changeset 22567:bfd5fdca1ce9

Clean separation between backend and frontend wordKind.
author Roland Schatz <roland.schatz@oracle.com>
date Wed, 16 Sep 2015 12:01:26 +0200
parents 94a604f431d3
children c79ee6cd7f53
files jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/TargetDescription.java jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCodeCacheProvider.java jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java
diffstat 3 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/TargetDescription.java	Tue Sep 15 21:48:17 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/TargetDescription.java	Wed Sep 16 12:01:26 2015 +0200
@@ -49,9 +49,9 @@
     public final int wordSize;
 
     /**
-     * The kind to be used for representing raw pointers and CPU registers.
+     * The {@link JavaKind} to be used for representing raw pointers and CPU registers in Java code.
      */
-    public final JavaKind wordKind;
+    public final JavaKind wordJavaKind;
 
     /**
      * The stack alignment requirement of the platform. For example, from Appendix D of <a
@@ -77,10 +77,12 @@
         this.arch = arch;
         this.isMP = isMP;
         this.wordSize = arch.getWordSize();
-        this.wordKind = JavaKind.fromWordSize(wordSize);
+        this.wordJavaKind = JavaKind.fromWordSize(wordSize);
         this.stackAlignment = stackAlignment;
         this.implicitNullCheckLimit = implicitNullCheckLimit;
         this.inlineObjects = inlineObjects;
+
+        assert arch.getPlatformKind(wordJavaKind).equals(arch.getWordKind());
     }
 
     @Override
@@ -100,7 +102,7 @@
                 this.inlineObjects == that.inlineObjects &&
                 this.isMP == that.isMP &&
                 this.stackAlignment == that.stackAlignment &&
-                this.wordKind.equals(that.wordKind) &&
+                this.wordJavaKind.equals(that.wordJavaKind) &&
                 this.wordSize == that.wordSize &&
                 this.arch.equals(that.arch)) {
                 return true;
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCodeCacheProvider.java	Tue Sep 15 21:48:17 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCodeCacheProvider.java	Wed Sep 16 12:01:26 2015 +0200
@@ -185,7 +185,7 @@
                 throw new JVMCIError(String.valueOf(constant));
             }
 
-            size = target.getSizeInBytes(compressed ? JavaKind.Int : target.wordKind);
+            size = compressed ? 4 : target.wordSize;
             if (size == 4) {
                 builder = (buffer, patch) -> {
                     patch.accept(new DataPatch(buffer.position(), new ConstantReference(vmConstant)));
@@ -200,7 +200,7 @@
             }
         } else if (JavaConstant.isNull(constant)) {
             boolean compressed = COMPRESSED_NULL.equals(constant);
-            size = target.getSizeInBytes(compressed ? JavaKind.Int : target.wordKind);
+            size = compressed ? 4 : target.wordSize;
             builder = DataBuilder.zero(size);
         } else if (constant instanceof SerializableConstant) {
             SerializableConstant s = (SerializableConstant) constant;
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java	Tue Sep 15 21:48:17 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java	Wed Sep 16 12:01:26 2015 +0200
@@ -126,7 +126,7 @@
      * Gets the kind of a word value on the {@linkplain #getHostJVMCIBackend() host} backend.
      */
     public static JavaKind getHostWordKind() {
-        return runtime().getHostJVMCIBackend().getCodeCache().getTarget().wordKind;
+        return runtime().getHostJVMCIBackend().getCodeCache().getTarget().wordJavaKind;
     }
 
     protected final CompilerToVM compilerToVm;