changeset 7760:0ae87cf94914

add primitive type mask to HotSpotVMConfig
author Lukas Stadler <lukas.stadler@jku.at>
date Fri, 08 Feb 2013 10:25:17 +0100
parents 9e68bd67b745
children eaecd7c187ad
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/HotSpotSnippetUtils.java src/share/vm/graal/graalCompilerToVM.cpp
diffstat 3 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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;
--- 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()));