< prev index next >

src/hotspot/share/oops/method.hpp

Print this page

  76   MethodData*       _method_data;
  77   MethodCounters*   _method_counters;
  78   AdapterHandlerEntry* _adapter;
  79   AccessFlags       _access_flags;               // Access flags
  80   int               _vtable_index;               // vtable index of this method (see VtableIndexFlag)
  81   MethodFlags       _flags;
  82 
  83   u2                _intrinsic_id;               // vmSymbols::intrinsic_id (0 == _none)
  84 
  85   JFR_ONLY(DEFINE_TRACE_FLAG;)
  86 
  87 #ifndef PRODUCT
  88   int64_t _compiled_invocation_count;
  89 
  90   Symbol* _name;
  91 #endif
  92   // Entry point for calling both from and to the interpreter.
  93   address _i2i_entry;           // All-args-on-stack calling convention
  94   // Entry point for calling from compiled code, to compiled code if it exists
  95   // or else the interpreter.
  96   volatile address _from_compiled_entry;        // Cache of: _code ? _code->entry_point() : _adapter->c2i_entry()


  97   // The entry point for calling both from and to compiled code is
  98   // "_code->entry_point()".  Because of tiered compilation and de-opt, this
  99   // field can come and go.  It can transition from null to not-null at any
 100   // time (whenever a compile completes).  It can transition from not-null to
 101   // null only at safepoints (because of a de-opt).
 102   CompiledMethod* volatile _code;                       // Points to the corresponding piece of native code
 103   volatile address           _from_interpreted_entry; // Cache of _code ? _adapter->i2c_entry() : _i2i_entry
 104 
 105   // Constructor
 106   Method(ConstMethod* xconst, AccessFlags access_flags, Symbol* name);
 107  public:
 108 
 109   static Method* allocate(ClassLoaderData* loader_data,
 110                           int byte_code_size,
 111                           AccessFlags access_flags,
 112                           InlineTableSizes* sizes,
 113                           ConstMethod::MethodType method_type,
 114                           Symbol* name,
 115                           TRAPS);
 116 
 117   // CDS and vtbl checking can create an empty Method to get vtbl pointer.
 118   Method(){}
 119 
 120   virtual bool is_method() const { return true; }
 121 
 122 #if INCLUDE_CDS
 123   void remove_unshareable_info();
 124   void restore_unshareable_info(TRAPS);
 125 #endif
 126 
 127   // accessors for instance variables
 128 
 129   ConstMethod* constMethod() const             { return _constMethod; }
 130   void set_constMethod(ConstMethod* xconst)    { _constMethod = xconst; }
 131 
 132 
 133   static address make_adapters(const methodHandle& mh, TRAPS);
 134   address from_compiled_entry() const;


 135   address from_interpreted_entry() const;
 136 
 137   // access flag
 138   AccessFlags access_flags() const               { return _access_flags;  }
 139   void set_access_flags(AccessFlags flags)       { _access_flags = flags; }
 140 
 141   // name
 142   Symbol* name() const                           { return constants()->symbol_at(name_index()); }
 143   u2 name_index() const                          { return constMethod()->name_index();         }
 144   void set_name_index(int index)                 { constMethod()->set_name_index(index);       }
 145 
 146   // signature
 147   Symbol* signature() const                      { return constants()->symbol_at(signature_index()); }
 148   u2 signature_index() const                     { return constMethod()->signature_index();         }
 149   void set_signature_index(int index)            { constMethod()->set_signature_index(index);       }
 150 
 151   // generics support
 152   Symbol* generic_signature() const              { int idx = generic_signature_index(); return ((idx != 0) ? constants()->symbol_at(idx) : nullptr); }
 153   u2 generic_signature_index() const             { return constMethod()->generic_signature_index(); }
 154 

 330 
 331   bool was_executed_more_than(int n);
 332   bool was_never_executed()                     { return !was_executed_more_than(0);  }
 333 
 334   static void build_profiling_method_data(const methodHandle& method, TRAPS);
 335 
 336   static MethodCounters* build_method_counters(Thread* current, Method* m);
 337 
 338   int interpreter_invocation_count()            { return invocation_count();          }
 339 
 340 #ifndef PRODUCT
 341   int64_t  compiled_invocation_count() const    { return _compiled_invocation_count;}
 342   void set_compiled_invocation_count(int count) { _compiled_invocation_count = (int64_t)count; }
 343 #else
 344   // for PrintMethodData in a product build
 345   int64_t  compiled_invocation_count() const    { return 0; }
 346 #endif // not PRODUCT
 347 
 348   // nmethod/verified compiler entry
 349   address verified_code_entry();


 350   bool check_code() const;      // Not inline to avoid circular ref
 351   CompiledMethod* code() const;
 352 
 353   // Locks CompiledMethod_lock if not held.
 354   void unlink_code(CompiledMethod *compare);
 355   // Locks CompiledMethod_lock if not held.
 356   void unlink_code();
 357 
 358 private:
 359   // Either called with CompiledMethod_lock held or from constructor.
 360   void clear_code();
 361 
 362   void clear_method_data() {
 363     _method_data = nullptr;
 364   }
 365 
 366 public:
 367   static void set_code(const methodHandle& mh, CompiledMethod* code);
 368   void set_adapter_entry(AdapterHandlerEntry* adapter) {
 369     _adapter = adapter;
 370   }
 371   void set_from_compiled_entry(address entry) {
 372     _from_compiled_entry =  entry;






 373   }
 374 
 375   address get_i2c_entry();
 376   address get_c2i_entry();

 377   address get_c2i_unverified_entry();

 378   address get_c2i_no_clinit_check_entry();
 379   AdapterHandlerEntry* adapter() const {
 380     return _adapter;
 381   }
 382   // setup entry points
 383   void link_method(const methodHandle& method, TRAPS);
 384   // clear entry points. Used by sharing code during dump time
 385   void unlink_method() NOT_CDS_RETURN;
 386   void remove_unshareable_flags() NOT_CDS_RETURN;
 387 
 388   // the number of argument reg slots that the compiled method uses on the stack.
 389   int num_stack_arg_slots() const { return constMethod()->num_stack_arg_slots(); }
 390 
 391   virtual void metaspace_pointers_do(MetaspaceClosure* iter);
 392   virtual MetaspaceObj::Type type() const { return MethodType; }
 393 
 394   // vtable index
 395   enum VtableIndexFlag {
 396     // Valid vtable indexes are non-negative (>= 0).
 397     // These few negative values are used as sentinels.

 472 
 473   // localvariable table
 474   bool has_localvariable_table() const
 475                           { return constMethod()->has_localvariable_table(); }
 476   u2 localvariable_table_length() const
 477                         { return constMethod()->localvariable_table_length(); }
 478   LocalVariableTableElement* localvariable_table_start() const
 479                          { return constMethod()->localvariable_table_start(); }
 480 
 481   bool has_linenumber_table() const
 482                               { return constMethod()->has_linenumber_table(); }
 483   u_char* compressed_linenumber_table() const
 484                        { return constMethod()->compressed_linenumber_table(); }
 485 
 486   // method holder (the Klass* holding this method)
 487   InstanceKlass* method_holder() const         { return constants()->pool_holder(); }
 488 
 489   Symbol* klass_name() const;                    // returns the name of the method holder
 490   BasicType result_type() const                  { return constMethod()->result_type(); }
 491   bool is_returning_oop() const                  { BasicType r = result_type(); return is_reference_type(r); }
 492   bool is_returning_fp() const                   { BasicType r = result_type(); return (r == T_FLOAT || r == T_DOUBLE); }
 493 
 494   // Checked exceptions thrown by this method (resolved to mirrors)
 495   objArrayHandle resolved_checked_exceptions(TRAPS) { return resolved_checked_exceptions_impl(this, THREAD); }
 496 
 497   // Access flags
 498   bool is_public() const                         { return access_flags().is_public();      }
 499   bool is_private() const                        { return access_flags().is_private();     }
 500   bool is_protected() const                      { return access_flags().is_protected();   }
 501   bool is_package_private() const                { return !is_public() && !is_private() && !is_protected(); }
 502   bool is_static() const                         { return access_flags().is_static();      }
 503   bool is_final() const                          { return access_flags().is_final();       }
 504   bool is_synchronized() const                   { return access_flags().is_synchronized();}
 505   bool is_native() const                         { return access_flags().is_native();      }
 506   bool is_abstract() const                       { return access_flags().is_abstract();    }
 507   bool is_synthetic() const                      { return access_flags().is_synthetic();   }
 508 
 509   // returns true if contains only return operation
 510   bool is_empty_method() const;
 511 
 512   // returns true if this is a vanilla constructor

 551   bool has_monitors() const                      { return is_synchronized() || has_monitor_bytecodes(); }
 552 
 553   // monitor matching. This returns a conservative estimate of whether the monitorenter/monitorexit bytecodes
 554   // properly nest in the method. It might return false, even though they actually nest properly, since the info.
 555   // has not been computed yet.
 556   bool guaranteed_monitor_matching() const       { return monitor_matching(); }
 557   void set_guaranteed_monitor_matching()         { set_monitor_matching(); }
 558 
 559   // returns true if the method is an accessor function (setter/getter).
 560   bool is_accessor() const;
 561 
 562   // returns true if the method is a getter
 563   bool is_getter() const;
 564 
 565   // returns true if the method is a setter
 566   bool is_setter() const;
 567 
 568   // returns true if the method does nothing but return a constant of primitive type
 569   bool is_constant_getter() const;
 570 
 571   // returns true if the method is an initializer (<init> or <clinit>).
 572   bool is_initializer() const;
 573 
 574   // returns true if the method is static OR if the classfile version < 51
 575   bool has_valid_initializer_flags() const;
 576 
 577   // returns true if the method name is <clinit> and the method has
 578   // valid static initializer flags.
 579   bool is_static_initializer() const;







 580 
 581   // returns true if the method name is <init>
 582   bool is_object_initializer() const;
 583 
 584   // compiled code support
 585   // NOTE: code() is inherently racy as deopt can be clearing code
 586   // simultaneously. Use with caution.
 587   bool has_compiled_code() const;
 588 
 589   bool needs_clinit_barrier() const;
 590 
 591   // sizing
 592   static int header_size()                       {
 593     return align_up((int)sizeof(Method), wordSize) / wordSize;
 594   }
 595   static int size(bool is_native);
 596   int size() const                               { return method_size(); }
 597   void log_touched(Thread* current);
 598   static void print_touched_methods(outputStream* out);
 599 
 600   // interpreter support
 601   static ByteSize const_offset()                 { return byte_offset_of(Method, _constMethod       ); }
 602   static ByteSize access_flags_offset()          { return byte_offset_of(Method, _access_flags      ); }
 603   static ByteSize from_compiled_offset()         { return byte_offset_of(Method, _from_compiled_entry); }


 604   static ByteSize code_offset()                  { return byte_offset_of(Method, _code); }

 605 
 606   static ByteSize method_counters_offset()       {
 607     return byte_offset_of(Method, _method_counters);
 608   }
 609 #ifndef PRODUCT
 610   static ByteSize compiled_invocation_counter_offset() { return byte_offset_of(Method, _compiled_invocation_count); }
 611 #endif // not PRODUCT
 612   static ByteSize native_function_offset()       { return in_ByteSize(sizeof(Method));                 }
 613   static ByteSize from_interpreted_offset()      { return byte_offset_of(Method, _from_interpreted_entry ); }
 614   static ByteSize interpreter_entry_offset()     { return byte_offset_of(Method, _i2i_entry ); }
 615   static ByteSize signature_handler_offset()     { return in_ByteSize(sizeof(Method) + wordSize);      }
 616   static ByteSize itable_index_offset()          { return byte_offset_of(Method, _vtable_index ); }
 617 
 618   // for code generation
 619   static ByteSize method_data_offset()  { return byte_offset_of(Method, _method_data); }
 620   static ByteSize intrinsic_id_offset() { return byte_offset_of(Method, _intrinsic_id); }
 621   static int intrinsic_id_size_in_bytes()        { return sizeof(u2); }
 622 
 623   // Static methods that are used to implement member methods where an exposed this pointer
 624   // is needed due to possible GCs

 742   void set_changes_current_thread() { constMethod()->set_changes_current_thread(); }
 743 
 744   bool jvmti_mount_transition() const { return constMethod()->jvmti_mount_transition(); }
 745   void set_jvmti_mount_transition() { constMethod()->set_jvmti_mount_transition(); }
 746 
 747   bool is_hidden() const { return constMethod()->is_hidden(); }
 748   void set_is_hidden() { constMethod()->set_is_hidden(); }
 749 
 750   bool is_scoped() const { return constMethod()->is_scoped(); }
 751   void set_scoped() { constMethod()->set_is_scoped(); }
 752 
 753   bool intrinsic_candidate() const { return constMethod()->intrinsic_candidate(); }
 754   void set_intrinsic_candidate() { constMethod()->set_intrinsic_candidate(); }
 755 
 756   bool has_injected_profile() const { return constMethod()->has_injected_profile(); }
 757   void set_has_injected_profile() { constMethod()->set_has_injected_profile(); }
 758 
 759   bool has_reserved_stack_access() const { return constMethod()->reserved_stack_access(); }
 760   void set_has_reserved_stack_access() { constMethod()->set_reserved_stack_access(); }
 761 

















 762   JFR_ONLY(DEFINE_TRACE_FLAG_ACCESSOR;)
 763 
 764   ConstMethod::MethodType method_type() const {
 765       return _constMethod->method_type();
 766   }
 767   bool is_overpass() const { return method_type() == ConstMethod::OVERPASS; }
 768 
 769   // On-stack replacement support
 770   bool has_osr_nmethod(int level, bool match_level) {
 771    return method_holder()->lookup_osr_nmethod(this, InvocationEntryBci, level, match_level) != nullptr;
 772   }
 773 
 774   nmethod* lookup_osr_nmethod_for(int bci, int level, bool match_level) {
 775     return method_holder()->lookup_osr_nmethod(this, bci, level, match_level);
 776   }
 777 
 778   // Find if klass for method is loaded
 779   bool is_klass_loaded_by_klass_index(int klass_index) const;
 780   bool is_klass_loaded(int refinfo_index, Bytecodes::Code bc, bool must_be_resolved = false) const;
 781 

  76   MethodData*       _method_data;
  77   MethodCounters*   _method_counters;
  78   AdapterHandlerEntry* _adapter;
  79   AccessFlags       _access_flags;               // Access flags
  80   int               _vtable_index;               // vtable index of this method (see VtableIndexFlag)
  81   MethodFlags       _flags;
  82 
  83   u2                _intrinsic_id;               // vmSymbols::intrinsic_id (0 == _none)
  84 
  85   JFR_ONLY(DEFINE_TRACE_FLAG;)
  86 
  87 #ifndef PRODUCT
  88   int64_t _compiled_invocation_count;
  89 
  90   Symbol* _name;
  91 #endif
  92   // Entry point for calling both from and to the interpreter.
  93   address _i2i_entry;           // All-args-on-stack calling convention
  94   // Entry point for calling from compiled code, to compiled code if it exists
  95   // or else the interpreter.
  96   volatile address _from_compiled_entry;           // Cache of: _code ? _code->verified_entry_point()           : _adapter->c2i_entry()
  97   volatile address _from_compiled_inline_ro_entry; // Cache of: _code ? _code->verified_inline_ro_entry_point() : _adapter->c2i_inline_ro_entry()
  98   volatile address _from_compiled_inline_entry;    // Cache of: _code ? _code->verified_inline_entry_point()    : _adapter->c2i_inline_entry()
  99   // The entry point for calling both from and to compiled code is
 100   // "_code->entry_point()".  Because of tiered compilation and de-opt, this
 101   // field can come and go.  It can transition from null to not-null at any
 102   // time (whenever a compile completes).  It can transition from not-null to
 103   // null only at safepoints (because of a de-opt).
 104   CompiledMethod* volatile _code;                       // Points to the corresponding piece of native code
 105   volatile address           _from_interpreted_entry; // Cache of _code ? _adapter->i2c_entry() : _i2i_entry
 106 
 107   // Constructor
 108   Method(ConstMethod* xconst, AccessFlags access_flags, Symbol* name);
 109  public:
 110 
 111   static Method* allocate(ClassLoaderData* loader_data,
 112                           int byte_code_size,
 113                           AccessFlags access_flags,
 114                           InlineTableSizes* sizes,
 115                           ConstMethod::MethodType method_type,
 116                           Symbol* name,
 117                           TRAPS);
 118 
 119   // CDS and vtbl checking can create an empty Method to get vtbl pointer.
 120   Method(){}
 121 
 122   virtual bool is_method() const { return true; }
 123 
 124 #if INCLUDE_CDS
 125   void remove_unshareable_info();
 126   void restore_unshareable_info(TRAPS);
 127 #endif
 128 
 129   // accessors for instance variables
 130 
 131   ConstMethod* constMethod() const             { return _constMethod; }
 132   void set_constMethod(ConstMethod* xconst)    { _constMethod = xconst; }
 133 
 134 
 135   static address make_adapters(const methodHandle& mh, TRAPS);
 136   address from_compiled_entry() const;
 137   address from_compiled_inline_ro_entry() const;
 138   address from_compiled_inline_entry() const;
 139   address from_interpreted_entry() const;
 140 
 141   // access flag
 142   AccessFlags access_flags() const               { return _access_flags;  }
 143   void set_access_flags(AccessFlags flags)       { _access_flags = flags; }
 144 
 145   // name
 146   Symbol* name() const                           { return constants()->symbol_at(name_index()); }
 147   u2 name_index() const                          { return constMethod()->name_index();         }
 148   void set_name_index(int index)                 { constMethod()->set_name_index(index);       }
 149 
 150   // signature
 151   Symbol* signature() const                      { return constants()->symbol_at(signature_index()); }
 152   u2 signature_index() const                     { return constMethod()->signature_index();         }
 153   void set_signature_index(int index)            { constMethod()->set_signature_index(index);       }
 154 
 155   // generics support
 156   Symbol* generic_signature() const              { int idx = generic_signature_index(); return ((idx != 0) ? constants()->symbol_at(idx) : nullptr); }
 157   u2 generic_signature_index() const             { return constMethod()->generic_signature_index(); }
 158 

 334 
 335   bool was_executed_more_than(int n);
 336   bool was_never_executed()                     { return !was_executed_more_than(0);  }
 337 
 338   static void build_profiling_method_data(const methodHandle& method, TRAPS);
 339 
 340   static MethodCounters* build_method_counters(Thread* current, Method* m);
 341 
 342   int interpreter_invocation_count()            { return invocation_count();          }
 343 
 344 #ifndef PRODUCT
 345   int64_t  compiled_invocation_count() const    { return _compiled_invocation_count;}
 346   void set_compiled_invocation_count(int count) { _compiled_invocation_count = (int64_t)count; }
 347 #else
 348   // for PrintMethodData in a product build
 349   int64_t  compiled_invocation_count() const    { return 0; }
 350 #endif // not PRODUCT
 351 
 352   // nmethod/verified compiler entry
 353   address verified_code_entry();
 354   address verified_inline_code_entry();
 355   address verified_inline_ro_code_entry();
 356   bool check_code() const;      // Not inline to avoid circular ref
 357   CompiledMethod* code() const;
 358 
 359   // Locks CompiledMethod_lock if not held.
 360   void unlink_code(CompiledMethod *compare);
 361   // Locks CompiledMethod_lock if not held.
 362   void unlink_code();
 363 
 364 private:
 365   // Either called with CompiledMethod_lock held or from constructor.
 366   void clear_code();
 367 
 368   void clear_method_data() {
 369     _method_data = nullptr;
 370   }
 371 
 372 public:
 373   static void set_code(const methodHandle& mh, CompiledMethod* code);
 374   void set_adapter_entry(AdapterHandlerEntry* adapter) {
 375     _adapter = adapter;
 376   }
 377   void set_from_compiled_entry(address entry) {
 378     _from_compiled_entry = entry;
 379   }
 380   void set_from_compiled_inline_ro_entry(address entry) {
 381     _from_compiled_inline_ro_entry = entry;
 382   }
 383   void set_from_compiled_inline_entry(address entry) {
 384     _from_compiled_inline_entry = entry;
 385   }
 386 
 387   address get_i2c_entry();
 388   address get_c2i_entry();
 389   address get_c2i_inline_entry();
 390   address get_c2i_unverified_entry();
 391   address get_c2i_unverified_inline_entry();
 392   address get_c2i_no_clinit_check_entry();
 393   AdapterHandlerEntry* adapter() const {
 394     return _adapter;
 395   }
 396   // setup entry points
 397   void link_method(const methodHandle& method, TRAPS);
 398   // clear entry points. Used by sharing code during dump time
 399   void unlink_method() NOT_CDS_RETURN;
 400   void remove_unshareable_flags() NOT_CDS_RETURN;
 401 
 402   // the number of argument reg slots that the compiled method uses on the stack.
 403   int num_stack_arg_slots() const { return constMethod()->num_stack_arg_slots(); }
 404 
 405   virtual void metaspace_pointers_do(MetaspaceClosure* iter);
 406   virtual MetaspaceObj::Type type() const { return MethodType; }
 407 
 408   // vtable index
 409   enum VtableIndexFlag {
 410     // Valid vtable indexes are non-negative (>= 0).
 411     // These few negative values are used as sentinels.

 486 
 487   // localvariable table
 488   bool has_localvariable_table() const
 489                           { return constMethod()->has_localvariable_table(); }
 490   u2 localvariable_table_length() const
 491                         { return constMethod()->localvariable_table_length(); }
 492   LocalVariableTableElement* localvariable_table_start() const
 493                          { return constMethod()->localvariable_table_start(); }
 494 
 495   bool has_linenumber_table() const
 496                               { return constMethod()->has_linenumber_table(); }
 497   u_char* compressed_linenumber_table() const
 498                        { return constMethod()->compressed_linenumber_table(); }
 499 
 500   // method holder (the Klass* holding this method)
 501   InstanceKlass* method_holder() const         { return constants()->pool_holder(); }
 502 
 503   Symbol* klass_name() const;                    // returns the name of the method holder
 504   BasicType result_type() const                  { return constMethod()->result_type(); }
 505   bool is_returning_oop() const                  { BasicType r = result_type(); return is_reference_type(r); }
 506   InlineKlass* returns_inline_type(Thread* thread) const;
 507 
 508   // Checked exceptions thrown by this method (resolved to mirrors)
 509   objArrayHandle resolved_checked_exceptions(TRAPS) { return resolved_checked_exceptions_impl(this, THREAD); }
 510 
 511   // Access flags
 512   bool is_public() const                         { return access_flags().is_public();      }
 513   bool is_private() const                        { return access_flags().is_private();     }
 514   bool is_protected() const                      { return access_flags().is_protected();   }
 515   bool is_package_private() const                { return !is_public() && !is_private() && !is_protected(); }
 516   bool is_static() const                         { return access_flags().is_static();      }
 517   bool is_final() const                          { return access_flags().is_final();       }
 518   bool is_synchronized() const                   { return access_flags().is_synchronized();}
 519   bool is_native() const                         { return access_flags().is_native();      }
 520   bool is_abstract() const                       { return access_flags().is_abstract();    }
 521   bool is_synthetic() const                      { return access_flags().is_synthetic();   }
 522 
 523   // returns true if contains only return operation
 524   bool is_empty_method() const;
 525 
 526   // returns true if this is a vanilla constructor

 565   bool has_monitors() const                      { return is_synchronized() || has_monitor_bytecodes(); }
 566 
 567   // monitor matching. This returns a conservative estimate of whether the monitorenter/monitorexit bytecodes
 568   // properly nest in the method. It might return false, even though they actually nest properly, since the info.
 569   // has not been computed yet.
 570   bool guaranteed_monitor_matching() const       { return monitor_matching(); }
 571   void set_guaranteed_monitor_matching()         { set_monitor_matching(); }
 572 
 573   // returns true if the method is an accessor function (setter/getter).
 574   bool is_accessor() const;
 575 
 576   // returns true if the method is a getter
 577   bool is_getter() const;
 578 
 579   // returns true if the method is a setter
 580   bool is_setter() const;
 581 
 582   // returns true if the method does nothing but return a constant of primitive type
 583   bool is_constant_getter() const;
 584 






 585   // returns true if the method name is <clinit> and the method has
 586   // valid static initializer flags.
 587   bool is_class_initializer() const;
 588 
 589   // returns true if the method name is <init> and the method is not a static factory
 590   bool is_object_constructor() const;
 591 
 592   // returns true if the method is an object constructor or class initializer
 593   // (non-static <init> or <clinit>), but false for factories (static <vnew>).
 594   bool is_object_constructor_or_class_initializer() const;
 595 
 596   // returns true if the method name is <vnew> and the method is static
 597   bool is_static_vnew_factory() const;
 598 
 599   // compiled code support
 600   // NOTE: code() is inherently racy as deopt can be clearing code
 601   // simultaneously. Use with caution.
 602   bool has_compiled_code() const;
 603 
 604   bool needs_clinit_barrier() const;
 605 
 606   // sizing
 607   static int header_size()                       {
 608     return align_up((int)sizeof(Method), wordSize) / wordSize;
 609   }
 610   static int size(bool is_native);
 611   int size() const                               { return method_size(); }
 612   void log_touched(Thread* current);
 613   static void print_touched_methods(outputStream* out);
 614 
 615   // interpreter support
 616   static ByteSize const_offset()                 { return byte_offset_of(Method, _constMethod       ); }
 617   static ByteSize access_flags_offset()          { return byte_offset_of(Method, _access_flags      ); }
 618   static ByteSize from_compiled_offset()         { return byte_offset_of(Method, _from_compiled_entry); }
 619   static ByteSize from_compiled_inline_offset()  { return byte_offset_of(Method, _from_compiled_inline_entry); }
 620   static ByteSize from_compiled_inline_ro_offset(){ return byte_offset_of(Method, _from_compiled_inline_ro_entry); }
 621   static ByteSize code_offset()                  { return byte_offset_of(Method, _code); }
 622   static ByteSize flags_offset()                 { return byte_offset_of(Method, _flags); }
 623 
 624   static ByteSize method_counters_offset()       {
 625     return byte_offset_of(Method, _method_counters);
 626   }
 627 #ifndef PRODUCT
 628   static ByteSize compiled_invocation_counter_offset() { return byte_offset_of(Method, _compiled_invocation_count); }
 629 #endif // not PRODUCT
 630   static ByteSize native_function_offset()       { return in_ByteSize(sizeof(Method));                 }
 631   static ByteSize from_interpreted_offset()      { return byte_offset_of(Method, _from_interpreted_entry ); }
 632   static ByteSize interpreter_entry_offset()     { return byte_offset_of(Method, _i2i_entry ); }
 633   static ByteSize signature_handler_offset()     { return in_ByteSize(sizeof(Method) + wordSize);      }
 634   static ByteSize itable_index_offset()          { return byte_offset_of(Method, _vtable_index ); }
 635 
 636   // for code generation
 637   static ByteSize method_data_offset()  { return byte_offset_of(Method, _method_data); }
 638   static ByteSize intrinsic_id_offset() { return byte_offset_of(Method, _intrinsic_id); }
 639   static int intrinsic_id_size_in_bytes()        { return sizeof(u2); }
 640 
 641   // Static methods that are used to implement member methods where an exposed this pointer
 642   // is needed due to possible GCs

 760   void set_changes_current_thread() { constMethod()->set_changes_current_thread(); }
 761 
 762   bool jvmti_mount_transition() const { return constMethod()->jvmti_mount_transition(); }
 763   void set_jvmti_mount_transition() { constMethod()->set_jvmti_mount_transition(); }
 764 
 765   bool is_hidden() const { return constMethod()->is_hidden(); }
 766   void set_is_hidden() { constMethod()->set_is_hidden(); }
 767 
 768   bool is_scoped() const { return constMethod()->is_scoped(); }
 769   void set_scoped() { constMethod()->set_is_scoped(); }
 770 
 771   bool intrinsic_candidate() const { return constMethod()->intrinsic_candidate(); }
 772   void set_intrinsic_candidate() { constMethod()->set_intrinsic_candidate(); }
 773 
 774   bool has_injected_profile() const { return constMethod()->has_injected_profile(); }
 775   void set_has_injected_profile() { constMethod()->set_has_injected_profile(); }
 776 
 777   bool has_reserved_stack_access() const { return constMethod()->reserved_stack_access(); }
 778   void set_has_reserved_stack_access() { constMethod()->set_reserved_stack_access(); }
 779 
 780   bool has_scalarized_args() const { return constMethod()->has_scalarized_args(); }
 781   void set_has_scalarized_args() { constMethod()->set_has_scalarized_args(); }
 782 
 783   bool has_scalarized_return() const { return constMethod()->has_scalarized_return(); }
 784   void set_has_scalarized_return() { constMethod()->set_has_scalarized_return(); }
 785 
 786   bool is_scalarized_arg(int idx) const;
 787 
 788   bool c1_needs_stack_repair() const { return constMethod()->c1_needs_stack_repair(); }
 789   void set_c1_needs_stack_repair() { constMethod()->set_c1_needs_stack_repair(); }
 790 
 791   bool c2_needs_stack_repair() const { return constMethod()->c2_needs_stack_repair(); }
 792   void set_c2_needs_stack_repair() { constMethod()->set_c2_needs_stack_repair(); }
 793 
 794   bool mismatch() const { return constMethod()->mismatch(); }
 795   void set_mismatch() { constMethod()->set_mismatch(); }
 796 
 797   JFR_ONLY(DEFINE_TRACE_FLAG_ACCESSOR;)
 798 
 799   ConstMethod::MethodType method_type() const {
 800       return _constMethod->method_type();
 801   }
 802   bool is_overpass() const { return method_type() == ConstMethod::OVERPASS; }
 803 
 804   // On-stack replacement support
 805   bool has_osr_nmethod(int level, bool match_level) {
 806    return method_holder()->lookup_osr_nmethod(this, InvocationEntryBci, level, match_level) != nullptr;
 807   }
 808 
 809   nmethod* lookup_osr_nmethod_for(int bci, int level, bool match_level) {
 810     return method_holder()->lookup_osr_nmethod(this, bci, level, match_level);
 811   }
 812 
 813   // Find if klass for method is loaded
 814   bool is_klass_loaded_by_klass_index(int klass_index) const;
 815   bool is_klass_loaded(int refinfo_index, Bytecodes::Code bc, bool must_be_resolved = false) const;
 816 
< prev index next >