Mercurial > hg > truffle
diff src/share/vm/c1x/c1x_VMEntries.cpp @ 1419:7bf6a77b9c5a
implement recent safepoint & exceptionobject ci changes, HotSpotVMConfig
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Mon, 12 Jul 2010 15:05:17 -0700 |
parents | 712c7ff1afc1 |
children | 6223633ce7dd |
line wrap: on
line diff
--- a/src/share/vm/c1x/c1x_VMEntries.cpp Fri Jul 09 16:33:03 2010 -0700 +++ b/src/share/vm/c1x/c1x_VMEntries.cpp Mon Jul 12 15:05:17 2010 -0700 @@ -358,6 +358,27 @@ } } +// helpers used to set fields in the HotSpotVMConfig object +#define SET_CONFIG_BOOLEAN(name, value) { jfieldID id = jniEnv->GetFieldID(klass, #name, "Z"); jniEnv->SetBooleanField(config, id, value); } +#define SET_CONFIG_INT(name, value) { jfieldID id = jniEnv->GetFieldID(klass, #name, "I"); jniEnv->SetIntField(config, id, value); } + +/* +* Class: com_sun_hotspot_c1x_VMEntries +* Method: getConfiguration +* Signature: ()Lcom/sun/hotspot/c1x/HotSpotVMConfig; +*/ +JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_getConfiguration(JNIEnv *jniEnv, jclass) { + jclass klass = jniEnv->FindClass("com/sun/hotspot/c1x/HotSpotVMConfig"); + assert(klass != NULL, "HotSpot vm config class not found"); + jobject config = jniEnv->AllocObject(klass); + jfieldID id = jniEnv->GetFieldID(klass, "windowsOs", "Z"); +#ifdef _WIN64 + SET_CONFIG_BOOLEAN(windowsOs, true) +#else + SET_CONFIG_BOOLEAN(windowsOs, false) +#endif + return config; +} JNINativeMethod VMEntries_methods[] = { @@ -380,7 +401,8 @@ {CC"RiType_isInstanceClass", CC"(Ljava/lang/Object;)Z", FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1isInstanceClass)}, {CC"RiType_isInterface", CC"(Ljava/lang/Object;)Z", FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1isInterface)}, {CC"RiMethod_accessFlags", CC"(Ljava/lang/Object;)I", FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1accessFlags)}, - {CC"installCode", CC"(Ljava/lang/Object;[BI)V", FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_installCode)} + {CC"installCode", CC"(Ljava/lang/Object;[BI)V", FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_installCode)}, + {CC"getConfiguration", CC"()Lcom/sun/hotspot/c1x/HotSpotVMConfig;", FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_getConfiguration)} }; int VMEntries_methods_count() {