1 /*
   2  * Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_OOPS_METHOD_HPP
  26 #define SHARE_OOPS_METHOD_HPP
  27 
  28 #include "code/compressedStream.hpp"
  29 #include "compiler/compilerDefinitions.hpp"
  30 #include "interpreter/invocationCounter.hpp"
  31 #include "oops/annotations.hpp"
  32 #include "oops/constantPool.hpp"
  33 #include "oops/methodCounters.hpp"
  34 #include "oops/instanceKlass.hpp"
  35 #include "oops/oop.hpp"
  36 #include "oops/typeArrayOop.hpp"
  37 #include "utilities/accessFlags.hpp"
  38 #include "utilities/align.hpp"
  39 #include "utilities/growableArray.hpp"
  40 #include "utilities/macros.hpp"
  41 #include "utilities/vmEnums.hpp"
  42 #if INCLUDE_JFR
  43 #include "jfr/support/jfrTraceIdExtension.hpp"
  44 #endif
  45 
  46 
  47 // A Method represents a Java method.
  48 //
  49 // Note that most applications load thousands of methods, so keeping the size of this
  50 // class small has a big impact on footprint.
  51 //
  52 // Note that native_function and signature_handler have to be at fixed offsets
  53 // (required by the interpreter)
  54 //
  55 //  Method embedded field layout (after declared fields):
  56 //   [EMBEDDED native_function       (present only if native) ]
  57 //   [EMBEDDED signature_handler     (present only if native) ]
  58 
  59 class CheckedExceptionElement;
  60 class LocalVariableTableElement;
  61 class AdapterHandlerEntry;
  62 class MethodData;
  63 class MethodCounters;
  64 class ConstMethod;
  65 class InlineTableSizes;
  66 class CompiledMethod;
  67 class InterpreterOopMap;
  68 
  69 class Method : public Metadata {
  70  friend class VMStructs;
  71  friend class JVMCIVMStructs;
  72  private:
  73   // If you add a new field that points to any metaspace object, you
  74   // must add this field to Method::metaspace_pointers_do().
  75   ConstMethod*      _constMethod;                // Method read-only data.
  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                                                  // note: can have vtables with >2**16 elements (because of inheritance)
  82   u2                _intrinsic_id;               // vmSymbols::intrinsic_id (0 == _none)
  83 
  84   // Flags
  85   enum Flags {
  86     _caller_sensitive      = 1 << 0,
  87     _force_inline          = 1 << 1,
  88     _dont_inline           = 1 << 2,
  89     _hidden                = 1 << 3,
  90     _has_injected_profile  = 1 << 4,
  91     _intrinsic_candidate   = 1 << 5,
  92     _reserved_stack_access = 1 << 6,
  93     _scoped                = 1 << 7
  94   };
  95   mutable u2 _flags;
  96 
  97   JFR_ONLY(DEFINE_TRACE_FLAG;)
  98 
  99 #ifndef PRODUCT
 100   int64_t _compiled_invocation_count;
 101 #endif
 102   // Entry point for calling both from and to the interpreter.
 103   address _i2i_entry;           // All-args-on-stack calling convention
 104   // Entry point for calling from compiled code, to compiled code if it exists
 105   // or else the interpreter.
 106   volatile address _from_compiled_entry;        // Cache of: _code ? _code->entry_point() : _adapter->c2i_entry()
 107   // The entry point for calling both from and to compiled code is
 108   // "_code->entry_point()".  Because of tiered compilation and de-opt, this
 109   // field can come and go.  It can transition from NULL to not-null at any
 110   // time (whenever a compile completes).  It can transition from not-null to
 111   // NULL only at safepoints (because of a de-opt).
 112   CompiledMethod* volatile _code;                       // Points to the corresponding piece of native code
 113   volatile address           _from_interpreted_entry; // Cache of _code ? _adapter->i2c_entry() : _i2i_entry
 114 
 115   // Constructor
 116   Method(ConstMethod* xconst, AccessFlags access_flags);
 117  public:
 118 
 119   static Method* allocate(ClassLoaderData* loader_data,
 120                           int byte_code_size,
 121                           AccessFlags access_flags,
 122                           InlineTableSizes* sizes,
 123                           ConstMethod::MethodType method_type,
 124                           TRAPS);
 125 
 126   // CDS and vtbl checking can create an empty Method to get vtbl pointer.
 127   Method(){}
 128 
 129   virtual bool is_method() const { return true; }
 130 
 131   void restore_unshareable_info(TRAPS);
 132 
 133   // accessors for instance variables
 134 
 135   ConstMethod* constMethod() const             { return _constMethod; }
 136   void set_constMethod(ConstMethod* xconst)    { _constMethod = xconst; }
 137 
 138 
 139   static address make_adapters(const methodHandle& mh, TRAPS);
 140   address from_compiled_entry() const;
 141   address from_compiled_entry_no_trampoline() const;
 142   address from_interpreted_entry() const;
 143 
 144   // access flag
 145   AccessFlags access_flags() const               { return _access_flags;  }
 146   void set_access_flags(AccessFlags flags)       { _access_flags = flags; }
 147 
 148   // name
 149   Symbol* name() const                           { return constants()->symbol_at(name_index()); }
 150   int name_index() const                         { return constMethod()->name_index();         }
 151   void set_name_index(int index)                 { constMethod()->set_name_index(index);       }
 152 
 153   // signature
 154   Symbol* signature() const                      { return constants()->symbol_at(signature_index()); }
 155   int signature_index() const                    { return constMethod()->signature_index();         }
 156   void set_signature_index(int index)            { constMethod()->set_signature_index(index);       }
 157 
 158   // generics support
 159   Symbol* generic_signature() const              { int idx = generic_signature_index(); return ((idx != 0) ? constants()->symbol_at(idx) : (Symbol*)NULL); }
 160   int generic_signature_index() const            { return constMethod()->generic_signature_index(); }
 161   void set_generic_signature_index(int index)    { constMethod()->set_generic_signature_index(index); }
 162 
 163   // annotations support
 164   AnnotationArray* annotations() const           {
 165     return constMethod()->method_annotations();
 166   }
 167   AnnotationArray* parameter_annotations() const {
 168     return constMethod()->parameter_annotations();
 169   }
 170   AnnotationArray* annotation_default() const    {
 171     return constMethod()->default_annotations();
 172   }
 173   AnnotationArray* type_annotations() const      {
 174     return constMethod()->type_annotations();
 175   }
 176 
 177   // Helper routine: get klass name + "." + method name + signature as
 178   // C string, for the purpose of providing more useful
 179   // fatal error handling. The string is allocated in resource
 180   // area if a buffer is not provided by the caller.
 181   char* name_and_sig_as_C_string() const;
 182   char* name_and_sig_as_C_string(char* buf, int size) const;
 183 
 184   // Static routine in the situations we don't have a Method*
 185   static char* name_and_sig_as_C_string(Klass* klass, Symbol* method_name, Symbol* signature);
 186   static char* name_and_sig_as_C_string(Klass* klass, Symbol* method_name, Symbol* signature, char* buf, int size);
 187 
 188   // Get return type + klass name + "." + method name + ( parameters types )
 189   // as a C string or print it to an outputStream.
 190   // This is to be used to assemble strings passed to Java, so that
 191   // the text more resembles Java code. Used in exception messages.
 192   // Memory is allocated in the resource area; the caller needs
 193   // a ResourceMark.
 194   const char* external_name() const;
 195   void  print_external_name(outputStream *os) const;
 196 
 197   static const char* external_name(                  Klass* klass, Symbol* method_name, Symbol* signature);
 198   static void  print_external_name(outputStream *os, Klass* klass, Symbol* method_name, Symbol* signature);
 199 
 200   Bytecodes::Code java_code_at(int bci) const {
 201     return Bytecodes::java_code_at(this, bcp_from(bci));
 202   }
 203   Bytecodes::Code code_at(int bci) const {
 204     return Bytecodes::code_at(this, bcp_from(bci));
 205   }
 206 
 207   // JVMTI breakpoints
 208 #if !INCLUDE_JVMTI
 209   Bytecodes::Code orig_bytecode_at(int bci) const {
 210     ShouldNotReachHere();
 211     return Bytecodes::_shouldnotreachhere;
 212   }
 213   void set_orig_bytecode_at(int bci, Bytecodes::Code code) {
 214     ShouldNotReachHere();
 215   };
 216   u2   number_of_breakpoints() const {return 0;}
 217 #else // !INCLUDE_JVMTI
 218   Bytecodes::Code orig_bytecode_at(int bci) const;
 219   void set_orig_bytecode_at(int bci, Bytecodes::Code code);
 220   void set_breakpoint(int bci);
 221   void clear_breakpoint(int bci);
 222   void clear_all_breakpoints();
 223   // Tracking number of breakpoints, for fullspeed debugging.
 224   // Only mutated by VM thread.
 225   u2   number_of_breakpoints() const {
 226     MethodCounters* mcs = method_counters();
 227     if (mcs == NULL) {
 228       return 0;
 229     } else {
 230       return mcs->number_of_breakpoints();
 231     }
 232   }
 233   void incr_number_of_breakpoints(Thread* current) {
 234     MethodCounters* mcs = get_method_counters(current);
 235     if (mcs != NULL) {
 236       mcs->incr_number_of_breakpoints();
 237     }
 238   }
 239   void decr_number_of_breakpoints(Thread* current) {
 240     MethodCounters* mcs = get_method_counters(current);
 241     if (mcs != NULL) {
 242       mcs->decr_number_of_breakpoints();
 243     }
 244   }
 245   // Initialization only
 246   void clear_number_of_breakpoints() {
 247     MethodCounters* mcs = method_counters();
 248     if (mcs != NULL) {
 249       mcs->clear_number_of_breakpoints();
 250     }
 251   }
 252 #endif // !INCLUDE_JVMTI
 253 
 254   // index into InstanceKlass methods() array
 255   // note: also used by jfr
 256   u2 method_idnum() const           { return constMethod()->method_idnum(); }
 257   void set_method_idnum(u2 idnum)   { constMethod()->set_method_idnum(idnum); }
 258 
 259   u2 orig_method_idnum() const           { return constMethod()->orig_method_idnum(); }
 260   void set_orig_method_idnum(u2 idnum)   { constMethod()->set_orig_method_idnum(idnum); }
 261 
 262   // code size
 263   int code_size() const                  { return constMethod()->code_size(); }
 264 
 265   // method size in words
 266   int method_size() const                { return sizeof(Method)/wordSize + ( is_native() ? 2 : 0 ); }
 267 
 268   // constant pool for Klass* holding this method
 269   ConstantPool* constants() const              { return constMethod()->constants(); }
 270   void set_constants(ConstantPool* c)          { constMethod()->set_constants(c); }
 271 
 272   // max stack
 273   // return original max stack size for method verification
 274   int  verifier_max_stack() const                { return constMethod()->max_stack(); }
 275   int           max_stack() const                { return constMethod()->max_stack() + extra_stack_entries(); }
 276   void      set_max_stack(int size)              {        constMethod()->set_max_stack(size); }
 277 
 278   // max locals
 279   int  max_locals() const                        { return constMethod()->max_locals(); }
 280   void set_max_locals(int size)                  { constMethod()->set_max_locals(size); }
 281 
 282   int highest_comp_level() const;
 283   void set_highest_comp_level(int level);
 284   int highest_osr_comp_level() const;
 285   void set_highest_osr_comp_level(int level);
 286 
 287 #if COMPILER2_OR_JVMCI
 288   // Count of times method was exited via exception while interpreting
 289   void interpreter_throwout_increment(Thread* current) {
 290     MethodCounters* mcs = get_method_counters(current);
 291     if (mcs != NULL) {
 292       mcs->interpreter_throwout_increment();
 293     }
 294   }
 295 #endif
 296 
 297   int  interpreter_throwout_count() const        {
 298     MethodCounters* mcs = method_counters();
 299     if (mcs == NULL) {
 300       return 0;
 301     } else {
 302       return mcs->interpreter_throwout_count();
 303     }
 304   }
 305 
 306   // Derive stuff from the signature at load time.
 307   void compute_from_signature(Symbol* sig);
 308 
 309   // size of parameters (receiver if any + arguments)
 310   int  size_of_parameters() const                { return constMethod()->size_of_parameters(); }
 311   void set_size_of_parameters(int size)          { constMethod()->set_size_of_parameters(size); }
 312 
 313   bool has_stackmap_table() const {
 314     return constMethod()->has_stackmap_table();
 315   }
 316 
 317   Array<u1>* stackmap_data() const {
 318     return constMethod()->stackmap_data();
 319   }
 320 
 321   void set_stackmap_data(Array<u1>* sd) {
 322     constMethod()->set_stackmap_data(sd);
 323   }
 324 
 325   // exception handler table
 326   bool has_exception_handler() const
 327                              { return constMethod()->has_exception_handler(); }
 328   int exception_table_length() const
 329                              { return constMethod()->exception_table_length(); }
 330   ExceptionTableElement* exception_table_start() const
 331                              { return constMethod()->exception_table_start(); }
 332 
 333   // Finds the first entry point bci of an exception handler for an
 334   // exception of klass ex_klass thrown at throw_bci. A value of NULL
 335   // for ex_klass indicates that the exception klass is not known; in
 336   // this case it matches any constraint class. Returns -1 if the
 337   // exception cannot be handled in this method. The handler
 338   // constraint classes are loaded if necessary. Note that this may
 339   // throw an exception if loading of the constraint classes causes
 340   // an IllegalAccessError (bugid 4307310) or an OutOfMemoryError.
 341   // If an exception is thrown, returns the bci of the
 342   // exception handler which caused the exception to be thrown, which
 343   // is needed for proper retries. See, for example,
 344   // InterpreterRuntime::exception_handler_for_exception.
 345   static int fast_exception_handler_bci_for(const methodHandle& mh, Klass* ex_klass, int throw_bci, TRAPS);
 346 
 347   static bool register_native(Klass* k,
 348                               Symbol* name,
 349                               Symbol* signature,
 350                               address entry,
 351                               TRAPS);
 352 
 353   // method data access
 354   MethodData* method_data() const              {
 355     return _method_data;
 356   }
 357 
 358   void set_method_data(MethodData* data);
 359 
 360   MethodCounters* method_counters() const {
 361     return _method_counters;
 362   }
 363 
 364   void clear_method_counters() {
 365     _method_counters = NULL;
 366   }
 367 
 368   bool init_method_counters(MethodCounters* counters);
 369 
 370   int prev_event_count() const {
 371     MethodCounters* mcs = method_counters();
 372     return mcs == NULL ? 0 : mcs->prev_event_count();
 373   }
 374   void set_prev_event_count(int count) {
 375     MethodCounters* mcs = method_counters();
 376     if (mcs != NULL) {
 377       mcs->set_prev_event_count(count);
 378     }
 379   }
 380   jlong prev_time() const {
 381     MethodCounters* mcs = method_counters();
 382     return mcs == NULL ? 0 : mcs->prev_time();
 383   }
 384   void set_prev_time(jlong time) {
 385     MethodCounters* mcs = method_counters();
 386     if (mcs != NULL) {
 387       mcs->set_prev_time(time);
 388     }
 389   }
 390   float rate() const {
 391     MethodCounters* mcs = method_counters();
 392     return mcs == NULL ? 0 : mcs->rate();
 393   }
 394   void set_rate(float rate) {
 395     MethodCounters* mcs = method_counters();
 396     if (mcs != NULL) {
 397       mcs->set_rate(rate);
 398     }
 399   }
 400 
 401   int nmethod_age() const {
 402     if (method_counters() == NULL) {
 403       return INT_MAX;
 404     } else {
 405       return method_counters()->nmethod_age();
 406     }
 407   }
 408 
 409   int invocation_count() const;
 410   int backedge_count() const;
 411 
 412   bool was_executed_more_than(int n);
 413   bool was_never_executed()                     { return !was_executed_more_than(0);  }
 414 
 415   static void build_interpreter_method_data(const methodHandle& method, TRAPS);
 416 
 417   static MethodCounters* build_method_counters(Thread* current, Method* m);
 418 
 419   int interpreter_invocation_count()            { return invocation_count();          }
 420 
 421 #ifndef PRODUCT
 422   int64_t  compiled_invocation_count() const    { return _compiled_invocation_count;}
 423   void set_compiled_invocation_count(int count) { _compiled_invocation_count = (int64_t)count; }
 424 #else
 425   // for PrintMethodData in a product build
 426   int64_t  compiled_invocation_count() const    { return 0; }
 427 #endif // not PRODUCT
 428 
 429   // Clear (non-shared space) pointers which could not be relevant
 430   // if this (shared) method were mapped into another JVM.
 431   void remove_unshareable_info();
 432 
 433   // nmethod/verified compiler entry
 434   address verified_code_entry();
 435   bool check_code() const;      // Not inline to avoid circular ref
 436   CompiledMethod* volatile code() const;
 437 
 438   // Locks CompiledMethod_lock if not held.
 439   void unlink_code(CompiledMethod *compare);
 440   // Locks CompiledMethod_lock if not held.
 441   void unlink_code();
 442 
 443 private:
 444   // Either called with CompiledMethod_lock held or from constructor.
 445   void clear_code();
 446 
 447 public:
 448   static void set_code(const methodHandle& mh, CompiledMethod* code);
 449   void set_adapter_entry(AdapterHandlerEntry* adapter) {
 450     _adapter = adapter;
 451   }
 452   void set_from_compiled_entry(address entry) {
 453     _from_compiled_entry =  entry;
 454   }
 455 
 456   address get_i2c_entry();
 457   address get_c2i_entry();
 458   address get_c2i_unverified_entry();
 459   address get_c2i_no_clinit_check_entry();
 460   AdapterHandlerEntry* adapter() const {
 461     return _adapter;
 462   }
 463   // setup entry points
 464   void link_method(const methodHandle& method, TRAPS);
 465   // clear entry points. Used by sharing code during dump time
 466   void unlink_method() NOT_CDS_RETURN;
 467 
 468   virtual void metaspace_pointers_do(MetaspaceClosure* iter);
 469   virtual MetaspaceObj::Type type() const { return MethodType; }
 470 
 471   // vtable index
 472   enum VtableIndexFlag {
 473     // Valid vtable indexes are non-negative (>= 0).
 474     // These few negative values are used as sentinels.
 475     itable_index_max        = -10, // first itable index, growing downward
 476     pending_itable_index    = -9,  // itable index will be assigned
 477     invalid_vtable_index    = -4,  // distinct from any valid vtable index
 478     garbage_vtable_index    = -3,  // not yet linked; no vtable layout yet
 479     nonvirtual_vtable_index = -2   // there is no need for vtable dispatch
 480     // 6330203 Note:  Do not use -1, which was overloaded with many meanings.
 481   };
 482   DEBUG_ONLY(bool valid_vtable_index() const     { return _vtable_index >= nonvirtual_vtable_index; })
 483   bool has_vtable_index() const                  { return _vtable_index >= 0; }
 484   int  vtable_index() const                      { return _vtable_index; }
 485   void set_vtable_index(int index);
 486   DEBUG_ONLY(bool valid_itable_index() const     { return _vtable_index <= pending_itable_index; })
 487   bool has_itable_index() const                  { return _vtable_index <= itable_index_max; }
 488   int  itable_index() const                      { assert(valid_itable_index(), "");
 489                                                    return itable_index_max - _vtable_index; }
 490   void set_itable_index(int index);
 491 
 492   // interpreter entry
 493   address interpreter_entry() const              { return _i2i_entry; }
 494   // Only used when first initialize so we can set _i2i_entry and _from_interpreted_entry
 495   void set_interpreter_entry(address entry) {
 496     if (_i2i_entry != entry) {
 497       _i2i_entry = entry;
 498     }
 499     if (_from_interpreted_entry != entry) {
 500       _from_interpreted_entry = entry;
 501     }
 502   }
 503 
 504   // native function (used for native methods only)
 505   enum {
 506     native_bind_event_is_interesting = true
 507   };
 508   address native_function() const                { return *(native_function_addr()); }
 509 
 510   // Must specify a real function (not NULL).
 511   // Use clear_native_function() to unregister.
 512   void set_native_function(address function, bool post_event_flag);
 513   bool has_native_function() const;
 514   void clear_native_function();
 515 
 516   // signature handler (used for native methods only)
 517   address signature_handler() const              { return *(signature_handler_addr()); }
 518   void set_signature_handler(address handler);
 519 
 520   // Interpreter oopmap support
 521   void mask_for(int bci, InterpreterOopMap* mask);
 522 
 523   // operations on invocation counter
 524   void print_invocation_count();
 525 
 526   // byte codes
 527   void    set_code(address code)      { return constMethod()->set_code(code); }
 528   address code_base() const           { return constMethod()->code_base(); }
 529   bool    contains(address bcp) const { return constMethod()->contains(bcp); }
 530 
 531   // prints byte codes
 532   void print_codes() const            { print_codes_on(tty); }
 533   void print_codes_on(outputStream* st) const;
 534   void print_codes_on(int from, int to, outputStream* st) const;
 535 
 536   // method parameters
 537   bool has_method_parameters() const
 538                          { return constMethod()->has_method_parameters(); }
 539   int method_parameters_length() const
 540                          { return constMethod()->method_parameters_length(); }
 541   MethodParametersElement* method_parameters_start() const
 542                           { return constMethod()->method_parameters_start(); }
 543 
 544   // checked exceptions
 545   int checked_exceptions_length() const
 546                          { return constMethod()->checked_exceptions_length(); }
 547   CheckedExceptionElement* checked_exceptions_start() const
 548                           { return constMethod()->checked_exceptions_start(); }
 549 
 550   // localvariable table
 551   bool has_localvariable_table() const
 552                           { return constMethod()->has_localvariable_table(); }
 553   int localvariable_table_length() const
 554                         { return constMethod()->localvariable_table_length(); }
 555   LocalVariableTableElement* localvariable_table_start() const
 556                          { return constMethod()->localvariable_table_start(); }
 557 
 558   bool has_linenumber_table() const
 559                               { return constMethod()->has_linenumber_table(); }
 560   u_char* compressed_linenumber_table() const
 561                        { return constMethod()->compressed_linenumber_table(); }
 562 
 563   // method holder (the Klass* holding this method)
 564   InstanceKlass* method_holder() const         { return constants()->pool_holder(); }
 565 
 566   Symbol* klass_name() const;                    // returns the name of the method holder
 567   BasicType result_type() const                  { return constMethod()->result_type(); }
 568   bool is_returning_oop() const                  { BasicType r = result_type(); return is_reference_type(r); }
 569   bool is_returning_fp() const                   { BasicType r = result_type(); return (r == T_FLOAT || r == T_DOUBLE); }
 570 
 571   // Checked exceptions thrown by this method (resolved to mirrors)
 572   objArrayHandle resolved_checked_exceptions(TRAPS) { return resolved_checked_exceptions_impl(this, THREAD); }
 573 
 574   // Access flags
 575   bool is_public() const                         { return access_flags().is_public();      }
 576   bool is_private() const                        { return access_flags().is_private();     }
 577   bool is_protected() const                      { return access_flags().is_protected();   }
 578   bool is_package_private() const                { return !is_public() && !is_private() && !is_protected(); }
 579   bool is_static() const                         { return access_flags().is_static();      }
 580   bool is_final() const                          { return access_flags().is_final();       }
 581   bool is_synchronized() const                   { return access_flags().is_synchronized();}
 582   bool is_native() const                         { return access_flags().is_native();      }
 583   bool is_abstract() const                       { return access_flags().is_abstract();    }
 584   bool is_synthetic() const                      { return access_flags().is_synthetic();   }
 585 
 586   // returns true if contains only return operation
 587   bool is_empty_method() const;
 588 
 589   // returns true if this is a vanilla constructor
 590   bool is_vanilla_constructor() const;
 591 
 592   // checks method and its method holder
 593   bool is_final_method() const;
 594   bool is_final_method(AccessFlags class_access_flags) const;
 595   // interface method declared with 'default' - excludes private interface methods
 596   bool is_default_method() const;
 597 
 598   // true if method needs no dynamic dispatch (final and/or no vtable entry)
 599   bool can_be_statically_bound() const;
 600   bool can_be_statically_bound(InstanceKlass* context) const;
 601   bool can_be_statically_bound(AccessFlags class_access_flags) const;
 602 
 603   // true if method can omit stack trace in throw in compiled code.
 604   bool can_omit_stack_trace();
 605 
 606   // returns true if the method has any backward branches.
 607   bool has_loops() {
 608     return access_flags().loops_flag_init() ? access_flags().has_loops() : compute_has_loops_flag();
 609   };
 610 
 611   bool compute_has_loops_flag();
 612 
 613   bool has_jsrs() {
 614     return access_flags().has_jsrs();
 615   };
 616   void set_has_jsrs() {
 617     _access_flags.set_has_jsrs();
 618   }
 619 
 620   // returns true if the method has any monitors.
 621   bool has_monitors() const                      { return is_synchronized() || access_flags().has_monitor_bytecodes(); }
 622   bool has_monitor_bytecodes() const             { return access_flags().has_monitor_bytecodes(); }
 623 
 624   void set_has_monitor_bytecodes()               { _access_flags.set_has_monitor_bytecodes(); }
 625 
 626   // monitor matching. This returns a conservative estimate of whether the monitorenter/monitorexit bytecodes
 627   // propererly nest in the method. It might return false, even though they actually nest properly, since the info.
 628   // has not been computed yet.
 629   bool guaranteed_monitor_matching() const       { return access_flags().is_monitor_matching(); }
 630   void set_guaranteed_monitor_matching()         { _access_flags.set_monitor_matching(); }
 631 
 632   // returns true if the method is an accessor function (setter/getter).
 633   bool is_accessor() const;
 634 
 635   // returns true if the method is a getter
 636   bool is_getter() const;
 637 
 638   // returns true if the method is a setter
 639   bool is_setter() const;
 640 
 641   // returns true if the method does nothing but return a constant of primitive type
 642   bool is_constant_getter() const;
 643 
 644   // returns true if the method is an initializer (<init> or <clinit>).
 645   bool is_initializer() const;
 646 
 647   // returns true if the method is static OR if the classfile version < 51
 648   bool has_valid_initializer_flags() const;
 649 
 650   // returns true if the method name is <clinit> and the method has
 651   // valid static initializer flags.
 652   bool is_static_initializer() const;
 653 
 654   // returns true if the method name is <init>
 655   bool is_object_initializer() const;
 656 
 657   // compiled code support
 658   // NOTE: code() is inherently racy as deopt can be clearing code
 659   // simultaneously. Use with caution.
 660   bool has_compiled_code() const;
 661 
 662   bool needs_clinit_barrier() const;
 663 
 664   // sizing
 665   static int header_size()                       {
 666     return align_up((int)sizeof(Method), wordSize) / wordSize;
 667   }
 668   static int size(bool is_native);
 669   int size() const                               { return method_size(); }
 670   void log_touched(Thread* current);
 671   static void print_touched_methods(outputStream* out);
 672 
 673   // interpreter support
 674   static ByteSize const_offset()                 { return byte_offset_of(Method, _constMethod       ); }
 675   static ByteSize access_flags_offset()          { return byte_offset_of(Method, _access_flags      ); }
 676   static ByteSize from_compiled_offset()         { return byte_offset_of(Method, _from_compiled_entry); }
 677   static ByteSize code_offset()                  { return byte_offset_of(Method, _code); }
 678   static ByteSize method_data_offset()           {
 679     return byte_offset_of(Method, _method_data);
 680   }
 681   static ByteSize method_counters_offset()       {
 682     return byte_offset_of(Method, _method_counters);
 683   }
 684 #ifndef PRODUCT
 685   static ByteSize compiled_invocation_counter_offset() { return byte_offset_of(Method, _compiled_invocation_count); }
 686 #endif // not PRODUCT
 687   static ByteSize native_function_offset()       { return in_ByteSize(sizeof(Method));                 }
 688   static ByteSize from_interpreted_offset()      { return byte_offset_of(Method, _from_interpreted_entry ); }
 689   static ByteSize interpreter_entry_offset()     { return byte_offset_of(Method, _i2i_entry ); }
 690   static ByteSize signature_handler_offset()     { return in_ByteSize(sizeof(Method) + wordSize);      }
 691   static ByteSize itable_index_offset()          { return byte_offset_of(Method, _vtable_index ); }
 692 
 693   // for code generation
 694   static int method_data_offset_in_bytes()       { return offset_of(Method, _method_data); }
 695   static int intrinsic_id_offset_in_bytes()      { return offset_of(Method, _intrinsic_id); }
 696   static int intrinsic_id_size_in_bytes()        { return sizeof(u2); }
 697 
 698   // Static methods that are used to implement member methods where an exposed this pointer
 699   // is needed due to possible GCs
 700   static objArrayHandle resolved_checked_exceptions_impl(Method* method, TRAPS);
 701 
 702   // Returns the byte code index from the byte code pointer
 703   int     bci_from(address bcp) const;
 704   address bcp_from(int bci) const;
 705   address bcp_from(address bcp) const;
 706   int validate_bci_from_bcp(address bcp) const;
 707   int validate_bci(int bci) const;
 708 
 709   // Returns the line number for a bci if debugging information for the method is prowided,
 710   // -1 is returned otherwise.
 711   int line_number_from_bci(int bci) const;
 712 
 713   // Reflection support
 714   bool is_overridden_in(Klass* k) const;
 715 
 716   // Stack walking support
 717   bool is_ignored_by_security_stack_walk() const;
 718 
 719   // JSR 292 support
 720   bool is_method_handle_intrinsic() const;          // MethodHandles::is_signature_polymorphic_intrinsic(intrinsic_id)
 721   bool is_compiled_lambda_form() const;             // intrinsic_id() == vmIntrinsics::_compiledLambdaForm
 722   bool has_member_arg() const;                      // intrinsic_id() == vmIntrinsics::_linkToSpecial, etc.
 723   static methodHandle make_method_handle_intrinsic(vmIntrinsicID iid, // _invokeBasic, _linkToVirtual
 724                                                    Symbol* signature, //anything at all
 725                                                    TRAPS);
 726   static Klass* check_non_bcp_klass(Klass* klass);
 727 
 728   enum {
 729     // How many extra stack entries for invokedynamic
 730     extra_stack_entries_for_jsr292 = 1
 731   };
 732 
 733   // this operates only on invoke methods:
 734   // presize interpreter frames for extra interpreter stack entries, if needed
 735   // Account for the extra appendix argument for invokehandle/invokedynamic
 736   static int extra_stack_entries() { return extra_stack_entries_for_jsr292; }
 737   static int extra_stack_words();  // = extra_stack_entries() * Interpreter::stackElementSize
 738 
 739   // RedefineClasses() support:
 740   bool is_old() const                               { return access_flags().is_old(); }
 741   void set_is_old()                                 { _access_flags.set_is_old(); }
 742   bool is_obsolete() const                          { return access_flags().is_obsolete(); }
 743   void set_is_obsolete()                            { _access_flags.set_is_obsolete(); }
 744   bool is_deleted() const                           { return access_flags().is_deleted(); }
 745   void set_is_deleted()                             { _access_flags.set_is_deleted(); }
 746 
 747   bool on_stack() const                             { return access_flags().on_stack(); }
 748   void set_on_stack(const bool value);
 749 
 750   // see the definition in Method*.cpp for the gory details
 751   bool should_not_be_cached() const;
 752 
 753   // JVMTI Native method prefixing support:
 754   bool is_prefixed_native() const                   { return access_flags().is_prefixed_native(); }
 755   void set_is_prefixed_native()                     { _access_flags.set_is_prefixed_native(); }
 756 
 757   // Rewriting support
 758   static methodHandle clone_with_new_data(const methodHandle& m, u_char* new_code, int new_code_length,
 759                                           u_char* new_compressed_linenumber_table, int new_compressed_linenumber_size, TRAPS);
 760 
 761   // jmethodID handling
 762   // Because the useful life-span of a jmethodID cannot be determined,
 763   // once created they are never reclaimed.  The methods to which they refer,
 764   // however, can be GC'ed away if the class is unloaded or if the method is
 765   // made obsolete or deleted -- in these cases, the jmethodID
 766   // refers to NULL (as is the case for any weak reference).
 767   static jmethodID make_jmethod_id(ClassLoaderData* loader_data, Method* mh);
 768   static void destroy_jmethod_id(ClassLoaderData* loader_data, jmethodID mid);
 769 
 770   // Ensure there is enough capacity in the internal tracking data
 771   // structures to hold the number of jmethodIDs you plan to generate.
 772   // This saves substantial time doing allocations.
 773   static void ensure_jmethod_ids(ClassLoaderData* loader_data, int capacity);
 774 
 775   // Use resolve_jmethod_id() in situations where the caller is expected
 776   // to provide a valid jmethodID; the only sanity checks are in asserts;
 777   // result guaranteed not to be NULL.
 778   inline static Method* resolve_jmethod_id(jmethodID mid) {
 779     assert(mid != NULL, "JNI method id should not be null");
 780     return *((Method**)mid);
 781   }
 782 
 783   // Use checked_resolve_jmethod_id() in situations where the caller
 784   // should provide a valid jmethodID, but might not. NULL is returned
 785   // when the jmethodID does not refer to a valid method.
 786   static Method* checked_resolve_jmethod_id(jmethodID mid);
 787 
 788   static void change_method_associated_with_jmethod_id(jmethodID old_jmid_ptr, Method* new_method);
 789   static bool is_method_id(jmethodID mid);
 790 
 791   // Clear methods
 792   static void clear_jmethod_ids(ClassLoaderData* loader_data);
 793   static void print_jmethod_ids_count(const ClassLoaderData* loader_data, outputStream* out) PRODUCT_RETURN;
 794 
 795   // Get this method's jmethodID -- allocate if it doesn't exist
 796   jmethodID jmethod_id();
 797 
 798   // Lookup the jmethodID for this method.  Return NULL if not found.
 799   // NOTE that this function can be called from a signal handler
 800   // (see AsyncGetCallTrace support for Forte Analyzer) and this
 801   // needs to be async-safe. No allocation should be done and
 802   // so handles are not used to avoid deadlock.
 803   jmethodID find_jmethod_id_or_null()               { return method_holder()->jmethod_id_or_null(this); }
 804 
 805   // Support for inlining of intrinsic methods
 806   vmIntrinsicID intrinsic_id() const          { return (vmIntrinsicID) _intrinsic_id;           }
 807   void     set_intrinsic_id(vmIntrinsicID id) {                           _intrinsic_id = (u2) id; }
 808 
 809   // Helper routines for intrinsic_id() and vmIntrinsics::method().
 810   void init_intrinsic_id(vmSymbolID klass_id);     // updates from _none if a match
 811   static vmSymbolID klass_id_for_intrinsics(const Klass* holder);
 812 
 813   bool caller_sensitive() {
 814     return (_flags & _caller_sensitive) != 0;
 815   }
 816   void set_caller_sensitive(bool x) {
 817     _flags = x ? (_flags | _caller_sensitive) : (_flags & ~_caller_sensitive);
 818   }
 819 
 820   bool force_inline() {
 821     return (_flags & _force_inline) != 0;
 822   }
 823   void set_force_inline(bool x) {
 824     _flags = x ? (_flags | _force_inline) : (_flags & ~_force_inline);
 825   }
 826 
 827   bool dont_inline() {
 828     return (_flags & _dont_inline) != 0;
 829   }
 830   void set_dont_inline(bool x) {
 831     _flags = x ? (_flags | _dont_inline) : (_flags & ~_dont_inline);
 832   }
 833 
 834   bool is_hidden() const {
 835     return (_flags & _hidden) != 0;
 836   }
 837 
 838   void set_hidden(bool x) {
 839     _flags = x ? (_flags | _hidden) : (_flags & ~_hidden);
 840   }
 841 
 842   bool is_scoped() const {
 843     return (_flags & _scoped) != 0;
 844   }
 845 
 846   void set_scoped(bool x) {
 847     _flags = x ? (_flags | _scoped) : (_flags & ~_scoped);
 848   }
 849 
 850   bool intrinsic_candidate() {
 851     return (_flags & _intrinsic_candidate) != 0;
 852   }
 853   void set_intrinsic_candidate(bool x) {
 854     _flags = x ? (_flags | _intrinsic_candidate) : (_flags & ~_intrinsic_candidate);
 855   }
 856 
 857   bool has_injected_profile() {
 858     return (_flags & _has_injected_profile) != 0;
 859   }
 860   void set_has_injected_profile(bool x) {
 861     _flags = x ? (_flags | _has_injected_profile) : (_flags & ~_has_injected_profile);
 862   }
 863 
 864   bool has_reserved_stack_access() {
 865     return (_flags & _reserved_stack_access) != 0;
 866   }
 867 
 868   void set_has_reserved_stack_access(bool x) {
 869     _flags = x ? (_flags | _reserved_stack_access) : (_flags & ~_reserved_stack_access);
 870   }
 871 
 872   JFR_ONLY(DEFINE_TRACE_FLAG_ACCESSOR;)
 873 
 874   ConstMethod::MethodType method_type() const {
 875       return _constMethod->method_type();
 876   }
 877   bool is_overpass() const { return method_type() == ConstMethod::OVERPASS; }
 878 
 879   // On-stack replacement support
 880   bool has_osr_nmethod(int level, bool match_level) {
 881    return method_holder()->lookup_osr_nmethod(this, InvocationEntryBci, level, match_level) != NULL;
 882   }
 883 
 884   int mark_osr_nmethods() {
 885     return method_holder()->mark_osr_nmethods(this);
 886   }
 887 
 888   nmethod* lookup_osr_nmethod_for(int bci, int level, bool match_level) {
 889     return method_holder()->lookup_osr_nmethod(this, bci, level, match_level);
 890   }
 891 
 892   // Find if klass for method is loaded
 893   bool is_klass_loaded_by_klass_index(int klass_index) const;
 894   bool is_klass_loaded(int refinfo_index, bool must_be_resolved = false) const;
 895 
 896   // Indicates whether compilation failed earlier for this method, or
 897   // whether it is not compilable for another reason like having a
 898   // breakpoint set in it.
 899   bool  is_not_compilable(int comp_level = CompLevel_any) const;
 900   void set_not_compilable(const char* reason, int comp_level = CompLevel_all, bool report = true);
 901   void set_not_compilable_quietly(const char* reason, int comp_level = CompLevel_all) {
 902     set_not_compilable(reason, comp_level, false);
 903   }
 904   bool  is_not_osr_compilable(int comp_level = CompLevel_any) const;
 905   void set_not_osr_compilable(const char* reason, int comp_level = CompLevel_all, bool report = true);
 906   void set_not_osr_compilable_quietly(const char* reason, int comp_level = CompLevel_all) {
 907     set_not_osr_compilable(reason, comp_level, false);
 908   }
 909   bool is_always_compilable() const;
 910 
 911  private:
 912   void print_made_not_compilable(int comp_level, bool is_osr, bool report, const char* reason);
 913 
 914  public:
 915   MethodCounters* get_method_counters(Thread* current) {
 916     if (_method_counters == NULL) {
 917       build_method_counters(current, this);
 918     }
 919     return _method_counters;
 920   }
 921 
 922   bool   is_not_c1_compilable() const         { return access_flags().is_not_c1_compilable();  }
 923   void  set_not_c1_compilable()               {       _access_flags.set_not_c1_compilable();   }
 924   void clear_not_c1_compilable()              {       _access_flags.clear_not_c1_compilable(); }
 925   bool   is_not_c2_compilable() const         { return access_flags().is_not_c2_compilable();  }
 926   void  set_not_c2_compilable()               {       _access_flags.set_not_c2_compilable();   }
 927   void clear_not_c2_compilable()              {       _access_flags.clear_not_c2_compilable(); }
 928 
 929   bool    is_not_c1_osr_compilable() const    { return is_not_c1_compilable(); }  // don't waste an accessFlags bit
 930   void   set_not_c1_osr_compilable()          {       set_not_c1_compilable(); }  // don't waste an accessFlags bit
 931   void clear_not_c1_osr_compilable()          {     clear_not_c1_compilable(); }  // don't waste an accessFlags bit
 932   bool   is_not_c2_osr_compilable() const     { return access_flags().is_not_c2_osr_compilable();  }
 933   void  set_not_c2_osr_compilable()           {       _access_flags.set_not_c2_osr_compilable();   }
 934   void clear_not_c2_osr_compilable()          {       _access_flags.clear_not_c2_osr_compilable(); }
 935 
 936   // Background compilation support
 937   bool queued_for_compilation() const  { return access_flags().queued_for_compilation(); }
 938   void set_queued_for_compilation()    { _access_flags.set_queued_for_compilation();     }
 939   void clear_queued_for_compilation()  { _access_flags.clear_queued_for_compilation();   }
 940 
 941   // Resolve all classes in signature, return 'true' if successful
 942   static bool load_signature_classes(const methodHandle& m, TRAPS);
 943 
 944   // Return if true if not all classes references in signature, including return type, has been loaded
 945   static bool has_unloaded_classes_in_signature(const methodHandle& m, TRAPS);
 946 
 947   // Printing
 948   void print_short_name(outputStream* st = tty); // prints as klassname::methodname; Exposed so field engineers can debug VM
 949 #if INCLUDE_JVMTI
 950   void print_name(outputStream* st = tty); // prints as "virtual void foo(int)"; exposed for -Xlog:redefine+class
 951 #else
 952   void print_name(outputStream* st = tty)        PRODUCT_RETURN; // prints as "virtual void foo(int)"
 953 #endif
 954 
 955   typedef int (*method_comparator_func)(Method* a, Method* b);
 956 
 957   // Helper routine used for method sorting
 958   static void sort_methods(Array<Method*>* methods, bool set_idnums = true, method_comparator_func func = NULL);
 959 
 960   // Deallocation function for redefine classes or if an error occurs
 961   void deallocate_contents(ClassLoaderData* loader_data);
 962 
 963   void release_C_heap_structures();
 964 
 965   Method* get_new_method() const {
 966     InstanceKlass* holder = method_holder();
 967     Method* new_method = holder->method_with_idnum(orig_method_idnum());
 968 
 969     assert(new_method != NULL, "method_with_idnum() should not be NULL");
 970     assert(this != new_method, "sanity check");
 971     return new_method;
 972   }
 973 
 974   // Printing
 975 #ifndef PRODUCT
 976   void print_on(outputStream* st) const;
 977 #endif
 978   void print_value_on(outputStream* st) const;
 979   void print_linkage_flags(outputStream* st) PRODUCT_RETURN;
 980 
 981   const char* internal_name() const { return "{method}"; }
 982 
 983   // Check for valid method pointer
 984   static bool has_method_vptr(const void* ptr);
 985   static bool is_valid_method(const Method* m);
 986 
 987   // Verify
 988   void verify() { verify_on(tty); }
 989   void verify_on(outputStream* st);
 990 
 991  private:
 992 
 993   // Inlined elements
 994   address* native_function_addr() const          { assert(is_native(), "must be native"); return (address*) (this+1); }
 995   address* signature_handler_addr() const        { return native_function_addr() + 1; }
 996 };
 997 
 998 
 999 // Utility class for compressing line number tables
1000 
1001 class CompressedLineNumberWriteStream: public CompressedWriteStream {
1002  private:
1003   int _bci;
1004   int _line;
1005  public:
1006   // Constructor
1007   CompressedLineNumberWriteStream(int initial_size) : CompressedWriteStream(initial_size), _bci(0), _line(0) {}
1008   CompressedLineNumberWriteStream(u_char* buffer, int initial_size) : CompressedWriteStream(buffer, initial_size), _bci(0), _line(0) {}
1009 
1010   // Write (bci, line number) pair to stream
1011   void write_pair_regular(int bci_delta, int line_delta);
1012 
1013   // If (bci delta, line delta) fits in (5-bit unsigned, 3-bit unsigned)
1014   // we save it as one byte, otherwise we write a 0xFF escape character
1015   // and use regular compression. 0x0 is used as end-of-stream terminator.
1016   void write_pair_inline(int bci, int line);
1017 
1018   void write_pair(int bci, int line);
1019 
1020   // Write end-of-stream marker
1021   void write_terminator()                        { write_byte(0); }
1022 };
1023 
1024 
1025 // Utility class for decompressing line number tables
1026 
1027 class CompressedLineNumberReadStream: public CompressedReadStream {
1028  private:
1029   int _bci;
1030   int _line;
1031  public:
1032   // Constructor
1033   CompressedLineNumberReadStream(u_char* buffer);
1034   // Read (bci, line number) pair from stream. Returns false at end-of-stream.
1035   bool read_pair();
1036   // Accessing bci and line number (after calling read_pair)
1037   int bci() const                               { return _bci; }
1038   int line() const                              { return _line; }
1039 };
1040 
1041 
1042 #if INCLUDE_JVMTI
1043 
1044 /// Fast Breakpoints.
1045 
1046 // If this structure gets more complicated (because bpts get numerous),
1047 // move it into its own header.
1048 
1049 // There is presently no provision for concurrent access
1050 // to breakpoint lists, which is only OK for JVMTI because
1051 // breakpoints are written only at safepoints, and are read
1052 // concurrently only outside of safepoints.
1053 
1054 class BreakpointInfo : public CHeapObj<mtClass> {
1055   friend class VMStructs;
1056  private:
1057   Bytecodes::Code  _orig_bytecode;
1058   int              _bci;
1059   u2               _name_index;       // of method
1060   u2               _signature_index;  // of method
1061   BreakpointInfo*  _next;             // simple storage allocation
1062 
1063  public:
1064   BreakpointInfo(Method* m, int bci);
1065 
1066   // accessors
1067   Bytecodes::Code orig_bytecode()                     { return _orig_bytecode; }
1068   void        set_orig_bytecode(Bytecodes::Code code) { _orig_bytecode = code; }
1069   int         bci()                                   { return _bci; }
1070 
1071   BreakpointInfo*          next() const               { return _next; }
1072   void                 set_next(BreakpointInfo* n)    { _next = n; }
1073 
1074   // helps for searchers
1075   bool match(const Method* m, int bci) {
1076     return bci == _bci && match(m);
1077   }
1078 
1079   bool match(const Method* m) {
1080     return _name_index == m->name_index() &&
1081       _signature_index == m->signature_index();
1082   }
1083 
1084   void set(Method* method);
1085   void clear(Method* method);
1086 };
1087 
1088 #endif // INCLUDE_JVMTI
1089 
1090 // Utility class for access exception handlers
1091 class ExceptionTable : public StackObj {
1092  private:
1093   ExceptionTableElement* _table;
1094   u2  _length;
1095 
1096  public:
1097   ExceptionTable(const Method* m) {
1098     if (m->has_exception_handler()) {
1099       _table = m->exception_table_start();
1100       _length = m->exception_table_length();
1101     } else {
1102       _table = NULL;
1103       _length = 0;
1104     }
1105   }
1106 
1107   int length() const {
1108     return _length;
1109   }
1110 
1111   u2 start_pc(int idx) const {
1112     assert(idx < _length, "out of bounds");
1113     return _table[idx].start_pc;
1114   }
1115 
1116   void set_start_pc(int idx, u2 value) {
1117     assert(idx < _length, "out of bounds");
1118     _table[idx].start_pc = value;
1119   }
1120 
1121   u2 end_pc(int idx) const {
1122     assert(idx < _length, "out of bounds");
1123     return _table[idx].end_pc;
1124   }
1125 
1126   void set_end_pc(int idx, u2 value) {
1127     assert(idx < _length, "out of bounds");
1128     _table[idx].end_pc = value;
1129   }
1130 
1131   u2 handler_pc(int idx) const {
1132     assert(idx < _length, "out of bounds");
1133     return _table[idx].handler_pc;
1134   }
1135 
1136   void set_handler_pc(int idx, u2 value) {
1137     assert(idx < _length, "out of bounds");
1138     _table[idx].handler_pc = value;
1139   }
1140 
1141   u2 catch_type_index(int idx) const {
1142     assert(idx < _length, "out of bounds");
1143     return _table[idx].catch_type_index;
1144   }
1145 
1146   void set_catch_type_index(int idx, u2 value) {
1147     assert(idx < _length, "out of bounds");
1148     _table[idx].catch_type_index = value;
1149   }
1150 };
1151 
1152 #endif // SHARE_OOPS_METHOD_HPP