comparison src/cpu/ppc/vm/stubGenerator_ppc.cpp @ 17804:fd1b9f02cc91

8036976: PPC64: implement the template interpreter Reviewed-by: kvn, coleenp Contributed-by: axel.siebenborn@sap.com, martin.doerr@sap.com
author goetz
date Mon, 10 Mar 2014 12:58:02 +0100
parents 31e80afe3fed
children 92aa6797d639 f6bde7889409
comparison
equal deleted inserted replaced
17803:31e80afe3fed 17804:fd1b9f02cc91
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * Copyright 2012, 2013 SAP AG. All rights reserved. 3 * Copyright 2012, 2014 SAP AG. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * 5 *
6 * This code is free software; you can redistribute it and/or modify it 6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as 7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
37 #include "runtime/handles.inline.hpp" 37 #include "runtime/handles.inline.hpp"
38 #include "runtime/sharedRuntime.hpp" 38 #include "runtime/sharedRuntime.hpp"
39 #include "runtime/stubCodeGenerator.hpp" 39 #include "runtime/stubCodeGenerator.hpp"
40 #include "runtime/stubRoutines.hpp" 40 #include "runtime/stubRoutines.hpp"
41 #include "utilities/top.hpp" 41 #include "utilities/top.hpp"
42 #ifdef TARGET_OS_FAMILY_aix
43 # include "thread_aix.inline.hpp"
44 #endif
45 #ifdef TARGET_OS_FAMILY_linux
46 # include "thread_linux.inline.hpp"
47 #endif
48 #ifdef COMPILER2 42 #ifdef COMPILER2
49 #include "opto/runtime.hpp" 43 #include "opto/runtime.hpp"
50 #endif 44 #endif
45 #include "runtime/thread.inline.hpp"
51 46
52 #define __ _masm-> 47 #define __ _masm->
53 48
54 #ifdef PRODUCT 49 #ifdef PRODUCT
55 #define BLOCK_COMMENT(str) // nothing 50 #define BLOCK_COMMENT(str) // nothing
219 } 214 }
220 215
221 { 216 {
222 BLOCK_COMMENT("Call frame manager or native entry."); 217 BLOCK_COMMENT("Call frame manager or native entry.");
223 // Call frame manager or native entry. 218 // Call frame manager or native entry.
224 Register r_new_arg_entry = R14_state; 219 Register r_new_arg_entry = R14; // PPC_state;
225 assert_different_registers(r_new_arg_entry, r_top_of_arguments_addr, 220 assert_different_registers(r_new_arg_entry, r_top_of_arguments_addr,
226 r_arg_method, r_arg_thread); 221 r_arg_method, r_arg_thread);
227 222
228 __ mr(r_new_arg_entry, r_arg_entry); 223 __ mr(r_new_arg_entry, r_arg_entry);
229 224
232 // tos - intptr_t* sender tos (prepushed) Lesp = (SP) + copied_arguments_offset - 8 227 // tos - intptr_t* sender tos (prepushed) Lesp = (SP) + copied_arguments_offset - 8
233 // R19_method - Method 228 // R19_method - Method
234 // R16_thread - JavaThread* 229 // R16_thread - JavaThread*
235 230
236 // Tos must point to last argument - element_size. 231 // Tos must point to last argument - element_size.
232 #ifdef CC_INTERP
237 const Register tos = R17_tos; 233 const Register tos = R17_tos;
234 #else
235 const Register tos = R15_esp;
236 #endif
238 __ addi(tos, r_top_of_arguments_addr, -Interpreter::stackElementSize); 237 __ addi(tos, r_top_of_arguments_addr, -Interpreter::stackElementSize);
239 238
240 // initialize call_stub locals (step 2) 239 // initialize call_stub locals (step 2)
241 // now save tos as arguments_tos_address 240 // now save tos as arguments_tos_address
242 __ std(tos, _entry_frame_locals_neg(arguments_tos_address), r_entryframe_fp); 241 __ std(tos, _entry_frame_locals_neg(arguments_tos_address), r_entryframe_fp);
246 __ mr(R16_thread, r_arg_thread); 245 __ mr(R16_thread, r_arg_thread);
247 assert(tos != r_arg_method, "trashed r_arg_method"); 246 assert(tos != r_arg_method, "trashed r_arg_method");
248 assert(tos != r_arg_thread && R19_method != r_arg_thread, "trashed r_arg_thread"); 247 assert(tos != r_arg_thread && R19_method != r_arg_thread, "trashed r_arg_thread");
249 248
250 // Set R15_prev_state to 0 for simplifying checks in callee. 249 // Set R15_prev_state to 0 for simplifying checks in callee.
250 #ifdef CC_INTERP
251 __ li(R15_prev_state, 0); 251 __ li(R15_prev_state, 0);
252 252 #else
253 __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1);
254 #endif
253 // Stack on entry to frame manager / native entry: 255 // Stack on entry to frame manager / native entry:
254 // 256 //
255 // F0 [TOP_IJAVA_FRAME_ABI] 257 // F0 [TOP_IJAVA_FRAME_ABI]
256 // alignment (optional) 258 // alignment (optional)
257 // [outgoing Java arguments] 259 // [outgoing Java arguments]
2087 2089
2088 if (UseAESIntrinsics) { 2090 if (UseAESIntrinsics) {
2089 guarantee(!UseAESIntrinsics, "not yet implemented."); 2091 guarantee(!UseAESIntrinsics, "not yet implemented.");
2090 } 2092 }
2091 2093
2092 // PPC uses stubs for safefetch. 2094 // Safefetch stubs.
2093 generate_safefetch("SafeFetch32", sizeof(int), &StubRoutines::_safefetch32_entry, 2095 generate_safefetch("SafeFetch32", sizeof(int), &StubRoutines::_safefetch32_entry,
2094 &StubRoutines::_safefetch32_fault_pc, 2096 &StubRoutines::_safefetch32_fault_pc,
2095 &StubRoutines::_safefetch32_continuation_pc); 2097 &StubRoutines::_safefetch32_continuation_pc);
2096 generate_safefetch("SafeFetchN", sizeof(intptr_t), &StubRoutines::_safefetchN_entry, 2098 generate_safefetch("SafeFetchN", sizeof(intptr_t), &StubRoutines::_safefetchN_entry,
2097 &StubRoutines::_safefetchN_fault_pc, 2099 &StubRoutines::_safefetchN_fault_pc,