changeset 13871:0d91d64b88f8

GNFI: set invalid rtld_default in HotSpotVMConfig
author Matthias Grimmer <grimmer@ssw.jku.at>
date Wed, 05 Feb 2014 10:37:07 +0100
parents d04be74665fb
children 43678ad7ae92
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java src/share/vm/graal/graalCompilerToVM.cpp
diffstat 2 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java	Wed Feb 05 09:32:30 2014 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java	Wed Feb 05 10:37:07 2014 +0100
@@ -840,9 +840,15 @@
     @HotSpotVMField(name = "JavaThread::_vm_result", type = "oop", get = HotSpotVMField.Type.OFFSET) @Stable public int threadObjectResultOffset;
     @HotSpotVMField(name = "JavaThread::_graal_counters[0]", type = "jlong", get = HotSpotVMField.Type.OFFSET, optional = true) @Stable public int graalCountersThreadOffset;
 
+    // The native side (graalCompilerToVM.cpp) sets the rtldDefault if the
+    // platform is NOT Windows (Windows is currently not supported).
+    // AMD64NativeFunctionInterface checks if rtld_default handle is valid.
+    // Using 0 is not possible as it is a valid value for rtldDefault on some platforms.
+    public static final long INVALID_RTLD_DEFAULT_HANDLE = 0xDEADFACE;
+
     @Stable public long libraryLoadAddress;
     @Stable public long functionLookupAddress;
-    @Stable public long rtldDefault;
+    @Stable public long rtldDefault = INVALID_RTLD_DEFAULT_HANDLE;
 
     /**
      * This field is used to pass exception objects into and out of the runtime system during
--- a/src/share/vm/graal/graalCompilerToVM.cpp	Wed Feb 05 09:32:30 2014 +0100
+++ b/src/share/vm/graal/graalCompilerToVM.cpp	Wed Feb 05 10:37:07 2014 +0100
@@ -562,11 +562,6 @@
   set_long("functionLookupAddress", (jlong) os::dll_lookup);
   #if defined(TARGET_OS_FAMILY_bsd) || defined(TARGET_OS_FAMILY_linux)
   set_long("rtldDefault", (jlong) RTLD_DEFAULT);
-  #else 
-  // Windows is not supported at the moment. 
-  // On Java-side we do a check on 0xDEADFACE and crash if rtldDefault == 0xDEADFACE. 
-  // Using 0 is not possible as it is a valid value for rtldDefault on some platforms.
-  set_long("rtldDefault", (jlong) 0xDEADFACE);
   #endif
 
 #undef set_boolean