# HG changeset patch # User Lukas Stadler # Date 1360315517 -3600 # Node ID 0ae87cf94914097ca8fb4298d750962e4df03f07 # Parent 9e68bd67b745850cfa66880252d11abc6143b638 add primitive type mask to HotSpotVMConfig diff -r 9e68bd67b745 -r 0ae87cf94914 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 Fri Feb 08 10:19:50 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java Fri Feb 08 10:25:17 2013 +0100 @@ -287,6 +287,7 @@ public int layoutHelperLog2ElementSizeMask; public int layoutHelperElementTypeShift; public int layoutHelperElementTypeMask; + public int layoutHelperElementTypePrimitiveInPlace; public int layoutHelperHeaderSizeShift; public int layoutHelperHeaderSizeMask; public int layoutHelperOffset; diff -r 9e68bd67b745 -r 0ae87cf94914 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/HotSpotSnippetUtils.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/HotSpotSnippetUtils.java Fri Feb 08 10:19:50 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/HotSpotSnippetUtils.java Fri Feb 08 10:25:17 2013 +0100 @@ -442,6 +442,12 @@ return config().layoutHelperElementTypeMask; } + @Fold + public static int layoutHelperElementTypePrimitiveInPlace() { + System.out.println(String.format("%x", config().layoutHelperElementTypePrimitiveInPlace)); + return config().layoutHelperElementTypePrimitiveInPlace; + } + static { assert arrayIndexScale(Kind.Byte) == 1; assert arrayIndexScale(Kind.Boolean) == 1; diff -r 9e68bd67b745 -r 0ae87cf94914 src/share/vm/graal/graalCompilerToVM.cpp --- a/src/share/vm/graal/graalCompilerToVM.cpp Fri Feb 08 10:19:50 2013 +0100 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Fri Feb 08 10:25:17 2013 +0100 @@ -701,6 +701,8 @@ set_int("layoutHelperLog2ElementSizeMask", Klass::_lh_log2_element_size_mask); set_int("layoutHelperElementTypeShift", Klass::_lh_element_type_shift); set_int("layoutHelperElementTypeMask", Klass::_lh_element_type_mask); + // this filters out the bit that differentiates a type array from an object array + set_int("layoutHelperElementTypePrimitiveInPlace", (Klass::_lh_array_tag_type_value & ~Klass::_lh_array_tag_obj_value) << Klass::_lh_array_tag_shift); set_int("layoutHelperHeaderSizeShift", Klass::_lh_header_size_shift); set_int("layoutHelperHeaderSizeMask", Klass::_lh_header_size_mask); set_int("layoutHelperOffset", in_bytes(Klass::layout_helper_offset()));