Mercurial > hg > truffle
diff src/share/vm/graal/graalRuntime.cpp @ 5525:77d302416830
Create HotSpotGraalRuntime class on HotSpot when Graal.getRuntime() is accessed.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 08 Jun 2012 17:55:28 +0200 |
parents | 861f8d5a5153 |
children | 87e4aed94b26 |
line wrap: on
line diff
--- a/src/share/vm/graal/graalRuntime.cpp Fri Jun 08 17:00:38 2012 +0200 +++ b/src/share/vm/graal/graalRuntime.cpp Fri Jun 08 17:55:28 2012 +0200 @@ -28,5 +28,9 @@ ThreadToNativeFromVM ttnfv(thread); jclass klass = env->FindClass("com/oracle/graal/hotspot/HotSpotGraalRuntime"); guarantee(klass != NULL, "Could not find class com.oracle.graal.hotspot.HotSpotGraalRuntime"); - return env->AllocObject(klass); + jmethodID constructor = env->GetMethodID(klass, "<init>", "()V"); + guarantee(constructor != NULL, "Constructor of HotSpotGraalRuntime must not have any parameters"); + jobject newObj = env->AllocObject(klass); + env->CallVoidMethod(newObj, constructor); + return newObj; JVM_END \ No newline at end of file