move logic from C++ to Java, Part 1

Christian Thalinger christian.thalinger at oracle.com
Tue Feb 12 11:21:50 PST 2013


On Feb 11, 2013, at 8:34 PM, Thomas Wuerthinger <thomas.wuerthinger at oracle.com> wrote:

> We could make a public gate repository though where we pull in changes to our gate and benchmarking infrastructure.

We probably don't need it right now but I think it might be a good idea in the future.  At some point non-Oracle people may want to contribute some code.

-- Chris

> 
> - thomas
> 
> On Feb 11, 2013, at 12:44 PM, Gilles Duboscq <duboscq at ssw.jku.at> wrote:
>> No, currently we only sync from internal to external.
>> 
>> 
>> On Mon, Feb 11, 2013 at 7:41 PM, Christian Thalinger <
>> christian.thalinger at oracle.com> wrote:
>> 
>>> 
>>> On Feb 11, 2013, at 8:38 AM, Lukas Stadler <lukas.stadler at jku.at> wrote:
>>> 
>>>> Thanks Christian! I will integrate the patch. Keep them coming :-)
>>>> You're right, the more of our logic we have in Java the better.
>>> 
>>> Thanks.  Certainly I can push them myself next time if you want.
>>> 
>>> Btw. do you guys also sync down to your internal repository from the
>>> OpenJDK one?  Means, can we push fixes to the OpenJDK repository in the
>>> future?  I guess not because we don't have a gate right now.
>>> 
>>> -- Chris
>>> 
>>>> 
>>>> - Lukas
>>>> 
>>>> On Feb 10, 2013, at 5:23 AM, Christian Thalinger <
>>> christian.thalinger at oracle.com> wrote:
>>>> 
>>>>> I think we should try to move more code from C++ to Java.  This whole
>>> Java-native dance makes things just complicated.  Here is a small patch to
>>> start.
>>>>> 
>>>>> -- Chris
>>>>> 
>>>>> 
>>>>> 
>>> graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java
>>> src/share/vm/graal/graalCompilerToVM.cpp
>>>>> 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
>>>>> @@ -22,18 +22,21 @@
>>>>> */
>>>>> package com.oracle.graal.hotspot;
>>>>> 
>>>>> +import sun.misc.Unsafe;
>>>>> +
>>>>> /**
>>>>> * Used to communicate configuration details, runtime offsets, etc. to
>>> Graal upon compileMethod.
>>>>> */
>>>>> public final class HotSpotVMConfig extends CompilerObject {
>>>>> 
>>>>>  private static final long serialVersionUID = -4744897993263044184L;
>>>>> +    private static final Unsafe unsafe = Unsafe.getUnsafe();
>>>>> 
>>>>>  HotSpotVMConfig() {
>>>>>  }
>>>>> 
>>>>>  // os information, register layout, code generation, ...
>>>>> -    public boolean windowsOs;
>>>>> +    public final boolean windowsOs = System.getProperty("os.name
>>> ").startsWith("Windows");
>>>>>  public int codeEntryAlignment;
>>>>>  public boolean verifyOops;
>>>>>  public boolean ciTime;
>>>>> @@ -44,7 +47,7 @@
>>>>>  public boolean useAESIntrinsics;
>>>>> 
>>>>>  // offsets, ...
>>>>> -    public int vmPageSize;
>>>>> +    public final int vmPageSize = unsafe.pageSize();
>>>>>  public int stackShadowPages;
>>>>> 
>>>>>  /**
>>>>> 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
>>>>> @@ -602,11 +602,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("verifyOops", VerifyOops);
>>>>> set_boolean("ciTime", CITime);
>>>>> set_boolean("useFastLocking", GraalUseFastLocking);
>>>>> @@ -615,7 +611,6 @@
>>>>> set_boolean("useAESIntrinsics", UseAESIntrinsics);
>>>>> set_boolean("useTLAB", UseTLAB);
>>>>> set_int("codeEntryAlignment", CodeEntryAlignment);
>>>>> -  set_int("vmPageSize", os::vm_page_size());
>>>>> set_int("stackShadowPages", StackShadowPages);
>>>>> set_int("hubOffset", oopDesc::klass_offset_in_bytes());
>>>>> set_int("markOffset", oopDesc::mark_offset_in_bytes());
>>>>> 
>>>> 
>>> 
>>> 
> 



More information about the graal-dev mailing list