1 /*
   2  * Copyright (c) 1999, 2019, 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_JVMCI_JVMCIENV_HPP
  26 #define SHARE_JVMCI_JVMCIENV_HPP
  27 
  28 #include "classfile/javaClasses.hpp"
  29 #include "jvmci/jvmciJavaClasses.hpp"
  30 #include "runtime/thread.hpp"
  31 
  32 class CompileTask;
  33 class JVMCIObject;
  34 class JVMCIObjectArray;
  35 class JVMCIPrimitiveArray;
  36 class JVMCICompiler;
  37 class JVMCIRuntime;
  38 
  39 #define JVMCI_EXCEPTION_CONTEXT \
  40   JavaThread* thread=JavaThread::current(); \
  41   Thread* THREAD = thread;
  42 
  43 // Helper to log more context on a JNI exception
  44 #define JVMCI_EXCEPTION_CHECK(env, ...) \
  45   do { \
  46     if (env->ExceptionCheck()) { \
  47       if (env != JavaThread::current()->jni_environment() && JVMCIEnv::get_shared_library_path() != NULL) { \
  48         tty->print_cr("In JVMCI shared library (%s):", JVMCIEnv::get_shared_library_path()); \
  49       } \
  50       tty->print_cr(__VA_ARGS__); \
  51       return; \
  52     } \
  53   } while(0)
  54 
  55 // Helper class to ensure that references to Klass* are kept alive for G1
  56 class JVMCIKlassHandle : public StackObj {
  57  private:
  58   Klass*     _klass;
  59   Handle     _holder;
  60   Thread*    _thread;
  61 
  62   Klass*        klass() const                     { return _klass; }
  63   Klass*        non_null_klass() const            { assert(_klass != NULL, "resolving NULL _klass"); return _klass; }
  64 
  65  public:
  66   /* Constructors */
  67   JVMCIKlassHandle (Thread* thread) : _klass(NULL), _thread(thread) {}
  68   JVMCIKlassHandle (Thread* thread, Klass* klass);
  69 
  70   JVMCIKlassHandle (const JVMCIKlassHandle &h): _klass(h._klass), _holder(h._holder), _thread(h._thread) {}
  71   JVMCIKlassHandle& operator=(const JVMCIKlassHandle &s);
  72   JVMCIKlassHandle& operator=(Klass* klass);
  73 
  74   /* Operators for ease of use */
  75   Klass*        operator () () const            { return klass(); }
  76   Klass*        operator -> () const            { return non_null_klass(); }
  77 
  78   bool    operator == (Klass* o) const          { return klass() == o; }
  79   bool    operator == (const JVMCIKlassHandle& h) const  { return klass() == h.klass(); }
  80 
  81   /* Null checks */
  82   bool    is_null() const                      { return _klass == NULL; }
  83   bool    not_null() const                     { return _klass != NULL; }
  84 };
  85 
  86 // A class that maintains the state needed for compilations requested
  87 // by the CompileBroker.  It is created in the broker and passed through
  88 // into the code installation step.
  89 class JVMCICompileState : public ResourceObj {
  90   friend class JVMCIVMStructs;
  91  private:
  92   CompileTask*     _task;
  93 
  94   // Cache JVMTI state. Defined as bytes so that reading them from Java
  95   // via Unsafe is well defined (the C++ type for bool is implementation
  96   // defined and may not be the same as a Java boolean).
  97   jbyte  _jvmti_can_hotswap_or_post_breakpoint;
  98   jbyte  _jvmti_can_access_local_variables;
  99   jbyte  _jvmti_can_post_on_exceptions;
 100   jbyte  _jvmti_can_pop_frame;
 101 
 102   // Compilation result values.
 103   bool             _retryable;
 104   const char*      _failure_reason;
 105 
 106   // Specifies if _failure_reason is on the C heap. If so, it is allocated
 107   // with the mtJVMCI NMT flag.
 108   bool             _failure_reason_on_C_heap;
 109 
 110  public:
 111   JVMCICompileState(CompileTask* task);
 112 
 113   CompileTask* task() { return _task; }
 114 
 115   bool  jvmti_state_changed() const;
 116   bool  jvmti_can_hotswap_or_post_breakpoint() const { return  _jvmti_can_hotswap_or_post_breakpoint != 0; }
 117   bool  jvmti_can_access_local_variables() const     { return  _jvmti_can_access_local_variables != 0; }
 118   bool  jvmti_can_post_on_exceptions() const         { return  _jvmti_can_post_on_exceptions != 0; }
 119   bool  jvmti_can_pop_frame() const                  { return  _jvmti_can_pop_frame != 0; }
 120 
 121   const char* failure_reason() { return _failure_reason; }
 122   bool failure_reason_on_C_heap() { return _failure_reason_on_C_heap; }
 123   bool retryable() { return _retryable; }
 124 
 125   void set_failure(bool retryable, const char* reason, bool reason_on_C_heap = false) {
 126     _failure_reason = reason;
 127     _failure_reason_on_C_heap = reason_on_C_heap;
 128     _retryable = retryable;
 129   }
 130 };
 131 
 132 
 133 // This class is a top level wrapper around interactions between HotSpot
 134 // and the JVMCI Java code.  It supports both a HotSpot heap based
 135 // runtime with HotSpot oop based accessors as well as a shared library
 136 // based runtime that is accessed through JNI. It abstracts away all
 137 // interactions with JVMCI objects so that a single version of the
 138 // HotSpot C++ code can can work with either runtime.
 139 class JVMCIEnv : public ResourceObj {
 140   friend class JNIAccessMark;
 141 
 142   static char*   _shared_library_path;   // argument to os:dll_load
 143   static void*   _shared_library_handle; // result of os::dll_load
 144   static JavaVM* _shared_library_javavm; // result of calling JNI_CreateJavaVM in shared library
 145 
 146   // Initializes the shared library JavaVM if not already initialized.
 147   // Returns the JNI interface pointer for the current thread
 148   // if initialization was performed by this call, NULL if
 149   // initialization was performed by a previous call.
 150   static JNIEnv* init_shared_library(JavaThread* thread);
 151 
 152   // Initializes the _env, _mode and _runtime fields.
 153   void init_env_mode_runtime(JavaThread* thread, JNIEnv* parent_env);
 154 
 155   void init(JavaThread* thread, bool is_hotspot, const char* file, int line);
 156 
 157   JNIEnv*                 _env;  // JNI env for calling into shared library
 158   bool     _pop_frame_on_close;  // Must pop frame on close?
 159   bool        _detach_on_close;  // Must detach on close?
 160   JVMCIRuntime*       _runtime;  // Access to a HotSpotJVMCIRuntime
 161   bool             _is_hotspot;  // Which heap is the HotSpotJVMCIRuntime in
 162   bool        _throw_to_caller;  // Propagate an exception raised in this env to the caller?
 163   const char*            _file;  // The file and ...
 164   int                    _line;  // ... line where this JNIEnv was created
 165 
 166   // Translates an exception on the HotSpot heap to an exception on
 167   // the shared library heap. The translation includes the stack and
 168   // causes of `throwable`. The translated exception is pending in the
 169   // shared library thread upon returning.
 170   void translate_hotspot_exception_to_jni_exception(JavaThread* THREAD, const Handle& throwable);
 171 
 172 public:
 173   // Opens a JVMCIEnv scope for a Java to VM call (e.g., via CompilerToVM).
 174   // An exception occurring within the scope is left pending when the
 175   // scope closes so that it will be propagated back to Java.
 176   // The JVMCIEnv destructor translates the exception object for the
 177   // Java runtime if necessary.
 178   JVMCIEnv(JavaThread* thread, JNIEnv* env, const char* file, int line);
 179 
 180   // Opens a JVMCIEnv scope for a compilation scheduled by the CompileBroker.
 181   // An exception occurring within the scope must not be propagated back to
 182   // the CompileBroker.
 183   JVMCIEnv(JavaThread* thread, JVMCICompileState* compile_state, const char* file, int line);
 184 
 185   // Opens a JNIEnv scope for a call from within the VM. An exception occurring
 186   // within the scope must not be propagated back to the caller.
 187   JVMCIEnv(JavaThread* env, const char* file, int line);
 188 
 189   // Opens a JNIEnv scope for accessing `for_object`. An exception occurring
 190   // within the scope must not be propagated back to the caller.
 191   JVMCIEnv(JavaThread* thread, JVMCIObject for_object, const char* file, int line) {
 192     // A JNI call to access an object in the shared library heap
 193     // can block or take a long time so do not allow such access
 194     // on the VM thread.
 195     assert(for_object.is_hotspot() || !Thread::current()->is_VM_thread(),
 196         "cannot open JVMCIEnv scope when in the VM thread for accessing a shared library heap object");
 197     init(thread, for_object.is_hotspot(), file, line);
 198   }
 199 
 200   // Opens a JNIEnv scope for the HotSpot runtime if `is_hotspot` is true
 201   // otherwise for the shared library runtime. An exception occurring
 202   // within the scope must not be propagated back to the caller.
 203   JVMCIEnv(JavaThread* thread, bool is_hotspot, const char* file, int line) {
 204     init(thread, is_hotspot, file, line);
 205   }
 206 
 207   ~JVMCIEnv();
 208 
 209   JVMCIRuntime* runtime() {
 210     return _runtime;
 211   }
 212 
 213   // Initializes Services.savedProperties in the shared library by copying
 214   // the values from the same field in the HotSpot heap.
 215   void copy_saved_properties();
 216 
 217   jboolean has_pending_exception();
 218   void clear_pending_exception();
 219 
 220   // Prints an exception and stack trace of a pending exception.
 221   void describe_pending_exception(bool clear);
 222 
 223   int get_length(JVMCIArray array);
 224 
 225   JVMCIObject get_object_at(JVMCIObjectArray array, int index);
 226   void put_object_at(JVMCIObjectArray array, int index, JVMCIObject value);
 227 
 228   jboolean get_bool_at(JVMCIPrimitiveArray array, int index);
 229   void put_bool_at(JVMCIPrimitiveArray array, int index, jboolean value);
 230 
 231   jbyte get_byte_at(JVMCIPrimitiveArray array, int index);
 232   void put_byte_at(JVMCIPrimitiveArray array, int index, jbyte value);
 233 
 234   jint get_int_at(JVMCIPrimitiveArray array, int index);
 235   void put_int_at(JVMCIPrimitiveArray array, int index, jint value);
 236 
 237   long get_long_at(JVMCIPrimitiveArray array, int index);
 238   void put_long_at(JVMCIPrimitiveArray array, int index, jlong value);
 239 
 240   void copy_bytes_to(JVMCIPrimitiveArray src, jbyte* dest, int offset, jsize length);
 241   void copy_bytes_from(jbyte* src, JVMCIPrimitiveArray dest, int offset, jsize length);
 242 
 243   void copy_longs_from(jlong* src, JVMCIPrimitiveArray dest, int offset, jsize length);
 244 
 245   JVMCIObjectArray initialize_intrinsics(JVMCI_TRAPS);
 246 
 247   jboolean is_boxing_object(BasicType type, JVMCIObject object);
 248 
 249   // Get the primitive value from a Java boxing object.  It's hard error to
 250   // pass a non-primitive BasicType.
 251   jvalue get_boxed_value(BasicType type, JVMCIObject object);
 252 
 253   // Return the BasicType of the object if it's a boxing object, otherwise return T_ILLEGAL.
 254   BasicType get_box_type(JVMCIObject object);
 255 
 256   // Create a boxing object of the appropriate primitive type.
 257   JVMCIObject create_box(BasicType type, jvalue* value, JVMCI_TRAPS);
 258 
 259   const char* as_utf8_string(JVMCIObject str);
 260   char* as_utf8_string(JVMCIObject str, char* buf, int buflen);
 261 
 262   JVMCIObject create_string(Symbol* str, JVMCI_TRAPS) {
 263     return create_string(str->as_C_string(), JVMCI_CHECK_(JVMCIObject()));
 264   }
 265 
 266   JVMCIObject create_string(const char* str, JVMCI_TRAPS);
 267 
 268   bool equals(JVMCIObject a, JVMCIObject b);
 269 
 270   // Convert into a JNI handle for the appropriate runtime
 271   jobject get_jobject(JVMCIObject object)                       { assert(object.as_jobject() == NULL || is_hotspot() == object.is_hotspot(), "mismatch"); return object.as_jobject(); }
 272   jarray get_jarray(JVMCIArray array)                           { assert(array.as_jobject() == NULL || is_hotspot() == array.is_hotspot(), "mismatch"); return array.as_jobject(); }
 273   jobjectArray get_jobjectArray(JVMCIObjectArray objectArray)   { assert(objectArray.as_jobject() == NULL || is_hotspot() == objectArray.is_hotspot(), "mismatch"); return objectArray.as_jobject(); }
 274   jbyteArray get_jbyteArray(JVMCIPrimitiveArray primitiveArray) { assert(primitiveArray.as_jobject() == NULL || is_hotspot() == primitiveArray.is_hotspot(), "mismatch"); return primitiveArray.as_jbyteArray(); }
 275 
 276   JVMCIObject         wrap(jobject obj);
 277   JVMCIObjectArray    wrap(jobjectArray obj)  { return (JVMCIObjectArray)    wrap((jobject) obj); }
 278   JVMCIPrimitiveArray wrap(jintArray obj)     { return (JVMCIPrimitiveArray) wrap((jobject) obj); }
 279   JVMCIPrimitiveArray wrap(jbooleanArray obj) { return (JVMCIPrimitiveArray) wrap((jobject) obj); }
 280   JVMCIPrimitiveArray wrap(jbyteArray obj)    { return (JVMCIPrimitiveArray) wrap((jobject) obj); }
 281   JVMCIPrimitiveArray wrap(jlongArray obj)    { return (JVMCIPrimitiveArray) wrap((jobject) obj); }
 282 
 283  private:
 284   JVMCIObject wrap(oop obj)                  { assert(is_hotspot(), "must be"); return wrap(JNIHandles::make_local(obj)); }
 285   JVMCIObjectArray wrap(objArrayOop obj)     { assert(is_hotspot(), "must be"); return (JVMCIObjectArray) wrap(JNIHandles::make_local(obj)); }
 286   JVMCIPrimitiveArray wrap(typeArrayOop obj) { assert(is_hotspot(), "must be"); return (JVMCIPrimitiveArray) wrap(JNIHandles::make_local(obj)); }
 287 
 288  public:
 289   // Compiles a method with the JVMIC compiler.
 290   // Caller must handle pending exception.
 291   JVMCIObject call_HotSpotJVMCIRuntime_compileMethod(JVMCIObject runtime, JVMCIObject method, int entry_bci,
 292                                                      jlong compile_state, int id);
 293 
 294   void call_HotSpotJVMCIRuntime_bootstrapFinished(JVMCIObject runtime, JVMCI_TRAPS);
 295   void call_HotSpotJVMCIRuntime_shutdown(JVMCIObject runtime);
 296   JVMCIObject call_HotSpotJVMCIRuntime_runtime(JVMCI_TRAPS);
 297   JVMCIObject call_JVMCI_getRuntime(JVMCI_TRAPS);
 298   JVMCIObject call_HotSpotJVMCIRuntime_getCompiler(JVMCIObject runtime, JVMCI_TRAPS);
 299 
 300   JVMCIObject call_HotSpotJVMCIRuntime_callToString(JVMCIObject object, JVMCI_TRAPS);
 301 
 302   JVMCIObject call_PrimitiveConstant_forTypeChar(jchar kind, jlong value, JVMCI_TRAPS);
 303   JVMCIObject call_JavaConstant_forFloat(float value, JVMCI_TRAPS);
 304   JVMCIObject call_JavaConstant_forDouble(double value, JVMCI_TRAPS);
 305 
 306   BasicType kindToBasicType(JVMCIObject kind, JVMCI_TRAPS);
 307 
 308 #define DO_THROW(name) \
 309   void throw_##name(const char* msg = NULL);
 310 
 311   DO_THROW(InternalError)
 312   DO_THROW(ArrayIndexOutOfBoundsException)
 313   DO_THROW(IllegalStateException)
 314   DO_THROW(NullPointerException)
 315   DO_THROW(IllegalArgumentException)
 316   DO_THROW(InvalidInstalledCodeException)
 317   DO_THROW(UnsatisfiedLinkError)
 318   DO_THROW(UnsupportedOperationException)
 319   DO_THROW(ClassNotFoundException)
 320 
 321 #undef DO_THROW
 322 
 323   void fthrow_error(const char* file, int line, const char* format, ...) ATTRIBUTE_PRINTF(4, 5);
 324 
 325   // Given an instance of HotSpotInstalledCode return the corresponding CodeBlob*
 326   CodeBlob* asCodeBlob(JVMCIObject code);
 327 
 328   nmethod* asNmethod(JVMCIObject code) {
 329     CodeBlob* cb = asCodeBlob(code);
 330     if (cb == NULL) {
 331       return NULL;
 332     }
 333     nmethod* nm = cb->as_nmethod_or_null();
 334     guarantee(nm != NULL, "not an nmethod");
 335     return nm;
 336   }
 337 
 338   MethodData* asMethodData(jlong metaspaceMethodData) {
 339     return (MethodData*) (address) metaspaceMethodData;
 340   }
 341 
 342   const char* klass_name(JVMCIObject object);
 343 
 344   // Unpack an instance of HotSpotResolvedJavaMethodImpl into the original Method*
 345   Method* asMethod(JVMCIObject jvmci_method);
 346   Method* asMethod(jobject jvmci_method) { return asMethod(wrap(jvmci_method)); }
 347 
 348   // Unpack an instance of HotSpotResolvedObjectTypeImpl into the original Klass*
 349   Klass* asKlass(JVMCIObject jvmci_type);
 350   Klass* asKlass(jobject jvmci_type)  { return asKlass(wrap(jvmci_type)); }
 351 
 352   JVMCIObject get_jvmci_method(const methodHandle& method, JVMCI_TRAPS);
 353 
 354   JVMCIObject get_jvmci_type(const JVMCIKlassHandle& klass, JVMCI_TRAPS);
 355 
 356   // Unpack an instance of HotSpotConstantPool into the original ConstantPool*
 357   ConstantPool* asConstantPool(JVMCIObject constant_pool);
 358   ConstantPool* asConstantPool(jobject constant_pool)  { return asConstantPool(wrap(constant_pool)); }
 359 
 360   JVMCIObject get_jvmci_constant_pool(const constantPoolHandle& cp, JVMCI_TRAPS);
 361   JVMCIObject get_jvmci_primitive_type(BasicType type);
 362 
 363   Handle asConstant(JVMCIObject object, JVMCI_TRAPS);
 364   JVMCIObject get_object_constant(oop objOop, bool compressed = false, bool dont_register = false);
 365 
 366   JVMCIPrimitiveArray new_booleanArray(int length, JVMCI_TRAPS);
 367   JVMCIPrimitiveArray new_byteArray(int length, JVMCI_TRAPS);
 368   JVMCIPrimitiveArray new_intArray(int length, JVMCI_TRAPS);
 369   JVMCIPrimitiveArray new_longArray(int length, JVMCI_TRAPS);
 370 
 371   JVMCIObjectArray new_byte_array_array(int length, JVMCI_TRAPS);
 372 
 373   JVMCIObject new_StackTraceElement(const methodHandle& method, int bci, JVMCI_TRAPS);
 374   JVMCIObject new_HotSpotNmethod(const methodHandle& method, const char* name, jboolean isDefault, jlong compileId, JVMCI_TRAPS);
 375   JVMCIObject new_VMField(JVMCIObject name, JVMCIObject type, jlong offset, jlong address, JVMCIObject value, JVMCI_TRAPS);
 376   JVMCIObject new_VMFlag(JVMCIObject name, JVMCIObject type, JVMCIObject value, JVMCI_TRAPS);
 377   JVMCIObject new_VMIntrinsicMethod(JVMCIObject declaringClass, JVMCIObject name, JVMCIObject descriptor, int id, JVMCI_TRAPS);
 378   JVMCIObject new_HotSpotStackFrameReference(JVMCI_TRAPS);
 379   JVMCIObject new_JVMCIError(JVMCI_TRAPS);
 380 
 381   jlong make_handle(const Handle& obj);
 382   oop resolve_handle(jlong objectHandle);
 383 
 384   // These are analagous to the JNI routines
 385   JVMCIObject make_local(JVMCIObject object);
 386   JVMCIObject make_global(JVMCIObject object);
 387   JVMCIObject make_weak(JVMCIObject object);
 388   void destroy_local(JVMCIObject object);
 389   void destroy_global(JVMCIObject object);
 390   void destroy_weak(JVMCIObject object);
 391 
 392   // Deoptimizes the nmethod (if any) in the HotSpotNmethod.address
 393   // field of mirror. The field is subsequently zeroed.
 394   void invalidate_nmethod_mirror(JVMCIObject mirror, JVMCI_TRAPS);
 395 
 396   void initialize_installed_code(JVMCIObject installed_code, CodeBlob* cb, JVMCI_TRAPS);
 397 
 398  private:
 399   JVMCICompileState* _compile_state;
 400 
 401  public:
 402   static JavaVM* get_shared_library_javavm() { return _shared_library_javavm; }
 403   static void* get_shared_library_handle()   { return _shared_library_handle; }
 404   static char* get_shared_library_path()     { return _shared_library_path; }
 405 
 406   // Determines if this is for the JVMCI runtime in the HotSpot
 407   // heap (true) or the shared library heap (false).
 408   bool is_hotspot() { return _is_hotspot; }
 409 
 410   JVMCICompileState* compile_state() { return _compile_state; }
 411   void set_compile_state(JVMCICompileState* compile_state) {
 412     assert(_compile_state == NULL, "set only once");
 413     _compile_state = compile_state;
 414   }
 415   // Generate declarations for the initialize, new, isa, get and set methods for all the types and
 416   // fields declared in the JVMCI_CLASSES_DO macro.
 417 
 418 #define START_CLASS(className, fullClassName)                           \
 419   void className##_initialize(JVMCI_TRAPS); \
 420   JVMCIObjectArray new_##className##_array(int length, JVMCI_TRAPS); \
 421   bool isa_##className(JVMCIObject object);
 422 
 423 #define END_CLASS
 424 
 425 #define FIELD(className, name, type, accessor)                                                                                                                         \
 426   type get_ ## className ## _ ## name(JVMCIObject obj); \
 427   void set_ ## className ## _ ## name(JVMCIObject obj, type x);
 428 
 429 #define OOPISH_FIELD(className, name, type, hstype, accessor) \
 430   FIELD(className, name, type, accessor)
 431 
 432 #define STATIC_FIELD(className, name, type) \
 433   type get_ ## className ## _ ## name(); \
 434   void set_ ## className ## _ ## name(type x);
 435 
 436 #define STATIC_OOPISH_FIELD(className, name, type, hstype) \
 437   STATIC_FIELD(className, name, type)
 438 
 439 #define EMPTY_CAST
 440 #define CHAR_FIELD(className,  name) FIELD(className, name, jchar, char_field)
 441 #define INT_FIELD(className,  name) FIELD(className, name, jint, int_field)
 442 #define BOOLEAN_FIELD(className,  name) FIELD(className, name, jboolean, bool_field)
 443 #define LONG_FIELD(className,  name) FIELD(className, name, jlong, long_field)
 444 #define FLOAT_FIELD(className,  name) FIELD(className, name, jfloat, float_field)
 445 #define OBJECT_FIELD(className,  name, signature) OOPISH_FIELD(className, name, JVMCIObject, oop, obj_field)
 446 #define OBJECTARRAY_FIELD(className,  name, signature) OOPISH_FIELD(className, name, JVMCIObjectArray, objArrayOop, obj_field)
 447 #define PRIMARRAY_FIELD(className,  name, signature) OOPISH_FIELD(className, name, JVMCIPrimitiveArray, typeArrayOop, obj_field)
 448 
 449 #define STATIC_INT_FIELD(className, name) STATIC_FIELD(className, name, jint)
 450 #define STATIC_BOOLEAN_FIELD(className, name) STATIC_FIELD(className, name, jboolean)
 451 #define STATIC_OBJECT_FIELD(className, name, signature) STATIC_OOPISH_FIELD(className, name, JVMCIObject, oop)
 452 #define STATIC_OBJECTARRAY_FIELD(className, name, signature) STATIC_OOPISH_FIELD(className, name, JVMCIObjectArray, objArrayOop)
 453 #define METHOD(jniCallType, jniGetMethod, hsCallType, returnType, className, methodName, signatureSymbolName, args)
 454 #define CONSTRUCTOR(className, signature)
 455 
 456   JVMCI_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, FLOAT_FIELD, OBJECT_FIELD, PRIMARRAY_FIELD, OBJECTARRAY_FIELD, STATIC_OBJECT_FIELD, STATIC_OBJECTARRAY_FIELD, STATIC_INT_FIELD, STATIC_BOOLEAN_FIELD, METHOD, CONSTRUCTOR)
 457 
 458 #undef JNI_START_CLASS
 459 #undef START_CLASS
 460 #undef END_CLASS
 461 #undef METHOD
 462 #undef CONSTRUCTOR
 463 #undef FIELD
 464 #undef CHAR_FIELD
 465 #undef INT_FIELD
 466 #undef BOOLEAN_FIELD
 467 #undef LONG_FIELD
 468 #undef FLOAT_FIELD
 469 #undef OBJECT_FIELD
 470 #undef PRIMARRAY_FIELD
 471 #undef OBJECTARRAY_FIELD
 472 #undef FIELD
 473 #undef OOPISH_FIELD
 474 #undef STATIC_FIELD
 475 #undef STATIC_OOPISH_FIELD
 476 #undef STATIC_FIELD
 477 #undef STATIC_OBJECT_FIELD
 478 #undef STATIC_OBJECTARRAY_FIELD
 479 #undef STATIC_INT_FIELD
 480 #undef STATIC_BOOLEAN_FIELD
 481 #undef EMPTY_CAST
 482 
 483   // End of JVMCIEnv
 484 };
 485 
 486 #endif // SHARE_JVMCI_JVMCIENV_HPP