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 + NativeCall::get_IC_pos_in_java_to_interp_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 volatile intptr_t data = method_holder->data(); 114 volatile address destination = jump->jump_destination(); 115 assert(data == 0 || data == (intptr_t)callee() || callee->is_compiled_lambda_form(), 116 "a) MT-unsafe modification of inline cache"); 117 assert(destination == (address)-1 || destination == entry, 118 "b) MT-unsafe modification of inline cache"); 119 #endif 120 121 // Update stub. 122 method_holder->set_data((intptr_t)callee(), relocInfo::metadata_type); 123 jump->set_jump_destination(entry); 124 125 // Update jump to call. 126 set_destination_mt_safe(stub); 127 } 128 129 void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { 130 // Reset stub. 131 address stub = static_stub->addr(); 132 assert(stub != NULL, "stub not found"); 133 assert(CompiledICLocker::is_safe(stub), "mt unsafe call"); 134 // Creation also verifies the object. 135 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + NativeCall::get_IC_pos_in_java_to_interp_stub()); 136 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); | 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 + NativeCall::get_IC_pos_in_java_to_interp_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(), relocInfo::metadata_type); 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 + NativeCall::get_IC_pos_in_java_to_interp_stub()); 140 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); |