< prev index next >

src/hotspot/share/classfile/javaClasses.hpp

Print this page

  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_CLASSFILE_JAVACLASSES_HPP
  26 #define SHARE_CLASSFILE_JAVACLASSES_HPP
  27 
  28 #include "classfile/vmClasses.hpp"
  29 #include "oops/oop.hpp"
  30 #include "oops/instanceKlass.hpp"

  31 #include "oops/symbol.hpp"
  32 #include "runtime/os.hpp"
  33 #include "utilities/vmEnums.hpp"
  34 

  35 class RecordComponent;
  36 
  37 // Interface for manipulating the basic Java classes.
  38 
  39 #define BASIC_JAVA_CLASSES_DO_PART1(f) \
  40   f(java_lang_Class) \
  41   f(java_lang_String) \
  42   f(java_lang_ref_Reference) \
  43   //end
  44 
  45 #define BASIC_JAVA_CLASSES_DO_PART2(f) \
  46   f(java_lang_System) \
  47   f(java_lang_ClassLoader) \
  48   f(java_lang_Throwable) \
  49   f(java_lang_Thread) \



  50   f(java_lang_ThreadGroup) \

  51   f(java_lang_InternalError) \
  52   f(java_lang_AssertionStatusDirectives) \
  53   f(java_lang_ref_SoftReference) \
  54   f(java_lang_invoke_MethodHandle) \
  55   f(java_lang_invoke_DirectMethodHandle) \
  56   f(java_lang_invoke_MemberName) \
  57   f(java_lang_invoke_ResolvedMethodName) \
  58   f(java_lang_invoke_LambdaForm) \
  59   f(java_lang_invoke_MethodType) \
  60   f(java_lang_invoke_CallSite) \
  61   f(java_lang_invoke_ConstantCallSite) \
  62   f(java_lang_invoke_MethodHandleNatives_CallSiteContext) \
  63   f(java_security_AccessControlContext) \
  64   f(java_lang_reflect_AccessibleObject) \
  65   f(java_lang_reflect_Method) \
  66   f(java_lang_reflect_Constructor) \
  67   f(java_lang_reflect_Field) \
  68   f(java_lang_reflect_RecordComponent) \
  69   f(reflect_ConstantPool) \
  70   f(reflect_UnsafeStaticFieldAccessorImpl) \
  71   f(java_lang_reflect_Parameter) \
  72   f(java_lang_Module) \
  73   f(java_lang_StackTraceElement) \
  74   f(java_lang_StackFrameInfo) \
  75   f(java_lang_LiveStackFrameInfo) \



  76   f(java_util_concurrent_locks_AbstractOwnableSynchronizer) \
  77   f(jdk_internal_invoke_NativeEntryPoint) \
  78   f(jdk_internal_misc_UnsafeConstants) \
  79   f(java_lang_boxing_object) \
  80   f(vector_VectorPayload) \
  81   //end
  82 
  83 #define BASIC_JAVA_CLASSES_DO(f) \
  84         BASIC_JAVA_CLASSES_DO_PART1(f) \
  85         BASIC_JAVA_CLASSES_DO_PART2(f)
  86 
  87 #define CHECK_INIT(offset)  assert(offset != 0, "should be initialized"); return offset;
  88 
  89 // Interface to java.lang.Object objects
  90 
  91 class java_lang_Object : AllStatic {
  92  public:
  93   static void register_natives(TRAPS);
  94 };
  95 

 373   static GrowableArray<Klass*>* fixup_mirror_list() {
 374     return _fixup_mirror_list;
 375   }
 376   static void set_fixup_mirror_list(GrowableArray<Klass*>* v) {
 377     _fixup_mirror_list = v;
 378   }
 379 
 380   static GrowableArray<Klass*>* fixup_module_field_list() {
 381     return _fixup_module_field_list;
 382   }
 383   static void set_fixup_module_field_list(GrowableArray<Klass*>* v) {
 384     _fixup_module_field_list = v;
 385   }
 386 
 387   // Debugging
 388   friend class JavaClasses;
 389 };
 390 
 391 // Interface to java.lang.Thread objects
 392 



 393 class java_lang_Thread : AllStatic {

 394  private:
 395   // Note that for this class the layout changed between JDK1.2 and JDK1.3,
 396   // so we compute the offsets at startup rather than hard-wiring them.

 397   static int _name_offset;
 398   static int _group_offset;
 399   static int _contextClassLoader_offset;
 400   static int _inheritedAccessControlContext_offset;
 401   static int _priority_offset;
 402   static int _eetop_offset;

 403   static int _interrupted_offset;
 404   static int _daemon_offset;
 405   static int _stillborn_offset;
 406   static int _stackSize_offset;
 407   static int _tid_offset;
 408   static int _thread_status_offset;
 409   static int _park_blocker_offset;

 410 
 411   static void compute_offsets();
 412 
 413  public:
 414   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 415 
 416   // Returns the JavaThread associated with the thread obj
 417   static JavaThread* thread(oop java_thread);
 418   // Set JavaThread for instance
 419   static void set_thread(oop java_thread, JavaThread* thread);


 420   // Interrupted status
 421   static bool interrupted(oop java_thread);
 422   static void set_interrupted(oop java_thread, bool val);
 423   // Name
 424   static oop name(oop java_thread);
 425   static void set_name(oop java_thread, oop name);
 426   // Priority
 427   static ThreadPriority priority(oop java_thread);
 428   static void set_priority(oop java_thread, ThreadPriority priority);
 429   // Thread group
 430   static oop  threadGroup(oop java_thread);
 431   // Stillborn
 432   static bool is_stillborn(oop java_thread);
 433   static void set_stillborn(oop java_thread);
 434   // Alive (NOTE: this is not really a field, but provides the correct
 435   // definition without doing a Java call)
 436   static bool is_alive(oop java_thread);
 437   // Daemon
 438   static bool is_daemon(oop java_thread);
 439   static void set_daemon(oop java_thread);
 440   // Context ClassLoader
 441   static oop context_class_loader(oop java_thread);
 442   // Control context
 443   static oop inherited_access_control_context(oop java_thread);
 444   // Stack size hint
 445   static jlong stackSize(oop java_thread);
 446   // Thread ID
 447   static jlong thread_id(oop java_thread);









 448 
 449   // Blocker object responsible for thread parking
 450   static oop park_blocker(oop java_thread);
 451 
 452   // Write thread status info to threadStatus field of java.lang.Thread.
 453   static void set_thread_status(oop java_thread_oop, JavaThreadStatus status);
 454   // Read thread status info from threadStatus field of java.lang.Thread.
 455   static JavaThreadStatus get_thread_status(oop java_thread_oop);
 456 
 457   static const char*  thread_status_name(oop java_thread_oop);
 458 



 459   // Debugging
 460   friend class JavaClasses;
 461 };
 462 
































































 463 // Interface to java.lang.ThreadGroup objects
 464 
 465 class java_lang_ThreadGroup : AllStatic {
 466  private:
 467   static int _parent_offset;
 468   static int _name_offset;
 469   static int _threads_offset;
 470   static int _groups_offset;
 471   static int _maxPriority_offset;
 472   static int _destroyed_offset;
 473   static int _daemon_offset;
 474   static int _nthreads_offset;
 475   static int _ngroups_offset;



 476 
 477   static void compute_offsets();
 478 
 479  public:
 480   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 481 
 482   // parent ThreadGroup
 483   static oop  parent(oop java_thread_group);
 484   // name
 485   static const char* name(oop java_thread_group);
 486   // ("name as oop" accessor is not necessary)
 487   // Number of threads in group
 488   static int nthreads(oop java_thread_group);
 489   // threads
 490   static objArrayOop threads(oop java_thread_group);
 491   // Number of threads in group
 492   static int ngroups(oop java_thread_group);
 493   // groups
 494   static objArrayOop groups(oop java_thread_group);
 495   // maxPriority in group
 496   static ThreadPriority maxPriority(oop java_thread_group);
 497   // Destroyed
 498   static bool is_destroyed(oop java_thread_group);
 499   // Daemon
 500   static bool is_daemon(oop java_thread_group);






 501   // Debugging
 502   friend class JavaClasses;
 503 };
 504 
 505 















































 506 
 507 // Interface to java.lang.Throwable objects
 508 
 509 class java_lang_Throwable: AllStatic {
 510   friend class BacktraceBuilder;
 511   friend class BacktraceIterator;
 512 
 513  private:
 514   // Trace constants
 515   enum {
 516     trace_methods_offset = 0,
 517     trace_bcis_offset    = 1,
 518     trace_mirrors_offset = 2,
 519     trace_names_offset   = 3,
 520     trace_next_offset    = 4,
 521     trace_hidden_offset  = 5,
 522     trace_size           = 6,

 523     trace_chunk_size     = 32
 524   };
 525 
 526   static int _backtrace_offset;
 527   static int _detailMessage_offset;
 528   static int _stackTrace_offset;
 529   static int _depth_offset;
 530   static int _cause_offset;
 531   static int _static_unassigned_stacktrace_offset;
 532 
 533   // StackTrace (programmatic access, new since 1.4)
 534   static void clear_stacktrace(oop throwable);
 535   // Stacktrace (post JDK 1.7.0 to allow immutability protocol to be followed)
 536   static void set_stacktrace(oop throwable, oop st_element_array);
 537   static oop unassigned_stacktrace();
 538 
 539  public:
 540   // Backtrace
 541   static oop backtrace(oop throwable);
 542   static void set_backtrace(oop throwable, oop value);
 543   static int depth(oop throwable);
 544   static void set_depth(oop throwable, int value);
 545   static int get_detailMessage_offset() { CHECK_INIT(_detailMessage_offset); }
 546   // Message
 547   static oop message(oop throwable);
 548   static oop cause(oop throwable);
 549   static void set_message(oop throwable, oop value);
 550   static Symbol* detail_message(oop throwable);
 551   static void print_stack_element(outputStream *st, Method* method, int bci);
 552 
 553   static void compute_offsets();
 554   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 555 
 556   // Allocate space for backtrace (created but stack trace not filled in)
 557   static void allocate_backtrace(Handle throwable, TRAPS);
 558   // Fill in current stack trace for throwable with preallocated backtrace (no GC)
 559   static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable);
 560   // Fill in current stack trace, can cause GC
 561   static void fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS);
 562   static void fill_in_stack_trace(Handle throwable, const methodHandle& method = methodHandle());

 563   // Programmatic access to stack trace
 564   static void get_stack_trace_elements(Handle throwable, objArrayHandle stack_trace, TRAPS);
 565 
 566   // For recreating class initialization error exceptions.
 567   static Handle get_cause_with_stack_trace(Handle throwable, TRAPS);
 568 
 569   // Printing
 570   static void print(oop throwable, outputStream* st);
 571   static void print_stack_trace(Handle throwable, outputStream* st);
 572   static void java_printStackTrace(Handle throwable, TRAPS);
 573   // Debugging
 574   friend class JavaClasses;
 575   // Gets the method and bci of the top frame (TOS). Returns false if this failed.
 576   static bool get_top_method_and_bci(oop throwable, Method** method, int* bci);
 577 };
 578 
 579 
 580 // Interface to java.lang.reflect.AccessibleObject objects
 581 
 582 class java_lang_reflect_AccessibleObject: AllStatic {
 583  private:
 584   // Note that to reduce dependencies on the JDK we compute these

 890   friend class JavaClasses;
 891 };
 892 
 893 
 894 
 895 // Interface to java.lang.ref.Reference objects
 896 
 897 class java_lang_ref_Reference: AllStatic {
 898   static int _referent_offset;
 899   static int _queue_offset;
 900   static int _next_offset;
 901   static int _discovered_offset;
 902 
 903   static bool _offsets_initialized;
 904 
 905  public:
 906   // Accessors
 907   static inline oop weak_referent_no_keepalive(oop ref);
 908   static inline oop phantom_referent_no_keepalive(oop ref);
 909   static inline oop unknown_referent_no_keepalive(oop ref);

 910   static inline void clear_referent(oop ref);
 911   static inline HeapWord* referent_addr_raw(oop ref);
 912   static inline oop next(oop ref);
 913   static inline void set_next(oop ref, oop value);
 914   static inline void set_next_raw(oop ref, oop value);
 915   static inline HeapWord* next_addr_raw(oop ref);
 916   static inline oop discovered(oop ref);
 917   static inline void set_discovered(oop ref, oop value);
 918   static inline void set_discovered_raw(oop ref, oop value);
 919   static inline HeapWord* discovered_addr_raw(oop ref);
 920   static bool is_referent_field(oop obj, ptrdiff_t offset);
 921   static inline bool is_final(oop ref);
 922   static inline bool is_phantom(oop ref);
 923 
 924   static int referent_offset()    { CHECK_INIT(_referent_offset); }
 925   static int queue_offset()       { CHECK_INIT(_queue_offset); }
 926   static int next_offset()        { CHECK_INIT(_next_offset); }
 927   static int discovered_offset()  { CHECK_INIT(_discovered_offset); }
 928 
 929   static void compute_offsets();

 932 
 933 
 934 // Interface to java.lang.ref.SoftReference objects
 935 
 936 class java_lang_ref_SoftReference: public java_lang_ref_Reference {
 937   static int _timestamp_offset;
 938   static int _static_clock_offset;
 939 
 940  public:
 941   // Accessors
 942   static jlong timestamp(oop ref);
 943 
 944   // Accessors for statics
 945   static jlong clock();
 946   static void set_clock(jlong value);
 947 
 948   static void compute_offsets();
 949   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 950 };
 951 












































































































 952 // Interface to java.lang.invoke.MethodHandle objects
 953 
 954 class java_lang_invoke_MethodHandle: AllStatic {
 955   friend class JavaClasses;
 956 
 957  private:
 958   static int _type_offset;               // the MethodType of this MH
 959   static int _form_offset;               // the LambdaForm of this MH
 960 
 961   static void compute_offsets();
 962 
 963  public:
 964   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 965 
 966   // Accessors
 967   static oop            type(oop mh);
 968   static void       set_type(oop mh, oop mtype);
 969 
 970   static oop            form(oop mh);
 971   static void       set_form(oop mh, oop lform);

1408   static void compute_offsets();
1409   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
1410 
1411   // Debugging
1412   friend class JavaClasses;
1413 };
1414 
1415 
1416 // Interface to java.lang.StackTraceElement objects
1417 
1418 class java_lang_StackTraceElement: AllStatic {
1419  private:
1420   static int _declaringClassObject_offset;
1421   static int _classLoaderName_offset;
1422   static int _moduleName_offset;
1423   static int _moduleVersion_offset;
1424   static int _declaringClass_offset;
1425   static int _methodName_offset;
1426   static int _fileName_offset;
1427   static int _lineNumber_offset;

1428 
1429   // Setters
1430   static void set_classLoaderName(oop element, oop value);
1431   static void set_moduleName(oop element, oop value);
1432   static void set_moduleVersion(oop element, oop value);
1433   static void set_declaringClass(oop element, oop value);
1434   static void set_methodName(oop element, oop value);
1435   static void set_fileName(oop element, oop value);
1436   static void set_lineNumber(oop element, int value);
1437   static void set_declaringClassObject(oop element, oop value);

1438 
1439   static void decode_file_and_line(Handle java_mirror, InstanceKlass* holder, int version,
1440                                    const methodHandle& method, int bci,
1441                                    Symbol*& source, oop& source_file, int& line_number, TRAPS);
1442 
1443  public:
1444   // Create an instance of StackTraceElement
1445   static oop create(const methodHandle& method, int bci, TRAPS);
1446 
1447   static void fill_in(Handle element, InstanceKlass* holder, const methodHandle& method,
1448                       int version, int bci, Symbol* name, TRAPS);
1449 
1450   static void compute_offsets();
1451   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
1452 
1453 #if INCLUDE_JVMCI
1454   static void decode(const methodHandle& method, int bci, Symbol*& fileName, int& lineNumber, TRAPS);
1455 #endif
1456 
1457   // Debugging
1458   friend class JavaClasses;
1459 };
1460 
1461 
1462 class Backtrace: AllStatic {
1463  public:
1464   // Helper backtrace functions to store bci|version together.
1465   static int merge_bci_and_version(int bci, int version);
1466   static int merge_mid_and_cpref(int mid, int cpref);
1467   static int bci_at(unsigned int merged);
1468   static int version_at(unsigned int merged);
1469   static int mid_at(unsigned int merged);
1470   static int cpref_at(unsigned int merged);
1471   static int get_line_number(Method* method, int bci);
1472   static Symbol* get_source_file_name(InstanceKlass* holder, int version);
1473 
1474   // Debugging
1475   friend class JavaClasses;
1476 };
1477 
1478 // Interface to java.lang.StackFrameInfo objects
1479 
1480 #define STACKFRAMEINFO_INJECTED_FIELDS(macro)                      \
1481   macro(java_lang_StackFrameInfo, version, short_signature, false)
1482 
1483 class java_lang_StackFrameInfo: AllStatic {
1484 private:
1485   static int _memberName_offset;
1486   static int _bci_offset;
1487   static int _version_offset;

1488 
1489   static Method* get_method(Handle stackFrame, InstanceKlass* holder, TRAPS);
1490 
1491 public:
1492   // Setters
1493   static void set_method_and_bci(Handle stackFrame, const methodHandle& method, int bci, TRAPS);
1494   static void set_bci(oop info, int value);
1495 
1496   static void set_version(oop info, short value);

1497 
1498   static void compute_offsets();
1499   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
1500 
1501   static void to_stack_trace_element(Handle stackFrame, Handle stack_trace_element, TRAPS);
1502 
1503   // Debugging
1504   friend class JavaClasses;
1505 };
1506 
1507 class java_lang_LiveStackFrameInfo: AllStatic {
1508  private:
1509   static int _monitors_offset;
1510   static int _locals_offset;
1511   static int _operands_offset;
1512   static int _mode_offset;
1513 
1514  public:
1515   static void set_monitors(oop info, oop value);
1516   static void set_locals(oop info, oop value);

1747   int compute_offset();
1748 
1749   // Find the Symbol for this index
1750   static Symbol* lookup_symbol(vmSymbolID symbol_index) {
1751     return Symbol::vm_symbol_at(symbol_index);
1752   }
1753 };
1754 
1755 #define DECLARE_INJECTED_FIELD_ENUM(klass, name, signature, may_be_java) \
1756   klass##_##name##_enum,
1757 
1758 #define ALL_INJECTED_FIELDS(macro)          \
1759   STRING_INJECTED_FIELDS(macro)             \
1760   CLASS_INJECTED_FIELDS(macro)              \
1761   CLASSLOADER_INJECTED_FIELDS(macro)        \
1762   RESOLVEDMETHOD_INJECTED_FIELDS(macro)     \
1763   MEMBERNAME_INJECTED_FIELDS(macro)         \
1764   CALLSITECONTEXT_INJECTED_FIELDS(macro)    \
1765   STACKFRAMEINFO_INJECTED_FIELDS(macro)     \
1766   MODULE_INJECTED_FIELDS(macro)             \

1767   INTERNALERROR_INJECTED_FIELDS(macro)
1768 
1769 
1770 // Interface to hard-coded offset checking
1771 
1772 class JavaClasses : AllStatic {
1773  private:
1774 
1775   static InjectedField _injected_fields[];
1776 
1777   static bool check_offset(const char *klass_name, int offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
1778  public:
1779   enum InjectedFieldID {
1780     ALL_INJECTED_FIELDS(DECLARE_INJECTED_FIELD_ENUM)
1781     MAX_enum
1782   };
1783 
1784   static int compute_injected_offset(InjectedFieldID id);
1785 
1786   static void compute_offsets();

  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_CLASSFILE_JAVACLASSES_HPP
  26 #define SHARE_CLASSFILE_JAVACLASSES_HPP
  27 
  28 #include "classfile/vmClasses.hpp"
  29 #include "oops/oop.hpp"
  30 #include "oops/instanceKlass.hpp"
  31 #include "oops/stackChunkOop.hpp"
  32 #include "oops/symbol.hpp"
  33 #include "runtime/os.hpp"
  34 #include "utilities/vmEnums.hpp"
  35 
  36 class JvmtiThreadState;
  37 class RecordComponent;
  38 
  39 // Interface for manipulating the basic Java classes.
  40 
  41 #define BASIC_JAVA_CLASSES_DO_PART1(f) \
  42   f(java_lang_Class) \
  43   f(java_lang_String) \
  44   f(java_lang_ref_Reference) \
  45   //end
  46 
  47 #define BASIC_JAVA_CLASSES_DO_PART2(f) \
  48   f(java_lang_System) \
  49   f(java_lang_ClassLoader) \
  50   f(java_lang_Throwable) \
  51   f(java_lang_Thread) \
  52   f(java_lang_Thread_FieldHolder) \
  53   f(java_lang_Thread_VirtualThreads) \
  54   f(java_lang_Thread_ClassLoaders) \
  55   f(java_lang_ThreadGroup) \
  56   f(java_lang_VirtualThread) \
  57   f(java_lang_InternalError) \
  58   f(java_lang_AssertionStatusDirectives) \
  59   f(java_lang_ref_SoftReference) \
  60   f(java_lang_invoke_MethodHandle) \
  61   f(java_lang_invoke_DirectMethodHandle) \
  62   f(java_lang_invoke_MemberName) \
  63   f(java_lang_invoke_ResolvedMethodName) \
  64   f(java_lang_invoke_LambdaForm) \
  65   f(java_lang_invoke_MethodType) \
  66   f(java_lang_invoke_CallSite) \
  67   f(java_lang_invoke_ConstantCallSite) \
  68   f(java_lang_invoke_MethodHandleNatives_CallSiteContext) \
  69   f(java_security_AccessControlContext) \
  70   f(java_lang_reflect_AccessibleObject) \
  71   f(java_lang_reflect_Method) \
  72   f(java_lang_reflect_Constructor) \
  73   f(java_lang_reflect_Field) \
  74   f(java_lang_reflect_RecordComponent) \
  75   f(reflect_ConstantPool) \
  76   f(reflect_UnsafeStaticFieldAccessorImpl) \
  77   f(java_lang_reflect_Parameter) \
  78   f(java_lang_Module) \
  79   f(java_lang_StackTraceElement) \
  80   f(java_lang_StackFrameInfo) \
  81   f(java_lang_LiveStackFrameInfo) \
  82   f(jdk_internal_vm_ContinuationScope) \
  83   f(jdk_internal_vm_Continuation) \
  84   f(jdk_internal_vm_StackChunk) \
  85   f(java_util_concurrent_locks_AbstractOwnableSynchronizer) \
  86   f(jdk_internal_invoke_NativeEntryPoint) \
  87   f(jdk_internal_misc_UnsafeConstants) \
  88   f(java_lang_boxing_object) \
  89   f(vector_VectorPayload) \
  90   //end
  91 
  92 #define BASIC_JAVA_CLASSES_DO(f) \
  93         BASIC_JAVA_CLASSES_DO_PART1(f) \
  94         BASIC_JAVA_CLASSES_DO_PART2(f)
  95 
  96 #define CHECK_INIT(offset)  assert(offset != 0, "should be initialized"); return offset;
  97 
  98 // Interface to java.lang.Object objects
  99 
 100 class java_lang_Object : AllStatic {
 101  public:
 102   static void register_natives(TRAPS);
 103 };
 104 

 382   static GrowableArray<Klass*>* fixup_mirror_list() {
 383     return _fixup_mirror_list;
 384   }
 385   static void set_fixup_mirror_list(GrowableArray<Klass*>* v) {
 386     _fixup_mirror_list = v;
 387   }
 388 
 389   static GrowableArray<Klass*>* fixup_module_field_list() {
 390     return _fixup_module_field_list;
 391   }
 392   static void set_fixup_module_field_list(GrowableArray<Klass*>* v) {
 393     _fixup_module_field_list = v;
 394   }
 395 
 396   // Debugging
 397   friend class JavaClasses;
 398 };
 399 
 400 // Interface to java.lang.Thread objects
 401 
 402 #define THREAD_INJECTED_FIELDS(macro)                            \
 403   macro(java_lang_Thread, jvmti_thread_state, intptr_signature, false)
 404 
 405 class java_lang_Thread : AllStatic {
 406   friend class java_lang_VirtualThread;
 407  private:
 408   // Note that for this class the layout changed between JDK1.2 and JDK1.3,
 409   // so we compute the offsets at startup rather than hard-wiring them.
 410   static int _holder_offset;
 411   static int _name_offset;

 412   static int _contextClassLoader_offset;
 413   static int _inheritedAccessControlContext_offset;

 414   static int _eetop_offset;
 415   static int _jvmti_thread_state_offset;
 416   static int _interrupted_offset;



 417   static int _tid_offset;
 418   static int _continuation_offset;
 419   static int _park_blocker_offset;
 420   static int _scopeLocalBindings_offset;
 421 
 422   static void compute_offsets();
 423 
 424  public:
 425   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 426 
 427   // Returns the JavaThread associated with the thread obj
 428   static JavaThread* thread(oop java_thread);
 429   // Set JavaThread for instance
 430   static void set_thread(oop java_thread, JavaThread* thread);
 431   // FieldHolder
 432   static oop holder(oop java_thread);
 433   // Interrupted status
 434   static bool interrupted(oop java_thread);
 435   static void set_interrupted(oop java_thread, bool val);
 436   // Name
 437   static oop name(oop java_thread);
 438   static void set_name(oop java_thread, oop name);
 439   // Priority
 440   static ThreadPriority priority(oop java_thread);
 441   static void set_priority(oop java_thread, ThreadPriority priority);
 442   // Thread group
 443   static oop  threadGroup(oop java_thread);
 444   // Stillborn
 445   static bool is_stillborn(oop java_thread);
 446   static void set_stillborn(oop java_thread);
 447   // Alive (NOTE: this is not really a field, but provides the correct
 448   // definition without doing a Java call)
 449   static bool is_alive(oop java_thread);
 450   // Daemon
 451   static bool is_daemon(oop java_thread);
 452   static void set_daemon(oop java_thread);
 453   // Context ClassLoader
 454   static oop context_class_loader(oop java_thread);
 455   // Control context
 456   static oop inherited_access_control_context(oop java_thread);
 457   // Stack size hint
 458   static jlong stackSize(oop java_thread);
 459   // Thread ID
 460   static jlong thread_id(oop java_thread);
 461   static ByteSize thread_id_offset();
 462   // Continuation
 463   static inline oop continuation(oop java_thread);
 464 
 465   static JvmtiThreadState* jvmti_thread_state(oop java_thread);
 466   static void set_jvmti_thread_state(oop java_thread, JvmtiThreadState* state);
 467 
 468   // Clear all scope local bindings on error
 469   static void clear_scopeLocalBindings(oop java_thread);
 470 
 471   // Blocker object responsible for thread parking
 472   static oop park_blocker(oop java_thread);
 473 
 474   // Write thread status info to threadStatus field of java.lang.Thread.
 475   static void set_thread_status(oop java_thread_oop, JavaThreadStatus status);
 476   // Read thread status info from threadStatus field of java.lang.Thread.
 477   static JavaThreadStatus get_thread_status(oop java_thread_oop);
 478 
 479   static const char*  thread_status_name(oop java_thread_oop);
 480 
 481   // Fill in current stack trace, can cause GC
 482   static oop async_get_stack_trace(oop java_thread, TRAPS);
 483 
 484   // Debugging
 485   friend class JavaClasses;
 486 };
 487 
 488 // Interface to java.lang.Thread$FieldHolder objects
 489 
 490 class java_lang_Thread_FieldHolder : AllStatic {
 491  private:
 492   static int _group_offset;
 493   static int _priority_offset;
 494   static int _stackSize_offset;
 495   static int _stillborn_offset;
 496   static int _daemon_offset;
 497   static int _thread_status_offset;
 498 
 499   static void compute_offsets();
 500  public:
 501   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 502 
 503   static oop threadGroup(oop holder);
 504 
 505   static ThreadPriority priority(oop holder);
 506   static void set_priority(oop holder, ThreadPriority priority);
 507 
 508   static jlong stackSize(oop holder);
 509 
 510   static bool is_stillborn(oop holder);
 511   static void set_stillborn(oop holder);
 512 
 513   static bool is_daemon(oop holder);
 514   static void set_daemon(oop holder);
 515 
 516   static void set_thread_status(oop holder, JavaThreadStatus);
 517   static JavaThreadStatus get_thread_status(oop holder);
 518 
 519   friend class JavaClasses;
 520 };
 521 
 522 // Interface to java.lang.Thread$VirtualThreads objects
 523 
 524 class java_lang_Thread_VirtualThreads : AllStatic {
 525  private:
 526   static int _static_THREAD_GROUP_offset;
 527 
 528   static void compute_offsets();
 529   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 530  public:
 531   static oop get_THREAD_GROUP();
 532 
 533   friend class JavaClasses;
 534 };
 535 
 536 
 537 // Interface to java.lang.Thread$ClassLoaders objects
 538 
 539 class java_lang_Thread_ClassLoaders : AllStatic {
 540  private:
 541   static int _static_NOT_SUPPORTED_offset;
 542 
 543   static void compute_offsets();
 544   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 545  public:
 546   static oop get_NOT_SUPPORTED();
 547 
 548   friend class JavaClasses;
 549 };
 550 
 551 
 552 // Interface to java.lang.ThreadGroup objects
 553 
 554 class java_lang_ThreadGroup : AllStatic {
 555  private:
 556   static int _parent_offset;
 557   static int _name_offset;


 558   static int _maxPriority_offset;
 559 


 560   static int _ngroups_offset;
 561   static int _groups_offset;
 562   static int _nweaks_offset;
 563   static int _weaks_offset;
 564 
 565   static void compute_offsets();
 566 
 567  public:
 568   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 569 
 570   // parent ThreadGroup
 571   static oop parent(oop java_thread_group);
 572   // name
 573   static const char* name(oop java_thread_group);









 574   // maxPriority in group
 575   static ThreadPriority maxPriority(oop java_thread_group);
 576 
 577   // Number of strongly reachable thread groups
 578   static int ngroups(oop java_thread_group);
 579   // Strongly reachable thread groups
 580   static objArrayOop groups(oop java_thread_group);
 581   // Number of weakly reachable thread groups
 582   static int nweaks(oop java_thread_group);
 583   // Weakly reachable thread groups
 584   static objArrayOop weaks(oop java_thread_group);
 585 
 586   // Debugging
 587   friend class JavaClasses;
 588 };
 589 
 590 
 591 // Interface to java.lang.VirtualThread objects
 592 
 593 class java_lang_VirtualThread : AllStatic {
 594  private:
 595   static int static_notify_jvmti_events_offset;
 596   static int static_vthread_scope_offset;
 597   static int _carrierThread_offset;
 598   static int _continuation_offset;
 599   static int _state_offset;
 600 
 601  public:
 602   enum {
 603     NEW          = 0,
 604     STARTED      = 1,
 605     RUNNABLE     = 2,
 606     RUNNING      = 3,
 607     PARKING      = 4,
 608     PARKED       = 5,
 609     PINNED       = 6,
 610     YIELDING     = 7,
 611     TERMINATED   = 99,
 612 
 613     // can be suspended from scheduling when parked
 614     SUSPENDED    = 1 << 8,
 615     PARKED_SUSPENDED = (PARKED | SUSPENDED)
 616   };
 617 
 618   static void compute_offsets();
 619   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 620 
 621   // Testers
 622   static bool is_subclass(Klass* klass) {
 623     return klass->is_subclass_of(vmClasses::VirtualThread_klass());
 624   }
 625   static bool is_instance(oop obj);
 626 
 627   static oop vthread_scope();
 628   static oop carrier_thread(oop vthread);
 629   static oop continuation(oop vthread);
 630   static jshort state(oop vthread);
 631   static JavaThreadStatus map_state_to_thread_status(jint state);
 632   static bool notify_jvmti_events();
 633   static void set_notify_jvmti_events(jboolean enable);
 634   static void init_static_notify_jvmti_events();
 635   static jlong set_jfrTraceId(oop vthread, jlong id);
 636 };
 637 
 638 
 639 // Interface to java.lang.Throwable objects
 640 
 641 class java_lang_Throwable: AllStatic {
 642   friend class BacktraceBuilder;
 643   friend class BacktraceIterator;
 644 
 645  private:
 646   // Trace constants
 647   enum {
 648     trace_methods_offset = 0,
 649     trace_bcis_offset    = 1,
 650     trace_mirrors_offset = 2,
 651     trace_names_offset   = 3,
 652     trace_conts_offset   = 4,
 653     trace_next_offset    = 5,
 654     trace_hidden_offset  = 6,
 655     trace_size           = 7,
 656     trace_chunk_size     = 32
 657   };
 658 
 659   static int _backtrace_offset;
 660   static int _detailMessage_offset;
 661   static int _stackTrace_offset;
 662   static int _depth_offset;
 663   static int _cause_offset;
 664   static int _static_unassigned_stacktrace_offset;
 665 
 666   // StackTrace (programmatic access, new since 1.4)
 667   static void clear_stacktrace(oop throwable);
 668   // Stacktrace (post JDK 1.7.0 to allow immutability protocol to be followed)
 669   static void set_stacktrace(oop throwable, oop st_element_array);
 670   static oop unassigned_stacktrace();
 671 
 672  public:
 673   // Backtrace
 674   static oop backtrace(oop throwable);
 675   static void set_backtrace(oop throwable, oop value);
 676   static int depth(oop throwable);
 677   static void set_depth(oop throwable, int value);
 678   static int get_detailMessage_offset() { CHECK_INIT(_detailMessage_offset); }
 679   // Message
 680   static oop message(oop throwable);
 681   static oop cause(oop throwable);
 682   static void set_message(oop throwable, oop value);
 683   static Symbol* detail_message(oop throwable);
 684   static void print_stack_element(outputStream *st, Method* method, int bci);
 685 
 686   static void compute_offsets();
 687   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
 688 
 689   // Allocate space for backtrace (created but stack trace not filled in)
 690   static void allocate_backtrace(Handle throwable, TRAPS);
 691   // Fill in current stack trace for throwable with preallocated backtrace (no GC)
 692   static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable);
 693   // Fill in current stack trace, can cause GC
 694   static void fill_in_stack_trace(Handle throwable, const methodHandle& method, TRAPS);
 695   static void fill_in_stack_trace(Handle throwable, const methodHandle& method = methodHandle());
 696 
 697   // Programmatic access to stack trace
 698   static void get_stack_trace_elements(int depth, Handle backtrace, objArrayHandle stack_trace, TRAPS);
 699 
 700   // For recreating class initialization error exceptions.
 701   static Handle get_cause_with_stack_trace(Handle throwable, TRAPS);
 702 
 703   // Printing
 704   static void print(oop throwable, outputStream* st);
 705   static void print_stack_trace(Handle throwable, outputStream* st);
 706   static void java_printStackTrace(Handle throwable, TRAPS);
 707   // Debugging
 708   friend class JavaClasses;
 709   // Gets the method and bci of the top frame (TOS). Returns false if this failed.
 710   static bool get_top_method_and_bci(oop throwable, Method** method, int* bci);
 711 };
 712 
 713 
 714 // Interface to java.lang.reflect.AccessibleObject objects
 715 
 716 class java_lang_reflect_AccessibleObject: AllStatic {
 717  private:
 718   // Note that to reduce dependencies on the JDK we compute these

1024   friend class JavaClasses;
1025 };
1026 
1027 
1028 
1029 // Interface to java.lang.ref.Reference objects
1030 
1031 class java_lang_ref_Reference: AllStatic {
1032   static int _referent_offset;
1033   static int _queue_offset;
1034   static int _next_offset;
1035   static int _discovered_offset;
1036 
1037   static bool _offsets_initialized;
1038 
1039  public:
1040   // Accessors
1041   static inline oop weak_referent_no_keepalive(oop ref);
1042   static inline oop phantom_referent_no_keepalive(oop ref);
1043   static inline oop unknown_referent_no_keepalive(oop ref);
1044   static inline oop unknown_referent(oop ref);
1045   static inline void clear_referent(oop ref);
1046   static inline HeapWord* referent_addr_raw(oop ref);
1047   static inline oop next(oop ref);
1048   static inline void set_next(oop ref, oop value);
1049   static inline void set_next_raw(oop ref, oop value);
1050   static inline HeapWord* next_addr_raw(oop ref);
1051   static inline oop discovered(oop ref);
1052   static inline void set_discovered(oop ref, oop value);
1053   static inline void set_discovered_raw(oop ref, oop value);
1054   static inline HeapWord* discovered_addr_raw(oop ref);
1055   static bool is_referent_field(oop obj, ptrdiff_t offset);
1056   static inline bool is_final(oop ref);
1057   static inline bool is_phantom(oop ref);
1058 
1059   static int referent_offset()    { CHECK_INIT(_referent_offset); }
1060   static int queue_offset()       { CHECK_INIT(_queue_offset); }
1061   static int next_offset()        { CHECK_INIT(_next_offset); }
1062   static int discovered_offset()  { CHECK_INIT(_discovered_offset); }
1063 
1064   static void compute_offsets();

1067 
1068 
1069 // Interface to java.lang.ref.SoftReference objects
1070 
1071 class java_lang_ref_SoftReference: public java_lang_ref_Reference {
1072   static int _timestamp_offset;
1073   static int _static_clock_offset;
1074 
1075  public:
1076   // Accessors
1077   static jlong timestamp(oop ref);
1078 
1079   // Accessors for statics
1080   static jlong clock();
1081   static void set_clock(jlong value);
1082 
1083   static void compute_offsets();
1084   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
1085 };
1086 
1087 // Interface to jdk.internal.vm.ContinuationScope objects
1088 class jdk_internal_vm_ContinuationScope: AllStatic {
1089   friend class JavaClasses;
1090  private:
1091   static int _name_offset;
1092 
1093   static void compute_offsets();
1094  public:
1095   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
1096 
1097   static inline oop name(oop ref);
1098 };
1099 
1100 // Interface to jdk.internal.vm.Continuation objects
1101 class jdk_internal_vm_Continuation: AllStatic {
1102   friend class JavaClasses;
1103  private:
1104   static int _scope_offset;
1105   static int _target_offset;
1106   static int _parent_offset;
1107   static int _yieldInfo_offset;
1108   static int _tail_offset;
1109   static int _cs_offset;
1110   static int _reset_offset;
1111   static int _mounted_offset;
1112   static int _done_offset;
1113   static int _preempted_offset;
1114 
1115   static void compute_offsets();
1116  public:
1117   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
1118   // Accessors
1119   static inline oop scope(oop ref);
1120   static inline oop target(oop ref);
1121   static inline oop parent(oop ref);
1122   static inline oop yieldInfo(oop ref);
1123   static inline void set_yieldInfo(oop ref, oop value);
1124   static inline stackChunkOop tail(oop ref);
1125   static inline void set_tail(oop ref, stackChunkOop value);
1126   static inline jshort critical_section(oop ref);
1127   static inline void set_critical_section(oop ref, jshort value);
1128   static inline bool on_local_stack(oop ref, address adr);
1129   static inline bool is_reset(oop ref);
1130   static inline bool is_mounted(oop ref);
1131   static inline bool done(oop ref);
1132   static inline bool is_preempted(oop ref);
1133   static inline void set_preempted(oop ref, bool value);
1134 };
1135 
1136 // Interface to jdk.internal.vm.StackChunk objects
1137 class jdk_internal_vm_StackChunk: AllStatic {
1138   friend class JavaClasses;
1139  private:
1140   static int _parent_offset;
1141   static int _size_offset;
1142   static int _sp_offset;
1143   static int _pc_offset;
1144   static int _argsize_offset;
1145   static int _flags_offset;
1146   static int _gcSP_offset;
1147   static int _markCycle_offset;
1148   static int _maxSize_offset;
1149   static int _numFrames_offset;
1150   static int _numOops_offset;
1151   static int _cont_offset;
1152 
1153   static void compute_offsets();
1154  public:
1155   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
1156 
1157   static inline int parent_offset() { return _parent_offset; }
1158   static inline int cont_offset()   { return _cont_offset; }
1159 
1160   // Accessors
1161   static inline oop parent(oop ref);
1162   static inline void set_parent(oop ref, oop value);
1163   template<typename P>
1164   static inline bool is_parent_null(oop ref); // bypasses barriers for a faster test
1165   template<typename P>
1166   static inline void set_parent_raw(oop ref, oop value);
1167   static inline jint size(oop ref);
1168   static inline void set_size(HeapWord* ref, jint value);
1169   static inline jint sp(oop ref);
1170   static inline void set_sp(oop ref, jint value);
1171   static inline jlong pc(oop ref);
1172   static inline void set_pc(oop ref, jlong value);
1173   static inline jint argsize(oop ref);
1174   static inline void set_argsize(oop ref, jint value);
1175   static inline jbyte flags(oop ref);
1176   static inline void set_flags(oop ref, jbyte value);
1177   static inline jint gc_sp(oop ref);
1178   static inline void set_gc_sp(oop ref, jint value);
1179   static inline jlong mark_cycle(oop ref);
1180   static inline void set_mark_cycle(oop ref, jlong value);
1181   static inline jint maxSize(oop ref);
1182   static inline void set_maxSize(oop ref, jint value);
1183   static inline jint numFrames(oop ref);
1184   static inline void set_numFrames(oop ref, jint value);
1185   static inline jint numOops(oop ref);
1186   static inline void set_numOops(oop ref, jint value);
1187   static inline oop cont(oop ref);
1188   static inline void set_cont(oop ref, oop value);
1189   template<typename P>
1190   static inline oop cont_raw(oop ref);
1191   template<typename P>
1192   static inline void set_cont_raw(oop ref, oop value);
1193 };
1194 
1195 // Interface to java.lang.invoke.MethodHandle objects
1196 
1197 class java_lang_invoke_MethodHandle: AllStatic {
1198   friend class JavaClasses;
1199 
1200  private:
1201   static int _type_offset;               // the MethodType of this MH
1202   static int _form_offset;               // the LambdaForm of this MH
1203 
1204   static void compute_offsets();
1205 
1206  public:
1207   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
1208 
1209   // Accessors
1210   static oop            type(oop mh);
1211   static void       set_type(oop mh, oop mtype);
1212 
1213   static oop            form(oop mh);
1214   static void       set_form(oop mh, oop lform);

1651   static void compute_offsets();
1652   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
1653 
1654   // Debugging
1655   friend class JavaClasses;
1656 };
1657 
1658 
1659 // Interface to java.lang.StackTraceElement objects
1660 
1661 class java_lang_StackTraceElement: AllStatic {
1662  private:
1663   static int _declaringClassObject_offset;
1664   static int _classLoaderName_offset;
1665   static int _moduleName_offset;
1666   static int _moduleVersion_offset;
1667   static int _declaringClass_offset;
1668   static int _methodName_offset;
1669   static int _fileName_offset;
1670   static int _lineNumber_offset;
1671   static int _contScopeName_offset;
1672 
1673   // Setters
1674   static void set_classLoaderName(oop element, oop value);
1675   static void set_moduleName(oop element, oop value);
1676   static void set_moduleVersion(oop element, oop value);
1677   static void set_declaringClass(oop element, oop value);
1678   static void set_methodName(oop element, oop value);
1679   static void set_fileName(oop element, oop value);
1680   static void set_lineNumber(oop element, int value);
1681   static void set_declaringClassObject(oop element, oop value);
1682   static void set_contScopeName(oop element, oop value);
1683 
1684   static void decode_file_and_line(Handle java_mirror, InstanceKlass* holder, int version,
1685                                    const methodHandle& method, int bci,
1686                                    Symbol*& source, oop& source_file, int& line_number, TRAPS);
1687 
1688  public:
1689   // Create an instance of StackTraceElement
1690   static oop create(const methodHandle& method, int bci, Handle contScopeName, TRAPS);
1691 
1692   static void fill_in(Handle element, InstanceKlass* holder, const methodHandle& method,
1693                       int version, int bci, Symbol* name, Handle contScopeName, TRAPS);
1694 
1695   static void compute_offsets();
1696   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
1697 
1698 #if INCLUDE_JVMCI
1699   static void decode(const methodHandle& method, int bci, Symbol*& fileName, int& lineNumber, TRAPS);
1700 #endif
1701 
1702   // Debugging
1703   friend class JavaClasses;
1704 };
1705 
1706 
1707 class Backtrace: AllStatic {
1708  public:
1709   // Helper backtrace functions to store bci|version together.
1710   static int merge_bci_and_version(int bci, int version);
1711   static int merge_mid_and_cpref(int mid, int cpref);
1712   static int bci_at(unsigned int merged);
1713   static int version_at(unsigned int merged);
1714   static int mid_at(unsigned int merged);
1715   static int cpref_at(unsigned int merged);
1716   static int get_line_number(Method* method, int bci);
1717   static Symbol* get_source_file_name(InstanceKlass* holder, int version);
1718 
1719   // Debugging
1720   friend class JavaClasses;
1721 };
1722 
1723 // Interface to java.lang.StackFrameInfo objects
1724 
1725 #define STACKFRAMEINFO_INJECTED_FIELDS(macro)                      \
1726   macro(java_lang_StackFrameInfo, version, short_signature, false)
1727 
1728 class java_lang_StackFrameInfo: AllStatic {
1729 private:
1730   static int _memberName_offset;
1731   static int _bci_offset;
1732   static int _version_offset;
1733   static int _contScope_offset;
1734 
1735   static Method* get_method(Handle stackFrame, InstanceKlass* holder, TRAPS);
1736 
1737 public:
1738   // Setters
1739   static void set_method_and_bci(Handle stackFrame, const methodHandle& method, int bci, oop cont, TRAPS);
1740   static void set_bci(oop info, int value);
1741 
1742   static void set_version(oop info, short value);
1743   static void set_contScope(oop info, oop value);
1744 
1745   static void compute_offsets();
1746   static void serialize_offsets(SerializeClosure* f) NOT_CDS_RETURN;
1747 
1748   static void to_stack_trace_element(Handle stackFrame, Handle stack_trace_element, TRAPS);
1749 
1750   // Debugging
1751   friend class JavaClasses;
1752 };
1753 
1754 class java_lang_LiveStackFrameInfo: AllStatic {
1755  private:
1756   static int _monitors_offset;
1757   static int _locals_offset;
1758   static int _operands_offset;
1759   static int _mode_offset;
1760 
1761  public:
1762   static void set_monitors(oop info, oop value);
1763   static void set_locals(oop info, oop value);

1994   int compute_offset();
1995 
1996   // Find the Symbol for this index
1997   static Symbol* lookup_symbol(vmSymbolID symbol_index) {
1998     return Symbol::vm_symbol_at(symbol_index);
1999   }
2000 };
2001 
2002 #define DECLARE_INJECTED_FIELD_ENUM(klass, name, signature, may_be_java) \
2003   klass##_##name##_enum,
2004 
2005 #define ALL_INJECTED_FIELDS(macro)          \
2006   STRING_INJECTED_FIELDS(macro)             \
2007   CLASS_INJECTED_FIELDS(macro)              \
2008   CLASSLOADER_INJECTED_FIELDS(macro)        \
2009   RESOLVEDMETHOD_INJECTED_FIELDS(macro)     \
2010   MEMBERNAME_INJECTED_FIELDS(macro)         \
2011   CALLSITECONTEXT_INJECTED_FIELDS(macro)    \
2012   STACKFRAMEINFO_INJECTED_FIELDS(macro)     \
2013   MODULE_INJECTED_FIELDS(macro)             \
2014   THREAD_INJECTED_FIELDS(macro)             \
2015   INTERNALERROR_INJECTED_FIELDS(macro)
2016 
2017 
2018 // Interface to hard-coded offset checking
2019 
2020 class JavaClasses : AllStatic {
2021  private:
2022 
2023   static InjectedField _injected_fields[];
2024 
2025   static bool check_offset(const char *klass_name, int offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
2026  public:
2027   enum InjectedFieldID {
2028     ALL_INJECTED_FIELDS(DECLARE_INJECTED_FIELD_ENUM)
2029     MAX_enum
2030   };
2031 
2032   static int compute_injected_offset(InjectedFieldID id);
2033 
2034   static void compute_offsets();
< prev index next >