261 jboolean transfer_pending_exception(JavaThread* THREAD, JVMCIEnv* peer_env);
262
263 // If there is a pending HotSpot exception, clears it and translates it to the shared library heap.
264 // The translated exception is pending in the shared library upon returning.
265 // Returns true if a pending exception was transferred, false otherwise.
266 static jboolean transfer_pending_exception_to_jni(JavaThread* THREAD, JVMCIEnv* hotspot_env, JVMCIEnv* jni_env);
267
268 // Prints the stack trace of a pending exception to `st` and clears the exception.
269 // If there is no pending exception, this is a nop.
270 void describe_pending_exception(outputStream* st);
271
272 // Gets the output of calling toString and/or printStactTrace on the pending exception.
273 // If to_string is not null, the output of toString is returned in it.
274 // If stack_trace is not null, the output of printStackTrace is returned in it.
275 // Returns false if there is no pending exception otherwise clears the pending
276 // exception and returns true.
277 bool pending_exception_as_string(const char** to_string, const char** stack_trace);
278
279 int get_length(JVMCIArray array);
280
281 JVMCIObject get_object_at(JVMCIObjectArray array, int index);
282 void put_object_at(JVMCIObjectArray array, int index, JVMCIObject value);
283
284 jboolean get_bool_at(JVMCIPrimitiveArray array, int index);
285 void put_bool_at(JVMCIPrimitiveArray array, int index, jboolean value);
286
287 jbyte get_byte_at(JVMCIPrimitiveArray array, int index);
288 void put_byte_at(JVMCIPrimitiveArray array, int index, jbyte value);
289
290 jint get_int_at(JVMCIPrimitiveArray array, int index);
291 void put_int_at(JVMCIPrimitiveArray array, int index, jint value);
292
293 jlong get_long_at(JVMCIPrimitiveArray array, int index);
294 void put_long_at(JVMCIPrimitiveArray array, int index, jlong value);
295
296 void copy_bytes_to(JVMCIPrimitiveArray src, jbyte* dest, int offset, jsize length);
297 void copy_bytes_from(jbyte* src, JVMCIPrimitiveArray dest, int offset, jsize length);
298
299 void copy_longs_from(jlong* src, JVMCIPrimitiveArray dest, int offset, jsize length);
300
301 JVMCIObjectArray initialize_intrinsics(JVMCI_TRAPS);
396 const char* klass_name(JVMCIObject object);
397
398 // Unpack an instance of HotSpotResolvedJavaMethodImpl into the original Method*
399 Method* asMethod(JVMCIObject jvmci_method);
400
401 // Unpack an instance of HotSpotResolvedObjectTypeImpl into the original Klass*
402 Klass* asKlass(JVMCIObject jvmci_type);
403
404 // Unpack an instance of HotSpotMethodData into the original MethodData*
405 MethodData* asMethodData(JVMCIObject jvmci_method_data);
406
407 JVMCIObject get_jvmci_method(const methodHandle& method, JVMCI_TRAPS);
408
409 JVMCIObject get_jvmci_type(const JVMCIKlassHandle& klass, JVMCI_TRAPS);
410
411 // Unpack an instance of HotSpotConstantPool into the original ConstantPool*
412 ConstantPool* asConstantPool(JVMCIObject constant_pool);
413 ConstantPool* asConstantPool(jobject constant_pool) { return asConstantPool(wrap(constant_pool)); }
414
415 JVMCIObject get_jvmci_constant_pool(const constantPoolHandle& cp, JVMCI_TRAPS);
416 JVMCIObject get_jvmci_primitive_type(BasicType type);
417
418 Handle asConstant(JVMCIObject object, JVMCI_TRAPS);
419 JVMCIObject get_object_constant(oop objOop, bool compressed = false, bool dont_register = false);
420
421 JVMCIPrimitiveArray new_booleanArray(int length, JVMCI_TRAPS);
422 JVMCIPrimitiveArray new_byteArray(int length, JVMCI_TRAPS);
423 JVMCIPrimitiveArray new_intArray(int length, JVMCI_TRAPS);
424 JVMCIPrimitiveArray new_longArray(int length, JVMCI_TRAPS);
425
426 JVMCIObjectArray new_byte_array_array(int length, JVMCI_TRAPS);
427
428 JVMCIObject new_StackTraceElement(const methodHandle& method, int bci, JVMCI_TRAPS);
429 JVMCIObject new_HotSpotNmethod(const methodHandle& method, const char* name, jboolean isDefault, jboolean profileDeopt, jlong compileId, JVMCI_TRAPS);
430 JVMCIObject new_VMField(JVMCIObject name, JVMCIObject type, jlong offset, jlong address, JVMCIObject value, JVMCI_TRAPS);
431 JVMCIObject new_VMFlag(JVMCIObject name, JVMCIObject type, JVMCIObject value, JVMCI_TRAPS);
432 JVMCIObject new_VMIntrinsicMethod(JVMCIObject declaringClass, JVMCIObject name, JVMCIObject descriptor, int id, jboolean isAvailable, jboolean c1Supported, jboolean c2Supported, JVMCI_TRAPS);
433 JVMCIObject new_HotSpotStackFrameReference(JVMCI_TRAPS);
434 JVMCIObject new_JVMCIError(JVMCI_TRAPS);
435 JVMCIObject new_FieldInfo(FieldInfo* fieldinfo, JVMCI_TRAPS);
436
|
261 jboolean transfer_pending_exception(JavaThread* THREAD, JVMCIEnv* peer_env);
262
263 // If there is a pending HotSpot exception, clears it and translates it to the shared library heap.
264 // The translated exception is pending in the shared library upon returning.
265 // Returns true if a pending exception was transferred, false otherwise.
266 static jboolean transfer_pending_exception_to_jni(JavaThread* THREAD, JVMCIEnv* hotspot_env, JVMCIEnv* jni_env);
267
268 // Prints the stack trace of a pending exception to `st` and clears the exception.
269 // If there is no pending exception, this is a nop.
270 void describe_pending_exception(outputStream* st);
271
272 // Gets the output of calling toString and/or printStactTrace on the pending exception.
273 // If to_string is not null, the output of toString is returned in it.
274 // If stack_trace is not null, the output of printStackTrace is returned in it.
275 // Returns false if there is no pending exception otherwise clears the pending
276 // exception and returns true.
277 bool pending_exception_as_string(const char** to_string, const char** stack_trace);
278
279 int get_length(JVMCIArray array);
280
281 JVMCIObject get_object_at(JVMCIObjectArray array, int index, JVMCI_TRAPS);
282 void put_object_at(JVMCIObjectArray array, int index, JVMCIObject value);
283
284 jboolean get_bool_at(JVMCIPrimitiveArray array, int index);
285 void put_bool_at(JVMCIPrimitiveArray array, int index, jboolean value);
286
287 jbyte get_byte_at(JVMCIPrimitiveArray array, int index);
288 void put_byte_at(JVMCIPrimitiveArray array, int index, jbyte value);
289
290 jint get_int_at(JVMCIPrimitiveArray array, int index);
291 void put_int_at(JVMCIPrimitiveArray array, int index, jint value);
292
293 jlong get_long_at(JVMCIPrimitiveArray array, int index);
294 void put_long_at(JVMCIPrimitiveArray array, int index, jlong value);
295
296 void copy_bytes_to(JVMCIPrimitiveArray src, jbyte* dest, int offset, jsize length);
297 void copy_bytes_from(jbyte* src, JVMCIPrimitiveArray dest, int offset, jsize length);
298
299 void copy_longs_from(jlong* src, JVMCIPrimitiveArray dest, int offset, jsize length);
300
301 JVMCIObjectArray initialize_intrinsics(JVMCI_TRAPS);
396 const char* klass_name(JVMCIObject object);
397
398 // Unpack an instance of HotSpotResolvedJavaMethodImpl into the original Method*
399 Method* asMethod(JVMCIObject jvmci_method);
400
401 // Unpack an instance of HotSpotResolvedObjectTypeImpl into the original Klass*
402 Klass* asKlass(JVMCIObject jvmci_type);
403
404 // Unpack an instance of HotSpotMethodData into the original MethodData*
405 MethodData* asMethodData(JVMCIObject jvmci_method_data);
406
407 JVMCIObject get_jvmci_method(const methodHandle& method, JVMCI_TRAPS);
408
409 JVMCIObject get_jvmci_type(const JVMCIKlassHandle& klass, JVMCI_TRAPS);
410
411 // Unpack an instance of HotSpotConstantPool into the original ConstantPool*
412 ConstantPool* asConstantPool(JVMCIObject constant_pool);
413 ConstantPool* asConstantPool(jobject constant_pool) { return asConstantPool(wrap(constant_pool)); }
414
415 JVMCIObject get_jvmci_constant_pool(const constantPoolHandle& cp, JVMCI_TRAPS);
416 JVMCIObject get_jvmci_primitive_type(BasicType type, JVMCI_TRAPS);
417
418 Handle asConstant(JVMCIObject object, JVMCI_TRAPS);
419 JVMCIObject get_object_constant(oop objOop, bool compressed = false, bool dont_register = false);
420
421 JVMCIPrimitiveArray new_booleanArray(int length, JVMCI_TRAPS);
422 JVMCIPrimitiveArray new_byteArray(int length, JVMCI_TRAPS);
423 JVMCIPrimitiveArray new_intArray(int length, JVMCI_TRAPS);
424 JVMCIPrimitiveArray new_longArray(int length, JVMCI_TRAPS);
425
426 JVMCIObjectArray new_byte_array_array(int length, JVMCI_TRAPS);
427
428 JVMCIObject new_StackTraceElement(const methodHandle& method, int bci, JVMCI_TRAPS);
429 JVMCIObject new_HotSpotNmethod(const methodHandle& method, const char* name, jboolean isDefault, jboolean profileDeopt, jlong compileId, JVMCI_TRAPS);
430 JVMCIObject new_VMField(JVMCIObject name, JVMCIObject type, jlong offset, jlong address, JVMCIObject value, JVMCI_TRAPS);
431 JVMCIObject new_VMFlag(JVMCIObject name, JVMCIObject type, JVMCIObject value, JVMCI_TRAPS);
432 JVMCIObject new_VMIntrinsicMethod(JVMCIObject declaringClass, JVMCIObject name, JVMCIObject descriptor, int id, jboolean isAvailable, jboolean c1Supported, jboolean c2Supported, JVMCI_TRAPS);
433 JVMCIObject new_HotSpotStackFrameReference(JVMCI_TRAPS);
434 JVMCIObject new_JVMCIError(JVMCI_TRAPS);
435 JVMCIObject new_FieldInfo(FieldInfo* fieldinfo, JVMCI_TRAPS);
436
|