RFR (XS): use os.name property to identify Windows OS

Doug Simon doug.simon at oracle.com
Mon May 6 10:05:27 PDT 2013


On May 6, 2013, at 6:36 PM, Christian Thalinger <christian.thalinger at oracle.com> wrote:

> 
> On May 4, 2013, at 2:44 PM, Doug Simon <doug.simon at oracle.com> wrote:
> 
>> Does that also work under cygwin? I know python returns something different.
> 
> I couldn't find a cygwin yet but MKS says:
> 
> os.name=Windows 2003
> 
> What does Python return?

It depends:

http://stackoverflow.com/questions/1387222/reliably-detect-windows-in-python

-Doug

>> 
>> On May 4, 2013, at 7:50 AM, Christian Thalinger <christian.thalinger at oracle.com> wrote:
>> 
>>> diff --git a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java
>>> --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java
>>> +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java
>>> @@ -34,7 +34,7 @@
>>> 
>>>   // os information, register layout, code generation, ...
>>>   public boolean cAssertions;
>>> -    public boolean windowsOs;
>>> +    public final boolean windowsOs = System.getProperty("os.name", "").startsWith("Windows");
>>>   public int codeEntryAlignment;
>>>   public boolean verifyOops;
>>>   public boolean ciTime;
>>> diff --git a/src/share/vm/graal/graalCompilerToVM.cpp b/src/share/vm/graal/graalCompilerToVM.cpp
>>> --- a/src/share/vm/graal/graalCompilerToVM.cpp
>>> +++ b/src/share/vm/graal/graalCompilerToVM.cpp
>>> @@ -629,11 +643,7 @@
>>> #define set_int_array(name, value) do { env->SetObjectField(config, getFieldID(env, config, name, "[I"), value); } while (0)
>>> 
>>> guarantee(HeapWordSize == sizeof(char*), "Graal assumption that HeadWordSize == machine word size is wrong");
>>> -#ifdef _WIN64
>>> -  set_boolean("windowsOs", true);
>>> -#else
>>> -  set_boolean("windowsOs", false);
>>> -#endif
>>> +
>>> set_boolean("cAssertions", DEBUG_ONLY(true) NOT_DEBUG(false));
>>> set_boolean("verifyOops", VerifyOops);
>>> set_boolean("ciTime", CITime);
>>> 
>> 
> 



More information about the graal-dev mailing list