src/share/vm/oops/method.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8014013 Sdiff src/share/vm/oops

src/share/vm/oops/method.hpp

Print this page




 431   // nmethod/verified compiler entry
 432   address verified_code_entry();
 433   bool check_code() const;      // Not inline to avoid circular ref
 434   nmethod* volatile code() const                 { assert( check_code(), "" ); return (nmethod *)OrderAccess::load_ptr_acquire(&_code); }
 435   void clear_code();            // Clear out any compiled code
 436   static void set_code(methodHandle mh, nmethod* code);
 437   void set_adapter_entry(AdapterHandlerEntry* adapter) {  _adapter = adapter; }
 438   address get_i2c_entry();
 439   address get_c2i_entry();
 440   address get_c2i_unverified_entry();
 441   AdapterHandlerEntry* adapter() {  return _adapter; }
 442   // setup entry points
 443   void link_method(methodHandle method, TRAPS);
 444   // clear entry points. Used by sharing code
 445   void unlink_method();
 446 
 447   // vtable index
 448   enum VtableIndexFlag {
 449     // Valid vtable indexes are non-negative (>= 0).
 450     // These few negative values are used as sentinels.
 451     highest_unused_vtable_index_value = -5,

 452     invalid_vtable_index    = -4,  // distinct from any valid vtable index
 453     garbage_vtable_index    = -3,  // not yet linked; no vtable layout yet
 454     nonvirtual_vtable_index = -2   // there is no need for vtable dispatch
 455     // 6330203 Note:  Do not use -1, which was overloaded with many meanings.
 456   };
 457   DEBUG_ONLY(bool valid_vtable_index() const     { return _vtable_index >= nonvirtual_vtable_index; })
 458   int  vtable_index() const                      { assert(valid_vtable_index(), "");
 459                                                    return _vtable_index; }
 460   void set_vtable_index(int index)               { _vtable_index = index; }





 461 
 462   // interpreter entry
 463   address interpreter_entry() const              { return _i2i_entry; }
 464   // Only used when first initialize so we can set _i2i_entry and _from_interpreted_entry
 465   void set_interpreter_entry(address entry)      { _i2i_entry = entry;  _from_interpreted_entry = entry; }
 466 
 467   // native function (used for native methods only)
 468   enum {
 469     native_bind_event_is_interesting = true
 470   };
 471   address native_function() const                { return *(native_function_addr()); }
 472   address critical_native_function();
 473 
 474   // Must specify a real function (not NULL).
 475   // Use clear_native_function() to unregister.
 476   void set_native_function(address function, bool post_event_flag);
 477   bool has_native_function() const;
 478   void clear_native_function();
 479 
 480   // signature handler (used for native methods only)


 543   bool is_public() const                         { return access_flags().is_public();      }
 544   bool is_private() const                        { return access_flags().is_private();     }
 545   bool is_protected() const                      { return access_flags().is_protected();   }
 546   bool is_package_private() const                { return !is_public() && !is_private() && !is_protected(); }
 547   bool is_static() const                         { return access_flags().is_static();      }
 548   bool is_final() const                          { return access_flags().is_final();       }
 549   bool is_synchronized() const                   { return access_flags().is_synchronized();}
 550   bool is_native() const                         { return access_flags().is_native();      }
 551   bool is_abstract() const                       { return access_flags().is_abstract();    }
 552   bool is_strict() const                         { return access_flags().is_strict();      }
 553   bool is_synthetic() const                      { return access_flags().is_synthetic();   }
 554 
 555   // returns true if contains only return operation
 556   bool is_empty_method() const;
 557 
 558   // returns true if this is a vanilla constructor
 559   bool is_vanilla_constructor() const;
 560 
 561   // checks method and its method holder
 562   bool is_final_method() const;
 563   bool is_strict_method() const;
 564 
 565   // true if method needs no dynamic dispatch (final and/or no vtable entry)
 566   bool can_be_statically_bound() const;

 567 
 568   // returns true if the method has any backward branches.
 569   bool has_loops() {
 570     return access_flags().loops_flag_init() ? access_flags().has_loops() : compute_has_loops_flag();
 571   };
 572 
 573   bool compute_has_loops_flag();
 574 
 575   bool has_jsrs() {
 576     return access_flags().has_jsrs();
 577   };
 578   void set_has_jsrs() {
 579     _access_flags.set_has_jsrs();
 580   }
 581 
 582   // returns true if the method has any monitors.
 583   bool has_monitors() const                      { return is_synchronized() || access_flags().has_monitor_bytecodes(); }
 584   bool has_monitor_bytecodes() const             { return access_flags().has_monitor_bytecodes(); }
 585 
 586   void set_has_monitor_bytecodes()               { _access_flags.set_has_monitor_bytecodes(); }


 723   static Method* checked_resolve_jmethod_id(jmethodID mid);
 724 
 725   static void change_method_associated_with_jmethod_id(jmethodID old_jmid_ptr, Method* new_method);
 726   static bool is_method_id(jmethodID mid);
 727 
 728   // Clear methods
 729   static void clear_jmethod_ids(ClassLoaderData* loader_data);
 730   static void print_jmethod_ids(ClassLoaderData* loader_data, outputStream* out) PRODUCT_RETURN;
 731 
 732   // Get this method's jmethodID -- allocate if it doesn't exist
 733   jmethodID jmethod_id()                            { methodHandle this_h(this);
 734                                                       return InstanceKlass::get_jmethod_id(method_holder(), this_h); }
 735 
 736   // Lookup the jmethodID for this method.  Return NULL if not found.
 737   // NOTE that this function can be called from a signal handler
 738   // (see AsyncGetCallTrace support for Forte Analyzer) and this
 739   // needs to be async-safe. No allocation should be done and
 740   // so handles are not used to avoid deadlock.
 741   jmethodID find_jmethod_id_or_null()               { return method_holder()->jmethod_id_or_null(this); }
 742 
 743   // JNI static invoke cached itable index accessors
 744   int cached_itable_index()                         { return method_holder()->cached_itable_index(method_idnum()); }
 745   void set_cached_itable_index(int index)           { method_holder()->set_cached_itable_index(method_idnum(), index); }
 746 
 747   // Support for inlining of intrinsic methods
 748   vmIntrinsics::ID intrinsic_id() const          { return (vmIntrinsics::ID) _intrinsic_id;           }
 749   void     set_intrinsic_id(vmIntrinsics::ID id) {                           _intrinsic_id = (u1) id; }
 750 
 751   // Helper routines for intrinsic_id() and vmIntrinsics::method().
 752   void init_intrinsic_id();     // updates from _none if a match
 753   static vmSymbols::SID klass_id_for_intrinsics(Klass* holder);
 754 
 755   bool     jfr_towrite()            { return _jfr_towrite;          }
 756   void set_jfr_towrite(bool x)      {        _jfr_towrite = x;      }
 757   bool     caller_sensitive()       { return _caller_sensitive;     }
 758   void set_caller_sensitive(bool x) {        _caller_sensitive = x; }
 759   bool     force_inline()           { return _force_inline;         }
 760   void set_force_inline(bool x)     {        _force_inline = x;     }
 761   bool     dont_inline()            { return _dont_inline;          }
 762   void set_dont_inline(bool x)      {        _dont_inline = x;      }
 763   bool  is_hidden()                 { return _hidden;               }
 764   void set_hidden(bool x)           {        _hidden = x;           }
 765   ConstMethod::MethodType method_type() const {
 766       return _constMethod->method_type();




 431   // nmethod/verified compiler entry
 432   address verified_code_entry();
 433   bool check_code() const;      // Not inline to avoid circular ref
 434   nmethod* volatile code() const                 { assert( check_code(), "" ); return (nmethod *)OrderAccess::load_ptr_acquire(&_code); }
 435   void clear_code();            // Clear out any compiled code
 436   static void set_code(methodHandle mh, nmethod* code);
 437   void set_adapter_entry(AdapterHandlerEntry* adapter) {  _adapter = adapter; }
 438   address get_i2c_entry();
 439   address get_c2i_entry();
 440   address get_c2i_unverified_entry();
 441   AdapterHandlerEntry* adapter() {  return _adapter; }
 442   // setup entry points
 443   void link_method(methodHandle method, TRAPS);
 444   // clear entry points. Used by sharing code
 445   void unlink_method();
 446 
 447   // vtable index
 448   enum VtableIndexFlag {
 449     // Valid vtable indexes are non-negative (>= 0).
 450     // These few negative values are used as sentinels.
 451     itable_index_max        = -10, // first itable index, growing downward
 452     pending_itable_index    = -9,  // itable index will be assigned
 453     invalid_vtable_index    = -4,  // distinct from any valid vtable index
 454     garbage_vtable_index    = -3,  // not yet linked; no vtable layout yet
 455     nonvirtual_vtable_index = -2   // there is no need for vtable dispatch
 456     // 6330203 Note:  Do not use -1, which was overloaded with many meanings.
 457   };
 458   DEBUG_ONLY(bool valid_vtable_index() const     { return _vtable_index >= nonvirtual_vtable_index; })
 459   bool has_vtable_index() const                  { return _vtable_index >= 0; }
 460   int  vtable_index() const                      { return _vtable_index; }
 461   void set_vtable_index(int index)               { _vtable_index = index; }
 462   DEBUG_ONLY(bool valid_itable_index() const     { return _vtable_index <= pending_itable_index; })
 463   bool has_itable_index() const                  { return _vtable_index <= itable_index_max; }
 464   int  itable_index() const                      { assert(valid_itable_index(), "");
 465                                                    return itable_index_max - _vtable_index; }
 466   void set_itable_index(int index)               { _vtable_index = itable_index_max - index; assert(valid_itable_index(), ""); }
 467 
 468   // interpreter entry
 469   address interpreter_entry() const              { return _i2i_entry; }
 470   // Only used when first initialize so we can set _i2i_entry and _from_interpreted_entry
 471   void set_interpreter_entry(address entry)      { _i2i_entry = entry;  _from_interpreted_entry = entry; }
 472 
 473   // native function (used for native methods only)
 474   enum {
 475     native_bind_event_is_interesting = true
 476   };
 477   address native_function() const                { return *(native_function_addr()); }
 478   address critical_native_function();
 479 
 480   // Must specify a real function (not NULL).
 481   // Use clear_native_function() to unregister.
 482   void set_native_function(address function, bool post_event_flag);
 483   bool has_native_function() const;
 484   void clear_native_function();
 485 
 486   // signature handler (used for native methods only)


 549   bool is_public() const                         { return access_flags().is_public();      }
 550   bool is_private() const                        { return access_flags().is_private();     }
 551   bool is_protected() const                      { return access_flags().is_protected();   }
 552   bool is_package_private() const                { return !is_public() && !is_private() && !is_protected(); }
 553   bool is_static() const                         { return access_flags().is_static();      }
 554   bool is_final() const                          { return access_flags().is_final();       }
 555   bool is_synchronized() const                   { return access_flags().is_synchronized();}
 556   bool is_native() const                         { return access_flags().is_native();      }
 557   bool is_abstract() const                       { return access_flags().is_abstract();    }
 558   bool is_strict() const                         { return access_flags().is_strict();      }
 559   bool is_synthetic() const                      { return access_flags().is_synthetic();   }
 560 
 561   // returns true if contains only return operation
 562   bool is_empty_method() const;
 563 
 564   // returns true if this is a vanilla constructor
 565   bool is_vanilla_constructor() const;
 566 
 567   // checks method and its method holder
 568   bool is_final_method() const;
 569   bool is_final_method(AccessFlags class_access_flags) const;
 570 
 571   // true if method needs no dynamic dispatch (final and/or no vtable entry)
 572   bool can_be_statically_bound() const;
 573   bool can_be_statically_bound(AccessFlags class_access_flags) const;
 574 
 575   // returns true if the method has any backward branches.
 576   bool has_loops() {
 577     return access_flags().loops_flag_init() ? access_flags().has_loops() : compute_has_loops_flag();
 578   };
 579 
 580   bool compute_has_loops_flag();
 581 
 582   bool has_jsrs() {
 583     return access_flags().has_jsrs();
 584   };
 585   void set_has_jsrs() {
 586     _access_flags.set_has_jsrs();
 587   }
 588 
 589   // returns true if the method has any monitors.
 590   bool has_monitors() const                      { return is_synchronized() || access_flags().has_monitor_bytecodes(); }
 591   bool has_monitor_bytecodes() const             { return access_flags().has_monitor_bytecodes(); }
 592 
 593   void set_has_monitor_bytecodes()               { _access_flags.set_has_monitor_bytecodes(); }


 730   static Method* checked_resolve_jmethod_id(jmethodID mid);
 731 
 732   static void change_method_associated_with_jmethod_id(jmethodID old_jmid_ptr, Method* new_method);
 733   static bool is_method_id(jmethodID mid);
 734 
 735   // Clear methods
 736   static void clear_jmethod_ids(ClassLoaderData* loader_data);
 737   static void print_jmethod_ids(ClassLoaderData* loader_data, outputStream* out) PRODUCT_RETURN;
 738 
 739   // Get this method's jmethodID -- allocate if it doesn't exist
 740   jmethodID jmethod_id()                            { methodHandle this_h(this);
 741                                                       return InstanceKlass::get_jmethod_id(method_holder(), this_h); }
 742 
 743   // Lookup the jmethodID for this method.  Return NULL if not found.
 744   // NOTE that this function can be called from a signal handler
 745   // (see AsyncGetCallTrace support for Forte Analyzer) and this
 746   // needs to be async-safe. No allocation should be done and
 747   // so handles are not used to avoid deadlock.
 748   jmethodID find_jmethod_id_or_null()               { return method_holder()->jmethod_id_or_null(this); }
 749 




 750   // Support for inlining of intrinsic methods
 751   vmIntrinsics::ID intrinsic_id() const          { return (vmIntrinsics::ID) _intrinsic_id;           }
 752   void     set_intrinsic_id(vmIntrinsics::ID id) {                           _intrinsic_id = (u1) id; }
 753 
 754   // Helper routines for intrinsic_id() and vmIntrinsics::method().
 755   void init_intrinsic_id();     // updates from _none if a match
 756   static vmSymbols::SID klass_id_for_intrinsics(Klass* holder);
 757 
 758   bool     jfr_towrite()            { return _jfr_towrite;          }
 759   void set_jfr_towrite(bool x)      {        _jfr_towrite = x;      }
 760   bool     caller_sensitive()       { return _caller_sensitive;     }
 761   void set_caller_sensitive(bool x) {        _caller_sensitive = x; }
 762   bool     force_inline()           { return _force_inline;         }
 763   void set_force_inline(bool x)     {        _force_inline = x;     }
 764   bool     dont_inline()            { return _dont_inline;          }
 765   void set_dont_inline(bool x)      {        _dont_inline = x;      }
 766   bool  is_hidden()                 { return _hidden;               }
 767   void set_hidden(bool x)           {        _hidden = x;           }
 768   ConstMethod::MethodType method_type() const {
 769       return _constMethod->method_type();


src/share/vm/oops/method.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File