changeset 22668:1edfd1161cec

Update jvmci import: Use PlatformKind.getSizeInBytes() instead of TargetDescription.getSizeInBytes(PlatformKind).
author Roland Schatz <roland.schatz@oracle.com>
date Tue, 22 Sep 2015 11:50:36 +0200
parents 500e3cecfbff
children 1999949f0c47
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotBackend.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCounterOp.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReferenceMapBuilder.java graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCFrameMap.java graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMap.java graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/WordCastNode.java mx.graal/suite.py
diffstat 8 files changed, 17 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotBackend.java	Mon Sep 21 23:24:58 2015 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotBackend.java	Tue Sep 22 11:50:36 2015 +0200
@@ -270,6 +270,6 @@
 
     @Override
     public ReferenceMapBuilder newReferenceMapBuilder(int totalFrameSize) {
-        return new HotSpotReferenceMapBuilder(getTarget(), totalFrameSize);
+        return new HotSpotReferenceMapBuilder(totalFrameSize);
     }
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCounterOp.java	Mon Sep 21 23:24:58 2015 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCounterOp.java	Tue Sep 22 11:50:36 2015 +0200
@@ -71,7 +71,7 @@
     }
 
     protected static int getDisplacementForLongIndex(TargetDescription target, long index) {
-        long finalDisp = index * target.getSizeInBytes(JavaKind.Long);
+        long finalDisp = index * target.arch.getPlatformKind(JavaKind.Long).getSizeInBytes();
         if (!NumUtil.isInt(finalDisp)) {
             throw JVMCIError.unimplemented("cannot deal with indices that big: " + index);
         }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReferenceMapBuilder.java	Mon Sep 21 23:24:58 2015 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReferenceMapBuilder.java	Tue Sep 22 11:50:36 2015 +0200
@@ -32,7 +32,6 @@
 import jdk.internal.jvmci.code.Location;
 import jdk.internal.jvmci.code.ReferenceMap;
 import jdk.internal.jvmci.code.StackSlot;
-import jdk.internal.jvmci.code.TargetDescription;
 import jdk.internal.jvmci.common.JVMCIError;
 import jdk.internal.jvmci.hotspot.HotSpotReferenceMap;
 import jdk.internal.jvmci.meta.LIRKind;
@@ -50,14 +49,12 @@
     private final ArrayList<Value> objectValues;
     private int objectCount;
 
-    private final TargetDescription target;
     private final int totalFrameSize;
 
-    public HotSpotReferenceMapBuilder(TargetDescription target, int totalFrameSize) {
+    public HotSpotReferenceMapBuilder(int totalFrameSize) {
         this.objectValues = new ArrayList<>();
         this.objectCount = 0;
 
-        this.target = target;
         this.totalFrameSize = totalFrameSize;
     }
 
@@ -76,7 +73,7 @@
             }
         }
         if (isRegister(v)) {
-            int size = target.getSizeInBytes(lirKind.getPlatformKind());
+            int size = lirKind.getPlatformKind().getSizeInBytes();
             if (size > maxRegisterSize) {
                 maxRegisterSize = size;
             }
@@ -118,9 +115,9 @@
         return new HotSpotReferenceMap(objects, derivedBase, sizeInBytes, maxRegisterSize);
     }
 
