< prev index next >

src/hotspot/share/oops/method.cpp

Print this page
rev 56755 : 8233159: Method::result_type should use calculated value in constMethod
Reviewed-by: lfoltan


 555     MetadataFactory::free_metadata(mh->method_holder()->class_loader_data(), counters);
 556   }
 557 
 558   if (LogTouchedMethods) {
 559     mh->log_touched(CHECK_NULL);
 560   }
 561 
 562   return mh->method_counters();
 563 }
 564 
 565 bool Method::init_method_counters(MethodCounters* counters) {
 566   // Try to install a pointer to MethodCounters, return true on success.
 567   return Atomic::replace_if_null(counters, &_method_counters);
 568 }
 569 
 570 int Method::extra_stack_words() {
 571   // not an inline function, to avoid a header dependency on Interpreter
 572   return extra_stack_entries() * Interpreter::stackElementSize;
 573 }
 574 
 575 
 576 void Method::compute_size_of_parameters(Thread *thread) {
 577   ArgumentSizeComputer asc(signature());
 578   set_size_of_parameters(asc.size() + (is_static() ? 0 : 1));
 579 }
 580 
 581 BasicType Method::result_type() const {
 582   ResultTypeFinder rtf(signature());
 583   return rtf.type();
 584 }
 585 
 586 
 587 bool Method::is_empty_method() const {
 588   return  code_size() == 1
 589       && *code_base() == Bytecodes::_return;
 590 }
 591 
 592 
 593 bool Method::is_vanilla_constructor() const {
 594   // Returns true if this method is a vanilla constructor, i.e. an "<init>" "()V" method
 595   // which only calls the superclass vanilla constructor and possibly does stores of
 596   // zero constants to local fields:
 597   //
 598   //   aload_0
 599   //   invokespecial
 600   //   indexbyte1
 601   //   indexbyte2
 602   //
 603   // followed by an (optional) sequence of:
 604   //
 605   //   aload_0
 606   //   aconst_null / iconst_0 / fconst_0 / dconst_0
 607   //   putfield
 608   //   indexbyte1
 609   //   indexbyte2
 610   //
 611   // followed by:




 555     MetadataFactory::free_metadata(mh->method_holder()->class_loader_data(), counters);
 556   }
 557 
 558   if (LogTouchedMethods) {
 559     mh->log_touched(CHECK_NULL);
 560   }
 561 
 562   return mh->method_counters();
 563 }
 564 
 565 bool Method::init_method_counters(MethodCounters* counters) {
 566   // Try to install a pointer to MethodCounters, return true on success.
 567   return Atomic::replace_if_null(counters, &_method_counters);
 568 }
 569 
 570 int Method::extra_stack_words() {
 571   // not an inline function, to avoid a header dependency on Interpreter
 572   return extra_stack_entries() * Interpreter::stackElementSize;
 573 }
 574 

 575 void Method::compute_size_of_parameters(Thread *thread) {
 576   ArgumentSizeComputer asc(signature());
 577   set_size_of_parameters(asc.size() + (is_static() ? 0 : 1));
 578 }
 579 






 580 bool Method::is_empty_method() const {
 581   return  code_size() == 1
 582       && *code_base() == Bytecodes::_return;
 583 }

 584 
 585 bool Method::is_vanilla_constructor() const {
 586   // Returns true if this method is a vanilla constructor, i.e. an "<init>" "()V" method
 587   // which only calls the superclass vanilla constructor and possibly does stores of
 588   // zero constants to local fields:
 589   //
 590   //   aload_0
 591   //   invokespecial
 592   //   indexbyte1
 593   //   indexbyte2
 594   //
 595   // followed by an (optional) sequence of:
 596   //
 597   //   aload_0
 598   //   aconst_null / iconst_0 / fconst_0 / dconst_0
 599   //   putfield
 600   //   indexbyte1
 601   //   indexbyte2
 602   //
 603   // followed by:


< prev index next >