1 /*
   2  * Copyright (c) 1997, 2010, 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_VM_CLASSFILE_JAVACLASSES_HPP
  26 #define SHARE_VM_CLASSFILE_JAVACLASSES_HPP
  27 
  28 #include "classfile/systemDictionary.hpp"
  29 #include "jvmtifiles/jvmti.h"
  30 #include "oops/oop.hpp"
  31 #include "runtime/os.hpp"
  32 #include "utilities/utf8.hpp"
  33 
  34 // Interface for manipulating the basic Java classes.
  35 //
  36 // All dependencies on layout of actual Java classes should be kept here.
  37 // If the layout of any of the classes above changes the offsets must be adjusted.
  38 //
  39 // For most classes we hardwire the offsets for performance reasons. In certain
  40 // cases (e.g. java.security.AccessControlContext) we compute the offsets at
  41 // startup since the layout here differs between JDK1.2 and JDK1.3.
  42 //
  43 // Note that fields (static and non-static) are arranged with oops before non-oops
  44 // on a per class basis. The offsets below have to reflect this ordering.
  45 //
  46 // When editing the layouts please update the check_offset verification code
  47 // correspondingly. The names in the enums must be identical to the actual field
  48 // names in order for the verification code to work.
  49 
  50 
  51 // Interface to java.lang.String objects
  52 
  53 class java_lang_String : AllStatic {
  54  private:
  55   enum {
  56     hc_value_offset  = 0,
  57     hc_offset_offset = 1
  58     //hc_count_offset = 2  -- not a word-scaled offset
  59     //hc_hash_offset  = 3  -- not a word-scaled offset
  60   };
  61 
  62   static int value_offset;
  63   static int offset_offset;
  64   static int count_offset;
  65   static int hash_offset;
  66 
  67   static Handle basic_create(int length, bool tenured, TRAPS);
  68   static Handle basic_create_from_unicode(jchar* unicode, int length, bool tenured, TRAPS);
  69 
  70   static void set_value( oop string, typeArrayOop buffer) { string->obj_field_put(value_offset,  (oop)buffer); }
  71   static void set_offset(oop string, int offset)          { string->int_field_put(offset_offset, offset); }
  72   static void set_count( oop string, int count)           { string->int_field_put(count_offset,  count);  }
  73 
  74  public:
  75   // Instance creation
  76   static Handle create_from_unicode(jchar* unicode, int len, TRAPS);
  77   static Handle create_tenured_from_unicode(jchar* unicode, int len, TRAPS);
  78   static oop    create_oop_from_unicode(jchar* unicode, int len, TRAPS);
  79   static Handle create_from_str(const char* utf8_str, TRAPS);
  80   static oop    create_oop_from_str(const char* utf8_str, TRAPS);
  81   static Handle create_from_symbol(Symbol* symbol, TRAPS);
  82   static Handle create_from_platform_dependent_str(const char* str, TRAPS);
  83   static Handle char_converter(Handle java_string, jchar from_char, jchar to_char, TRAPS);
  84 
  85   static int value_offset_in_bytes()  { return value_offset;  }
  86   static int count_offset_in_bytes()  { return count_offset;  }
  87   static int offset_offset_in_bytes() { return offset_offset; }
  88   static int hash_offset_in_bytes()   { return hash_offset;   }
  89 
  90   // Accessors
  91   static typeArrayOop value(oop java_string) {
  92     assert(is_instance(java_string), "must be java_string");
  93     return (typeArrayOop) java_string->obj_field(value_offset);
  94   }
  95   static int offset(oop java_string) {
  96     assert(is_instance(java_string), "must be java_string");
  97     return java_string->int_field(offset_offset);
  98   }
  99   static int length(oop java_string) {
 100     assert(is_instance(java_string), "must be java_string");
 101     return java_string->int_field(count_offset);
 102   }
 103   static int utf8_length(oop java_string);
 104 
 105   // String converters
 106   static char*  as_utf8_string(oop java_string);
 107   static char*  as_utf8_string(oop java_string, char* buf, int buflen);
 108   static char*  as_utf8_string(oop java_string, int start, int len);
 109   static char*  as_platform_dependent_str(Handle java_string, TRAPS);
 110   static jchar* as_unicode_string(oop java_string, int& length);
 111 
 112   static bool equals(oop java_string, jchar* chars, int len);
 113 
 114   // Conversion between '.' and '/' formats
 115   static Handle externalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '/', '.', THREAD); }
 116   static Handle internalize_classname(Handle java_string, TRAPS) { return char_converter(java_string, '.', '/', THREAD); }
 117 
 118   // Conversion
 119   static Symbol* as_symbol(Handle java_string, TRAPS);
 120   static Symbol* as_symbol_or_null(oop java_string);
 121 
 122   // Testers
 123   static bool is_instance(oop obj) {
 124     return obj != NULL && obj->klass() == SystemDictionary::String_klass();
 125   }
 126 
 127   // Debugging
 128   static void print(Handle java_string, outputStream* st);
 129   friend class JavaClasses;
 130 };
 131 
 132 
 133 // Interface to java.lang.Class objects
 134 
 135 class java_lang_Class : AllStatic {
 136    friend class VMStructs;
 137  private:
 138   // The fake offsets are added by the class loader when java.lang.Class is loaded
 139 
 140   enum {
 141     hc_klass_offset                = 0,
 142     hc_array_klass_offset          = 1,
 143     hc_resolved_constructor_offset = 2,
 144     hc_size_offset                 = 3,
 145     hc_static_oop_field_size       = 4,
 146     hc_number_of_fake_oop_fields   = 3,
 147     hc_number_of_fake_int_fields   = 2
 148   };
 149 
 150   static int klass_offset;
 151   static int resolved_constructor_offset;
 152   static int array_klass_offset;
 153   static int number_of_fake_oop_fields;
 154 
 155   static int oop_size_offset;
 156   static int static_oop_field_size_offset;
 157 
 158   static void compute_offsets();
 159   static bool offsets_computed;
 160   static int classRedefinedCount_offset;
 161   static int parallelCapable_offset;
 162 
 163  public:
 164   // Instance creation
 165   static oop  create_mirror(KlassHandle k, TRAPS);
 166   static oop  fixup_mirror(KlassHandle k, TRAPS);
 167   static oop  create_basic_type_mirror(const char* basic_type_name, BasicType type, TRAPS);
 168   // Conversion
 169   static klassOop as_klassOop(oop java_class);
 170   static BasicType as_BasicType(oop java_class, klassOop* reference_klass = NULL);
 171   static BasicType as_BasicType(oop java_class, KlassHandle* reference_klass) {
 172     klassOop refk_oop = NULL;
 173     BasicType result = as_BasicType(java_class, &refk_oop);
 174     (*reference_klass) = KlassHandle(refk_oop);
 175     return result;
 176   }
 177   static Symbol* as_signature(oop java_class, bool intern_if_not_found, TRAPS);
 178   static void print_signature(oop java_class, outputStream *st);
 179   // Testing
 180   static bool is_instance(oop obj) {
 181     return obj != NULL && obj->klass() == SystemDictionary::Class_klass();
 182   }
 183   static bool is_primitive(oop java_class);
 184   static BasicType primitive_type(oop java_class);
 185   static oop primitive_mirror(BasicType t);
 186   // JVM_NewInstance support
 187   static methodOop resolved_constructor(oop java_class);
 188   static void set_resolved_constructor(oop java_class, methodOop constructor);
 189   // JVM_NewArray support
 190   static klassOop array_klass(oop java_class);
 191   static void set_array_klass(oop java_class, klassOop klass);
 192   // compiler support for class operations
 193   static int klass_offset_in_bytes() { return klass_offset; }
 194   static int resolved_constructor_offset_in_bytes() { return resolved_constructor_offset; }
 195   static int array_klass_offset_in_bytes() { return array_klass_offset; }
 196   // Support for classRedefinedCount field
 197   static int classRedefinedCount(oop the_class_mirror);
 198   static void set_classRedefinedCount(oop the_class_mirror, int value);
 199   // Support for parallelCapable field
 200   static bool parallelCapable(oop the_class_mirror);
 201 
 202   static int oop_size(oop java_class);
 203   static void set_oop_size(oop java_class, int size);
 204   static int static_oop_field_size(oop java_class);
 205   static void set_static_oop_field_size(oop java_class, int size);
 206 
 207   // Debugging
 208   friend class JavaClasses;
 209   friend class instanceKlass;   // verification code accesses offsets
 210   friend class ClassFileParser; // access to number_of_fake_fields
 211 };
 212 
 213 // Interface to java.lang.Thread objects
 214 
 215 class java_lang_Thread : AllStatic {
 216  private:
 217   // Note that for this class the layout changed between JDK1.2 and JDK1.3,
 218   // so we compute the offsets at startup rather than hard-wiring them.
 219   static int _name_offset;
 220   static int _group_offset;
 221   static int _contextClassLoader_offset;
 222   static int _inheritedAccessControlContext_offset;
 223   static int _priority_offset;
 224   static int _eetop_offset;
 225   static int _daemon_offset;
 226   static int _stillborn_offset;
 227   static int _stackSize_offset;
 228   static int _tid_offset;
 229   static int _thread_status_offset;
 230   static int _park_blocker_offset;
 231   static int _park_event_offset ;
 232 
 233   static void compute_offsets();
 234 
 235  public:
 236   // Instance creation
 237   static oop create();
 238   // Returns the JavaThread associated with the thread obj
 239   static JavaThread* thread(oop java_thread);
 240   // Set JavaThread for instance
 241   static void set_thread(oop java_thread, JavaThread* thread);
 242   // Name
 243   static typeArrayOop name(oop java_thread);
 244   static void set_name(oop java_thread, typeArrayOop name);
 245   // Priority
 246   static ThreadPriority priority(oop java_thread);
 247   static void set_priority(oop java_thread, ThreadPriority priority);
 248   // Thread group
 249   static oop  threadGroup(oop java_thread);
 250   // Stillborn
 251   static bool is_stillborn(oop java_thread);
 252   static void set_stillborn(oop java_thread);
 253   // Alive (NOTE: this is not really a field, but provides the correct
 254   // definition without doing a Java call)
 255   static bool is_alive(oop java_thread);
 256   // Daemon
 257   static bool is_daemon(oop java_thread);
 258   static void set_daemon(oop java_thread);
 259   // Context ClassLoader
 260   static oop context_class_loader(oop java_thread);
 261   // Control context
 262   static oop inherited_access_control_context(oop java_thread);
 263   // Stack size hint
 264   static jlong stackSize(oop java_thread);
 265   // Thread ID
 266   static jlong thread_id(oop java_thread);
 267 
 268   // Blocker object responsible for thread parking
 269   static oop park_blocker(oop java_thread);
 270 
 271   // Pointer to type-stable park handler, encoded as jlong.
 272   // Should be set when apparently null
 273   // For details, see unsafe.cpp Unsafe_Unpark
 274   static jlong park_event(oop java_thread);
 275   static bool set_park_event(oop java_thread, jlong ptr);
 276 
 277   // Java Thread Status for JVMTI and M&M use.
 278   // This thread status info is saved in threadStatus field of
 279   // java.lang.Thread java class.
 280   enum ThreadStatus {
 281     NEW                      = 0,
 282     RUNNABLE                 = JVMTI_THREAD_STATE_ALIVE +          // runnable / running
 283                                JVMTI_THREAD_STATE_RUNNABLE,
 284     SLEEPING                 = JVMTI_THREAD_STATE_ALIVE +          // Thread.sleep()
 285                                JVMTI_THREAD_STATE_WAITING +
 286                                JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +
 287                                JVMTI_THREAD_STATE_SLEEPING,
 288     IN_OBJECT_WAIT           = JVMTI_THREAD_STATE_ALIVE +          // Object.wait()
 289                                JVMTI_THREAD_STATE_WAITING +
 290                                JVMTI_THREAD_STATE_WAITING_INDEFINITELY +
 291                                JVMTI_THREAD_STATE_IN_OBJECT_WAIT,
 292     IN_OBJECT_WAIT_TIMED     = JVMTI_THREAD_STATE_ALIVE +          // Object.wait(long)
 293                                JVMTI_THREAD_STATE_WAITING +
 294                                JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +
 295                                JVMTI_THREAD_STATE_IN_OBJECT_WAIT,
 296     PARKED                   = JVMTI_THREAD_STATE_ALIVE +          // LockSupport.park()
 297                                JVMTI_THREAD_STATE_WAITING +
 298                                JVMTI_THREAD_STATE_WAITING_INDEFINITELY +
 299                                JVMTI_THREAD_STATE_PARKED,
 300     PARKED_TIMED             = JVMTI_THREAD_STATE_ALIVE +          // LockSupport.park(long)
 301                                JVMTI_THREAD_STATE_WAITING +
 302                                JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT +
 303                                JVMTI_THREAD_STATE_PARKED,
 304     BLOCKED_ON_MONITOR_ENTER = JVMTI_THREAD_STATE_ALIVE +          // (re-)entering a synchronization block
 305                                JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER,
 306     TERMINATED               = JVMTI_THREAD_STATE_TERMINATED
 307   };
 308   // Write thread status info to threadStatus field of java.lang.Thread.
 309   static void set_thread_status(oop java_thread_oop, ThreadStatus status);
 310   // Read thread status info from threadStatus field of java.lang.Thread.
 311   static ThreadStatus get_thread_status(oop java_thread_oop);
 312 
 313   static const char*  thread_status_name(oop java_thread_oop);
 314 
 315   // Debugging
 316   friend class JavaClasses;
 317 };
 318 
 319 // Interface to java.lang.ThreadGroup objects
 320 
 321 class java_lang_ThreadGroup : AllStatic {
 322  private:
 323   static int _parent_offset;
 324   static int _name_offset;
 325   static int _threads_offset;
 326   static int _groups_offset;
 327   static int _maxPriority_offset;
 328   static int _destroyed_offset;
 329   static int _daemon_offset;
 330   static int _vmAllowSuspension_offset;
 331   static int _nthreads_offset;
 332   static int _ngroups_offset;
 333 
 334   static void compute_offsets();
 335 
 336  public:
 337   // parent ThreadGroup
 338   static oop  parent(oop java_thread_group);
 339   // name
 340   static typeArrayOop name(oop java_thread_group);
 341   // ("name as oop" accessor is not necessary)
 342   // Number of threads in group
 343   static int nthreads(oop java_thread_group);
 344   // threads
 345   static objArrayOop threads(oop java_thread_group);
 346   // Number of threads in group
 347   static int ngroups(oop java_thread_group);
 348   // groups
 349   static objArrayOop groups(oop java_thread_group);
 350   // maxPriority in group
 351   static ThreadPriority maxPriority(oop java_thread_group);
 352   // Destroyed
 353   static bool is_destroyed(oop java_thread_group);
 354   // Daemon
 355   static bool is_daemon(oop java_thread_group);
 356   // vmAllowSuspension
 357   static bool is_vmAllowSuspension(oop java_thread_group);
 358   // Debugging
 359   friend class JavaClasses;
 360 };
 361 
 362 
 363 
 364 // Interface to java.lang.Throwable objects
 365 
 366 class java_lang_Throwable: AllStatic {
 367   friend class BacktraceBuilder;
 368 
 369  private:
 370   // Offsets
 371   enum {
 372     hc_backtrace_offset     =  0,
 373     hc_detailMessage_offset =  1,
 374     hc_cause_offset         =  2,  // New since 1.4
 375     hc_stackTrace_offset    =  3   // New since 1.4
 376   };
 377   // Trace constants
 378   enum {
 379     trace_methods_offset = 0,
 380     trace_bcis_offset    = 1,
 381     trace_next_offset    = 2,
 382     trace_size           = 3,
 383     trace_chunk_size     = 32
 384   };
 385 
 386   static int backtrace_offset;
 387   static int detailMessage_offset;
 388   static int cause_offset;
 389   static int stackTrace_offset;
 390 
 391   // Printing
 392   static char* print_stack_element_to_buffer(methodOop method, int bci);
 393   static void print_to_stream(Handle stream, const char* str);
 394   // StackTrace (programmatic access, new since 1.4)
 395   static void clear_stacktrace(oop throwable);
 396   // No stack trace available
 397   static const char* no_stack_trace_message();
 398 
 399  public:
 400   // Backtrace
 401   static oop backtrace(oop throwable);
 402   static void set_backtrace(oop throwable, oop value);
 403   // Needed by JVMTI to filter out this internal field.
 404   static int get_backtrace_offset() { return backtrace_offset;}
 405   static int get_detailMessage_offset() { return detailMessage_offset;}
 406   // Message
 407   static oop message(oop throwable);
 408   static oop message(Handle throwable);
 409   static void set_message(oop throwable, oop value);
 410   // Print stack trace stored in exception by call-back to Java
 411   // Note: this is no longer used in Merlin, but we still suppport
 412   // it for compatibility.
 413   static void print_stack_trace(oop throwable, oop print_stream);
 414   static void print_stack_element(Handle stream, methodOop method, int bci);
 415   static void print_stack_element(outputStream *st, methodOop method, int bci);
 416   static void print_stack_usage(Handle stream);
 417 
 418   // Allocate space for backtrace (created but stack trace not filled in)
 419   static void allocate_backtrace(Handle throwable, TRAPS);
 420   // Fill in current stack trace for throwable with preallocated backtrace (no GC)
 421   static void fill_in_stack_trace_of_preallocated_backtrace(Handle throwable);
 422 
 423   // Fill in current stack trace, can cause GC
 424   static void fill_in_stack_trace(Handle throwable, TRAPS);
 425   static void fill_in_stack_trace(Handle throwable);
 426   // Programmatic access to stack trace
 427   static oop  get_stack_trace_element(oop throwable, int index, TRAPS);
 428   static int  get_stack_trace_depth(oop throwable, TRAPS);
 429   // Printing
 430   static void print(oop throwable, outputStream* st);
 431   static void print(Handle throwable, outputStream* st);
 432   static void print_stack_trace(oop throwable, outputStream* st);
 433   // Debugging
 434   friend class JavaClasses;
 435 };
 436 
 437 
 438 // Interface to java.lang.reflect.AccessibleObject objects
 439 
 440 class java_lang_reflect_AccessibleObject: AllStatic {
 441  private:
 442   // Note that to reduce dependencies on the JDK we compute these
 443   // offsets at run-time.
 444   static int override_offset;
 445 
 446   static void compute_offsets();
 447 
 448  public:
 449   // Accessors
 450   static jboolean override(oop reflect);
 451   static void set_override(oop reflect, jboolean value);
 452 
 453   // Debugging
 454   friend class JavaClasses;
 455 };
 456 
 457 
 458 // Interface to java.lang.reflect.Method objects
 459 
 460 class java_lang_reflect_Method : public java_lang_reflect_AccessibleObject {
 461  private:
 462   // Note that to reduce dependencies on the JDK we compute these
 463   // offsets at run-time.
 464   static int clazz_offset;
 465   static int name_offset;
 466   static int returnType_offset;
 467   static int parameterTypes_offset;
 468   static int exceptionTypes_offset;
 469   static int slot_offset;
 470   static int modifiers_offset;
 471   static int signature_offset;
 472   static int annotations_offset;
 473   static int parameter_annotations_offset;
 474   static int annotation_default_offset;
 475 
 476   static void compute_offsets();
 477 
 478  public:
 479   // Allocation
 480   static Handle create(TRAPS);
 481 
 482   // Accessors
 483   static oop clazz(oop reflect);
 484   static void set_clazz(oop reflect, oop value);
 485 
 486   static oop name(oop method);
 487   static void set_name(oop method, oop value);
 488 
 489   static oop return_type(oop method);
 490   static void set_return_type(oop method, oop value);
 491 
 492   static oop parameter_types(oop method);
 493   static void set_parameter_types(oop method, oop value);
 494 
 495   static oop exception_types(oop method);
 496   static void set_exception_types(oop method, oop value);
 497 
 498   static int slot(oop reflect);
 499   static void set_slot(oop reflect, int value);
 500 
 501   static int modifiers(oop method);
 502   static void set_modifiers(oop method, int value);
 503 
 504   static bool has_signature_field();
 505   static oop signature(oop method);
 506   static void set_signature(oop method, oop value);
 507 
 508   static bool has_annotations_field();
 509   static oop annotations(oop method);
 510   static void set_annotations(oop method, oop value);
 511 
 512   static bool has_parameter_annotations_field();
 513   static oop parameter_annotations(oop method);
 514   static void set_parameter_annotations(oop method, oop value);
 515 
 516   static bool has_annotation_default_field();
 517   static oop annotation_default(oop method);
 518   static void set_annotation_default(oop method, oop value);
 519 
 520   // Debugging
 521   friend class JavaClasses;
 522 };
 523 
 524 
 525 // Interface to java.lang.reflect.Constructor objects
 526 
 527 class java_lang_reflect_Constructor : public java_lang_reflect_AccessibleObject {
 528  private:
 529   // Note that to reduce dependencies on the JDK we compute these
 530   // offsets at run-time.
 531   static int clazz_offset;
 532   static int parameterTypes_offset;
 533   static int exceptionTypes_offset;
 534   static int slot_offset;
 535   static int modifiers_offset;
 536   static int signature_offset;
 537   static int annotations_offset;
 538   static int parameter_annotations_offset;
 539 
 540   static void compute_offsets();
 541 
 542  public:
 543   // Allocation
 544   static Handle create(TRAPS);
 545 
 546   // Accessors
 547   static oop clazz(oop reflect);
 548   static void set_clazz(oop reflect, oop value);
 549 
 550   static oop parameter_types(oop constructor);
 551   static void set_parameter_types(oop constructor, oop value);
 552 
 553   static oop exception_types(oop constructor);
 554   static void set_exception_types(oop constructor, oop value);
 555 
 556   static int slot(oop reflect);
 557   static void set_slot(oop reflect, int value);
 558 
 559   static int modifiers(oop constructor);
 560   static void set_modifiers(oop constructor, int value);
 561 
 562   static bool has_signature_field();
 563   static oop signature(oop constructor);
 564   static void set_signature(oop constructor, oop value);
 565 
 566   static bool has_annotations_field();
 567   static oop annotations(oop constructor);
 568   static void set_annotations(oop constructor, oop value);
 569 
 570   static bool has_parameter_annotations_field();
 571   static oop parameter_annotations(oop method);
 572   static void set_parameter_annotations(oop method, oop value);
 573 
 574   // Debugging
 575   friend class JavaClasses;
 576 };
 577 
 578 
 579 // Interface to java.lang.reflect.Field objects
 580 
 581 class java_lang_reflect_Field : public java_lang_reflect_AccessibleObject {
 582  private:
 583   // Note that to reduce dependencies on the JDK we compute these
 584   // offsets at run-time.
 585   static int clazz_offset;
 586   static int name_offset;
 587   static int type_offset;
 588   static int slot_offset;
 589   static int modifiers_offset;
 590   static int signature_offset;
 591   static int annotations_offset;
 592 
 593   static void compute_offsets();
 594 
 595  public:
 596   // Allocation
 597   static Handle create(TRAPS);
 598 
 599   // Accessors
 600   static oop clazz(oop reflect);
 601   static void set_clazz(oop reflect, oop value);
 602 
 603   static oop name(oop field);
 604   static void set_name(oop field, oop value);
 605 
 606   static oop type(oop field);
 607   static void set_type(oop field, oop value);
 608 
 609   static int slot(oop reflect);
 610   static void set_slot(oop reflect, int value);
 611 
 612   static int modifiers(oop field);
 613   static void set_modifiers(oop field, int value);
 614 
 615   static bool has_signature_field();
 616   static oop signature(oop constructor);
 617   static void set_signature(oop constructor, oop value);
 618 
 619   static bool has_annotations_field();
 620   static oop annotations(oop constructor);
 621   static void set_annotations(oop constructor, oop value);
 622 
 623   static bool has_parameter_annotations_field();
 624   static oop parameter_annotations(oop method);
 625   static void set_parameter_annotations(oop method, oop value);
 626 
 627   static bool has_annotation_default_field();
 628   static oop annotation_default(oop method);
 629   static void set_annotation_default(oop method, oop value);
 630 
 631   // Debugging
 632   friend class JavaClasses;
 633 };
 634 
 635 // Interface to sun.reflect.ConstantPool objects
 636 class sun_reflect_ConstantPool {
 637  private:
 638   // Note that to reduce dependencies on the JDK we compute these
 639   // offsets at run-time.
 640   static int _cp_oop_offset;
 641 
 642   static void compute_offsets();
 643 
 644  public:
 645   // Allocation
 646   static Handle create(TRAPS);
 647 
 648   // Accessors
 649   static oop cp_oop(oop reflect);
 650   static void set_cp_oop(oop reflect, oop value);
 651   static int cp_oop_offset() {
 652     return _cp_oop_offset;
 653   }
 654 
 655   // Debugging
 656   friend class JavaClasses;
 657 };
 658 
 659 // Interface to sun.reflect.UnsafeStaticFieldAccessorImpl objects
 660 class sun_reflect_UnsafeStaticFieldAccessorImpl {
 661  private:
 662   static int _base_offset;
 663   static void compute_offsets();
 664 
 665  public:
 666   static int base_offset() {
 667     return _base_offset;
 668   }
 669 
 670   // Debugging
 671   friend class JavaClasses;
 672 };
 673 
 674 // Interface to java.lang primitive type boxing objects:
 675 //  - java.lang.Boolean
 676 //  - java.lang.Character
 677 //  - java.lang.Float
 678 //  - java.lang.Double
 679 //  - java.lang.Byte
 680 //  - java.lang.Short
 681 //  - java.lang.Integer
 682 //  - java.lang.Long
 683 
 684 // This could be separated out into 8 individual classes.
 685 
 686 class java_lang_boxing_object: AllStatic {
 687  private:
 688   enum {
 689    hc_value_offset = 0
 690   };
 691   static int value_offset;
 692   static int long_value_offset;
 693 
 694   static oop initialize_and_allocate(BasicType type, TRAPS);
 695  public:
 696   // Allocation. Returns a boxed value, or NULL for invalid type.
 697   static oop create(BasicType type, jvalue* value, TRAPS);
 698   // Accessors. Returns the basic type being boxed, or T_ILLEGAL for invalid oop.
 699   static BasicType get_value(oop box, jvalue* value);
 700   static BasicType set_value(oop box, jvalue* value);
 701   static BasicType basic_type(oop box);
 702   static bool is_instance(oop box)                 { return basic_type(box) != T_ILLEGAL; }
 703   static bool is_instance(oop box, BasicType type) { return basic_type(box) == type; }
 704   static void print(oop box, outputStream* st)     { jvalue value;  print(get_value(box, &value), &value, st); }
 705   static void print(BasicType type, jvalue* value, outputStream* st);
 706 
 707   static int value_offset_in_bytes(BasicType type) {
 708     return ( type == T_LONG || type == T_DOUBLE ) ? long_value_offset :
 709                                                     value_offset;
 710   }
 711 
 712   // Debugging
 713   friend class JavaClasses;
 714 };
 715 
 716 
 717 
 718 // Interface to java.lang.ref.Reference objects
 719 
 720 class java_lang_ref_Reference: AllStatic {
 721  public:
 722   enum {
 723    hc_referent_offset   = 0,
 724    hc_queue_offset      = 1,
 725    hc_next_offset       = 2,
 726    hc_discovered_offset = 3  // Is not last, see SoftRefs.
 727   };
 728   enum {
 729    hc_static_lock_offset    = 0,
 730    hc_static_pending_offset = 1
 731   };
 732 
 733   static int referent_offset;
 734   static int queue_offset;
 735   static int next_offset;
 736   static int discovered_offset;
 737   static int static_lock_offset;
 738   static int static_pending_offset;
 739   static int number_of_fake_oop_fields;
 740 
 741   // Accessors
 742   static oop referent(oop ref) {
 743     return ref->obj_field(referent_offset);
 744   }
 745   static void set_referent(oop ref, oop value) {
 746     ref->obj_field_put(referent_offset, value);
 747   }
 748   static void set_referent_raw(oop ref, oop value) {
 749     ref->obj_field_raw_put(referent_offset, value);
 750   }
 751   static HeapWord* referent_addr(oop ref) {
 752     return ref->obj_field_addr<HeapWord>(referent_offset);
 753   }
 754   static oop next(oop ref) {
 755     return ref->obj_field(next_offset);
 756   }
 757   static void set_next(oop ref, oop value) {
 758     ref->obj_field_put(next_offset, value);
 759   }
 760   static void set_next_raw(oop ref, oop value) {
 761     ref->obj_field_raw_put(next_offset, value);
 762   }
 763   static HeapWord* next_addr(oop ref) {
 764     return ref->obj_field_addr<HeapWord>(next_offset);
 765   }
 766   static oop discovered(oop ref) {
 767     return ref->obj_field(discovered_offset);
 768   }
 769   static void set_discovered(oop ref, oop value) {
 770     ref->obj_field_put(discovered_offset, value);
 771   }
 772   static void set_discovered_raw(oop ref, oop value) {
 773     ref->obj_field_raw_put(discovered_offset, value);
 774   }
 775   static HeapWord* discovered_addr(oop ref) {
 776     return ref->obj_field_addr<HeapWord>(discovered_offset);
 777   }
 778   // Accessors for statics
 779   static oop  pending_list_lock();
 780   static oop  pending_list();
 781 
 782   static HeapWord*  pending_list_addr();
 783 };
 784 
 785 
 786 // Interface to java.lang.ref.SoftReference objects
 787 
 788 class java_lang_ref_SoftReference: public java_lang_ref_Reference {
 789  public:
 790   enum {
 791    // The timestamp is a long field and may need to be adjusted for alignment.
 792    hc_timestamp_offset  = hc_discovered_offset + 1
 793   };
 794   enum {
 795    hc_static_clock_offset = 0
 796   };
 797 
 798   static int timestamp_offset;
 799   static int static_clock_offset;
 800 
 801   // Accessors
 802   static jlong timestamp(oop ref);
 803 
 804   // Accessors for statics
 805   static jlong clock();
 806   static void set_clock(jlong value);
 807 };
 808 
 809 
 810 // Interface to java.dyn.MethodHandle objects
 811 
 812 class MethodHandleEntry;
 813 
 814 class java_dyn_MethodHandle: AllStatic {
 815   friend class JavaClasses;
 816 
 817  private:
 818   static int _vmentry_offset;           // assembly code trampoline for MH
 819   static int _vmtarget_offset;          // class-specific target reference
 820   static int _type_offset;              // the MethodType of this MH
 821   static int _vmslots_offset;           // OPTIONAL hoisted type.form.vmslots
 822 
 823   static void compute_offsets();
 824 
 825  public:
 826   // Accessors
 827   static oop            type(oop mh);
 828   static void       set_type(oop mh, oop mtype);
 829 
 830   static oop            vmtarget(oop mh);
 831   static void       set_vmtarget(oop mh, oop target);
 832 
 833   static MethodHandleEntry* vmentry(oop mh);
 834   static void       set_vmentry(oop mh, MethodHandleEntry* data);
 835 
 836   static int            vmslots(oop mh);
 837   static void      init_vmslots(oop mh);
 838   static int    compute_vmslots(oop mh);
 839 
 840   // Testers
 841   static bool is_subclass(klassOop klass) {
 842     return Klass::cast(klass)->is_subclass_of(SystemDictionary::MethodHandle_klass());
 843   }
 844   static bool is_instance(oop obj) {
 845     return obj != NULL && is_subclass(obj->klass());
 846   }
 847 
 848   // Accessors for code generation:
 849   static int type_offset_in_bytes()             { return _type_offset; }
 850   static int vmtarget_offset_in_bytes()         { return _vmtarget_offset; }
 851   static int vmentry_offset_in_bytes()          { return _vmentry_offset; }
 852   static int vmslots_offset_in_bytes()          { return _vmslots_offset; }
 853 };
 854 
 855 class sun_dyn_DirectMethodHandle: public java_dyn_MethodHandle {
 856   friend class JavaClasses;
 857 
 858  private:
 859   //         _vmtarget_offset;          // method   or class      or interface
 860   static int _vmindex_offset;           // negative or vtable idx or itable idx
 861   static void compute_offsets();
 862 
 863  public:
 864   // Accessors
 865   static int            vmindex(oop mh);
 866   static void       set_vmindex(oop mh, int index);
 867 
 868   // Testers
 869   static bool is_subclass(klassOop klass) {
 870     return Klass::cast(klass)->is_subclass_of(SystemDictionary::DirectMethodHandle_klass());
 871   }
 872   static bool is_instance(oop obj) {
 873     return obj != NULL && is_subclass(obj->klass());
 874   }
 875 
 876   // Accessors for code generation:
 877   static int vmindex_offset_in_bytes()          { return _vmindex_offset; }
 878 };
 879 
 880 class sun_dyn_BoundMethodHandle: public java_dyn_MethodHandle {
 881   friend class JavaClasses;
 882 
 883  private:
 884   static int _argument_offset;          // argument value bound into this MH
 885   static int _vmargslot_offset;         // relevant argument slot (<= vmslots)
 886   static void compute_offsets();
 887 
 888 public:
 889   static oop            argument(oop mh);
 890   static void       set_argument(oop mh, oop ref);
 891 
 892   static jint           vmargslot(oop mh);
 893   static void       set_vmargslot(oop mh, jint slot);
 894 
 895   // Testers
 896   static bool is_subclass(klassOop klass) {
 897     return Klass::cast(klass)->is_subclass_of(SystemDictionary::BoundMethodHandle_klass());
 898   }
 899   static bool is_instance(oop obj) {
 900     return obj != NULL && is_subclass(obj->klass());
 901   }
 902 
 903   static int argument_offset_in_bytes()         { return _argument_offset; }
 904   static int vmargslot_offset_in_bytes()        { return _vmargslot_offset; }
 905 };
 906 
 907 class sun_dyn_AdapterMethodHandle: public sun_dyn_BoundMethodHandle {
 908   friend class JavaClasses;
 909 
 910  private:
 911   static int _conversion_offset;        // type of conversion to apply
 912   static void compute_offsets();
 913 
 914  public:
 915   static int            conversion(oop mh);
 916   static void       set_conversion(oop mh, int conv);
 917 
 918   // Testers
 919   static bool is_subclass(klassOop klass) {
 920     return Klass::cast(klass)->is_subclass_of(SystemDictionary::AdapterMethodHandle_klass());
 921   }
 922   static bool is_instance(oop obj) {
 923     return obj != NULL && is_subclass(obj->klass());
 924   }
 925 
 926   // Relevant integer codes (keep these in synch. with MethodHandleNatives.Constants):
 927   enum {
 928     OP_RETYPE_ONLY   = 0x0, // no argument changes; straight retype
 929     OP_RETYPE_RAW    = 0x1, // straight retype, trusted (void->int, Object->T)
 930     OP_CHECK_CAST    = 0x2, // ref-to-ref conversion; requires a Class argument
 931     OP_PRIM_TO_PRIM  = 0x3, // converts from one primitive to another
 932     OP_REF_TO_PRIM   = 0x4, // unboxes a wrapper to produce a primitive
 933     OP_PRIM_TO_REF   = 0x5, // boxes a primitive into a wrapper (NYI)
 934     OP_SWAP_ARGS     = 0x6, // swap arguments (vminfo is 2nd arg)
 935     OP_ROT_ARGS      = 0x7, // rotate arguments (vminfo is displaced arg)
 936     OP_DUP_ARGS      = 0x8, // duplicates one or more arguments (at TOS)
 937     OP_DROP_ARGS     = 0x9, // remove one or more argument slots
 938     OP_COLLECT_ARGS  = 0xA, // combine one or more arguments into a varargs (NYI)
 939     OP_SPREAD_ARGS   = 0xB, // expand in place a varargs array (of known size)
 940     OP_FLYBY         = 0xC, // operate first on reified argument list (NYI)
 941     OP_RICOCHET      = 0xD, // run an adapter chain on the return value (NYI)
 942     CONV_OP_LIMIT    = 0xE, // limit of CONV_OP enumeration
 943 
 944     CONV_OP_MASK     = 0xF00, // this nybble contains the conversion op field
 945     CONV_VMINFO_MASK = 0x0FF, // LSB is reserved for JVM use
 946     CONV_VMINFO_SHIFT     =  0, // position of bits in CONV_VMINFO_MASK
 947     CONV_OP_SHIFT         =  8, // position of bits in CONV_OP_MASK
 948     CONV_DEST_TYPE_SHIFT  = 12, // byte 2 has the adapter BasicType (if needed)
 949     CONV_SRC_TYPE_SHIFT   = 16, // byte 2 has the source BasicType (if needed)
 950     CONV_STACK_MOVE_SHIFT = 20, // high 12 bits give signed SP change
 951     CONV_STACK_MOVE_MASK  = (1 << (32 - CONV_STACK_MOVE_SHIFT)) - 1
 952   };
 953 
 954   static int conversion_offset_in_bytes()       { return _conversion_offset; }
 955 };
 956 
 957 
 958 // Interface to sun.dyn.MemberName objects
 959 // (These are a private interface for Java code to query the class hierarchy.)
 960 
 961 class sun_dyn_MemberName: AllStatic {
 962   friend class JavaClasses;
 963 
 964  private:
 965   // From java.dyn.MemberName:
 966   //    private Class<?>   clazz;       // class in which the method is defined
 967   //    private String     name;        // may be null if not yet materialized
 968   //    private Object     type;        // may be null if not yet materialized
 969   //    private int        flags;       // modifier bits; see reflect.Modifier
 970   //    private Object     vmtarget;    // VM-specific target value
 971   //    private int        vmindex;     // method index within class or interface
 972   static int _clazz_offset;
 973   static int _name_offset;
 974   static int _type_offset;
 975   static int _flags_offset;
 976   static int _vmtarget_offset;
 977   static int _vmindex_offset;
 978 
 979   static void compute_offsets();
 980 
 981  public:
 982   // Accessors
 983   static oop            clazz(oop mname);
 984   static void       set_clazz(oop mname, oop clazz);
 985 
 986   static oop            type(oop mname);
 987   static void       set_type(oop mname, oop type);
 988 
 989   static oop            name(oop mname);
 990   static void       set_name(oop mname, oop name);
 991 
 992   static int            flags(oop mname);
 993   static void       set_flags(oop mname, int flags);
 994 
 995   static int            modifiers(oop mname) { return (u2) flags(mname); }
 996   static void       set_modifiers(oop mname, int mods)
 997                                 { set_flags(mname, (flags(mname) &~ (u2)-1) | (u2)mods); }
 998 
 999   static oop            vmtarget(oop mname);
1000   static void       set_vmtarget(oop mname, oop target);
1001 
1002   static int            vmindex(oop mname);
1003   static void       set_vmindex(oop mname, int index);
1004 
1005   // Testers
1006   static bool is_subclass(klassOop klass) {
1007     return Klass::cast(klass)->is_subclass_of(SystemDictionary::MemberName_klass());
1008   }
1009   static bool is_instance(oop obj) {
1010     return obj != NULL && is_subclass(obj->klass());
1011   }
1012 
1013   // Relevant integer codes (keep these in synch. with MethodHandleNatives.Constants):
1014   enum {
1015     MN_IS_METHOD           = 0x00010000, // method (not constructor)
1016     MN_IS_CONSTRUCTOR      = 0x00020000, // constructor
1017     MN_IS_FIELD            = 0x00040000, // field
1018     MN_IS_TYPE             = 0x00080000, // nested type
1019     MN_SEARCH_SUPERCLASSES = 0x00100000, // for MHN.getMembers
1020     MN_SEARCH_INTERFACES   = 0x00200000, // for MHN.getMembers
1021     VM_INDEX_UNINITIALIZED = -99
1022   };
1023 
1024   // Accessors for code generation:
1025   static int clazz_offset_in_bytes()            { return _clazz_offset; }
1026   static int type_offset_in_bytes()             { return _type_offset; }
1027   static int name_offset_in_bytes()             { return _name_offset; }
1028   static int flags_offset_in_bytes()            { return _flags_offset; }
1029   static int vmtarget_offset_in_bytes()         { return _vmtarget_offset; }
1030   static int vmindex_offset_in_bytes()          { return _vmindex_offset; }
1031 };
1032 
1033 
1034 // Interface to java.dyn.MethodType objects
1035 
1036 class java_dyn_MethodType: AllStatic {
1037   friend class JavaClasses;
1038 
1039  private:
1040   static int _rtype_offset;
1041   static int _ptypes_offset;
1042   static int _form_offset;
1043 
1044   static void compute_offsets();
1045 
1046  public:
1047   // Accessors
1048   static oop            rtype(oop mt);
1049   static objArrayOop    ptypes(oop mt);
1050   static oop            form(oop mt);
1051 
1052   static oop            ptype(oop mt, int index);
1053   static int            ptype_count(oop mt);
1054 
1055   static Symbol*        as_signature(oop mt, bool intern_if_not_found, TRAPS);
1056   static void           print_signature(oop mt, outputStream* st);
1057 
1058   static bool is_instance(oop obj) {
1059     return obj != NULL && obj->klass() == SystemDictionary::MethodType_klass();
1060   }
1061 
1062   // Accessors for code generation:
1063   static int rtype_offset_in_bytes()            { return _rtype_offset; }
1064   static int ptypes_offset_in_bytes()           { return _ptypes_offset; }
1065   static int form_offset_in_bytes()             { return _form_offset; }
1066 };
1067 
1068 class java_dyn_MethodTypeForm: AllStatic {
1069   friend class JavaClasses;
1070 
1071  private:
1072   static int _vmslots_offset;           // number of argument slots needed
1073   static int _erasedType_offset;        // erasedType = canonical MethodType
1074   static int _genericInvoker_offset;    // genericInvoker = adapter for invokeGeneric
1075 
1076   static void compute_offsets();
1077 
1078  public:
1079   // Accessors
1080   static int            vmslots(oop mtform);
1081   static oop            erasedType(oop mtform);
1082   static oop            genericInvoker(oop mtform);
1083 
1084   // Accessors for code generation:
1085   static int vmslots_offset_in_bytes()          { return _vmslots_offset; }
1086   static int erasedType_offset_in_bytes()       { return _erasedType_offset; }
1087   static int genericInvoker_offset_in_bytes()   { return _genericInvoker_offset; }
1088 };
1089 
1090 
1091 // Interface to java.dyn.CallSite objects
1092 
1093 class java_dyn_CallSite: AllStatic {
1094   friend class JavaClasses;
1095 
1096 private:
1097   static int _target_offset;
1098   static int _caller_method_offset;
1099   static int _caller_bci_offset;
1100 
1101   static void compute_offsets();
1102 
1103 public:
1104   // Accessors
1105   static oop            target(oop site);
1106   static void       set_target(oop site, oop target);
1107 
1108   static oop            caller_method(oop site);
1109   static void       set_caller_method(oop site, oop ref);
1110 
1111   static jint           caller_bci(oop site);
1112   static void       set_caller_bci(oop site, jint bci);
1113 
1114   // Testers
1115   static bool is_subclass(klassOop klass) {
1116     return Klass::cast(klass)->is_subclass_of(SystemDictionary::CallSite_klass());
1117   }
1118   static bool is_instance(oop obj) {
1119     return obj != NULL && is_subclass(obj->klass());
1120   }
1121 
1122   // Accessors for code generation:
1123   static int target_offset_in_bytes()           { return _target_offset; }
1124   static int caller_method_offset_in_bytes()    { return _caller_method_offset; }
1125   static int caller_bci_offset_in_bytes()       { return _caller_bci_offset; }
1126 };
1127 
1128 
1129 // Interface to java.security.AccessControlContext objects
1130 
1131 class java_security_AccessControlContext: AllStatic {
1132  private:
1133   // Note that for this class the layout changed between JDK1.2 and JDK1.3,
1134   // so we compute the offsets at startup rather than hard-wiring them.
1135   static int _context_offset;
1136   static int _privilegedContext_offset;
1137   static int _isPrivileged_offset;
1138 
1139   static void compute_offsets();
1140  public:
1141   static oop create(objArrayHandle context, bool isPrivileged, Handle privileged_context, TRAPS);
1142 
1143   // Debugging/initialization
1144   friend class JavaClasses;
1145 };
1146 
1147 
1148 // Interface to java.lang.ClassLoader objects
1149 
1150 class java_lang_ClassLoader : AllStatic {
1151  private:
1152   enum {
1153    hc_parent_offset = 0
1154   };
1155 
1156   static int parent_offset;
1157 
1158  public:
1159   static oop parent(oop loader);
1160 
1161   static bool is_trusted_loader(oop loader);
1162 
1163   // Fix for 4474172
1164   static oop  non_reflection_class_loader(oop loader);
1165 
1166   // Debugging
1167   friend class JavaClasses;
1168 };
1169 
1170 
1171 // Interface to java.lang.System objects
1172 
1173 class java_lang_System : AllStatic {
1174  private:
1175   enum {
1176    hc_static_in_offset  = 0,
1177    hc_static_out_offset = 1,
1178    hc_static_err_offset = 2
1179   };
1180 
1181   static int  static_in_offset;
1182   static int static_out_offset;
1183   static int static_err_offset;
1184 
1185  public:
1186   static int  in_offset_in_bytes();
1187   static int out_offset_in_bytes();
1188   static int err_offset_in_bytes();
1189 
1190   // Debugging
1191   friend class JavaClasses;
1192 };
1193 
1194 
1195 // Interface to java.lang.StackTraceElement objects
1196 
1197 class java_lang_StackTraceElement: AllStatic {
1198  private:
1199   enum {
1200     hc_declaringClass_offset  = 0,
1201     hc_methodName_offset = 1,
1202     hc_fileName_offset   = 2,
1203     hc_lineNumber_offset = 3
1204   };
1205 
1206   static int declaringClass_offset;
1207   static int methodName_offset;
1208   static int fileName_offset;
1209   static int lineNumber_offset;
1210 
1211  public:
1212   // Setters
1213   static void set_declaringClass(oop element, oop value);
1214   static void set_methodName(oop element, oop value);
1215   static void set_fileName(oop element, oop value);
1216   static void set_lineNumber(oop element, int value);
1217 
1218   // Create an instance of StackTraceElement
1219   static oop create(methodHandle m, int bci, TRAPS);
1220 
1221   // Debugging
1222   friend class JavaClasses;
1223 };
1224 
1225 
1226 // Interface to java.lang.AssertionStatusDirectives objects
1227 
1228 class java_lang_AssertionStatusDirectives: AllStatic {
1229  private:
1230   enum {
1231     hc_classes_offset,
1232     hc_classEnabled_offset,
1233     hc_packages_offset,
1234     hc_packageEnabled_offset,
1235     hc_deflt_offset
1236   };
1237 
1238   static int classes_offset;
1239   static int classEnabled_offset;
1240   static int packages_offset;
1241   static int packageEnabled_offset;
1242   static int deflt_offset;
1243 
1244  public:
1245   // Setters
1246   static void set_classes(oop obj, oop val);
1247   static void set_classEnabled(oop obj, oop val);
1248   static void set_packages(oop obj, oop val);
1249   static void set_packageEnabled(oop obj, oop val);
1250   static void set_deflt(oop obj, bool val);
1251   // Debugging
1252   friend class JavaClasses;
1253 };
1254 
1255 
1256 class java_nio_Buffer: AllStatic {
1257  private:
1258   static int _limit_offset;
1259 
1260  public:
1261   static int  limit_offset();
1262   static void compute_offsets();
1263 };
1264 
1265 class sun_misc_AtomicLongCSImpl: AllStatic {
1266  private:
1267   static int _value_offset;
1268 
1269  public:
1270   static int  value_offset();
1271   static void compute_offsets();
1272 };
1273 
1274 class java_util_concurrent_locks_AbstractOwnableSynchronizer : AllStatic {
1275  private:
1276   static int  _owner_offset;
1277  public:
1278   static void initialize(TRAPS);
1279   static oop  get_owner_threadObj(oop obj);
1280 };
1281 
1282 // Interface to hard-coded offset checking
1283 
1284 class JavaClasses : AllStatic {
1285  private:
1286   static bool check_offset(const char *klass_name, int offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
1287   static bool check_static_offset(const char *klass_name, int hardcoded_offset, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
1288   static bool check_constant(const char *klass_name, int constant, const char *field_name, const char* field_sig) PRODUCT_RETURN0;
1289  public:
1290   static void compute_hard_coded_offsets();
1291   static void compute_offsets();
1292   static void check_offsets() PRODUCT_RETURN;
1293 };
1294 
1295 #endif // SHARE_VM_CLASSFILE_JAVACLASSES_HPP