changeset 22689:f48b657b550d

Remove unused class VirtualStackSlot.
author Roland Schatz <roland.schatz@oracle.com>
date Fri, 16 Oct 2015 13:44:47 +0200
parents ef7d87db544a
children 3da4f19cf93b
files jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/StackLockValue.java jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/StackSlot.java jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/StackSlotValue.java jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueUtil.java jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/VirtualStackSlot.java src/share/vm/jvmci/jvmciJavaClasses.hpp
diffstat 6 files changed, 8 insertions(+), 142 deletions(-) [+]
line wrap: on
line diff
--- a/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/StackLockValue.java	Fri Oct 16 11:12:34 2015 +0200
+++ b/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/StackLockValue.java	Fri Oct 16 13:44:47 2015 +0200
@@ -22,8 +22,7 @@
  */
 package jdk.vm.ci.code;
 
-import static jdk.vm.ci.code.ValueUtil.isStackSlot;
-import static jdk.vm.ci.code.ValueUtil.isVirtualStackSlot;
+import jdk.vm.ci.meta.AllocatableValue;
 import jdk.vm.ci.meta.JavaValue;
 import jdk.vm.ci.meta.Value;
 
@@ -33,10 +32,10 @@
 public final class StackLockValue implements JavaValue {
 
     private JavaValue owner;
-    private StackSlotValue slot;
+    private AllocatableValue slot;
     private final boolean eliminated;
 
-    public StackLockValue(JavaValue object, StackSlotValue slot, boolean eliminated) {
+    public StackLockValue(JavaValue object, AllocatableValue slot, boolean eliminated) {
         this.owner = object;
         this.slot = slot;
         this.eliminated = eliminated;
@@ -82,8 +81,7 @@
         return false;
     }
 
-    public void setSlot(StackSlotValue stackSlot) {
-        assert slot == null || (isVirtualStackSlot(slot) && (slot.equals(stackSlot) || isStackSlot(stackSlot))) : String.format("Can not set slot for %s to %s", this, stackSlot);
+    public void setSlot(AllocatableValue stackSlot) {
         slot = stackSlot;
     }
 }
--- a/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/StackSlot.java	Fri Oct 16 11:12:34 2015 +0200
+++ b/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/StackSlot.java	Fri Oct 16 13:44:47 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,14 @@
  */
 package jdk.vm.ci.code;
 
+import jdk.vm.ci.meta.AllocatableValue;
 import jdk.vm.ci.meta.LIRKind;
 
 /**
  * Represents a compiler spill slot or an outgoing stack-based argument in a method's frame or an
  * incoming stack-based argument in a method's {@linkplain #isInCallerFrame() caller's frame}.
  */
-public final class StackSlot extends StackSlotValue {
+public final class StackSlot extends AllocatableValue {
 
     private final int offset;
     private final boolean addFrameSize;
--- a/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/StackSlotValue.java	Fri Oct 16 11:12:34 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.code;
-
-import jdk.vm.ci.meta.AllocatableValue;
-import jdk.vm.ci.meta.LIRKind;
-
-/**
- * Common base class for {@linkplain StackSlot real} and {@linkplain VirtualStackSlot virtual} stack
- * slots.
- */
-public abstract class StackSlotValue extends AllocatableValue {
-
-    public StackSlotValue(LIRKind lirKind) {
-        super(lirKind);
-    }
-
-}
--- a/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueUtil.java	Fri Oct 16 11:12:34 2015 +0200
+++ b/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueUtil.java	Fri Oct 16 13:44:47 2015 +0200
@@ -90,26 +90,6 @@
         return (StackSlot) value;
     }
 
-    public static boolean isStackSlotValue(Value value) {
-        assert value != null;
-        return value instanceof StackSlotValue;
-    }
-
-    public static StackSlotValue asStackSlotValue(Value value) {
-        assert value != null;
-        return (StackSlotValue) value;
-    }
-
-    public static boolean isVirtualStackSlot(Value value) {
-        assert value != null;
-        return value instanceof VirtualStackSlot;
-    }
-
-    public static VirtualStackSlot asVirtualStackSlot(Value value) {
-        assert value != null;
-        return (VirtualStackSlot) value;
-    }
-
     public static boolean isRegister(Value value) {
         assert value != null;
         return value instanceof RegisterValue;
--- a/jvmci/jdk.vm.ci.code/src/jdk/vm/ci/code/VirtualStackSlot.java	Fri Oct 16 11:12:34 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package jdk.vm.ci.code;
-
-import jdk.vm.ci.meta.LIRKind;
-
-/**
- * {@link VirtualStackSlot}s are stack slots that are not yet fixed to specific frame offset. They
- * are replaced by real {@link StackSlot}s with a fixed position in the frame before code emission.
- */
-public abstract class VirtualStackSlot extends StackSlotValue {
-
-    private final int id;
-
-    public VirtualStackSlot(int id, LIRKind lirKind) {
-        super(lirKind);
-        this.id = id;
-    }
-
-    public int getId() {
-        return id;
-    }
-
-    @Override
-    public String toString() {
-        return "vstack:" + id + getKindSuffix();
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = super.hashCode();
-        result = prime * result + id;
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (!super.equals(obj)) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        VirtualStackSlot other = (VirtualStackSlot) obj;
-        if (id != other.id) {
-            return false;
-        }
-        return true;
-    }
-
-}
--- a/src/share/vm/jvmci/jvmciJavaClasses.hpp	Fri Oct 16 11:12:34 2015 +0200
+++ b/src/share/vm/jvmci/jvmciJavaClasses.hpp	Fri Oct 16 13:44:47 2015 +0200
@@ -254,7 +254,7 @@
   end_class                                                                                                                                                    \
   start_class(StackLockValue)                                                                                                                                  \
     oop_field(StackLockValue, owner, "Ljdk/vm/ci/meta/JavaValue;")                                                                                             \
-    oop_field(StackLockValue, slot, "Ljdk/vm/ci/code/StackSlotValue;")                                                                                         \
+    oop_field(StackLockValue, slot, "Ljdk/vm/ci/meta/AllocatableValue;")                                                                                       \
     boolean_field(StackLockValue, eliminated)                                                                                                                  \
   end_class                                                                                                                                                    \
   start_class(SpeculationLog)                                                                                                                                  \