142 } 143 } 144 #endif // INCLUDE_AOT 145 146 void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, address entry) { 147 address stub = find_stub(false /* is_aot */); 148 guarantee(stub != NULL, "stub not found"); 149 150 if (TraceICs) { 151 ResourceMark rm; 152 tty->print_cr("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s", 153 p2i(instruction_address()), 154 callee->name_and_sig_as_C_string()); 155 } 156 157 // Creation also verifies the object. 158 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); 159 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); 160 161 #ifdef ASSERT 162 Method* old_method = reinterpret_cast<Method*>(method_holder->data()); 163 address destination = jump->jump_destination(); 164 assert(old_method == NULL || old_method == callee() || 165 !old_method->method_holder()->is_loader_alive(), 166 "a) MT-unsafe modification of inline cache"); 167 assert(destination == (address)-1 || destination == entry, 168 "b) MT-unsafe modification of inline cache"); 169 #endif 170 171 // Update stub. 172 method_holder->set_data((intptr_t)callee()); 173 jump->set_jump_destination(entry); 174 175 // Update jump to call. 176 set_destination_mt_safe(stub); 177 } 178 179 void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { 180 assert(CompiledICLocker::is_safe(static_stub->addr()), "mt unsafe call"); 181 // Reset stub. 182 address stub = static_stub->addr(); 183 assert(stub != NULL, "stub not found"); 184 // Creation also verifies the object. 185 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); 186 method_holder->set_data(0); | 142 } 143 } 144 #endif // INCLUDE_AOT 145 146 void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, address entry) { 147 address stub = find_stub(false /* is_aot */); 148 guarantee(stub != NULL, "stub not found"); 149 150 if (TraceICs) { 151 ResourceMark rm; 152 tty->print_cr("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s", 153 p2i(instruction_address()), 154 callee->name_and_sig_as_C_string()); 155 } 156 157 // Creation also verifies the object. 158 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); 159 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); 160 161 #ifdef ASSERT 162 // A generated lambda form might be deleted from the Lambdaform 163 // cache in MethodTypeForm. If a jit compiled lambdaform method 164 // becomes not entrant and the cache access returns null, the new 165 // resolve will lead to a new generated LambdaForm. 166 Method* old_method = reinterpret_cast<Method*>(method_holder->data()); 167 assert(old_method == NULL || old_method == callee() || 168 callee->is_compiled_lambda_form() || 169 !old_method->method_holder()->is_loader_alive() || 170 old_method->is_old(), // may be race patching deoptimized nmethod due to redefinition. 171 "a) MT-unsafe modification of inline cache"); 172 173 address destination = jump->jump_destination(); 174 assert(destination == (address)-1 || destination == entry, 175 "b) MT-unsafe modification of inline cache"); 176 #endif 177 178 // Update stub. 179 method_holder->set_data((intptr_t)callee()); 180 jump->set_jump_destination(entry); 181 182 // Update jump to call. 183 set_destination_mt_safe(stub); 184 } 185 186 void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { 187 assert(CompiledICLocker::is_safe(static_stub->addr()), "mt unsafe call"); 188 // Reset stub. 189 address stub = static_stub->addr(); 190 assert(stub != NULL, "stub not found"); 191 // Creation also verifies the object. 192 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub); 193 method_holder->set_data(0); |