< 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_unverified_entry();
 405   address get_c2i_unverified_inline_entry();
 406   address get_c2i_no_clinit_check_entry();
 407   AdapterHandlerEntry* adapter() const {
 408     return _adapter;
 409   }
 410   // setup entry points
 411   void link_method(const methodHandle& method, TRAPS);
 412   // clear entry points. Used by sharing code during dump time
 413   void unlink_method() NOT_CDS_RETURN;
 414   void remove_unshareable_flags() NOT_CDS_RETURN;
 415 
 416   virtual void metaspace_pointers_do(MetaspaceClosure* iter);
 417   virtual MetaspaceObj::Type type() const { return MethodType; }
 418 
 419   // vtable index
 420   enum VtableIndexFlag {
 421     // Valid vtable indexes are non-negative (>= 0).
 422     // These few negative values are used as sentinels.
 423     itable_index_max        = -10, // first itable index, growing downward
 424     pending_itable_index    = -9,  // itable index will be assigned
 425     invalid_vtable_index    = -4,  // distinct from any valid vtable index

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

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



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

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