22 * questions. 23 * 24 */ 25 26 #include "precompiled.hpp" 27 #include "asm/macroAssembler.inline.hpp" 28 #include "interpreter/bytecodeHistogram.hpp" 29 #include "interpreter/interpreter.hpp" 30 #include "interpreter/interpreterGenerator.hpp" 31 #include "interpreter/interpreterRuntime.hpp" 32 #include "interpreter/interp_masm.hpp" 33 #include "interpreter/templateTable.hpp" 34 #include "oops/arrayOop.hpp" 35 #include "oops/methodData.hpp" 36 #include "oops/method.hpp" 37 #include "oops/oop.inline.hpp" 38 #include "prims/jvmtiExport.hpp" 39 #include "prims/jvmtiThreadState.hpp" 40 #include "prims/methodHandles.hpp" 41 #include "runtime/arguments.hpp" 42 #include "runtime/deoptimization.hpp" 43 #include "runtime/frame.inline.hpp" 44 #include "runtime/sharedRuntime.hpp" 45 #include "runtime/stubRoutines.hpp" 46 #include "runtime/synchronizer.hpp" 47 #include "runtime/timer.hpp" 48 #include "runtime/vframeArray.hpp" 49 #include "utilities/debug.hpp" 50 #ifdef COMPILER1 51 #include "c1/c1_Runtime1.hpp" 52 #endif 53 54 #define __ _masm-> 55 56 #ifdef PRODUCT 57 #define BLOCK_COMMENT(str) // nothing 58 #else 59 #define BLOCK_COMMENT(str) __ block_comment(str) 60 #endif 61 62 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":") 63 64 int AbstractInterpreter::BasicType_as_index(BasicType type) { 65 int i = 0; 66 switch (type) { 67 case T_BOOLEAN: i = 0; break; 68 case T_CHAR : i = 1; break; 69 case T_BYTE : i = 2; break; 70 case T_SHORT : i = 3; break; 71 case T_INT : i = 4; break; 72 case T_LONG : i = 5; break; 73 case T_VOID : i = 6; break; 74 case T_FLOAT : i = 7; break; 75 case T_DOUBLE : i = 8; break; 76 case T_OBJECT : i = 9; break; 77 case T_ARRAY : i = 9; break; 78 default : ShouldNotReachHere(); 79 } 80 assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds"); 81 return i; 82 } 83 84 address AbstractInterpreterGenerator::generate_slow_signature_handler() { 85 // Slow_signature handler that respects the PPC C calling conventions. 86 // 87 // We get called by the native entry code with our output register 88 // area == 8. First we call InterpreterRuntime::get_result_handler 89 // to copy the pointer to the signature string temporarily to the 90 // first C-argument and to return the result_handler in 91 // R3_RET. Since native_entry will copy the jni-pointer to the 92 // first C-argument slot later on, it is OK to occupy this slot 93 // temporarilly. Then we copy the argument list on the java 94 // expression stack into native varargs format on the native stack 95 // and load arguments into argument registers. Integer arguments in 96 // the varargs vector will be sign-extended to 8 bytes. 97 // 98 // On entry: 99 // R3_ARG1 - intptr_t* Address of java argument list in memory. 100 // R15_prev_state - BytecodeInterpreter* Address of interpreter state for 101 // this method 102 // R19_method 103 // 553 __ asm_assert_eq("backlink", 0x544); 554 #endif // ASSERT 555 __ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started. 556 557 __ g1_write_barrier_pre(noreg, // obj 558 noreg, // offset 559 R3_RET, // pre_val 560 R11_scratch1, // tmp 561 R12_scratch2, // tmp 562 true); // needs_frame 563 564 __ blr(); 565 566 // Generate regular method entry. 567 __ bind(slow_path); 568 __ jump_to_entry(Interpreter::entry_for_kind(Interpreter::zerolocals), R11_scratch1); 569 return entry; 570 } 571 572 return NULL; 573 } 574 575 void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) { 576 // This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in 577 // the days we had adapter frames. When we deoptimize a situation where a 578 // compiled caller calls a compiled caller will have registers it expects 579 // to survive the call to the callee. If we deoptimize the callee the only 580 // way we can restore these registers is to have the oldest interpreter 581 // frame that we create restore these values. That is what this routine 582 // will accomplish. 583 584 // At the moment we have modified c2 to not have any callee save registers 585 // so this problem does not exist and this routine is just a place holder. 586 587 assert(f->is_interpreted_frame(), "must be interpreted"); 588 } | 22 * questions. 23 * 24 */ 25 26 #include "precompiled.hpp" 27 #include "asm/macroAssembler.inline.hpp" 28 #include "interpreter/bytecodeHistogram.hpp" 29 #include "interpreter/interpreter.hpp" 30 #include "interpreter/interpreterGenerator.hpp" 31 #include "interpreter/interpreterRuntime.hpp" 32 #include "interpreter/interp_masm.hpp" 33 #include "interpreter/templateTable.hpp" 34 #include "oops/arrayOop.hpp" 35 #include "oops/methodData.hpp" 36 #include "oops/method.hpp" 37 #include "oops/oop.inline.hpp" 38 #include "prims/jvmtiExport.hpp" 39 #include "prims/jvmtiThreadState.hpp" 40 #include "prims/methodHandles.hpp" 41 #include "runtime/arguments.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 #define __ _masm-> 54 55 #ifdef PRODUCT 56 #define BLOCK_COMMENT(str) // nothing 57 #else 58 #define BLOCK_COMMENT(str) __ block_comment(str) 59 #endif 60 61 #define BIND(label) bind(label); BLOCK_COMMENT(#label ":") 62 63 address AbstractInterpreterGenerator::generate_slow_signature_handler() { 64 // Slow_signature handler that respects the PPC C calling conventions. 65 // 66 // We get called by the native entry code with our output register 67 // area == 8. First we call InterpreterRuntime::get_result_handler 68 // to copy the pointer to the signature string temporarily to the 69 // first C-argument and to return the result_handler in 70 // R3_RET. Since native_entry will copy the jni-pointer to the 71 // first C-argument slot later on, it is OK to occupy this slot 72 // temporarilly. Then we copy the argument list on the java 73 // expression stack into native varargs format on the native stack 74 // and load arguments into argument registers. Integer arguments in 75 // the varargs vector will be sign-extended to 8 bytes. 76 // 77 // On entry: 78 // R3_ARG1 - intptr_t* Address of java argument list in memory. 79 // R15_prev_state - BytecodeInterpreter* Address of interpreter state for 80 // this method 81 // R19_method 82 // 532 __ asm_assert_eq("backlink", 0x544); 533 #endif // ASSERT 534 __ mr(R1_SP, R21_sender_SP); // Cut the stack back to where the caller started. 535 536 __ g1_write_barrier_pre(noreg, // obj 537 noreg, // offset 538 R3_RET, // pre_val 539 R11_scratch1, // tmp 540 R12_scratch2, // tmp 541 true); // needs_frame 542 543 __ blr(); 544 545 // Generate regular method entry. 546 __ bind(slow_path); 547 __ jump_to_entry(Interpreter::entry_for_kind(Interpreter::zerolocals), R11_scratch1); 548 return entry; 549 } 550 551 return NULL; 552 } |