< prev index next >

src/hotspot/share/jvmci/jvmciEnv.cpp

Print this page




1094   }
1095 
1096   if (exception) {
1097     JVMCI::release_handle(handle);
1098     return JVMCIObject();
1099   }
1100 
1101   assert(asMethod(method_object) == method(), "must be");
1102   if (get_HotSpotResolvedJavaMethodImpl_metadataHandle(method_object) != (jlong) handle) {
1103     JVMCI::release_handle(handle);
1104   }
1105   assert(!method_object.is_null(), "must be");
1106   return method_object;
1107 }
1108 
1109 JVMCIObject JVMCIEnv::get_jvmci_type(const JVMCIKlassHandle& klass, JVMCI_TRAPS) {
1110   JVMCIObject type;
1111   if (klass.is_null()) {
1112     return type;
1113   }







1114 
1115   jlong pointer = (jlong) klass();
1116   JavaThread* THREAD = JavaThread::current();
1117   JVMCIObject signature = create_string(klass->signature_name(), JVMCI_CHECK_(JVMCIObject()));
1118   jboolean exception = false;
1119   if (is_hotspot()) {
1120     JavaValue result(T_OBJECT);
1121     JavaCallArguments args;
1122     args.push_long(pointer);
1123     args.push_oop(Handle(THREAD, HotSpotJVMCI::resolve(signature)));
1124     JavaCalls::call_static(&result,
1125                            HotSpotJVMCI::HotSpotResolvedObjectTypeImpl::klass(),
1126                            vmSymbols::fromMetaspace_name(),
1127                            vmSymbols::klass_fromMetaspace_signature(), &args, THREAD);
1128 
1129     if (HAS_PENDING_EXCEPTION) {
1130       exception = true;
1131     } else {
1132       type = wrap((oop)result.get_jobject());
1133     }




1094   }
1095 
1096   if (exception) {
1097     JVMCI::release_handle(handle);
1098     return JVMCIObject();
1099   }
1100 
1101   assert(asMethod(method_object) == method(), "must be");
1102   if (get_HotSpotResolvedJavaMethodImpl_metadataHandle(method_object) != (jlong) handle) {
1103     JVMCI::release_handle(handle);
1104   }
1105   assert(!method_object.is_null(), "must be");
1106   return method_object;
1107 }
1108 
1109 JVMCIObject JVMCIEnv::get_jvmci_type(const JVMCIKlassHandle& klass, JVMCI_TRAPS) {
1110   JVMCIObject type;
1111   if (klass.is_null()) {
1112     return type;
1113   }
1114 #ifdef INCLUDE_ALL_GCS
1115     if (UseG1GC) {
1116       // The klass might have come from a weak location so enqueue
1117       // the Class to make sure it's noticed by G1
1118       G1SATBCardTableModRefBS::enqueue(klass()->java_mirror());
1119     }
1120 #endif  // Klass* don't require tracking as Metadata*
1121 
1122   jlong pointer = (jlong) klass();
1123   JavaThread* THREAD = JavaThread::current();
1124   JVMCIObject signature = create_string(klass->signature_name(), JVMCI_CHECK_(JVMCIObject()));
1125   jboolean exception = false;
1126   if (is_hotspot()) {
1127     JavaValue result(T_OBJECT);
1128     JavaCallArguments args;
1129     args.push_long(pointer);
1130     args.push_oop(Handle(THREAD, HotSpotJVMCI::resolve(signature)));
1131     JavaCalls::call_static(&result,
1132                            HotSpotJVMCI::HotSpotResolvedObjectTypeImpl::klass(),
1133                            vmSymbols::fromMetaspace_name(),
1134                            vmSymbols::klass_fromMetaspace_signature(), &args, THREAD);
1135 
1136     if (HAS_PENDING_EXCEPTION) {
1137       exception = true;
1138     } else {
1139       type = wrap((oop)result.get_jobject());
1140     }


< prev index next >