< prev index next >

src/hotspot/share/jvmci/jvmciCompilerToVM.cpp

Print this page




  83     args.push_long((jlong) (address) method());
  84     JavaCalls::call_static(&result, SystemDictionary::HotSpotResolvedJavaMethodImpl_klass(), vmSymbols::fromMetaspace_name(), vmSymbols::method_fromMetaspace_signature(), &args, CHECK_NULL);
  85 
  86     return (oop)result.get_jobject();
  87   }
  88   return NULL;
  89 }
  90 
  91 oop CompilerToVM::get_jvmci_type(Klass* klass, TRAPS) {
  92   if (klass != NULL) {
  93     JavaValue result(T_OBJECT);
  94     JavaCallArguments args;
  95     args.push_oop(Handle(THREAD, klass->java_mirror()));
  96     JavaCalls::call_static(&result, SystemDictionary::HotSpotResolvedObjectTypeImpl_klass(), vmSymbols::fromMetaspace_name(), vmSymbols::klass_fromMetaspace_signature(), &args, CHECK_NULL);
  97 
  98     return (oop)result.get_jobject();
  99   }
 100   return NULL;
 101 }
 102 






 103 
 104 jobjectArray readConfiguration0(JNIEnv *env, TRAPS);
 105 
 106 C2V_VMENTRY(jobjectArray, readConfiguration, (JNIEnv *env))
 107    jobjectArray config = readConfiguration0(env, CHECK_NULL);
 108    return config;
 109 C2V_END
 110 
 111 C2V_VMENTRY(jobject, getFlagValue, (JNIEnv *, jobject c2vm, jobject name_handle))
 112 #define RETURN_BOXED_LONG(value) oop box; jvalue p; p.j = (jlong) (value); box = java_lang_boxing_object::create(T_LONG, &p, CHECK_NULL); return JNIHandles::make_local(THREAD, box);
 113 #define RETURN_BOXED_DOUBLE(value) oop box; jvalue p; p.d = (jdouble) (value); box = java_lang_boxing_object::create(T_DOUBLE, &p, CHECK_NULL); return JNIHandles::make_local(THREAD, box);
 114   Handle name(THREAD, JNIHandles::resolve(name_handle));
 115   if (name.is_null()) {
 116     THROW_0(vmSymbols::java_lang_NullPointerException());
 117   }
 118   ResourceMark rm;
 119   const char* cstring = java_lang_String::as_utf8_string(name());
 120   Flag* flag = Flag::find_flag(cstring, strlen(cstring), /* allow_locked */ true, /* return_flag */ true);
 121   if (flag == NULL) {
 122     return c2vm;




  83     args.push_long((jlong) (address) method());
  84     JavaCalls::call_static(&result, SystemDictionary::HotSpotResolvedJavaMethodImpl_klass(), vmSymbols::fromMetaspace_name(), vmSymbols::method_fromMetaspace_signature(), &args, CHECK_NULL);
  85 
  86     return (oop)result.get_jobject();
  87   }
  88   return NULL;
  89 }
  90 
  91 oop CompilerToVM::get_jvmci_type(Klass* klass, TRAPS) {
  92   if (klass != NULL) {
  93     JavaValue result(T_OBJECT);
  94     JavaCallArguments args;
  95     args.push_oop(Handle(THREAD, klass->java_mirror()));
  96     JavaCalls::call_static(&result, SystemDictionary::HotSpotResolvedObjectTypeImpl_klass(), vmSymbols::fromMetaspace_name(), vmSymbols::klass_fromMetaspace_signature(), &args, CHECK_NULL);
  97 
  98     return (oop)result.get_jobject();
  99   }
 100   return NULL;
 101 }
 102 
 103 Handle JavaArgumentUnboxer::next_arg(BasicType expectedType) {
 104   assert(_index < _args->length(), "out of bounds");
 105   oop arg=((objArrayOop) (_args))->obj_at(_index++);
 106   assert(expectedType == T_OBJECT || java_lang_boxing_object::is_instance(arg, expectedType), "arg type mismatch");
 107   return Handle(Thread::current(), arg);
 108 }
 109 
 110 jobjectArray readConfiguration0(JNIEnv *env, TRAPS);
 111 
 112 C2V_VMENTRY(jobjectArray, readConfiguration, (JNIEnv *env))
 113    jobjectArray config = readConfiguration0(env, CHECK_NULL);
 114    return config;
 115 C2V_END
 116 
 117 C2V_VMENTRY(jobject, getFlagValue, (JNIEnv *, jobject c2vm, jobject name_handle))
 118 #define RETURN_BOXED_LONG(value) oop box; jvalue p; p.j = (jlong) (value); box = java_lang_boxing_object::create(T_LONG, &p, CHECK_NULL); return JNIHandles::make_local(THREAD, box);
 119 #define RETURN_BOXED_DOUBLE(value) oop box; jvalue p; p.d = (jdouble) (value); box = java_lang_boxing_object::create(T_DOUBLE, &p, CHECK_NULL); return JNIHandles::make_local(THREAD, box);
 120   Handle name(THREAD, JNIHandles::resolve(name_handle));
 121   if (name.is_null()) {
 122     THROW_0(vmSymbols::java_lang_NullPointerException());
 123   }
 124   ResourceMark rm;
 125   const char* cstring = java_lang_String::as_utf8_string(name());
 126   Flag* flag = Flag::find_flag(cstring, strlen(cstring), /* allow_locked */ true, /* return_flag */ true);
 127   if (flag == NULL) {
 128     return c2vm;


< prev index next >