21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "asm/macroAssembler.hpp" 27 #include "interpreter/bytecodeHistogram.hpp" 28 #include "interpreter/interpreter.hpp" 29 #include "interpreter/interpreterGenerator.hpp" 30 #include "interpreter/interpreterRuntime.hpp" 31 #include "interpreter/interp_masm.hpp" 32 #include "interpreter/templateTable.hpp" 33 #include "oops/arrayOop.hpp" 34 #include "oops/methodData.hpp" 35 #include "oops/method.hpp" 36 #include "oops/oop.inline.hpp" 37 #include "prims/jvmtiExport.hpp" 38 #include "prims/jvmtiThreadState.hpp" 39 #include "prims/methodHandles.hpp" 40 #include "runtime/arguments.hpp" 41 #include "runtime/deoptimization.hpp" 42 #include "runtime/frame.inline.hpp" 43 #include "runtime/sharedRuntime.hpp" 44 #include "runtime/stubRoutines.hpp" 45 #include "runtime/synchronizer.hpp" 46 #include "runtime/timer.hpp" 47 #include "runtime/vframeArray.hpp" 48 #include "utilities/debug.hpp" 49 #ifdef COMPILER1 50 #include "c1/c1_Runtime1.hpp" 51 #endif 52 53 54 55 // Generation of Interpreter 56 // 57 // The InterpreterGenerator generates the interpreter into Interpreter::_code. 58 59 60 #define __ _masm-> 61 62 63 //---------------------------------------------------------------------------------------------------- 64 65 66 67 68 int AbstractInterpreter::BasicType_as_index(BasicType type) { 69 int i = 0; 70 switch (type) { 71 case T_BOOLEAN: i = 0; break; 72 case T_CHAR : i = 1; break; 73 case T_BYTE : i = 2; break; 74 case T_SHORT : i = 3; break; 75 case T_INT : i = 4; break; 76 case T_LONG : i = 5; break; 77 case T_VOID : i = 6; break; 78 case T_FLOAT : i = 7; break; 79 case T_DOUBLE : i = 8; break; 80 case T_OBJECT : i = 9; break; 81 case T_ARRAY : i = 9; break; 82 default : ShouldNotReachHere(); 83 } 84 assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds"); 85 return i; 86 } 87 88 89 #ifndef _LP64 90 address AbstractInterpreterGenerator::generate_slow_signature_handler() { 91 address entry = __ pc(); 92 Argument argv(0, true); 93 94 // We are in the jni transition frame. Save the last_java_frame corresponding to the 95 // outer interpreter frame 96 // 97 __ set_last_Java_frame(FP, noreg); 98 // make sure the interpreter frame we've pushed has a valid return pc 99 __ mov(O7, I7); 100 __ mov(Lmethod, G3_scratch); 101 __ mov(Llocals, G4_scratch); 102 __ save_frame(0); 103 __ mov(G2_thread, L7_thread_cache); 104 __ add(argv.address_in_frame(), O3); 105 __ mov(G2_thread, O0); 106 __ mov(G3_scratch, O1); 107 __ call(CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), relocInfo::runtime_call_type); 108 __ delayed()->mov(G4_scratch, O2); 242 // Various method entries 243 244 // Abstract method entry 245 // Attempt to execute abstract method. Throw exception 246 // 247 address InterpreterGenerator::generate_abstract_entry(void) { 248 address entry = __ pc(); 249 // abstract method entry 250 // throw exception 251 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); 252 // the call_VM checks for exception, so we should never return here. 253 __ should_not_reach_here(); 254 return entry; 255 256 } 257 258 bool AbstractInterpreter::can_be_compiled(methodHandle m) { 259 // No special entry points that preclude compilation 260 return true; 261 } 262 263 void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) { 264 265 // This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in 266 // the days we had adapter frames. When we deoptimize a situation where a 267 // compiled caller calls a compiled caller will have registers it expects 268 // to survive the call to the callee. If we deoptimize the callee the only 269 // way we can restore these registers is to have the oldest interpreter 270 // frame that we create restore these values. That is what this routine 271 // will accomplish. 272 273 // At the moment we have modified c2 to not have any callee save registers 274 // so this problem does not exist and this routine is just a place holder. 275 276 assert(f->is_interpreted_frame(), "must be interpreted"); 277 } 278 279 280 //---------------------------------------------------------------------------------------------------- 281 // Exceptions | 21 * questions. 22 * 23 */ 24 25 #include "precompiled.hpp" 26 #include "asm/macroAssembler.hpp" 27 #include "interpreter/bytecodeHistogram.hpp" 28 #include "interpreter/interpreter.hpp" 29 #include "interpreter/interpreterGenerator.hpp" 30 #include "interpreter/interpreterRuntime.hpp" 31 #include "interpreter/interp_masm.hpp" 32 #include "interpreter/templateTable.hpp" 33 #include "oops/arrayOop.hpp" 34 #include "oops/methodData.hpp" 35 #include "oops/method.hpp" 36 #include "oops/oop.inline.hpp" 37 #include "prims/jvmtiExport.hpp" 38 #include "prims/jvmtiThreadState.hpp" 39 #include "prims/methodHandles.hpp" 40 #include "runtime/arguments.hpp" 41 #include "runtime/frame.inline.hpp" 42 #include "runtime/sharedRuntime.hpp" 43 #include "runtime/stubRoutines.hpp" 44 #include "runtime/synchronizer.hpp" 45 #include "runtime/timer.hpp" 46 #include "runtime/vframeArray.hpp" 47 #include "utilities/debug.hpp" 48 #ifdef COMPILER1 49 #include "c1/c1_Runtime1.hpp" 50 #endif 51 52 53 54 // Generation of Interpreter 55 // 56 // The InterpreterGenerator generates the interpreter into Interpreter::_code. 57 58 59 #define __ _masm-> 60 61 62 //---------------------------------------------------------------------------------------------------- 63 64 #ifndef _LP64 65 address AbstractInterpreterGenerator::generate_slow_signature_handler() { 66 address entry = __ pc(); 67 Argument argv(0, true); 68 69 // We are in the jni transition frame. Save the last_java_frame corresponding to the 70 // outer interpreter frame 71 // 72 __ set_last_Java_frame(FP, noreg); 73 // make sure the interpreter frame we've pushed has a valid return pc 74 __ mov(O7, I7); 75 __ mov(Lmethod, G3_scratch); 76 __ mov(Llocals, G4_scratch); 77 __ save_frame(0); 78 __ mov(G2_thread, L7_thread_cache); 79 __ add(argv.address_in_frame(), O3); 80 __ mov(G2_thread, O0); 81 __ mov(G3_scratch, O1); 82 __ call(CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), relocInfo::runtime_call_type); 83 __ delayed()->mov(G4_scratch, O2); 217 // Various method entries 218 219 // Abstract method entry 220 // Attempt to execute abstract method. Throw exception 221 // 222 address InterpreterGenerator::generate_abstract_entry(void) { 223 address entry = __ pc(); 224 // abstract method entry 225 // throw exception 226 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); 227 // the call_VM checks for exception, so we should never return here. 228 __ should_not_reach_here(); 229 return entry; 230 231 } 232 233 bool AbstractInterpreter::can_be_compiled(methodHandle m) { 234 // No special entry points that preclude compilation 235 return true; 236 } |