89 int CompiledStaticCall::reloc_to_interp_stub() { 90 return 10; // 4 in emit_java_to_interp + 1 in Java_Static_Call 91 } 92 93 void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, address entry) { 94 address stub = find_stub(/*is_aot*/ false); 95 guarantee(stub != NULL, "stub not found"); 96 97 if (TraceICs) { 98 ResourceMark rm; 99 tty->print_cr("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s", 100 p2i(instruction_address()), 101 callee->name_and_sig_as_C_string()); 102 } 103 104 // Creation also verifies the object. 105 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); 106 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); 107 108 #ifdef ASSERT 109 // read the value once 110 volatile intptr_t data = method_holder->data(); 111 volatile address destination = jump->jump_destination(); 112 assert(data == 0 || data == (intptr_t)callee(), 113 "a) MT-unsafe modification of inline cache"); 114 assert(destination == (address)-1 || destination == entry, 115 "b) MT-unsafe modification of inline cache"); 116 #endif 117 118 // Update stub. 119 method_holder->set_data((intptr_t)callee()); 120 jump->set_jump_destination(entry); 121 122 // Update jump to call. 123 set_destination_mt_safe(stub); 124 } 125 126 void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { 127 // Reset stub. 128 address stub = static_stub->addr(); 129 assert(stub != NULL, "stub not found"); 130 assert(CompiledICLocker::is_safe(stub), "mt unsafe call"); 131 // Creation also verifies the object. 132 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); 133 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); | 89 int CompiledStaticCall::reloc_to_interp_stub() { 90 return 10; // 4 in emit_java_to_interp + 1 in Java_Static_Call 91 } 92 93 void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, address entry) { 94 address stub = find_stub(/*is_aot*/ false); 95 guarantee(stub != NULL, "stub not found"); 96 97 if (TraceICs) { 98 ResourceMark rm; 99 tty->print_cr("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s", 100 p2i(instruction_address()), 101 callee->name_and_sig_as_C_string()); 102 } 103 104 // Creation also verifies the object. 105 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); 106 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); 107 108 #ifdef ASSERT 109 // A generated lambda form might be deleted from the Lambdaform 110 // cache in MethodTypeForm. If a jit compiled lambdaform method 111 // becomes not entrant and the cache access returns null, the new 112 // resolve will lead to a new generated LambdaForm. 113 Method* volatile old_method = reinterpret_cast<Method*>(method_holder->data()); 114 assert(old_method == NULL || old_method == callee() || 115 callee->is_compiled_lambda_form() || 116 !old_method->method_holder()->is_loader_alive() || 117 old_method->is_old(), // may be race patching deoptimized nmethod due to redefinition. 118 "a) MT-unsafe modification of inline cache"); 119 120 volatile address destination = jump->jump_destination(); 121 assert(destination == (address)-1 || destination == entry, 122 "b) MT-unsafe modification of inline cache"); 123 #endif 124 125 // Update stub. 126 method_holder->set_data((intptr_t)callee()); 127 jump->set_jump_destination(entry); 128 129 // Update jump to call. 130 set_destination_mt_safe(stub); 131 } 132 133 void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { 134 // Reset stub. 135 address stub = static_stub->addr(); 136 assert(stub != NULL, "stub not found"); 137 assert(CompiledICLocker::is_safe(stub), "mt unsafe call"); 138 // Creation also verifies the object. 139 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); 140 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); |