< prev index next >

src/hotspot/share/oops/method.hpp

Print this page

  76   MethodData*       _method_data;
  77   MethodCounters*   _method_counters;
  78   AdapterHandlerEntry* _adapter;
  79   int               _vtable_index;               // vtable index of this method (see VtableIndexFlag)
  80   AccessFlags       _access_flags;               // Access flags
  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   nmethod* 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   static void restore_archived_method_handle_intrinsic(methodHandle m, TRAPS);
 126 #endif
 127 
 128   // accessors for instance variables
 129 
 130   ConstMethod* constMethod() const             { return _constMethod; }
 131   void set_constMethod(ConstMethod* xconst)    { _constMethod = xconst; }
 132 
 133 
 134   static address make_adapters(const methodHandle& mh, TRAPS);
 135   address from_compiled_entry() const;


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

 344 
 345   bool was_executed_more_than(int n);
 346   bool was_never_executed()                     { return !was_executed_more_than(0);  }
 347 
 348   static void build_profiling_method_data(const methodHandle& method, TRAPS);
 349   static bool install_training_method_data(const methodHandle& method);
 350   static MethodCounters* build_method_counters(Thread* current, Method* m);
 351 
 352   inline int interpreter_invocation_count() const;
 353 
 354 #ifndef PRODUCT
 355   int64_t  compiled_invocation_count() const    { return _compiled_invocation_count;}
 356   void set_compiled_invocation_count(int count) { _compiled_invocation_count = (int64_t)count; }
 357 #else
 358   // for PrintMethodData in a product build
 359   int64_t  compiled_invocation_count() const    { return 0; }
 360 #endif // not PRODUCT
 361 
 362   // nmethod/verified compiler entry
 363   address verified_code_entry();


 364   bool check_code() const;      // Not inline to avoid circular ref
 365   nmethod* code() const;
 366 
 367   // Locks NMethodState_lock if not held.
 368   void unlink_code(nmethod *compare);
 369   // Locks NMethodState_lock if not held.
 370   void unlink_code();
 371 
 372 private:
 373   // Either called with NMethodState_lock held or from constructor.
 374   void clear_code();
 375 
 376   void clear_method_data() {
 377     _method_data = nullptr;
 378   }
 379 
 380 public:
 381   static void set_code(const methodHandle& mh, nmethod* code);
 382   void set_adapter_entry(AdapterHandlerEntry* adapter) {
 383     _adapter = adapter;
 384   }
 385   void set_from_compiled_entry(address entry) {
 386     _from_compiled_entry =  entry;






 387   }
 388 
 389   address get_i2c_entry();
 390   address get_c2i_entry();


 391   address get_c2i_unverified_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   virtual void metaspace_pointers_do(MetaspaceClosure* iter);
 403   virtual MetaspaceObj::Type type() const { return MethodType; }
 404 
 405   // vtable index
 406   enum VtableIndexFlag {
 407     // Valid vtable indexes are non-negative (>= 0).
 408     // These few negative values are used as sentinels.
 409     itable_index_max        = -10, // first itable index, growing downward
 410     pending_itable_index    = -9,  // itable index will be assigned
 411     invalid_vtable_index    = -4,  // distinct from any valid vtable index

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

 564   bool has_monitors() const                      { return is_synchronized() || has_monitor_bytecodes(); }
 565 
 566   // monitor matching. This returns a conservative estimate of whether the monitorenter/monitorexit bytecodes
 567   // properly nest in the method. It might return false, even though they actually nest properly, since the info.
 568   // has not been computed yet.
 569   bool guaranteed_monitor_matching() const       { return monitor_matching(); }
 570   void set_guaranteed_monitor_matching()         { set_monitor_matching(); }
 571 
 572   // returns true if the method is an accessor function (setter/getter).
 573   bool is_accessor() const;
 574 
 575   // returns true if the method is a getter
 576   bool is_getter() const;
 577 
 578   // returns true if the method is a setter
 579   bool is_setter() const;
 580 
 581   // returns true if the method does nothing but return a constant of primitive type
 582   bool is_constant_getter() const;
 583 
 584   // returns true if the method is static OR if the classfile version < 51
 585   bool has_valid_initializer_flags() const;
 586 
 587   // returns true if the method name is <clinit> and the method has
 588   // valid static initializer flags.
 589   bool is_static_initializer() const;
 590 
 591   // returns true if the method name is <init>
 592   bool is_object_initializer() const;
 593 
 594   // returns true if the method name is wait0
 595   bool is_object_wait0() const;
 596 
 597   // compiled code support
 598   // NOTE: code() is inherently racy as deopt can be clearing code
 599   // simultaneously. Use with caution.
 600   bool has_compiled_code() const;
 601 
 602   bool needs_clinit_barrier() const;
 603 
 604   // sizing
 605   static int header_size()                       {
 606     return align_up((int)sizeof(Method), wordSize) / wordSize;
 607   }
 608   static int size(bool is_native);
 609   int size() const                               { return method_size(); }
 610   void log_touched(Thread* current);
 611   static void print_touched_methods(outputStream* out);
 612 
 613   // interpreter support
 614   static ByteSize const_offset()                 { return byte_offset_of(Method, _constMethod       ); }
 615   static ByteSize access_flags_offset()          { return byte_offset_of(Method, _access_flags      ); }
 616   static ByteSize from_compiled_offset()         { return byte_offset_of(Method, _from_compiled_entry); }


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

 618 
 619   static ByteSize method_counters_offset()       {
 620     return byte_offset_of(Method, _method_counters);
 621   }
 622 #ifndef PRODUCT
 623   static ByteSize compiled_invocation_counter_offset() { return byte_offset_of(Method, _compiled_invocation_count); }
 624 #endif // not PRODUCT
 625   static ByteSize native_function_offset()       { return in_ByteSize(sizeof(Method));                 }
 626   static ByteSize from_interpreted_offset()      { return byte_offset_of(Method, _from_interpreted_entry ); }
 627   static ByteSize interpreter_entry_offset()     { return byte_offset_of(Method, _i2i_entry ); }
 628   static ByteSize signature_handler_offset()     { return in_ByteSize(sizeof(Method) + wordSize);      }
 629   static ByteSize itable_index_offset()          { return byte_offset_of(Method, _vtable_index ); }
 630 
 631   // for code generation
 632   static ByteSize method_data_offset()  { return byte_offset_of(Method, _method_data); }
 633   static ByteSize intrinsic_id_offset() { return byte_offset_of(Method, _intrinsic_id); }
 634   static int intrinsic_id_size_in_bytes()        { return sizeof(u2); }
 635 
 636   // Static methods that are used to implement member methods where an exposed this pointer
 637   // is needed due to possible GCs

 749   void set_jvmti_hide_events() { constMethod()->set_jvmti_hide_events(); }
 750 
 751   bool jvmti_mount_transition() const { return constMethod()->jvmti_mount_transition(); }
 752   void set_jvmti_mount_transition() { constMethod()->set_jvmti_mount_transition(); }
 753 
 754   bool is_hidden() const { return constMethod()->is_hidden(); }
 755   void set_is_hidden() { constMethod()->set_is_hidden(); }
 756 
 757   bool is_scoped() const { return constMethod()->is_scoped(); }
 758   void set_scoped() { constMethod()->set_is_scoped(); }
 759 
 760   bool intrinsic_candidate() const { return constMethod()->intrinsic_candidate(); }
 761   void set_intrinsic_candidate() { constMethod()->set_intrinsic_candidate(); }
 762 
 763   bool has_injected_profile() const { return constMethod()->has_injected_profile(); }
 764   void set_has_injected_profile() { constMethod()->set_has_injected_profile(); }
 765 
 766   bool has_reserved_stack_access() const { return constMethod()->reserved_stack_access(); }
 767   void set_has_reserved_stack_access() { constMethod()->set_reserved_stack_access(); }
 768 











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

  76   MethodData*       _method_data;
  77   MethodCounters*   _method_counters;
  78   AdapterHandlerEntry* _adapter;
  79   int               _vtable_index;               // vtable index of this method (see VtableIndexFlag)
  80   AccessFlags       _access_flags;               // Access flags
  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   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   nmethod* 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   static void restore_archived_method_handle_intrinsic(methodHandle m, TRAPS);
 128 #endif
 129 
 130   // accessors for instance variables
 131 
 132   ConstMethod* constMethod() const             { return _constMethod; }
 133   void set_constMethod(ConstMethod* xconst)    { _constMethod = xconst; }
 134 
 135 
 136   static address make_adapters(const methodHandle& mh, TRAPS);
 137   address from_compiled_entry() const;
 138   address from_compiled_inline_ro_entry() const;
 139   address from_compiled_inline_entry() const;
 140   address from_interpreted_entry() const;
 141 
 142   // access flag
 143   AccessFlags access_flags() const               { return _access_flags;  }
 144   void set_access_flags(AccessFlags flags)       { _access_flags = flags; }
 145 
 146   // name
 147   Symbol* name() const                           { return constants()->symbol_at(name_index()); }
 148   u2 name_index() const                          { return constMethod()->name_index();         }
 149   void set_name_index(int index)                 { constMethod()->set_name_index(index);       }
 150 
 151   // signature
 152   Symbol* signature() const                      { return constants()->symbol_at(signature_index()); }
 153   u2 signature_index() const                     { return constMethod()->signature_index();         }
 154   void set_signature_index(int index)            { constMethod()->set_signature_index(index);       }
 155 
 156   // generics support
 157   Symbol* generic_signature() const              { int idx = generic_signature_index(); return ((idx != 0) ? constants()->symbol_at(idx) : nullptr); }
 158   u2 generic_signature_index() const             { return constMethod()->generic_signature_index(); }
 159 

 348 
 349   bool was_executed_more_than(int n);
 350   bool was_never_executed()                     { return !was_executed_more_than(0);  }
 351 
 352   static void build_profiling_method_data(const methodHandle& method, TRAPS);
 353   static bool install_training_method_data(const methodHandle& method);
 354   static MethodCounters* build_method_counters(Thread* current, Method* m);
 355 
 356   inline int interpreter_invocation_count() const;
 357 
 358 #ifndef PRODUCT
 359   int64_t  compiled_invocation_count() const    { return _compiled_invocation_count;}
 360   void set_compiled_invocation_count(int count) { _compiled_invocation_count = (int64_t)count; }
 361 #else
 362   // for PrintMethodData in a product build
 363   int64_t  compiled_invocation_count() const    { return 0; }
 364 #endif // not PRODUCT
 365 
 366   // nmethod/verified compiler entry
 367   address verified_code_entry();
 368   address verified_inline_code_entry();
 369   address verified_inline_ro_code_entry();
 370   bool check_code() const;      // Not inline to avoid circular ref
 371   nmethod* code() const;
 372 
 373   // Locks NMethodState_lock if not held.
 374   void unlink_code(nmethod *compare);
 375   // Locks NMethodState_lock if not held.
 376   void unlink_code();
 377 
 378 private:
 379   // Either called with NMethodState_lock held or from constructor.
 380   void clear_code();
 381 
 382   void clear_method_data() {
 383     _method_data = nullptr;
 384   }
 385 
 386 public:
 387   static void set_code(const methodHandle& mh, nmethod* code);
 388   void set_adapter_entry(AdapterHandlerEntry* adapter) {
 389     _adapter = adapter;
 390   }
 391   void set_from_compiled_entry(address entry) {
 392     _from_compiled_entry = entry;
 393   }
 394   void set_from_compiled_inline_ro_entry(address entry) {
 395     _from_compiled_inline_ro_entry = entry;
 396   }
 397   void set_from_compiled_inline_entry(address entry) {
 398     _from_compiled_inline_entry = entry;
 399   }
 400 
 401   address get_i2c_entry();
 402   address get_c2i_entry();
 403   address get_c2i_inline_entry();
 404   address get_c2i_inline_ro_entry();
 405   address get_c2i_unverified_entry();
 406   address get_c2i_unverified_inline_entry();
 407   address get_c2i_no_clinit_check_entry();
 408   AdapterHandlerEntry* adapter() const {
 409     return _adapter;
 410   }
 411   // setup entry points
 412   void link_method(const methodHandle& method, TRAPS);
 413   // clear entry points. Used by sharing code during dump time
 414   void unlink_method() NOT_CDS_RETURN;
 415   void remove_unshareable_flags() NOT_CDS_RETURN;
 416 
 417   virtual void metaspace_pointers_do(MetaspaceClosure* iter);
 418   virtual MetaspaceObj::Type type() const { return MethodType; }
 419 
 420   // vtable index
 421   enum VtableIndexFlag {
 422     // Valid vtable indexes are non-negative (>= 0).
 423     // These few negative values are used as sentinels.
 424     itable_index_max        = -10, // first itable index, growing downward
 425     pending_itable_index    = -9,  // itable index will be assigned
 426     invalid_vtable_index    = -4,  // distinct from any valid vtable index

 500 
 501   // localvariable table
 502   bool has_localvariable_table() const
 503                           { return constMethod()->has_localvariable_table(); }
 504   u2 localvariable_table_length() const
 505                         { return constMethod()->localvariable_table_length(); }
 506   LocalVariableTableElement* localvariable_table_start() const
 507                          { return constMethod()->localvariable_table_start(); }
 508 
 509   bool has_linenumber_table() const
 510                               { return constMethod()->has_linenumber_table(); }
 511   u_char* compressed_linenumber_table() const
 512                        { return constMethod()->compressed_linenumber_table(); }
 513 
 514   // method holder (the Klass* holding this method)
 515   InstanceKlass* method_holder() const         { return constants()->pool_holder(); }
 516 
 517   Symbol* klass_name() const;                    // returns the name of the method holder
 518   BasicType result_type() const                  { return constMethod()->result_type(); }
 519   bool is_returning_oop() const                  { BasicType r = result_type(); return is_reference_type(r); }
 520   InlineKlass* returns_inline_type() const;
 521 
 522   // Checked exceptions thrown by this method (resolved to mirrors)
 523   objArrayHandle resolved_checked_exceptions(TRAPS) { return resolved_checked_exceptions_impl(this, THREAD); }
 524 
 525   // Access flags
 526   bool is_public() const                         { return access_flags().is_public();      }
 527   bool is_private() const                        { return access_flags().is_private();     }
 528   bool is_protected() const                      { return access_flags().is_protected();   }
 529   bool is_package_private() const                { return !is_public() && !is_private() && !is_protected(); }
 530   bool is_static() const                         { return access_flags().is_static();      }
 531   bool is_final() const                          { return access_flags().is_final();       }
 532   bool is_synchronized() const                   { return access_flags().is_synchronized();}
 533   bool is_native() const                         { return access_flags().is_native();      }
 534   bool is_abstract() const                       { return access_flags().is_abstract();    }
 535   bool is_synthetic() const                      { return access_flags().is_synthetic();   }
 536 
 537   // returns true if contains only return operation
 538   bool is_empty_method() const;
 539 
 540   // returns true if this is a vanilla constructor

 579   bool has_monitors() const                      { return is_synchronized() || has_monitor_bytecodes(); }
 580 
 581   // monitor matching. This returns a conservative estimate of whether the monitorenter/monitorexit bytecodes
 582   // properly nest in the method. It might return false, even though they actually nest properly, since the info.
 583   // has not been computed yet.
 584   bool guaranteed_monitor_matching() const       { return monitor_matching(); }
 585   void set_guaranteed_monitor_matching()         { set_monitor_matching(); }
 586 
 587   // returns true if the method is an accessor function (setter/getter).
 588   bool is_accessor() const;
 589 
 590   // returns true if the method is a getter
 591   bool is_getter() const;
 592 
 593   // returns true if the method is a setter
 594   bool is_setter() const;
 595 
 596   // returns true if the method does nothing but return a constant of primitive type
 597   bool is_constant_getter() const;
 598 



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

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