src/hotspot/share/jvmci/jvmciJavaClasses.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/hotspot/share/jvmci/jvmciJavaClasses.cpp Sat May 4 16:22:31 2019
--- new/src/hotspot/share/jvmci/jvmciJavaClasses.cpp Sat May 4 16:22:29 2019
*** 354,363 ****
--- 354,400 ----
extern "C" {
void JNICALL JVM_RegisterJVMCINatives(JNIEnv *env, jclass compilerToVMClass);
jobject JNICALL JVM_GetJVMCIRuntime(JNIEnv *env, jclass c);
}
+ // Dumps symbols for public <init>() and <init>(String) methods of
+ // non-abstract Throwable subtypes known by the VM. This is to
+ // support the use of reflection in jdk.vm.ci.hotspot.TranslatedException.create().
+ class ThrowableInitDumper : public SymbolClosure {
+ private:
+ fileStream* _st;
+ public:
+ ThrowableInitDumper(fileStream* st) { _st = st; }
+ void do_symbol(Symbol** p) {
+ Thread* THREAD = Thread::current();
+ Symbol* name = *p;
+ if (name == NULL) {
+ return;
+ }
+ Klass* k = SystemDictionary::resolve_or_null(name, CHECK_EXIT);
+ if (k != NULL && k->is_instance_klass()) {
+ InstanceKlass* iklass = InstanceKlass::cast(k);
+ if (iklass->is_subclass_of(SystemDictionary::Throwable_klass()) && iklass->is_public() && !iklass->is_abstract()) {
+ const char* class_name = NULL;
+ Array<Method*>* methods = iklass->methods();
+ for (int i = 0; i < methods->length(); i++) {
+ Method* m = methods->at(i);
+ if (m->name() == vmSymbols::object_initializer_name() &&
+ m->is_public() &&
+ (m->signature() == vmSymbols::void_method_signature() || m->signature() == vmSymbols::string_void_signature())) {
+ if (class_name == NULL) {
+ class_name = name->as_C_string();
+ _st->print_cr("class %s", class_name);
+ }
+ _st->print_cr("method %s %s %s", class_name, m->name()->as_C_string(), m->signature()->as_C_string());
+ }
+ }
+ }
+ }
+ }
+ };
+
#define IN_CLASS(fullClassName) current_class_name = vmSymbols::fullClassName()->as_C_string()
/**
* Initializes the JNI method and field ids used in JNIJVMCI.
*/
void JNIJVMCI::initialize_ids(JNIEnv* env) {
*** 439,448 ****
--- 476,487 ----
if (JVMCILibDumpJNIConfig != NULL) {
Thread* THREAD = Thread::current();
fileStream* st = JVMCIGlobals::get_jni_config_file();
DUMP_ALL_NATIVE_METHODS(vmSymbols::jdk_vm_ci_hotspot_CompilerToVM());
+ ThrowableInitDumper dumper(st);
+ vmSymbols::symbols_do(&dumper);
st->flush();
tty->print_cr("Dumped JVMCI shared library JNI configuration to %s", JVMCILibDumpJNIConfig);
vm_exit(0);
}
src/hotspot/share/jvmci/jvmciJavaClasses.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File