328 if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc(), this)) { 329 CompiledIC *ic = CompiledIC_at(&iter); 330 if (TraceCompiledIC) { 331 tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder())); 332 ic->print(); 333 } 334 assert(ic->cached_icholder() != NULL, "must be non-NULL"); 335 count++; 336 } 337 } 338 } 339 340 return count; 341 } 342 343 // Method that knows how to preserve outgoing arguments at call. This method must be 344 // called with a frame corresponding to a Java invoke 345 void CompiledMethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { 346 if (method() != NULL && !method()->is_native()) { 347 address pc = fr.pc(); 348 SimpleScopeDesc ssd(this, pc); 349 Bytecode_invoke call(ssd.method(), ssd.bci()); 350 bool has_receiver = call.has_receiver(); 351 bool has_appendix = call.has_appendix(); 352 Symbol* signature = call.signature(); 353 354 // The method attached by JIT-compilers should be used, if present. 355 // Bytecode can be inaccurate in such case. 356 Method* callee = attached_method_before_pc(pc); 357 if (callee != NULL) { 358 has_receiver = !(callee->access_flags().is_static()); 359 has_appendix = false; 360 signature = callee->signature(); 361 362 // If value types are passed as fields, use the extended signature 363 // which contains the types of all (oop) fields of the value type. 364 if (callee->has_scalarized_args()) { 365 const GrowableArray<SigEntry>* sig = callee->adapter()->get_sig_cc(); 366 signature = SigEntry::create_symbol(sig); 367 has_receiver = false; // The extended signature contains the receiver type 368 } 369 } 370 371 fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f); 372 } 373 } 374 375 Method* CompiledMethod::attached_method(address call_instr) { 376 assert(code_contains(call_instr), "not part of the nmethod"); 377 RelocIterator iter(this, call_instr, call_instr + 1); 378 while (iter.next()) { 379 if (iter.addr() == call_instr) { 380 switch(iter.type()) { 381 case relocInfo::static_call_type: return iter.static_call_reloc()->method_value(); 382 case relocInfo::opt_virtual_call_type: return iter.opt_virtual_call_reloc()->method_value(); 383 case relocInfo::virtual_call_type: return iter.virtual_call_reloc()->method_value(); 384 default: break; 385 } 386 } 387 } 388 return NULL; // not found | 328 if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc(), this)) { 329 CompiledIC *ic = CompiledIC_at(&iter); 330 if (TraceCompiledIC) { 331 tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder())); 332 ic->print(); 333 } 334 assert(ic->cached_icholder() != NULL, "must be non-NULL"); 335 count++; 336 } 337 } 338 } 339 340 return count; 341 } 342 343 // Method that knows how to preserve outgoing arguments at call. This method must be 344 // called with a frame corresponding to a Java invoke 345 void CompiledMethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { 346 if (method() != NULL && !method()->is_native()) { 347 address pc = fr.pc(); 348 // The method attached by JIT-compilers should be used, if present. 349 // Bytecode can be inaccurate in such case. 350 Method* callee = attached_method_before_pc(pc); 351 bool has_receiver = false; 352 bool has_appendix = false; 353 Symbol* signature = NULL; 354 if (callee != NULL) { 355 has_receiver = !(callee->access_flags().is_static()); 356 has_appendix = false; 357 signature = callee->signature(); 358 359 // If value types are passed as fields, use the extended signature 360 // which contains the types of all (oop) fields of the value type. 361 if (callee->has_scalarized_args()) { 362 const GrowableArray<SigEntry>* sig = callee->adapter()->get_sig_cc(); 363 signature = SigEntry::create_symbol(sig); 364 has_receiver = false; // The extended signature contains the receiver type 365 } 366 } else { 367 SimpleScopeDesc ssd(this, pc); 368 Bytecode_invoke call(ssd.method(), ssd.bci()); 369 has_receiver = call.has_receiver(); 370 has_appendix = call.has_appendix(); 371 signature = call.signature(); 372 } 373 374 fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f); 375 } 376 } 377 378 Method* CompiledMethod::attached_method(address call_instr) { 379 assert(code_contains(call_instr), "not part of the nmethod"); 380 RelocIterator iter(this, call_instr, call_instr + 1); 381 while (iter.next()) { 382 if (iter.addr() == call_instr) { 383 switch(iter.type()) { 384 case relocInfo::static_call_type: return iter.static_call_reloc()->method_value(); 385 case relocInfo::opt_virtual_call_type: return iter.opt_virtual_call_reloc()->method_value(); 386 case relocInfo::virtual_call_type: return iter.virtual_call_reloc()->method_value(); 387 default: break; 388 } 389 } 390 } 391 return NULL; // not found |