162 int CompiledStaticCall::reloc_to_interp_stub() { 163 return 5; 164 } 165 166 void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, address entry) { 167 address stub = find_stub(/*is_aot*/ false); 168 guarantee(stub != NULL, "stub not found"); 169 170 if (TraceICs) { 171 ResourceMark rm; 172 tty->print_cr("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s", 173 p2i(instruction_address()), 174 callee->name_and_sig_as_C_string()); 175 } 176 177 // Creation also verifies the object. 178 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + IC_pos_in_java_to_interp_stub); 179 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); 180 181 #ifdef ASSERT 182 // read the value once 183 volatile intptr_t data = method_holder->data(); 184 volatile address destination = jump->jump_destination(); 185 assert(data == 0 || data == (intptr_t)callee(), 186 "a) MT-unsafe modification of inline cache"); 187 assert(destination == (address)-1 || destination == entry, 188 "b) MT-unsafe modification of inline cache"); 189 #endif 190 191 // Update stub. 192 method_holder->set_data((intptr_t)callee()); 193 jump->set_jump_destination(entry); 194 195 // Update jump to call. 196 set_destination_mt_safe(stub); 197 } 198 199 void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { 200 // Reset stub. 201 address stub = static_stub->addr(); 202 assert(stub != NULL, "stub not found"); 203 assert(CompiledICLocker::is_safe(stub), "mt unsafe call"); 204 // Creation also verifies the object. 205 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + IC_pos_in_java_to_interp_stub); 206 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); | 162 int CompiledStaticCall::reloc_to_interp_stub() { 163 return 5; 164 } 165 166 void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, address entry) { 167 address stub = find_stub(/*is_aot*/ false); 168 guarantee(stub != NULL, "stub not found"); 169 170 if (TraceICs) { 171 ResourceMark rm; 172 tty->print_cr("CompiledDirectStaticCall@" INTPTR_FORMAT ": set_to_interpreted %s", 173 p2i(instruction_address()), 174 callee->name_and_sig_as_C_string()); 175 } 176 177 // Creation also verifies the object. 178 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + IC_pos_in_java_to_interp_stub); 179 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); 180 181 #ifdef ASSERT 182 // A generated lambda form might be deleted from the Lambdaform 183 // cache in MethodTypeForm. If a jit compiled lambdaform method 184 // becomes not entrant and the cache access returns null, the new 185 // resolve will lead to a new generated LambdaForm. 186 Method* volatile old_method = reinterpret_cast<Method*>(method_holder->data()); 187 assert(old_method == NULL || old_method == callee() || 188 callee->is_compiled_lambda_form() || 189 !old_method->method_holder()->is_loader_alive() || 190 old_method->is_old(), // may be race patching deoptimized nmethod due to redefinition. 191 "a) MT-unsafe modification of inline cache"); 192 193 volatile address destination = jump->jump_destination(); 194 assert(destination == (address)-1 || destination == entry, 195 "b) MT-unsafe modification of inline cache"); 196 #endif 197 198 // Update stub. 199 method_holder->set_data((intptr_t)callee()); 200 jump->set_jump_destination(entry); 201 202 // Update jump to call. 203 set_destination_mt_safe(stub); 204 } 205 206 void CompiledDirectStaticCall::set_stub_to_clean(static_stub_Relocation* static_stub) { 207 // Reset stub. 208 address stub = static_stub->addr(); 209 assert(stub != NULL, "stub not found"); 210 assert(CompiledICLocker::is_safe(stub), "mt unsafe call"); 211 // Creation also verifies the object. 212 NativeMovConstReg* method_holder = nativeMovConstReg_at(stub + IC_pos_in_java_to_interp_stub); 213 NativeJump* jump = nativeJump_at(method_holder->next_instruction_address()); |