< prev index next >

src/hotspot/share/code/compiledMethod.cpp

Print this page

342       if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc(), this)) {
343         CompiledIC *ic = CompiledIC_at(&iter);
344         if (TraceCompiledIC) {
345           tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder()));
346           ic->print();
347         }
348         assert(ic->cached_icholder() != NULL, "must be non-NULL");
349         count++;
350       }
351     }
352   }
353 
354   return count;
355 }
356 
357 // Method that knows how to preserve outgoing arguments at call. This method must be
358 // called with a frame corresponding to a Java invoke
359 void CompiledMethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) {
360   if (method() != NULL && !method()->is_native()) {
361     address pc = fr.pc();
362     SimpleScopeDesc ssd(this, pc);
363     if (ssd.is_optimized_linkToNative()) return; // call was replaced
364     Bytecode_invoke call(methodHandle(Thread::current(), ssd.method()), ssd.bci());
365     bool has_receiver = call.has_receiver();
366     bool has_appendix = call.has_appendix();
367     Symbol* signature = call.signature();
368 
369     // The method attached by JIT-compilers should be used, if present.
370     // Bytecode can be inaccurate in such case.
371     Method* callee = attached_method_before_pc(pc);



372     if (callee != NULL) {
373       has_receiver = !(callee->access_flags().is_static());
374       has_appendix = false;
375       signature = callee->signature();


















376     }
377 
378     fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f);
379   }
380 }
381 
382 Method* CompiledMethod::attached_method(address call_instr) {
383   assert(code_contains(call_instr), "not part of the nmethod");
384   RelocIterator iter(this, call_instr, call_instr + 1);
385   while (iter.next()) {
386     if (iter.addr() == call_instr) {
387       switch(iter.type()) {
388         case relocInfo::static_call_type:      return iter.static_call_reloc()->method_value();
389         case relocInfo::opt_virtual_call_type: return iter.opt_virtual_call_reloc()->method_value();
390         case relocInfo::virtual_call_type:     return iter.virtual_call_reloc()->method_value();
391         default:                               break;
392       }
393     }
394   }
395   return NULL; // not found

342       if (CompiledIC::is_icholder_call_site(iter.virtual_call_reloc(), this)) {
343         CompiledIC *ic = CompiledIC_at(&iter);
344         if (TraceCompiledIC) {
345           tty->print("noticed icholder " INTPTR_FORMAT " ", p2i(ic->cached_icholder()));
346           ic->print();
347         }
348         assert(ic->cached_icholder() != NULL, "must be non-NULL");
349         count++;
350       }
351     }
352   }
353 
354   return count;
355 }
356 
357 // Method that knows how to preserve outgoing arguments at call. This method must be
358 // called with a frame corresponding to a Java invoke
359 void CompiledMethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) {
360   if (method() != NULL && !method()->is_native()) {
361     address pc = fr.pc();







362     // The method attached by JIT-compilers should be used, if present.
363     // Bytecode can be inaccurate in such case.
364     Method* callee = attached_method_before_pc(pc);
365     bool has_receiver = false;
366     bool has_appendix = false;
367     Symbol* signature = NULL;
368     if (callee != NULL) {
369       has_receiver = !(callee->access_flags().is_static());
370       has_appendix = false;
371       signature = callee->signature();
372 
373       // If inline types are passed as fields, use the extended signature
374       // which contains the types of all (oop) fields of the inline type.
375       if (this->is_compiled_by_c2() && callee->has_scalarized_args()) {
376         const GrowableArray<SigEntry>* sig = callee->adapter()->get_sig_cc();
377         assert(sig != NULL, "sig should never be null");
378         TempNewSymbol tmp_sig = SigEntry::create_symbol(sig);
379         has_receiver = false; // The extended signature contains the receiver type
380         fr.oops_compiled_arguments_do(tmp_sig, has_receiver, has_appendix, reg_map, f);
381         return;
382       }
383     } else {
384       SimpleScopeDesc ssd(this, pc);
385       if (ssd.is_optimized_linkToNative()) return; // call was replaced
386       Bytecode_invoke call(methodHandle(Thread::current(), ssd.method()), ssd.bci());
387       has_receiver = call.has_receiver();
388       has_appendix = call.has_appendix();
389       signature = call.signature();
390     }
391 
392     fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f);
393   }
394 }
395 
396 Method* CompiledMethod::attached_method(address call_instr) {
397   assert(code_contains(call_instr), "not part of the nmethod");
398   RelocIterator iter(this, call_instr, call_instr + 1);
399   while (iter.next()) {
400     if (iter.addr() == call_instr) {
401       switch(iter.type()) {
402         case relocInfo::static_call_type:      return iter.static_call_reloc()->method_value();
403         case relocInfo::opt_virtual_call_type: return iter.opt_virtual_call_reloc()->method_value();
404         case relocInfo::virtual_call_type:     return iter.virtual_call_reloc()->method_value();
405         default:                               break;
406       }
407     }
408   }
409   return NULL; // not found
< prev index next >