-    private int bytesPerElement(LIRKind kind) {
+    private static int bytesPerElement(LIRKind kind) {
         PlatformKind platformKind = kind.getPlatformKind();
-        return target.getSizeInBytes(platformKind) / platformKind.getVectorLength();
+        return platformKind.getSizeInBytes() / platformKind.getVectorLength();
     }
 
     private Location toLocation(Value v, int offset) {
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCFrameMap.java	Mon Sep 21 23:24:58 2015 +0200
+++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCFrameMap.java	Tue Sep 22 11:50:36 2015 +0200
@@ -110,7 +110,7 @@
      */
     @Override
     public int spillSlotSize(LIRKind kind) {
-        return SPARC.spillSlotSize(getTarget(), kind.getPlatformKind());
+        return Math.max(kind.getPlatformKind().getSizeInBytes(), SPARC.MEMORY_ACCESS_ALIGN);
     }
 
     @Override
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java	Mon Sep 21 23:24:58 2015 +0200
+++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java	Tue Sep 22 11:50:36 2015 +0200
@@ -127,7 +127,7 @@
 
         @Override
         public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
-            final int byteCount = crb.target.getSizeInBytes(result.getPlatformKind());
+            final int byteCount = result.getPlatformKind().getSizeInBytes();
             assert byteCount > 1 : "Byte values must not be loaded via constant table";
             final Runnable recordReference = () -> crb.recordDataReferenceInCode(constant, byteCount);
             Register baseRegister = asRegister(constantTableBase);
@@ -243,9 +243,8 @@
         }
 
         private void moveViaStack(CompilationResultBuilder crb, SPARCMacroAssembler masm, JavaKind inputKind, JavaKind resultKind) {
-            int inputKindSize = crb.target.getSizeInBytes(inputKind);
-            int resultKindSize = crb.target.getSizeInBytes(resultKind);
-            assert inputKindSize == resultKindSize;
+            int resultKindSize = resultKind.getSizeInBytes();
+            assert inputKind.getSizeInBytes() == resultKindSize;
             try (ScratchRegister sc = masm.getScratchRegister()) {
                 Register scratch = sc.getRegister();
                 SPARCAddress tempAddress = generateSimm13OffsetLoad((SPARCAddress) crb.asAddress(temp), masm, scratch);
@@ -514,7 +513,7 @@
                 if (state != null) {
                     crb.recordImplicitException(masm.position(), state);
                 }
-                int byteCount = crb.target.getSizeInBytes(kind);
+                int byteCount = kind.getSizeInBytes();
                 masm.st(g0, addr, byteCount);
             }
         }
@@ -635,7 +634,7 @@
             boolean hasVIS1 = cpuFeatures.contains(CPUFeature.VIS1);
             boolean hasVIS3 = cpuFeatures.contains(CPUFeature.VIS3);
             Register resultRegister = asRegister(result);
-            int byteCount = crb.target.getSizeInBytes(result.getPlatformKind());
+            int byteCount = result.getPlatformKind().getSizeInBytes();
             Runnable recordReference = () -> crb.recordDataReferenceInCode(input, byteCount);
             switch (input.getJavaKind().getStackKind()) {
                 case Int:
@@ -739,7 +738,7 @@
             if (state != null) {
                 crb.recordImplicitException(masm.position(), state);
             }
-            int byteCount = crb.target.getSizeInBytes(kind);
+            int byteCount = kind.getSizeInBytes();
             masm.ld(addr, dst, byteCount, signExtend);
         }
     }
@@ -753,7 +752,7 @@
             if (state != null) {
                 crb.recordImplicitException(masm.position(), state);
             }
-            int byteCount = crb.target.getSizeInBytes(kind);
+            int byteCount = kind.getSizeInBytes();
             masm.st(asRegister(input), addr, byteCount);
         }
     }
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMap.java	Mon Sep 21 23:24:58 2015 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMap.java	Tue Sep 22 11:50:36 2015 +0200
@@ -248,7 +248,7 @@
      * @return the size in bytes
      */
     public int spillSlotSize(LIRKind kind) {
-        return getTarget().getSizeInBytes(kind.getPlatformKind());
+        return kind.getPlatformKind().getSizeInBytes();
     }
 
     /**
--- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/WordCastNode.java	Mon Sep 21 23:24:58 2015 +0200
+++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/WordCastNode.java	Tue Sep 22 11:50:36 2015 +0200
@@ -116,7 +116,7 @@
     public void generate(NodeLIRBuilderTool generator) {
         Value value = generator.operand(input);
         LIRKind kind = generator.getLIRGeneratorTool().getLIRKind(stamp());
-        assert generator.getLIRGeneratorTool().target().getSizeInBytes(kind.getPlatformKind()) == generator.getLIRGeneratorTool().target().getSizeInBytes(value.getPlatformKind());
+        assert kind.getPlatformKind().getSizeInBytes() == value.getPlatformKind().getSizeInBytes();
 
         if (trackedPointer && kind.isValue() && !value.getLIRKind().isValue()) {
             // just change the PlatformKind, but don't drop reference information
--- a/mx.graal/suite.py	Mon Sep 21 23:24:58 2015 +0200
+++ b/mx.graal/suite.py	Tue Sep 22 11:50:36 2015 +0200
@@ -6,7 +6,7 @@
     "suites": [
             {
                "name" : "jvmci",
-               "version" : "3f6488b29c1ae49f0f695ddc00822a16e8c418f7",
+               "version" : "4371622a22da480f866d821d190ab511175068d2",
                "urls" : [
                     {"url" : "http://lafo.ssw.uni-linz.ac.at/hg/graal-jvmci-8", "kind" : "hg"},
                     {"url" : "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind" : "binary"},