changeset 22565:a7c7901367ed

Merge
author Christian Wimmer <christian.wimmer@oracle.com>
date Tue, 15 Sep 2015 18:13:11 -0700
parents c345ad3a1cbb (diff) 118f9560e0ea (current diff)
children 94a604f431d3
files jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/DataSection.java
diffstat 156 files changed, 3320 insertions(+), 3965 deletions(-) [+]
line wrap: on
line diff
--- a/jvmci/jdk.internal.jvmci.amd64/src/jdk/internal/jvmci/amd64/AMD64.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.amd64/src/jdk/internal/jvmci/amd64/AMD64.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -149,7 +149,7 @@
     private final EnumSet<Flag> flags;
 
     public AMD64(EnumSet<CPUFeature> features, EnumSet<Flag> flags) {
-        super("AMD64", 8, ByteOrder.LITTLE_ENDIAN, true, allRegisters, LOAD_STORE | STORE_STORE, 1, cpuRegisters.length + (xmmRegisters.length << XMM_REFERENCE_MAP_SHIFT), 8);
+        super("AMD64", JavaKind.Long, ByteOrder.LITTLE_ENDIAN, true, allRegisters, LOAD_STORE | STORE_STORE, 1, cpuRegisters.length + (xmmRegisters.length << XMM_REFERENCE_MAP_SHIFT), 8);
         this.features = features;
         this.flags = flags;
         assert features.contains(CPUFeature.SSE2) : "minimum config for x64";
@@ -164,12 +164,21 @@
     }
 
     @Override
+    public PlatformKind getPlatformKind(JavaKind javaKind) {
+        if (javaKind.isObject()) {
+            return getWordKind();
+        } else {
+            return javaKind;
+        }
+    }
+
+    @Override
     public boolean canStoreValue(RegisterCategory category, PlatformKind platformKind) {
-        if (!(platformKind instanceof Kind)) {
+        if (!(platformKind instanceof JavaKind)) {
             return false;
         }
 
-        Kind kind = (Kind) platformKind;
+        JavaKind kind = (JavaKind) platformKind;
         if (category.equals(CPU)) {
             switch (kind) {
                 case Boolean:
@@ -178,7 +187,6 @@
                 case Short:
                 case Int:
                 case Long:
-                case Object:
                     return true;
             }
         } else if (category.equals(XMM)) {
@@ -195,11 +203,11 @@
     @Override
     public PlatformKind getLargestStorableKind(RegisterCategory category) {
         if (category.equals(CPU)) {
-            return Kind.Long;
+            return JavaKind.Long;
         } else if (category.equals(XMM)) {
-            return Kind.Double;
+            return JavaKind.Double;
         } else {
-            return Kind.Illegal;
+            return JavaKind.Illegal;
         }
     }
 }
--- a/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/Architecture.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/Architecture.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -25,7 +25,7 @@
 import java.nio.*;
 import java.util.*;
 
-import jdk.internal.jvmci.code.Register.*;
+import jdk.internal.jvmci.code.Register.RegisterCategory;
 import jdk.internal.jvmci.meta.*;
 
 /**
@@ -42,10 +42,9 @@
     private final int registerReferenceMapSize;
 
     /**
-     * Represents the natural size of words (typically registers and pointers) of this architecture,
-     * in bytes.
+     * The architecture specific type of a native word.
      */
-    private final int wordSize;
+    private final PlatformKind wordKind;
 
     /**
      * The name of this architecture (e.g. "AMD64", "SPARCv9").
@@ -85,11 +84,11 @@
      */
     private final int returnAddressSize;
 
-    protected Architecture(String name, int wordSize, ByteOrder byteOrder, boolean unalignedMemoryAccess, Register[] registers, int implicitMemoryBarriers, int nativeCallDisplacementOffset,
+    protected Architecture(String name, PlatformKind wordKind, ByteOrder byteOrder, boolean unalignedMemoryAccess, Register[] registers, int implicitMemoryBarriers, int nativeCallDisplacementOffset,
                     int registerReferenceMapSize, int returnAddressSize) {
         this.name = name;
         this.registers = registers;
-        this.wordSize = wordSize;
+        this.wordKind = wordKind;
         this.byteOrder = byteOrder;
         this.unalignedMemoryAccess = unalignedMemoryAccess;
         this.implicitMemoryBarriers = implicitMemoryBarriers;
@@ -117,7 +116,11 @@
      * bytes.
      */
     public int getWordSize() {
-        return wordSize;
+        return wordKind.getSizeInBytes();
+    }
+
+    public PlatformKind getWordKind() {
+        return wordKind;
     }
 
     /**
@@ -173,38 +176,6 @@
     }
 
     /**
-     * Gets the size in bytes of the specified kind for this target.
-     *
-     * @param kind the kind for which to get the size
-     *
-     * @return the size in bytes of {@code kind}
-     */
-    public int getSizeInBytes(PlatformKind kind) {
-        switch ((Kind) kind) {
-            case Boolean:
-                return 1;
-            case Byte:
-                return 1;
-            case Char:
-                return 2;
-            case Short:
-                return 2;
-            case Int:
-                return 4;
-            case Long:
-                return 8;
-            case Float:
-                return 4;
-            case Double:
-                return 8;
-            case Object:
-                return wordSize;
-            default:
-                return 0;
-        }
-    }
-
-    /**
      * Determine whether a kind can be stored in a register of a given category.
      *
      * @param category the category of the register
@@ -220,6 +191,11 @@
      */
     public abstract PlatformKind getLargestStorableKind(RegisterCategory category);
 
+    /**
+     * Return the {@link PlatformKind} that is used to store values of a given {@link JavaKind}.
+     */
+    public abstract PlatformKind getPlatformKind(JavaKind javaKind);
+
     @Override
     public final boolean equals(Object obj) {
         if (obj == this) {
@@ -235,7 +211,7 @@
                 assert Arrays.equals(this.registers, that.registers);
                 assert this.returnAddressSize == that.returnAddressSize;
                 assert this.unalignedMemoryAccess == that.unalignedMemoryAccess;
-                assert this.wordSize == that.wordSize;
+                assert this.wordKind == that.wordKind;
                 return true;
             }
         }
--- a/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/BytecodeFrame.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/BytecodeFrame.java	Tue Sep 15 18:13:11 2015 -0700
@@ -63,7 +63,13 @@
      * Note that the number of locals and the number of stack slots may be smaller than the maximum
      * number of locals and stack slots as specified in the compiled method.
      */
-    public final Value[] values;
+    public final JavaValue[] values;
+
+    /**
+     * An array describing the Java kind of the {@link #values}. It records a kind for the locals
+     * and the operand stack.
+     */
+    public final JavaKind[] slotKinds;
 
     /**
      * The number of locals in the values array.
@@ -169,12 +175,14 @@
      * @param numStack the depth of the stack
      * @param numLocks the number of locked objects
      */
-    public BytecodeFrame(BytecodeFrame caller, ResolvedJavaMethod method, int bci, boolean rethrowException, boolean duringCall, Value[] values, int numLocals, int numStack, int numLocks) {
+    public BytecodeFrame(BytecodeFrame caller, ResolvedJavaMethod method, int bci, boolean rethrowException, boolean duringCall, JavaValue[] values, JavaKind[] slotKinds, int numLocals, int numStack,
+                    int numLocks) {
         super(caller, method, bci);
         assert values != null;
         this.rethrowException = rethrowException;
         this.duringCall = duringCall;
         this.values = values;
+        this.slotKinds = slotKinds;
         this.numLocals = numLocals;
         this.numStack = numStack;
         this.numLocks = numLocks;
@@ -186,18 +194,17 @@
      * slot following a double word item. This should really be checked in FrameState itself but
      * because of Word type rewriting and alternative backends that can't be done.
      */
-    public boolean validateFormat(boolean derivedOk) {
+    public boolean validateFormat() {
         if (caller() != null) {
-            caller().validateFormat(derivedOk);
+            caller().validateFormat();
         }
         for (int i = 0; i < numLocals + numStack; i++) {
             if (values[i] != null) {
-                Kind kind = values[i].getKind();
+                JavaKind kind = slotKinds[i];
                 if (kind.needsTwoSlots()) {
-                    assert values.length > i + 1 : String.format("missing second word %s", this);
-                    assert values[i + 1] == null || values[i + 1].getKind() == Kind.Illegal : this;
+                    assert slotKinds.length > i + 1 : String.format("missing second word %s", this);
+                    assert slotKinds[i + 1] == JavaKind.Illegal : this;
                 }
-                assert derivedOk || ValueUtil.isIllegal(values[i]) || !values[i].getLIRKind().isUnknownReference() : "Unexpected derived value: " + values[i];
             }
         }
         return true;
@@ -209,7 +216,7 @@
      * @param i the local variable index
      * @return the value that can be used to reconstruct the local's current value
      */
-    public Value getLocalValue(int i) {
+    public JavaValue getLocalValue(int i) {
         return values[i];
     }
 
@@ -219,7 +226,7 @@
      * @param i the stack index
      * @return the value that can be used to reconstruct the stack slot's current value
      */
-    public Value getStackValue(int i) {
+    public JavaValue getStackValue(int i) {
         return values[i + numLocals];
     }
 
@@ -229,7 +236,7 @@
      * @param i the lock index
      * @return the value that can be used to reconstruct the lock's current value
      */
-    public Value getLockValue(int i) {
+    public JavaValue getLockValue(int i) {
         return values[i + numLocals + numStack];
     }
 
--- a/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/DataSection.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/DataSection.java	Tue Sep 15 18:13:11 2015 -0700
@@ -224,6 +224,10 @@
         sectionSize = position;
     }
 
+    public boolean isFinalized() {
+        return finalLayout;
+    }
+
     /**
      * Get the size of the data section. Can only be called after {@link #finalizeLayout}.
      */
--- a/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/Register.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/Register.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -157,7 +157,7 @@
     /**
      * Gets this register as a {@linkplain RegisterValue value} with no particular kind.
      *
-     * @return a {@link RegisterValue} with {@link Kind#Illegal} kind.
+     * @return a {@link RegisterValue} with {@link JavaKind#Illegal} kind.
      */
     public RegisterValue asValue() {
         return asValue(LIRKind.Illegal);
--- a/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/RegisterConfig.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/RegisterConfig.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -34,7 +34,7 @@
     /**
      * Gets the register to be used for returning a value of a given kind.
      */
-    Register getReturnRegister(Kind kind);
+    Register getReturnRegister(JavaKind kind);
 
     /**
      * Gets the maximum allowed size of the frame.
@@ -68,7 +68,7 @@
      * @return the ordered set of registers that may be used to pass parameters in a call conforming
      *         to {@code type}
      */
-    Register[] getCallingConventionRegisters(Type type, Kind kind);
+    Register[] getCallingConventionRegisters(Type type, JavaKind kind);
 
     /**
      * Gets the set of all registers that might be used by the register allocator.
--- a/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/RegisterValue.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/RegisterValue.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -26,7 +26,7 @@
 
 /**
  * Denotes a register that stores a value of a fixed kind. There is exactly one (canonical) instance
- * of {@link RegisterValue} for each ({@link Register}, {@link Kind}) pair. Use
+ * of {@link RegisterValue} for each ({@link Register}, {@link JavaKind}) pair. Use
  * {@link Register#asValue(LIRKind)} to retrieve the canonical {@link RegisterValue} instance for a
  * given (register,kind) pair.
  */
--- a/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/StackLockValue.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/StackLockValue.java	Tue Sep 15 18:13:11 2015 -0700
@@ -28,24 +28,23 @@
 /**
  * Represents lock information in the debug information.
  */
-public final class StackLockValue extends AbstractValue implements JavaValue {
+public final class StackLockValue implements JavaValue {
 
-    private Value owner;
+    private JavaValue owner;
     private StackSlotValue slot;
     private final boolean eliminated;
 
-    public StackLockValue(Value object, StackSlotValue slot, boolean eliminated) {
-        super(LIRKind.Illegal);
+    public StackLockValue(JavaValue object, StackSlotValue slot, boolean eliminated) {
         this.owner = object;
         this.slot = slot;
         this.eliminated = eliminated;
     }
 
-    public Value getOwner() {
+    public JavaValue getOwner() {
         return owner;
     }
 
-    public void setOwner(Value newOwner) {
+    public void setOwner(JavaValue newOwner) {
         this.owner = newOwner;
     }
 
--- a/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/TargetDescription.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/TargetDescription.java	Tue Sep 15 18:13:11 2015 -0700
@@ -51,7 +51,7 @@
     /**
      * The kind to be used for representing raw pointers and CPU registers.
      */
-    public final Kind wordKind;
+    public final JavaKind wordKind;
 
     /**
      * The stack alignment requirement of the platform. For example, from Appendix D of <a
@@ -77,7 +77,7 @@
         this.arch = arch;
         this.isMP = isMP;
         this.wordSize = arch.getWordSize();
-        this.wordKind = Kind.fromWordSize(wordSize);
+        this.wordKind = JavaKind.fromWordSize(wordSize);
         this.stackAlignment = stackAlignment;
         this.implicitNullCheckLimit = implicitNullCheckLimit;
         this.inlineObjects = inlineObjects;
@@ -116,24 +116,15 @@
     }
 
     public int getSizeInBytes(PlatformKind kind) {
-        return arch.getSizeInBytes(kind);
+        return kind.getSizeInBytes();
     }
 
-    public LIRKind getLIRKind(Kind javaKind) {
-        switch (javaKind) {
-            case Boolean:
-            case Byte:
-            case Short:
-            case Char:
-            case Int:
-            case Long:
-            case Float:
-            case Double:
-                return LIRKind.value(javaKind);
-            case Object:
-                return LIRKind.reference(javaKind);
-            default:
-                return LIRKind.Illegal;
+    public LIRKind getLIRKind(JavaKind javaKind) {
+        PlatformKind platformKind = arch.getPlatformKind(javaKind);
+        if (javaKind.isObject()) {
+            return LIRKind.reference(platformKind);
+        } else {
+            return LIRKind.value(platformKind);
         }
     }
 }
--- a/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/ValueUtil.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/ValueUtil.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -36,30 +36,30 @@
         return Value.ILLEGAL.equals(value);
     }
 
+    public static boolean isIllegalJavaValue(JavaValue value) {
+        assert value != null;
+        return Value.ILLEGAL.equals(value);
+    }
+
     public static boolean isLegal(Value value) {
         return !isIllegal(value);
     }
 
-    public static boolean isVirtualObject(Value value) {
+    public static boolean isVirtualObject(JavaValue value) {
         assert value != null;
         return value instanceof VirtualObject;
     }
 
-    public static VirtualObject asVirtualObject(Value value) {
+    public static VirtualObject asVirtualObject(JavaValue value) {
         assert value != null;
         return (VirtualObject) value;
     }
 
-    public static boolean isConstant(Value value) {
+    public static boolean isConstantJavaValue(JavaValue value) {
         assert value != null;
         return value instanceof JavaConstant;
     }
 
-    public static JavaConstant asConstant(Value value) {
-        assert value != null;
-        return (JavaConstant) value;
-    }
-
     public static boolean isAllocatableValue(Value value) {
         assert value != null;
         return value instanceof AllocatableValue;
@@ -106,41 +106,22 @@
     }
 
     public static Register asRegister(Value value) {
-        assert value != null;
-        return ((RegisterValue) value).getRegister();
+        return asRegisterValue(value).getRegister();
     }
 
-    public static Register asIntReg(Value value) {
-        if (value.getKind().getStackKind() != Kind.Int) {
-            throw new InternalError("needed Int got: " + value.getKind());
+    public static RegisterValue asRegisterValue(Value value) {
+        assert value != null;
+        return (RegisterValue) value;
+    }
+
+    public static Register asRegister(Value value, PlatformKind kind) {
+        if (value.getPlatformKind() != kind) {
+            throw new InternalError("needed: " + kind + " got: " + value.getPlatformKind());
         } else {
             return asRegister(value);
         }
     }
 
-    public static Register asLongReg(Value value) {
-        if (value.getKind() != Kind.Long) {
-            throw new InternalError("needed Long got: " + value.getKind());
-        } else {
-            return asRegister(value);
-        }
-    }
-
-    public static Register asObjectReg(Value value) {
-        assert value.getKind() == Kind.Object : value.getKind();
-        return asRegister(value);
-    }
-
-    public static Register asFloatReg(Value value) {
-        assert value.getKind() == Kind.Float : value.getKind();
-        return asRegister(value);
-    }
-
-    public static Register asDoubleReg(Value value) {
-        assert value.getKind() == Kind.Double : value.getKind();
-        return asRegister(value);
-    }
-
     public static boolean sameRegister(Value v1, Value v2) {
         return isRegister(v1) && isRegister(v2) && asRegister(v1).equals(asRegister(v2));
     }
@@ -184,4 +165,29 @@
         }
         return registers;
     }
+
+    /**
+     * Subtract sets of registers (x - y).
+     *
+     * @param x a set of register to subtract from.
+     * @param y a set of registers to subtract.
+     * @return resulting set of registers (x - y).
+     */
+    public static Value[] subtractRegisters(Value[] x, Value[] y) {
+        ArrayList<Value> result = new ArrayList<>(x.length);
+        for (Value i : x) {
+            boolean append = true;
+            for (Value j : y) {
+                if (ValueUtil.sameRegister(i, j)) {
+                    append = false;
+                    break;
+                }
+            }
+            if (append) {
+                result.add(i);
+            }
+        }
+        Value[] resultArray = new Value[result.size()];
+        return result.toArray(resultArray);
+    }
 }
--- a/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/VirtualObject.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.code/src/jdk/internal/jvmci/code/VirtualObject.java	Tue Sep 15 18:13:11 2015 -0700
@@ -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
@@ -31,10 +31,11 @@
  * The information stored in the {@link VirtualObject} is used during deoptimization to recreate the
  * object.
  */
-public final class VirtualObject extends AbstractValue implements JavaValue {
+public final class VirtualObject implements JavaValue {
 
     private final ResolvedJavaType type;
-    private Value[] values;
+    private JavaValue[] values;
+    private JavaKind[] slotKinds;
     private final int id;
 
     /**
@@ -46,24 +47,20 @@
      *
      * @param type the type of the object whose allocation was removed during compilation. This can
      *            be either an instance of an array type.
-     * @param values an array containing all the values to be stored into the object when it is
-     *            recreated
      * @param id a unique id that identifies the object within the debug information for one
      *            position in the compiled code.
      * @return a new {@link VirtualObject} instance.
      */
-    public static VirtualObject get(ResolvedJavaType type, Value[] values, int id) {
-        return new VirtualObject(type, values, id);
+    public static VirtualObject get(ResolvedJavaType type, int id) {
+        return new VirtualObject(type, id);
     }
 
-    private VirtualObject(ResolvedJavaType type, Value[] values, int id) {
-        super(LIRKind.reference(Kind.Object));
+    private VirtualObject(ResolvedJavaType type, int id) {
         this.type = type;
-        this.values = values;
         this.id = id;
     }
 
-    private static StringBuilder appendValue(StringBuilder buf, Value value, Set<VirtualObject> visited) {
+    private static StringBuilder appendValue(StringBuilder buf, JavaValue value, Set<VirtualObject> visited) {
         if (value instanceof VirtualObject) {
             VirtualObject vo = (VirtualObject) value;
             buf.append("vobject:").append(vo.type.toJavaName(false)).append(':').append(vo.id);
@@ -118,11 +115,18 @@
     /**
      * Returns an array containing all the values to be stored into the object when it is recreated.
      */
-    public Value[] getValues() {
+    public JavaValue[] getValues() {
         return values;
     }
 
     /**
+     * Returns an array containing the Java kind of all values in the object.
+     */
+    public JavaKind[] getSlotKinds() {
+        return slotKinds;
+    }
+
+    /**
      * Returns the unique id that identifies the object within the debug information for one
      * position in the compiled code.
      */
@@ -130,36 +134,38 @@
         return id;
     }
 
-    private static boolean checkValues(ResolvedJavaType type, Value[] values) {
+    private boolean checkValues() {
+        assert (values == null) == (slotKinds == null);
         if (values != null) {
+            assert values.length == slotKinds.length;
             if (!type.isArray()) {
                 ResolvedJavaField[] fields = type.getInstanceFields(true);
                 int fieldIndex = 0;
                 for (int i = 0; i < values.length; i++) {
                     ResolvedJavaField field = fields[fieldIndex++];
-                    Kind valKind = values[i].getKind().getStackKind();
-                    if (field.getKind() == Kind.Object) {
-                        assert values[i].getLIRKind().isReference(0) : field + ": " + valKind + " != " + field.getKind();
+                    JavaKind valKind = slotKinds[i].getStackKind();
+                    if (field.getJavaKind() == JavaKind.Object) {
+                        assert valKind.isObject() : field + ": " + valKind + " != " + field.getJavaKind();
                     } else {
-                        if ((valKind == Kind.Double || valKind == Kind.Long) && field.getKind() == Kind.Int) {
-                            assert fields[fieldIndex].getKind() == Kind.Int;
+                        if ((valKind == JavaKind.Double || valKind == JavaKind.Long) && field.getJavaKind() == JavaKind.Int) {
+                            assert fields[fieldIndex].getJavaKind() == JavaKind.Int;
                             fieldIndex++;
                         } else {
-                            assert valKind == field.getKind().getStackKind() : field + ": " + valKind + " != " + field.getKind();
+                            assert valKind == field.getJavaKind().getStackKind() : field + ": " + valKind + " != " + field.getJavaKind();
                         }
                     }
                 }
                 assert fields.length == fieldIndex : type + ": fields=" + Arrays.toString(fields) + ", field values=" + Arrays.toString(values);
             } else {
-                Kind componentKind = type.getComponentType().getKind().getStackKind();
-                if (componentKind == Kind.Object) {
+                JavaKind componentKind = type.getComponentType().getJavaKind().getStackKind();
+                if (componentKind == JavaKind.Object) {
                     for (int i = 0; i < values.length; i++) {
-                        assert values[i].getLIRKind().isReference(0) : values[i].getKind() + " != " + componentKind;
+                        assert slotKinds[i].isObject() : slotKinds[i] + " != " + componentKind;
                     }
                 } else {
                     for (int i = 0; i < values.length; i++) {
-                        assert values[i].getKind() == componentKind || componentKind.getBitCount() >= values[i].getKind().getBitCount() ||
-                                        (componentKind == Kind.Int && values[i].getKind().getBitCount() >= Kind.Int.getBitCount()) : values[i].getKind() + " != " + componentKind;
+                        assert slotKinds[i] == componentKind || componentKind.getBitCount() >= slotKinds[i].getBitCount() ||
+                                        (componentKind == JavaKind.Int && slotKinds[i].getBitCount() >= JavaKind.Int.getBitCount()) : slotKinds[i] + " != " + componentKind;
                     }
                 }
             }
@@ -172,15 +178,17 @@
      *
      * @param values an array containing all the values to be stored into the object when it is
      *            recreated.
+     * @param slotKinds an array containing the Java kinds of the values.
      */
-    public void setValues(Value[] values) {
-        assert checkValues(type, values);
+    public void setValues(JavaValue[] values, JavaKind[] slotKinds) {
         this.values = values;
+        this.slotKinds = slotKinds;
+        assert checkValues();
     }
 
     @Override
     public int hashCode() {
-        return getLIRKind().hashCode() + type.hashCode();
+        return 42 + type.hashCode();
     }
 
     @Override
--- a/jvmci/jdk.internal.jvmci.common/src/jdk/internal/jvmci/common/JVMCIError.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.common/src/jdk/internal/jvmci/common/JVMCIError.java	Tue Sep 15 18:13:11 2015 -0700
@@ -70,6 +70,15 @@
     }
 
     /**
+     * This constructor creates a {@link JVMCIError} with a given message.
+     *
+     * @param msg the message that will be associated with the error
+     */
+    public JVMCIError(String msg) {
+        super(msg);
+    }
+
+    /**
      * This constructor creates a {@link JVMCIError} with a message assembled via
      * {@link String#format(String, Object...)}. It always uses the ENGLISH locale in order to
      * always generate the same output.
--- a/jvmci/jdk.internal.jvmci.common/src/jdk/internal/jvmci/common/UnsafeAccess.java	Tue Sep 15 18:12:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, 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.internal.jvmci.common;
-
-import java.lang.reflect.*;
-
-import sun.misc.*;
-
-public class UnsafeAccess {
-
-    /**
-     * An instance of {@link Unsafe} for use within JVMCI.
-     */
-    public static final Unsafe unsafe;
-
-    static {
-        try {
-            Field theUnsafeInstance = Unsafe.class.getDeclaredField("theUnsafe");
-            theUnsafeInstance.setAccessible(true);
-            unsafe = (Unsafe) theUnsafeInstance.get(Unsafe.class);
-        } catch (Exception e) {
-            throw new RuntimeException("exception while trying to get Unsafe", e);
-        }
-    }
-
-    /**
-     * Copies the contents of a {@link String} to a native memory buffer as a {@code '\0'}
-     * terminated C string. The native memory buffer is allocated via
-     * {@link Unsafe#allocateMemory(long)}. The caller is responsible for releasing the buffer when
-     * it is no longer needed via {@link Unsafe#freeMemory(long)}.
-     *
-     * @return the native memory pointer of the C string created from {@code s}
-     */
-    public static long createCString(String s) {
-        return writeCString(s, unsafe.allocateMemory(s.length() + 1));
-    }
-
-    /**
-     * Reads a {@code '\0'} terminated C string from native memory and converts it to a
-     * {@link String}.
-     *
-     * @return a Java string
-     */
-    public static String readCString(long address) {
-        if (address == 0) {
-            return null;
-        }
-        StringBuilder sb = new StringBuilder();
-        for (int i = 0;; i++) {
-            char c = (char) unsafe.getByte(address + i);
-            if (c == 0) {
-                break;
-            }
-            sb.append(c);
-        }
-        return sb.toString();
-    }
-
-    /**
-     * Writes the contents of a {@link String} to a native memory buffer as a {@code '\0'}
-     * terminated C string. The caller is responsible for ensuring the buffer is at least
-     * {@code s.length() + 1} bytes long. The caller is also responsible for releasing the buffer
-     * when it is no longer.
-     *
-     * @return the value of {@code buf}
-     */
-    public static long writeCString(String s, long buf) {
-        int size = s.length();
-        for (int i = 0; i < size; i++) {
-            unsafe.putByte(buf + i, (byte) s.charAt(i));
-        }
-        unsafe.putByte(buf + size, (byte) '\0');
-        return buf;
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jvmci/jdk.internal.jvmci.common/src/jdk/internal/jvmci/common/UnsafeUtil.java	Tue Sep 15 18:13:11 2015 -0700
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2012, 2012, 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.internal.jvmci.common;
+
+import sun.misc.Unsafe;
+
+/**
+ * Utilities for operating on raw memory with {@link Unsafe}.
+ */
+public class UnsafeUtil {
+
+    /**
+     * Copies the contents of a {@link String} to a native memory buffer as a {@code '\0'}
+     * terminated C string. The native memory buffer is allocated via
+     * {@link Unsafe#allocateMemory(long)}. The caller is responsible for releasing the buffer when
+     * it is no longer needed via {@link Unsafe#freeMemory(long)}.
+     *
+     * @return the native memory pointer of the C string created from {@code s}
+     */
+    public static long createCString(Unsafe unsafe, String s) {
+        return writeCString(unsafe, s, unsafe.allocateMemory(s.length() + 1));
+    }
+
+    /**
+     * Reads a {@code '\0'} terminated C string from native memory and converts it to a
+     * {@link String}.
+     *
+     * @return a Java string
+     */
+    public static String readCString(Unsafe unsafe, long address) {
+        if (address == 0) {
+            return null;
+        }
+        StringBuilder sb = new StringBuilder();
+        for (int i = 0;; i++) {
+            char c = (char) unsafe.getByte(address + i);
+            if (c == 0) {
+                break;
+            }
+            sb.append(c);
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Writes the contents of a {@link String} to a native memory buffer as a {@code '\0'}
+     * terminated C string. The caller is responsible for ensuring the buffer is at least
+     * {@code s.length() + 1} bytes long. The caller is also responsible for releasing the buffer
+     * when it is no longer.
+     *
+     * @return the value of {@code buf}
+     */
+    public static long writeCString(Unsafe unsafe, String s, long buf) {
+        int size = s.length();
+        for (int i = 0; i < size; i++) {
+            unsafe.putByte(buf + i, (byte) s.charAt(i));
+        }
+        unsafe.putByte(buf + size, (byte) '\0');
+        return buf;
+    }
+}
--- a/jvmci/jdk.internal.jvmci.compiler/src/jdk/internal/jvmci/compiler/Compiler.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.compiler/src/jdk/internal/jvmci/compiler/Compiler.java	Tue Sep 15 18:13:11 2015 -0700
@@ -47,10 +47,4 @@
      * @param id a unique identifier for this compilation
      */
     void compileMethod(ResolvedJavaMethod method, int entryBCI, long jvmciEnv, int id);
-
-    /**
-     * Notifies this JVMCI compiler that the VM is running in CompileTheWorld mode and it should now
-     * perform its version of CompileTheWorld.
-     */
-    void compileTheWorld() throws Throwable;
 }
--- a/jvmci/jdk.internal.jvmci.hotspot.amd64/src/jdk/internal/jvmci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot.amd64/src/jdk/internal/jvmci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java	Tue Sep 15 18:13:11 2015 -0700
@@ -131,6 +131,7 @@
         return "JVMCIBackend:" + getArchitecture();
     }
 
+    @SuppressWarnings("try")
     public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, CompilerFactory compilerFactory, JVMCIBackend host) {
 
         assert host == null;
--- a/jvmci/jdk.internal.jvmci.hotspot.amd64/src/jdk/internal/jvmci/hotspot/amd64/AMD64HotSpotRegisterConfig.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot.amd64/src/jdk/internal/jvmci/hotspot/amd64/AMD64HotSpotRegisterConfig.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -166,12 +166,22 @@
         return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly);
     }
 
-    public Register[] getCallingConventionRegisters(Type type, Kind kind) {
-        if (architecture.canStoreValue(XMM, kind)) {
-            return xmmParameterRegisters;
+    public Register[] getCallingConventionRegisters(Type type, JavaKind kind) {
+        switch (kind) {
+            case Boolean:
+            case Byte:
+            case Short:
+            case Char:
+            case Int:
+            case Long:
+            case Object:
+                return type == Type.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters;
+            case Float:
+            case Double:
+                return xmmParameterRegisters;
+            default:
+                throw JVMCIError.shouldNotReachHere();
         }
-        assert architecture.canStoreValue(CPU, kind);
-        return type == Type.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters;
     }
 
     private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) {
@@ -182,7 +192,7 @@
         int currentStackOffset = type == Type.NativeCall && needsNativeStackHomeSpace ? generalParameterRegisters.length * target.wordSize : 0;
 
         for (int i = 0; i < parameterTypes.length; i++) {
-            final Kind kind = parameterTypes[i].getKind();
+            final JavaKind kind = parameterTypes[i].getJavaKind().getStackKind();
 
             switch (kind) {
                 case Byte:
@@ -209,18 +219,19 @@
             }
 
             if (locations[i] == null) {
-                locations[i] = StackSlot.get(target.getLIRKind(kind.getStackKind()), currentStackOffset, !type.out);
-                currentStackOffset += Math.max(target.getSizeInBytes(kind), target.wordSize);
+                LIRKind lirKind = target.getLIRKind(kind);
+                locations[i] = StackSlot.get(lirKind, currentStackOffset, !type.out);
+                currentStackOffset += Math.max(target.getSizeInBytes(lirKind.getPlatformKind()), target.wordSize);
             }
         }
 
-        Kind returnKind = returnType == null ? Kind.Void : returnType.getKind();
-        AllocatableValue returnLocation = returnKind == Kind.Void ? Value.ILLEGAL : getReturnRegister(returnKind).asValue(target.getLIRKind(returnKind.getStackKind()));
+        JavaKind returnKind = returnType == null ? JavaKind.Void : returnType.getJavaKind();
+        AllocatableValue returnLocation = returnKind == JavaKind.Void ? Value.ILLEGAL : getReturnRegister(returnKind).asValue(target.getLIRKind(returnKind.getStackKind()));
         return new CallingConvention(currentStackOffset, returnLocation, locations);
     }
 
     @Override
-    public Register getReturnRegister(Kind kind) {
+    public Register getReturnRegister(JavaKind kind) {
         switch (kind) {
             case Boolean:
             case Byte:
--- a/jvmci/jdk.internal.jvmci.hotspot.sparc/src/jdk/internal/jvmci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot.sparc/src/jdk/internal/jvmci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java	Tue Sep 15 18:13:11 2015 -0700
@@ -80,6 +80,7 @@
         return "JVMCIBackend:" + getArchitecture();
     }
 
+    @SuppressWarnings("try")
     public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, CompilerFactory compilerFactory, JVMCIBackend host) {
         assert host == null;
         TargetDescription target = createTarget(runtime.getConfig(), compilerFactory);
--- a/jvmci/jdk.internal.jvmci.hotspot.sparc/src/jdk/internal/jvmci/hotspot/sparc/SPARCHotSpotRegisterConfig.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot.sparc/src/jdk/internal/jvmci/hotspot/sparc/SPARCHotSpotRegisterConfig.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -52,11 +52,11 @@
             if (architecture.canStoreValue(reg.getRegisterCategory(), kind)) {
                 // Special treatment for double precision
                 // TODO: This is wasteful it uses only half of the registers as float.
-                if (kind == Kind.Double) {
+                if (kind == JavaKind.Double) {
                     if (reg.getRegisterCategory().equals(FPUd)) {
                         list.add(reg);
                     }
-                } else if (kind == Kind.Float) {
+                } else if (kind == JavaKind.Float) {
                     if (reg.getRegisterCategory().equals(FPUs)) {
                         list.add(reg);
                     }
@@ -181,11 +181,11 @@
         throw JVMCIError.shouldNotReachHere();
     }
 
-    public Register[] getCallingConventionRegisters(Type type, Kind kind) {
+    public Register[] getCallingConventionRegisters(Type type, JavaKind kind) {
         if (architecture.canStoreValue(FPUs, kind) || architecture.canStoreValue(FPUd, kind)) {
             return fpuParameterRegisters;
         }
-        assert architecture.canStoreValue(CPU, kind);
+        assert architecture.canStoreValue(CPU, kind) : kind;
         return type == Type.JavaCallee ? cpuCalleeParameterRegisters : cpuCallerParameterRegisters;
     }
 
@@ -197,7 +197,7 @@
         int currentStackOffset = 0;
 
         for (int i = 0; i < parameterTypes.length; i++) {
-            final Kind kind = parameterTypes[i].getKind();
+            final JavaKind kind = parameterTypes[i].getJavaKind().getStackKind();
 
             switch (kind) {
                 case Byte:
@@ -234,17 +234,18 @@
             }
 
             if (locations[i] == null) {
+                LIRKind lirKind = target.getLIRKind(kind);
                 // Stack slot is always aligned to its size in bytes but minimum wordsize
-                int typeSize = SPARC.spillSlotSize(target, kind);
+                int typeSize = target.getSizeInBytes(lirKind.getPlatformKind());
                 currentStackOffset = roundUp(currentStackOffset, typeSize);
                 int slotOffset = currentStackOffset + SPARC.REGISTER_SAFE_AREA_SIZE;
-                locations[i] = StackSlot.get(target.getLIRKind(kind.getStackKind()), slotOffset, !type.out);
+                locations[i] = StackSlot.get(lirKind, slotOffset, !type.out);
                 currentStackOffset += typeSize;
             }
         }
 
-        Kind returnKind = returnType == null ? Kind.Void : returnType.getKind();
-        AllocatableValue returnLocation = returnKind == Kind.Void ? Value.ILLEGAL : getReturnRegister(returnKind, type).asValue(target.getLIRKind(returnKind.getStackKind()));
+        JavaKind returnKind = returnType == null ? JavaKind.Void : returnType.getJavaKind();
+        AllocatableValue returnLocation = returnKind == JavaKind.Void ? Value.ILLEGAL : getReturnRegister(returnKind, type).asValue(target.getLIRKind(returnKind.getStackKind()));
         return new CallingConvention(currentStackOffset, returnLocation, locations);
     }
 
@@ -253,11 +254,11 @@
     }
 
     @Override
-    public Register getReturnRegister(Kind kind) {
+    public Register getReturnRegister(JavaKind kind) {
         return getReturnRegister(kind, Type.JavaCallee);
     }
 
-    private static Register getReturnRegister(Kind kind, Type type) {
+    private static Register getReturnRegister(JavaKind kind, Type type) {
         switch (kind) {
             case Boolean:
             case Byte:
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/CompileTheWorldMain.java	Tue Sep 15 18:12:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 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
- * 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.internal.jvmci.hotspot;
-
-import jdk.internal.jvmci.compiler.Compiler;
-
-public class CompileTheWorldMain {
-    public static void main(String[] args) throws Throwable {
-        Compiler compiler = HotSpotJVMCIRuntime.runtime().getCompiler();
-        compiler.compileTheWorld();
-    }
-}
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/CompilerToVM.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/CompilerToVM.java	Tue Sep 15 18:13:11 2015 -0700
@@ -23,32 +23,56 @@
 
 package jdk.internal.jvmci.hotspot;
 
-import java.lang.reflect.*;
+import static jdk.internal.jvmci.inittimer.InitTimer.timer;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
 
-import jdk.internal.jvmci.code.*;
-import jdk.internal.jvmci.hotspotvmconfig.*;
-import jdk.internal.jvmci.meta.*;
-import sun.misc.*;
+import jdk.internal.jvmci.code.InstalledCode;
+import jdk.internal.jvmci.code.InvalidInstalledCodeException;
+import jdk.internal.jvmci.code.TargetDescription;
+import jdk.internal.jvmci.hotspotvmconfig.HotSpotVMField;
+import jdk.internal.jvmci.inittimer.InitTimer;
+import jdk.internal.jvmci.meta.JavaType;
+import jdk.internal.jvmci.meta.ResolvedJavaMethod;
+import jdk.internal.jvmci.meta.ResolvedJavaType;
+import jdk.internal.jvmci.meta.SpeculationLog;
+import sun.misc.Unsafe;
 
 /**
  * Calls from Java into HotSpot. The behavior of all the methods in this class that take a native
  * pointer as an argument (e.g., {@link #getSymbol(long)}) is undefined if the argument does not
  * denote a valid native object.
  */
-public interface CompilerToVM {
+public final class CompilerToVM {
+    /**
+     * Initializes the native part of the JVMCI runtime.
+     */
+    private static native void init();
+
+    static {
+        initialize();
+    }
+
+    @SuppressWarnings("try")
+    private static void initialize() {
+        try (InitTimer t = timer("CompilerToVMImpl.init")) {
+            init();
+        }
+    }
 
     /**
      * Copies the original bytecode of {@code method} into a new byte array and returns it.
      *
      * @return a new byte array containing the original bytecode of {@code method}
      */
-    byte[] getBytecode(HotSpotResolvedJavaMethodImpl method);
+    native byte[] getBytecode(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Gets the number of entries in {@code method}'s exception handler table or 0 if it has not
      * exception handler table.
      */
-    int getExceptionTableLength(HotSpotResolvedJavaMethodImpl method);
+    native int getExceptionTableLength(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Gets the address of the first entry in {@code method}'s exception handler table.
@@ -66,12 +90,12 @@
      * @return 0 if {@code method} has no exception handlers (i.e.
      *         {@code getExceptionTableLength(method) == 0})
      */
-    long getExceptionTableStart(HotSpotResolvedJavaMethodImpl method);
+    native long getExceptionTableStart(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Determines if {@code method} has balanced monitors.
      */
-    boolean hasBalancedMonitors(HotSpotResolvedJavaMethodImpl method);
+    native boolean hasBalancedMonitors(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Determines if {@code method} can be inlined. A method may not be inlinable for a number of
@@ -82,7 +106,7 @@
      * <li>the method may have other bytecode features that require special handling by the VM</li>
      * </ul>
      */
-    boolean canInlineMethod(HotSpotResolvedJavaMethodImpl method);
+    native boolean canInlineMethod(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Determines if {@code method} should be inlined at any cost. This could be because:
@@ -91,7 +115,7 @@
      * <li>an annotation forces inlining of this method</li>
      * </ul>
      */
-    boolean shouldInlineMethod(HotSpotResolvedJavaMethodImpl method);
+    native boolean shouldInlineMethod(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Used to implement {@link ResolvedJavaType#findUniqueConcreteMethod(ResolvedJavaMethod)}.
@@ -100,7 +124,7 @@
      * @param actualHolderType the best known type of receiver
      * @return the method result or 0 is there is no unique concrete method for {@code method}
      */
-    HotSpotResolvedJavaMethodImpl findUniqueConcreteMethod(HotSpotResolvedObjectTypeImpl actualHolderType, HotSpotResolvedJavaMethodImpl method);
+    native HotSpotResolvedJavaMethodImpl findUniqueConcreteMethod(HotSpotResolvedObjectTypeImpl actualHolderType, HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Gets the implementor for the interface class {@code type}.
@@ -108,12 +132,12 @@
      * @return the implementor if there is a single implementor, 0 if there is no implementor, or
      *         {@code type} itself if there is more than one implementor
      */
-    HotSpotResolvedObjectTypeImpl getImplementor(HotSpotResolvedObjectTypeImpl type);
+    native HotSpotResolvedObjectTypeImpl getImplementor(HotSpotResolvedObjectTypeImpl type);
 
     /**
      * Determines if {@code method} is ignored by security stack walks.
      */
-    boolean methodIsIgnoredBySecurityStackWalk(HotSpotResolvedJavaMethodImpl method);
+    native boolean methodIsIgnoredBySecurityStackWalk(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Converts a name to a type.
@@ -125,7 +149,7 @@
      * @return the type for {@code name} or 0 if resolution failed and {@code resolve == false}
      * @throws LinkageError if {@code resolve == true} and the resolution failed
      */
-    HotSpotResolvedObjectTypeImpl lookupType(String name, Class<?> accessingClass, boolean resolve);
+    native HotSpotResolvedObjectTypeImpl lookupType(String name, Class<?> accessingClass, boolean resolve);
 
     /**
      * Resolves the entry at index {@code cpi} in {@code constantPool} to an object.
@@ -133,7 +157,7 @@
      * The behavior of this method is undefined if {@code cpi} does not denote an entry that can be
      * resolved to an object.
      */
-    Object resolveConstantInPool(HotSpotConstantPool constantPool, int cpi);
+    native Object resolveConstantInPool(HotSpotConstantPool constantPool, int cpi);
 
     /**
      * Resolves the entry at index {@code cpi} in {@code constantPool} to an object, looking in the
@@ -142,7 +166,7 @@
      * The behavior of this method is undefined if {@code cpi} does not denote an entry that can be
      * resolved to an object.
      */
-    Object resolvePossiblyCachedConstantInPool(HotSpotConstantPool constantPool, int cpi);
+    native Object resolvePossiblyCachedConstantInPool(HotSpotConstantPool constantPool, int cpi);
 
     /**
      * Gets the {@code JVM_CONSTANT_NameAndType} index from the entry at index {@code cpi} in
@@ -151,7 +175,7 @@
      * The behavior of this method is undefined if {@code cpi} does not denote an entry containing a
      * {@code JVM_CONSTANT_NameAndType} index.
      */
-    int lookupNameAndTypeRefIndexInPool(HotSpotConstantPool constantPool, int cpi);
+    native int lookupNameAndTypeRefIndexInPool(HotSpotConstantPool constantPool, int cpi);
 
     /**
      * Gets the name of the {@code JVM_CONSTANT_NameAndType} entry at index {@code cpi} in
@@ -160,7 +184,7 @@
      * The behavior of this method is undefined if {@code cpi} does not denote a
      * {@code JVM_CONSTANT_NameAndType} entry.
      */
-    String lookupNameRefInPool(HotSpotConstantPool constantPool, int cpi);
+    native String lookupNameRefInPool(HotSpotConstantPool constantPool, int cpi);
 
     /**
      * Gets the signature of the {@code JVM_CONSTANT_NameAndType} entry at index {@code cpi} in
@@ -169,7 +193,7 @@
      * The behavior of this method is undefined if {@code cpi} does not denote a
      * {@code JVM_CONSTANT_NameAndType} entry.
      */
-    String lookupSignatureRefInPool(HotSpotConstantPool constantPool, int cpi);
+    native String lookupSignatureRefInPool(HotSpotConstantPool constantPool, int cpi);
 
     /**
      * Gets the {@code JVM_CONSTANT_Class} index from the entry at index {@code cpi} in
@@ -178,7 +202,7 @@
      * The behavior of this method is undefined if {@code cpi} does not denote an entry containing a
      * {@code JVM_CONSTANT_Class} index.
      */
-    int lookupKlassRefIndexInPool(HotSpotConstantPool constantPool, int cpi);
+    native int lookupKlassRefIndexInPool(HotSpotConstantPool constantPool, int cpi);
 
     /**
      * Looks up a class denoted by the {@code JVM_CONSTANT_Class} entry at index {@code cpi} in
@@ -189,7 +213,7 @@
      *
      * @return the resolved class entry or a String otherwise
      */
-    Object lookupKlassInPool(HotSpotConstantPool constantPool, int cpi);
+    native Object lookupKlassInPool(HotSpotConstantPool constantPool, int cpi);
 
     /**
      * Looks up a method denoted by the entry at index {@code cpi} in {@code constantPool}. This
@@ -204,7 +228,7 @@
      *            checks fail, 0 is returned.
      * @return the resolved method entry, 0 otherwise
      */
-    HotSpotResolvedJavaMethodImpl lookupMethodInPool(HotSpotConstantPool constantPool, int cpi, byte opcode);
+    native HotSpotResolvedJavaMethodImpl lookupMethodInPool(HotSpotConstantPool constantPool, int cpi, byte opcode);
 
     /**
      * Ensures that the type referenced by the specified {@code JVM_CONSTANT_InvokeDynamic} entry at
@@ -213,7 +237,7 @@
      * The behavior of this method is undefined if {@code cpi} does not denote a
      * {@code JVM_CONSTANT_InvokeDynamic} entry.
      */
-    void resolveInvokeDynamicInPool(HotSpotConstantPool constantPool, int cpi);
+    native void resolveInvokeDynamicInPool(HotSpotConstantPool constantPool, int cpi);
 
     /**
      * Ensures that the type referenced by the entry for a <a
@@ -224,7 +248,7 @@
      * The behavior of this method is undefined if {@code cpi} does not denote an entry representing
      * a signature polymorphic method.
      */
-    void resolveInvokeHandleInPool(HotSpotConstantPool constantPool, int cpi);
+    native void resolveInvokeHandleInPool(HotSpotConstantPool constantPool, int cpi);
 
     /**
      * Gets the resolved type denoted by the entry at index {@code cpi} in {@code constantPool}.
@@ -234,7 +258,7 @@
      *
      * @throws LinkageError if resolution failed
      */
-    HotSpotResolvedObjectTypeImpl resolveTypeInPool(HotSpotConstantPool constantPool, int cpi) throws LinkageError;
+    native HotSpotResolvedObjectTypeImpl resolveTypeInPool(HotSpotConstantPool constantPool, int cpi) throws LinkageError;
 
     /**
      * Looks up and attempts to resolve the {@code JVM_CONSTANT_Field} entry at index {@code cpi} in
@@ -251,7 +275,7 @@
      * @param info an array in which the details of the field are returned
      * @return the type defining the field if resolution is successful, 0 otherwise
      */
-    HotSpotResolvedObjectTypeImpl resolveFieldInPool(HotSpotConstantPool constantPool, int cpi, byte opcode, long[] info);
+    native HotSpotResolvedObjectTypeImpl resolveFieldInPool(HotSpotConstantPool constantPool, int cpi, byte opcode, long[] info);
 
     /**
      * Converts {@code cpci} from an index into the cache for {@code constantPool} to an index
@@ -260,17 +284,18 @@
      * The behavior of this method is undefined if {@code ccpi} is an invalid constant pool cache
      * index.
      */
-    int constantPoolRemapInstructionOperandFromCache(HotSpotConstantPool constantPool, int cpci);
+    native int constantPoolRemapInstructionOperandFromCache(HotSpotConstantPool constantPool, int cpci);
 
     /**
      * Gets the appendix object (if any) associated with the entry at index {@code cpi} in
      * {@code constantPool}.
      */
-    Object lookupAppendixInPool(HotSpotConstantPool constantPool, int cpi);
+    native Object lookupAppendixInPool(HotSpotConstantPool constantPool, int cpi);
 
     /**
      * Installs the result of a compilation into the code cache.
      *
+     * @param target the target where this code should be installed
      * @param compiledCode the result of a compilation
      * @param code the details of the installed CodeBlob are written to this object
      * @return the outcome of the installation which will be one of
@@ -280,7 +305,7 @@
      *         {@link HotSpotVMConfig#codeInstallResultDependenciesFailed} or
      *         {@link HotSpotVMConfig#codeInstallResultDependenciesInvalid}.
      */
-    int installCode(HotSpotCompiledCode compiledCode, InstalledCode code, SpeculationLog speculationLog);
+    public native int installCode(TargetDescription target, HotSpotCompiledCode compiledCode, InstalledCode code, SpeculationLog speculationLog);
 
     /**
      * Notifies the VM of statistics for a completed compilation.
@@ -294,17 +319,18 @@
      * @param timeUnitsPerSecond the granularity of the units for the {@code time} value
      * @param installedCode the nmethod installed as a result of the compilation
      */
-    void notifyCompilationStatistics(int id, HotSpotResolvedJavaMethodImpl method, boolean osr, int processedBytecodes, long time, long timeUnitsPerSecond, InstalledCode installedCode);
+    public synchronized native void notifyCompilationStatistics(int id, HotSpotResolvedJavaMethodImpl method, boolean osr, int processedBytecodes, long time, long timeUnitsPerSecond,
+                    InstalledCode installedCode);
 
     /**
      * Resets all compilation statistics.
      */
-    void resetCompilationStatistics();
+    public native void resetCompilationStatistics();
 
     /**
      * Initializes the fields of {@code config}.
      */
-    void initializeConfiguration(HotSpotVMConfig config);
+    native void initializeConfiguration(HotSpotVMConfig config);
 
     /**
      * Resolves the implementation of {@code method} for virtual dispatches on objects of dynamic
@@ -315,27 +341,26 @@
      * @return the link-time resolved method (might be abstract) or {@code 0} if it can not be
      *         linked
      */
-    HotSpotResolvedJavaMethodImpl resolveMethod(HotSpotResolvedObjectTypeImpl exactReceiver, HotSpotResolvedJavaMethodImpl method, HotSpotResolvedObjectTypeImpl caller);
+    native HotSpotResolvedJavaMethodImpl resolveMethod(HotSpotResolvedObjectTypeImpl exactReceiver, HotSpotResolvedJavaMethodImpl method, HotSpotResolvedObjectTypeImpl caller);
 
     /**
      * Gets the static initializer of {@code type}.
      *
      * @return 0 if {@code type} has no static initializer
      */
-    HotSpotResolvedJavaMethodImpl getClassInitializer(HotSpotResolvedObjectTypeImpl type);
+    native HotSpotResolvedJavaMethodImpl getClassInitializer(HotSpotResolvedObjectTypeImpl type);
 
     /**
      * Determines if {@code type} or any of its currently loaded subclasses overrides
      * {@code Object.finalize()}.
      */
-    boolean hasFinalizableSubclass(HotSpotResolvedObjectTypeImpl type);
+    native boolean hasFinalizableSubclass(HotSpotResolvedObjectTypeImpl type);
 
     /**
      * Gets the method corresponding to {@code holder} and slot number {@code slot} (i.e.
      * {@link Method#slot} or {@link Constructor#slot}).
      */
-    @SuppressWarnings("javadoc")
-    HotSpotResolvedJavaMethodImpl getResolvedJavaMethodAtSlot(Class<?> holder, int slot);
+    native HotSpotResolvedJavaMethodImpl getResolvedJavaMethodAtSlot(Class<?> holder, int slot);
 
     /**
      * Gets the maximum absolute offset of a PC relative call to {@code address} from any position
@@ -344,7 +369,7 @@
      * @param address an address that may be called from any code in the code cache
      * @return -1 if {@code address == 0}
      */
-    long getMaxCallTargetOffset(long address);
+    public native long getMaxCallTargetOffset(long address);
 
     /**
      * Gets a textual disassembly of {@code codeBlob}.
@@ -352,12 +377,13 @@
      * @return a non-zero length string containing a disassembly of {@code codeBlob} or null if
      *         {@code codeBlob} could not be disassembled for some reason
      */
-    String disassembleCodeBlob(long codeBlob);
+    // The HotSpot disassembler seems not to be thread safe so it's better to synchronize its usage
+    public synchronized native String disassembleCodeBlob(long codeBlob);
 
     /**
      * Gets a stack trace element for {@code method} at bytecode index {@code bci}.
      */
-    StackTraceElement getStackTraceElement(HotSpotResolvedJavaMethodImpl method, int bci);
+    native StackTraceElement getStackTraceElement(HotSpotResolvedJavaMethodImpl method, int bci);
 
     /**
      * Executes some {@code installedCode} with arguments {@code args}.
@@ -365,7 +391,7 @@
      * @return the result of executing {@code installedCode}
      * @throws InvalidInstalledCodeException if {@code installedCode} has been invalidated
      */
-    Object executeInstalledCode(Object[] args, InstalledCode installedCode) throws InvalidInstalledCodeException;
+    native Object executeInstalledCode(Object[] args, InstalledCode installedCode) throws InvalidInstalledCodeException;
 
     /**
      * Gets the line number table for {@code method}. The line number table is encoded as (bci,
@@ -373,14 +399,14 @@
      *
      * @return the line number table for {@code method} or null if it doesn't have one
      */
-    long[] getLineNumberTable(HotSpotResolvedJavaMethodImpl method);
+    native long[] getLineNumberTable(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Gets the number of entries in the local variable table for {@code method}.
      *
      * @return the number of entries in the local variable table for {@code method}
      */
-    int getLocalVariableTableLength(HotSpotResolvedJavaMethodImpl method);
+    native int getLocalVariableTableLength(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Gets the address of the first entry in the local variable table for {@code method}.
@@ -399,7 +425,7 @@
      *
      * @return 0 if {@code method} does not have a local variable table
      */
-    long getLocalVariableTableStart(HotSpotResolvedJavaMethodImpl method);
+    native long getLocalVariableTableStart(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Reads an object pointer within a VM data structure. That is, any {@link HotSpotVMField} whose
@@ -413,65 +439,50 @@
      *
      * @param address address of an oop field within a VM data structure
      */
-    Object readUncompressedOop(long address);
+    native Object readUncompressedOop(long address);
 
     /**
      * Determines if {@code method} should not be inlined or compiled.
      */
-    void doNotInlineOrCompile(HotSpotResolvedJavaMethodImpl method);
+    native void doNotInlineOrCompile(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Invalidates the profiling information for {@code method} and (re)initializes it such that
      * profiling restarts upon its next invocation.
      */
-    void reprofile(HotSpotResolvedJavaMethodImpl method);
+    native void reprofile(HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Invalidates {@code installedCode} such that {@link InvalidInstalledCodeException} will be
      * raised the next time {@code installedCode} is executed.
      */
-    void invalidateInstalledCode(InstalledCode installedCode);
+    public native void invalidateInstalledCode(InstalledCode installedCode);
 
     /**
      * Collects the current values of all JVMCI benchmark counters, summed up over all threads.
      */
-    long[] collectCounters();
+    public native long[] collectCounters();
 
     /**
      * Determines if {@code metaspaceMethodData} is mature.
      */
-    boolean isMature(long metaspaceMethodData);
+    native boolean isMature(long metaspaceMethodData);
 
     /**
      * Generate a unique id to identify the result of the compile.
      */
-    int allocateCompileId(HotSpotResolvedJavaMethodImpl method, int entryBCI);
-
-    /**
-     * Gets the names of the supported GPU architectures.
-     *
-     * @return a comma separated list of names
-     */
-    String getGPUs();
+    native int allocateCompileId(HotSpotResolvedJavaMethodImpl method, int entryBCI);
 
     /**
      * Determines if {@code method} has OSR compiled code identified by {@code entryBCI} for
      * compilation level {@code level}.
      */
-    boolean hasCompiledCodeForOSR(HotSpotResolvedJavaMethodImpl method, int entryBCI, int level);
-
-    /**
-     * Fetch the time stamp used for printing inside hotspot. It's relative to VM start so that all
-     * events can be ordered.
-     *
-     * @return milliseconds since VM start
-     */
-    long getTimeStamp();
+    native boolean hasCompiledCodeForOSR(HotSpotResolvedJavaMethodImpl method, int entryBCI, int level);
 
     /**
      * Gets the value of {@code metaspaceSymbol} as a String.
      */
-    String getSymbol(long metaspaceSymbol);
+    native String getSymbol(long metaspaceSymbol);
 
     /**
      * Looks for the next Java stack frame matching an entry in {@code methods}.
@@ -480,7 +491,7 @@
      * @param methods the methods to look for, where {@code null} means that any frame is returned
      * @return the frame, or {@code null} if the end of the stack was reached during the search
      */
-    HotSpotStackFrameReference getNextStackFrame(HotSpotStackFrameReference frame, HotSpotResolvedJavaMethodImpl[] methods, int initialSkip);
+    public native HotSpotStackFrameReference getNextStackFrame(HotSpotStackFrameReference frame, HotSpotResolvedJavaMethodImpl[] methods, int initialSkip);
 
     /**
      * Materializes all virtual objects within {@code stackFrame} updates its locals.
@@ -488,30 +499,30 @@
      * @param invalidate if {@code true}, the compiled method for the stack frame will be
      *            invalidated.
      */
-    void materializeVirtualObjects(HotSpotStackFrameReference stackFrame, boolean invalidate);
+    native void materializeVirtualObjects(HotSpotStackFrameReference stackFrame, boolean invalidate);
 
     /**
      * Gets the v-table index for interface method {@code method} in the receiver {@code type} or
      * {@link HotSpotVMConfig#invalidVtableIndex} if {@code method} is not in {@code type}'s
      * v-table.
      */
-    int getVtableIndexForInterface(HotSpotResolvedObjectTypeImpl type, HotSpotResolvedJavaMethodImpl method);
+    native int getVtableIndexForInterface(HotSpotResolvedObjectTypeImpl type, HotSpotResolvedJavaMethodImpl method);
 
     /**
      * Determines if debug info should also be emitted at non-safepoint locations.
      */
-    boolean shouldDebugNonSafepoints();
+    public native boolean shouldDebugNonSafepoints();
 
     /**
      * Writes {@code length} bytes from {@code buf} starting at offset {@code offset} to the
      * HotSpot's log stream. No range checking is performed.
      */
-    void writeDebugOutput(byte[] bytes, int offset, int length);
+    public native void writeDebugOutput(byte[] bytes, int offset, int length);
 
     /**
      * Flush HotSpot's log stream.
      */
-    void flushDebugOutput();
+    public native void flushDebugOutput();
 
     /**
      * Read a value representing a metaspace Method* and return the
@@ -524,7 +535,7 @@
      * @param displacement
      * @return null or the resolved method for this location
      */
-    HotSpotResolvedJavaMethodImpl getResolvedJavaMethod(Object base, long displacement);
+    native HotSpotResolvedJavaMethodImpl getResolvedJavaMethod(Object base, long displacement);
 
     /**
      * Read a value representing a metaspace ConstantPool* and return the
@@ -537,7 +548,7 @@
      * @param displacement
      * @return null or the resolved method for this location
      */
-    HotSpotConstantPool getConstantPool(Object base, long displacement);
+    native HotSpotConstantPool getConstantPool(Object base, long displacement);
 
     /**
      * Read a value representing a metaspace Klass* and return the
@@ -551,5 +562,5 @@
      * @param compressed true if the location contains a compressed Klass*
      * @return null or the resolved method for this location
      */
-    HotSpotResolvedObjectTypeImpl getResolvedJavaType(Object base, long displacement, boolean compressed);
+    native HotSpotResolvedObjectTypeImpl getResolvedJavaType(Object base, long displacement, boolean compressed);
 }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/CompilerToVMImpl.java	Tue Sep 15 18:12:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,236 +0,0 @@
-/*
- * Copyright (c) 2011, 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
- * 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.internal.jvmci.hotspot;
-
-import static jdk.internal.jvmci.inittimer.InitTimer.*;
-import jdk.internal.jvmci.code.*;
-import jdk.internal.jvmci.common.*;
-import jdk.internal.jvmci.inittimer.*;
-import jdk.internal.jvmci.meta.*;
-
-/**
- * Entries into the HotSpot VM from Java code.
- */
-public class CompilerToVMImpl implements CompilerToVM {
-
-    /**
-     * Initializes the native part of the JVMCI runtime.
-     */
-    private static native void init();
-
-    static {
-        try (InitTimer t = timer("CompilerToVMImpl.init")) {
-            init();
-        }
-    }
-
-    @Override
-    public native int installCode(HotSpotCompiledCode compiledCode, InstalledCode code, SpeculationLog speculationLog);
-
-    @Override
-    public native HotSpotResolvedJavaMethodImpl getResolvedJavaMethodAtSlot(Class<?> holder, int slot);
-
-    @Override
-    public native byte[] getBytecode(HotSpotResolvedJavaMethodImpl method);
-
-    @Override
-    public native int getExceptionTableLength(HotSpotResolvedJavaMethodImpl method);
-
-    @Override
-    public native long getExceptionTableStart(HotSpotResolvedJavaMethodImpl method);
-
-    @Override
-    public native boolean hasBalancedMonitors(HotSpotResolvedJavaMethodImpl method);
-
-    @Override
-    public native HotSpotResolvedJavaMethodImpl findUniqueConcreteMethod(HotSpotResolvedObjectTypeImpl actualHolderType, HotSpotResolvedJavaMethodImpl method);
-
-    @Override
-    public native HotSpotResolvedObjectTypeImpl getImplementor(HotSpotResolvedObjectTypeImpl type);
-
-    @Override
-    public native HotSpotResolvedObjectTypeImpl lookupType(String name, Class<?> accessingClass, boolean eagerResolve);
-
-    public native Object resolveConstantInPool(HotSpotConstantPool constantPool, int cpi);
-
-    public Object resolvePossiblyCachedConstantInPool(HotSpotConstantPool constantPool, int cpi) {
-        JVMCIError.guarantee(!HotSpotConstantPool.Options.UseConstantPoolCacheJavaCode.getValue(), "");
-        return resolvePossiblyCachedConstantInPool0(constantPool, cpi);
-    }
-
-    private native Object resolvePossiblyCachedConstantInPool0(HotSpotConstantPool constantPool, int cpi);
-
-    @Override
-    public native int lookupNameAndTypeRefIndexInPool(HotSpotConstantPool constantPool, int cpi);
-
-    @Override
-    public String lookupNameRefInPool(HotSpotConstantPool constantPool, int cpi) {
-        JVMCIError.guarantee(!HotSpotConstantPool.Options.UseConstantPoolCacheJavaCode.getValue(), "");
-        return lookupNameRefInPool0(constantPool, cpi);
-    }
-
-    private native String lookupNameRefInPool0(HotSpotConstantPool constantPool, int cpi);
-
-    @Override
-    public String lookupSignatureRefInPool(HotSpotConstantPool constantPool, int cpi) {
-        JVMCIError.guarantee(!HotSpotConstantPool.Options.UseConstantPoolCacheJavaCode.getValue(), "");
-        return lookupSignatureRefInPool0(constantPool, cpi);
-    }
-
-    private native String lookupSignatureRefInPool0(HotSpotConstantPool constantPool, int cpi);
-
-    @Override
-    public int lookupKlassRefIndexInPool(HotSpotConstantPool constantPool, int cpi) {
-        JVMCIError.guarantee(!HotSpotConstantPool.Options.UseConstantPoolCacheJavaCode.getValue(), "");
-        return lookupKlassRefIndexInPool0(constantPool, cpi);
-    }
-
-    private native int lookupKlassRefIndexInPool0(HotSpotConstantPool constantPool, int cpi);
-
-    public native HotSpotResolvedObjectTypeImpl resolveTypeInPool(HotSpotConstantPool constantPool, int cpi);
-
-    @Override
-    public native Object lookupKlassInPool(HotSpotConstantPool constantPool, int cpi);
-
-    @Override
-    public native HotSpotResolvedJavaMethodImpl lookupMethodInPool(HotSpotConstantPool constantPool, int cpi, byte opcode);
-
-    @Override
-    public native HotSpotResolvedObjectTypeImpl resolveFieldInPool(HotSpotConstantPool constantPool, int cpi, byte opcode, long[] info);
-
-    public int constantPoolRemapInstructionOperandFromCache(HotSpotConstantPool constantPool, int cpi) {
-        JVMCIError.guarantee(!HotSpotConstantPool.Options.UseConstantPoolCacheJavaCode.getValue(), "");
-        return constantPoolRemapInstructionOperandFromCache0(constantPool, cpi);
-    }
-
-    private native int constantPoolRemapInstructionOperandFromCache0(HotSpotConstantPool constantPool, int cpi);
-
-    @Override
-    public Object lookupAppendixInPool(HotSpotConstantPool constantPool, int cpi) {
-        JVMCIError.guarantee(!HotSpotConstantPool.Options.UseConstantPoolCacheJavaCode.getValue(), "");
-        return lookupAppendixInPool0(constantPool, cpi);
-    }
-
-    private native Object lookupAppendixInPool0(HotSpotConstantPool constantPool, int cpi);
-
-    @Override
-    public native void initializeConfiguration(HotSpotVMConfig config);
-
-    @Override
-    public native HotSpotResolvedJavaMethodImpl resolveMethod(HotSpotResolvedObjectTypeImpl klassExactReceiver, HotSpotResolvedJavaMethodImpl method, HotSpotResolvedObjectTypeImpl klassCaller);
-
-    @Override
-    public native boolean hasFinalizableSubclass(HotSpotResolvedObjectTypeImpl type);
-
-    public native boolean methodIsIgnoredBySecurityStackWalk(HotSpotResolvedJavaMethodImpl method);
-
-    @Override
-    public native HotSpotResolvedJavaMethodImpl getClassInitializer(HotSpotResolvedObjectTypeImpl type);
-
-    @Override
-    public native long getMaxCallTargetOffset(long address);
-
-    // The HotSpot disassembler seems not to be thread safe so it's better to synchronize its usage
-    @Override
-    public synchronized native String disassembleCodeBlob(long codeBlob);
-
-    @Override
-    public native StackTraceElement getStackTraceElement(HotSpotResolvedJavaMethodImpl method, int bci);
-
-    @Override
-    public native Object executeInstalledCode(Object[] args, InstalledCode hotspotInstalledCode);
-
-    @Override
-    public native long[] getLineNumberTable(HotSpotResolvedJavaMethodImpl method);
-
-    @Override
-    public native long getLocalVariableTableStart(HotSpotResolvedJavaMethodImpl method);
-
-    @Override
-    public native int getLocalVariableTableLength(HotSpotResolvedJavaMethodImpl method);
-
-    @Override
-    public native void reprofile(HotSpotResolvedJavaMethodImpl method);
-
-    @Override
-    public native void invalidateInstalledCode(InstalledCode hotspotInstalledCode);
-
-    @Override
-    public native Object readUncompressedOop(long address);
-
-    @Override
-    public native void doNotInlineOrCompile(HotSpotResolvedJavaMethodImpl method);
-
-    public synchronized native void notifyCompilationStatistics(int id, HotSpotResolvedJavaMethodImpl method, boolean osr, int processedBytecodes, long time, long timeUnitsPerSecond,
-                    InstalledCode installedCode);
-
-    public native void resetCompilationStatistics();
-
-    public native long[] collectCounters();
-
-    public native boolean isMature(long metaspaceMethodData);
-
-    public native int allocateCompileId(HotSpotResolvedJavaMethodImpl method, int entryBCI);
-
-    public String getGPUs() {
-        return "";
-    }
-
-    public native boolean canInlineMethod(HotSpotResolvedJavaMethodImpl method);
-
-    public native boolean shouldInlineMethod(HotSpotResolvedJavaMethodImpl method);
-
-    public native boolean hasCompiledCodeForOSR(HotSpotResolvedJavaMethodImpl method, int entryBCI, int level);
-
-    public native HotSpotStackFrameReference getNextStackFrame(HotSpotStackFrameReference frame, HotSpotResolvedJavaMethodImpl[] methods, int initialSkip);
-
-    public native void materializeVirtualObjects(HotSpotStackFrameReference stackFrame, boolean invalidate);
-
-    public native long getTimeStamp();
-
-    public String getSymbol(long metaspaceSymbol) {
-        JVMCIError.guarantee(!HotSpotConstantPool.Options.UseConstantPoolCacheJavaCode.getValue(), "");
-        return getSymbol0(metaspaceSymbol);
-    }
-
-    private native String getSymbol0(long metaspaceSymbol);
-
-    public native void resolveInvokeDynamicInPool(HotSpotConstantPool constantPool, int index);
-
-    public native void resolveInvokeHandleInPool(HotSpotConstantPool constantPool, int index);
-
-    public native int getVtableIndexForInterface(HotSpotResolvedObjectTypeImpl type, HotSpotResolvedJavaMethodImpl method);
-
-    public native boolean shouldDebugNonSafepoints();
-
-    public native void writeDebugOutput(byte[] bytes, int offset, int length);
-
-    public native void flushDebugOutput();
-
-    public native HotSpotResolvedJavaMethodImpl getResolvedJavaMethod(Object base, long displacement);
-
-    public native HotSpotConstantPool getConstantPool(Object base, long displacement);
-
-    public native HotSpotResolvedObjectTypeImpl getResolvedJavaType(Object base, long displacement, boolean compressed);
-}
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCodeCacheProvider.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCodeCacheProvider.java	Tue Sep 15 18:13:11 2015 -0700
@@ -99,7 +99,7 @@
     }
 
     public InstalledCode logOrDump(InstalledCode installedCode, CompilationResult compResult) {
-        HotSpotJVMCIRuntime.runtime().notifyInstall(this, installedCode, compResult);
+        ((HotSpotJVMCIRuntime) runtime).notifyInstall(this, installedCode, compResult);
         return installedCode;
     }
 
@@ -108,7 +108,7 @@
             compResult.setId(method.allocateCompileId(compResult.getEntryBCI()));
         }
         HotSpotInstalledCode installedCode = new HotSpotNmethod(method, compResult.getName(), isDefault);
-        runtime.getCompilerToVM().installCode(new HotSpotCompiledNmethod(method, compResult, jvmciEnv), installedCode, method.getSpeculationLog());
+        runtime.getCompilerToVM().installCode(target, new HotSpotCompiledNmethod(method, compResult, jvmciEnv), installedCode, method.getSpeculationLog());
         return logOrDump(installedCode, compResult);
     }
 
@@ -124,7 +124,7 @@
             installedCode = code;
         }
         HotSpotCompiledNmethod compiledCode = new HotSpotCompiledNmethod(hotspotMethod, compResult);
-        int result = runtime.getCompilerToVM().installCode(compiledCode, installedCode, log);
+        int result = runtime.getCompilerToVM().installCode(target, compiledCode, installedCode, log);
         if (result != config.codeInstallResultOk) {
             String msg = compiledCode.getInstallationFailureMessage();
             String resultDesc = config.getCodeInstallResultDescription(result);
@@ -155,7 +155,7 @@
         HotSpotNmethod code = new HotSpotNmethod(javaMethod, compResult.getName(), false, true);
         HotSpotCompiledNmethod compiled = new HotSpotCompiledNmethod(javaMethod, compResult);
         CompilerToVM vm = runtime.getCompilerToVM();
-        int result = vm.installCode(compiled, code, null);
+        int result = vm.installCode(target, compiled, code, null);
         if (result != runtime.getConfig().codeInstallResultOk) {
             return null;
         }
@@ -185,7 +185,7 @@
                 throw new JVMCIError(String.valueOf(constant));
             }
 
-            size = target.getSizeInBytes(compressed ? Kind.Int : target.wordKind);
+            size = target.getSizeInBytes(compressed ? JavaKind.Int : target.wordKind);
             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 ? Kind.Int : target.wordKind);
+            size = target.getSizeInBytes(compressed ? JavaKind.Int : target.wordKind);
             builder = DataBuilder.zero(size);
         } else if (constant instanceof SerializableConstant) {
             SerializableConstant s = (SerializableConstant) constant;
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCompiledCode.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCompiledCode.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -138,7 +138,7 @@
                 Infopoint info = (Infopoint) site;
                 if (info.debugInfo != null) {
                     BytecodeFrame frame = info.debugInfo.frame();
-                    assert frame == null || frame.validateFormat(false);
+                    assert frame == null || frame.validateFormat();
                 }
             }
         }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCompressedNullConstant.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotCompressedNullConstant.java	Tue Sep 15 18:13:11 2015 -0700
@@ -27,12 +27,15 @@
 /**
  * The compressed representation of the {@link JavaConstant#NULL_POINTER null constant}.
  */
-public final class HotSpotCompressedNullConstant extends AbstractValue implements JavaConstant, HotSpotConstant {
+public final class HotSpotCompressedNullConstant implements JavaConstant, HotSpotConstant {
 
     public static final JavaConstant COMPRESSED_NULL = new HotSpotCompressedNullConstant();
 
     private HotSpotCompressedNullConstant() {
-        super(LIRKind.reference(Kind.Int));
+    }
+
+    public JavaKind getJavaKind() {
+        return JavaKind.Object;
     }
 
     @Override
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotConstantPool.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotConstantPool.java	Tue Sep 15 18:13:11 2015 -0700
@@ -22,28 +22,19 @@
  */
 package jdk.internal.jvmci.hotspot;
 
-import static jdk.internal.jvmci.common.UnsafeAccess.*;
 import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime.*;
+import static jdk.internal.jvmci.hotspot.UnsafeAccess.UNSAFE;
 
 import java.lang.invoke.*;
-import java.util.*;
 
 import jdk.internal.jvmci.common.*;
 import jdk.internal.jvmci.meta.*;
-import jdk.internal.jvmci.options.*;
 
 /**
  * Implementation of {@link ConstantPool} for HotSpot.
  */
 public final class HotSpotConstantPool implements ConstantPool, HotSpotProxified, MetaspaceWrapperObject {
 
-    public static class Options {
-        // @formatter:off
-        @Option(help = "Use Java code to access the constant pool cache and resolved references array", type = OptionType.Expert)
-        public static final OptionValue<Boolean> UseConstantPoolCacheJavaCode = new OptionValue<>(false);
-        // @formatter:on
-    }
-
     /**
      * Subset of JVM bytecode opcodes used by {@link HotSpotConstantPool}.
      */
@@ -189,227 +180,6 @@
     private volatile LookupTypeCacheElement lastLookupType;
 
     /**
-     * The constant pool cache of this constant pool.
-     */
-    private final Cache cache;
-
-    /**
-     * Represents a {@code ConstantPoolCache}. The cache needs to be lazy since the constant pool
-     * cache is created when the methods of this class are rewritten and rewriting happens when the
-     * class is linked.
-     */
-    private final class Cache {
-
-        private long address;
-
-        public Cache() {
-            // Maybe the constant pool cache already exists...
-            queryAddress();
-        }
-
-        /**
-         * Queries the current value of {@code ConstantPool::_cache} if the current address is null.
-         */
-        private void queryAddress() {
-            if (address == 0) {
-                address = unsafe.getAddress(getMetaspaceConstantPool() + runtime().getConfig().constantPoolCacheOffset);
-            }
-        }
-
-        /**
-         * Returns whether a constant pool cache for this constant pool exists.
-         *
-         * @return true if it exists, false otherwise
-         */
-        public boolean exists() {
-            queryAddress();
-            return address != 0;
-        }
-
-        /**
-         * Represents a {@code ConstantPoolCacheEntry}.
-         */
-        private final class Entry {
-
-            private final long address;
-
-            public Entry(final long address) {
-                this.address = address;
-            }
-
-            /**
-             * {@code ConstantPoolCacheEntry::_indices} is volatile of type {@code intx}.
-             *
-             * @return value of field {@code _indices}
-             */
-            private long getIndices() {
-                assert runtime().getHostJVMCIBackend().getTarget().wordSize == 8 : "port to non-64-bit platform";
-                return unsafe.getLongVolatile(null, address + runtime().getConfig().constantPoolCacheEntryIndicesOffset);
-            }
-
-            /**
-             * {@code ConstantPoolCacheEntry::_f1} is volatile of type {@code Metadata*}.
-             *
-             * @return value of field {@code _f1}
-             */
-            private long getF1() {
-                assert runtime().getHostJVMCIBackend().getTarget().wordSize == 8 : "port to non-64-bit platform";
-                return unsafe.getLongVolatile(null, address + runtime().getConfig().constantPoolCacheEntryF1Offset);
-            }
-
-            /**
-             * {@code ConstantPoolCacheEntry::_f2} is volatile of type {@code intx}.
-             *
-             * @return value of field {@code _f2}
-             */
-            private long getF2() {
-                assert runtime().getHostJVMCIBackend().getTarget().wordSize == 8 : "port to non-64-bit platform";
-                return unsafe.getLongVolatile(null, address + runtime().getConfig().constantPoolCacheEntryF2Offset);
-            }
-
-            /**
-             * {@code ConstantPoolCacheEntry::_flags} is volatile of type {@code intx}.
-             *
-             * @return flag bits
-             */
-            private long flags() {
-                assert runtime().getHostJVMCIBackend().getTarget().wordSize == 8 : "port to non-64-bit platform";
-                return unsafe.getLongVolatile(null, address + runtime().getConfig().constantPoolCacheEntryFlagsOffset);
-            }
-
-            private boolean isF1Null() {
-                final long f1 = getF1();
-                return f1 == 0;
-            }
-
-            /**
-             * Returns the constant pool index for this entry. See
-             * {@code ConstantPoolCacheEntry::constant_pool_index()}
-             *
-             * @return the constant pool index for this entry
-             */
-            public int getConstantPoolIndex() {
-                return ((int) getIndices()) & runtime().getConfig().constantPoolCacheEntryCpIndexMask;
-            }
-
-            /**
-             * See {@code ConstantPoolCache::has_appendix()}.
-             *
-             * @return true if there is an appendix, false otherwise
-             */
-            private boolean hasAppendix() {
-                return (!isF1Null()) && (flags() & (1 << runtime().getConfig().constantPoolCacheEntryHasAppendixShift)) != 0;
-            }
-
-            /**
-             * See {@code ConstantPoolCache::appendix_if_resolved()}.
-             */
-            public Object getAppendixIfResolved() {
-                if (!hasAppendix()) {
-                    return null;
-                }
-                final int index = ((int) getF2()) + runtime().getConfig().constantPoolCacheEntryIndyResolvedReferencesAppendixOffset;
-                return resolvedReferences.getArray()[index];
-            }
-        }
-
-        /**
-         * Get the constant pool cache entry at index {@code index}.
-         *
-         * @param index index of entry to return
-         * @return constant pool cache entry at given index
-         */
-        public Entry getEntryAt(int index) {
-            queryAddress();
-            assert exists();
-            HotSpotVMConfig config = runtime().getConfig();
-            return new Entry(address + config.constantPoolCacheSize + config.constantPoolCacheEntrySize * index);
-        }
-
-        /**
-         * Maps the constant pool cache index back to a constant pool index. See
-         * {@code ConstantPool::remap_instruction_operand_from_cache}.
-         *
-         * @param index the constant pool cache index
-         * @return constant pool index
-         */
-        public int constantPoolCacheIndexToConstantPoolIndex(int index) {
-            final int cacheIndex = index - runtime().getConfig().constantPoolCpCacheIndexTag;
-            return getEntryAt(cacheIndex).getConstantPoolIndex();
-        }
-
-    }
-
-    /**
-     * Resolved references of this constant pool.
-     */
-    private final ResolvedReferences resolvedReferences = new ResolvedReferences();
-
-    /**
-     * Hide the resolved references array in a private class so it cannot be accessed directly. The
-     * reason is the resolved references array is created when the constant pool cache is created.
-     *
-     * @see Cache
-     */
-    private final class ResolvedReferences {
-
-        /**
-         * Pointer to the {@code ConstantPool::_resolved_references} array.
-         */
-        private Object[] resolvedReferences;
-
-        /**
-         * Map of constant pool indexes to {@code ConstantPool::_resolved_references} indexes.
-         */
-        private final HashMap<Integer, Integer> referenceMap = new HashMap<>();
-
-        /**
-         * Returns the {@code ConstantPool::_resolved_references} array for this constant pool.
-         *
-         * @return resolved references array if exists, null otherwise
-         */
-        public Object[] getArray() {
-            if (resolvedReferences == null) {
-                final long handle = unsafe.getAddress(getMetaspaceConstantPool() + runtime().getConfig().constantPoolResolvedReferencesOffset);
-                if (handle != 0) {
-                    resolvedReferences = (Object[]) runtime().getCompilerToVM().readUncompressedOop(handle + runtime().getConfig().handleHandleOffset);
-                    fillReferenceMap();
-                }
-            }
-            return resolvedReferences;
-        }
-
-        /**
-         * Fills the {@link #referenceMap} with all the values from
-         * {@code ConstantPool::_reference_map} for faster lookup.
-         */
-        private void fillReferenceMap() {
-            // It is possible there is a resolved references array but no reference map.
-            final long address = unsafe.getAddress(getMetaspaceConstantPool() + runtime().getConfig().constantPoolReferenceMapOffset);
-            if (address != 0) {
-                final int length = unsafe.getInt(null, address + runtime().getConfig().arrayU1LengthOffset);
-                for (int i = 0; i < length; i++) {
-                    final int value = unsafe.getShort(address + runtime().getConfig().arrayU2DataOffset + i * Short.BYTES);
-                    referenceMap.put(value, i);
-                }
-            }
-        }
-
-        /**
-         * See {@code ConstantPool::cp_to_object_index}.
-         *
-         * @param cpi constant pool index
-         * @return resolved references array index
-         */
-        public int constantPoolIndexToResolvedReferencesIndex(int cpi) {
-            final Integer index = referenceMap.get(cpi);
-            // We might not find the index for jsr292 call.
-            return (index == null) ? -1 : index;
-        }
-
-    }
-
-    /**
      * Gets the JVMCI mirror from a HotSpot constant pool.The VM is responsible for ensuring that
      * the ConstantPool is kept alive for the duration of this call and the
      * {@link HotSpotJVMCIMetaAccessContext} keeps it alive after that.
@@ -426,9 +196,6 @@
 
     private HotSpotConstantPool(long metaspaceConstantPool) {
         this.metaspaceConstantPool = metaspaceConstantPool;
-
-        // Cache constructor needs metaspaceConstantPool.
-        cache = new Cache();
     }
 
     /**
@@ -510,8 +277,8 @@
     private JVM_CONSTANT getTagAt(int index) {
         assertBounds(index);
         HotSpotVMConfig config = runtime().getConfig();
-        final long metaspaceConstantPoolTags = unsafe.getAddress(getMetaspaceConstantPool() + config.constantPoolTagsOffset);
-        final int tag = unsafe.getByteVolatile(null, metaspaceConstantPoolTags + config.arrayU1DataOffset + index);
+        final long metaspaceConstantPoolTags = UNSAFE.getAddress(getMetaspaceConstantPool() + config.constantPoolTagsOffset);
+        final int tag = UNSAFE.getByteVolatile(null, metaspaceConstantPoolTags + config.arrayU1DataOffset + index);
         if (tag == 0) {
             return null;
         }
@@ -526,7 +293,7 @@
      */
     private long getEntryAt(int index) {
         assertBounds(index);
-        return unsafe.getAddress(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
+        return UNSAFE.getAddress(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
     }
 
     /**
@@ -537,7 +304,7 @@
      */
     private int getIntAt(int index) {
         assertTag(index, JVM_CONSTANT.Integer);
-        return unsafe.getInt(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
+        return UNSAFE.getInt(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
     }
 
     /**
@@ -548,7 +315,7 @@
      */
     private long getLongAt(int index) {
         assertTag(index, JVM_CONSTANT.Long);
-        return unsafe.getLong(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
+        return UNSAFE.getLong(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
     }
 
     /**
@@ -559,7 +326,7 @@
      */
     private float getFloatAt(int index) {
         assertTag(index, JVM_CONSTANT.Float);
-        return unsafe.getFloat(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
+        return UNSAFE.getFloat(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
     }
 
     /**
@@ -570,7 +337,7 @@
      */
     private double getDoubleAt(int index) {
         assertTag(index, JVM_CONSTANT.Double);
-        return unsafe.getDouble(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
+        return UNSAFE.getDouble(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
     }
 
     /**
@@ -581,7 +348,7 @@
      */
     private int getNameAndTypeAt(int index) {
         assertTag(index, JVM_CONSTANT.NameAndType);
-        return unsafe.getInt(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
+        return UNSAFE.getInt(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
     }
 
     /**
@@ -603,12 +370,7 @@
      * @return name as {@link String}
      */
     private String getNameRefAt(int index) {
-        if (Options.UseConstantPoolCacheJavaCode.getValue()) {
-            final int nameRefIndex = getNameRefIndexAt(getNameAndTypeRefIndexAt(index));
-            return new HotSpotSymbol(getEntryAt(nameRefIndex)).asString();
-        } else {
-            return runtime().getCompilerToVM().lookupNameRefInPool(this, index);
-        }
+        return runtime().getCompilerToVM().lookupNameRefInPool(this, index);
     }
 
     /**
@@ -632,12 +394,7 @@
      * @return signature as {@link String}
      */
     private String getSignatureRefAt(int index) {
-        if (Options.UseConstantPoolCacheJavaCode.getValue()) {
-            final int signatureRefIndex = getSignatureRefIndexAt(getNameAndTypeRefIndexAt(index));
-            return new HotSpotSymbol(getEntryAt(signatureRefIndex)).asString();
-        } else {
-            return runtime().getCompilerToVM().lookupSignatureRefInPool(this, index);
-        }
+        return runtime().getCompilerToVM().lookupSignatureRefInPool(this, index);
     }
 
     /**
@@ -654,38 +411,13 @@
     }
 
     /**
-     * Gets the klass reference index constant pool entry at index {@code index}. See
-     * {@code ConstantPool::klass_ref_index_at}.
-     *
-     * @param index constant pool index
-     * @param cached whether to go through the constant pool cache
-     * @return klass reference index
-     */
-    private int getKlassRefIndexAt(int index, boolean cached) {
-        int cpi = index;
-        if (cached && cache.exists()) {
-            // change byte-ordering and go via cache
-            cpi = cache.constantPoolCacheIndexToConstantPoolIndex(index);
-        }
-        assertTagIsFieldOrMethod(cpi);
-        final int refIndex = unsafe.getInt(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + cpi * runtime().getHostJVMCIBackend().getTarget().wordSize);
-        // klass ref index is in the low 16-bits.
-        return refIndex & 0xFFFF;
-    }
-
-    /**
-     * Gets the klass reference index constant pool entry at index {@code index}. See
-     * {@code ConstantPool::klass_ref_index_at}.
+     * Gets the klass reference index constant pool entry at index {@code index}.
      *
      * @param index constant pool index
      * @return klass reference index
      */
     private int getKlassRefIndexAt(int index) {
-        if (Options.UseConstantPoolCacheJavaCode.getValue()) {
-            return getKlassRefIndexAt(index, true);
-        } else {
-            return runtime().getCompilerToVM().lookupKlassRefIndexInPool(this, index);
-        }
+        return runtime().getCompilerToVM().lookupKlassRefIndexInPool(this, index);
     }
 
     /**
@@ -696,14 +428,10 @@
      * @return klass reference index
      */
     private int getUncachedKlassRefIndexAt(int index) {
-        if (Options.UseConstantPoolCacheJavaCode.getValue()) {
-            return getKlassRefIndexAt(index, false);
-        } else {
-            assertTagIsFieldOrMethod(index);
-            final int refIndex = unsafe.getInt(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
-            // klass ref index is in the low 16-bits.
-            return refIndex & 0xFFFF;
-        }
+        assertTagIsFieldOrMethod(index);
+        final int refIndex = UNSAFE.getInt(getMetaspaceConstantPool() + runtime().getConfig().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize);
+        // klass ref index is in the low 16-bits.
+        return refIndex & 0xFFFF;
     }
 
     /**
@@ -739,7 +467,7 @@
 
     @Override
     public int length() {
-        return unsafe.getInt(getMetaspaceConstantPool() + runtime().getConfig().constantPoolLengthOffset);
+        return UNSAFE.getInt(getMetaspaceConstantPool() + runtime().getConfig().constantPoolLengthOffset);
     }
 
     @Override
@@ -766,33 +494,7 @@
                  * "pseudo strings" (arbitrary live objects) patched into a String entry. Such
                  * entries do not have a symbol in the constant pool slot.
                  */
-                Object string;
-                if (Options.UseConstantPoolCacheJavaCode.getValue()) {
-                    // See: ConstantPool::resolve_constant_at_impl
-                    /*
-                     * Note: Call getArray() before constantPoolIndexToResolvedReferencesIndex()
-                     * because it fills the map if the array exists.
-                     */
-                    Object[] localResolvedReferences = resolvedReferences.getArray();
-                    final int index = resolvedReferences.constantPoolIndexToResolvedReferencesIndex(cpi);
-                    assert index >= 0;
-                    // See: ConstantPool::string_at_impl
-                    string = localResolvedReferences[index];
-                    if (string != null) {
-                        assert string instanceof String || getEntryAt(index) == 0L;
-                        return HotSpotObjectConstantImpl.forObject(string);
-                    } else {
-                        final long metaspaceSymbol = getEntryAt(cpi);
-                        if (metaspaceSymbol != 0L) {
-                            HotSpotSymbol symbol = new HotSpotSymbol(metaspaceSymbol);
-                            string = symbol.asString().intern();
-                            // See: ConstantPool::string_at_put
-                            localResolvedReferences[index] = string;
-                        }
-                    }
-                } else {
-                    string = runtime().getCompilerToVM().resolvePossiblyCachedConstantInPool(this, cpi);
-                }
+                Object string = runtime().getCompilerToVM().resolvePossiblyCachedConstantInPool(this, cpi);
                 return HotSpotObjectConstantImpl.forObject(string);
             case MethodHandle:
             case MethodHandleInError:
@@ -808,18 +510,7 @@
     @Override
     public String lookupUtf8(int cpi) {
         assertTag(cpi, JVM_CONSTANT.Utf8);
-        String s;
-        if (Options.UseConstantPoolCacheJavaCode.getValue()) {
-            HotSpotSymbol symbol = new HotSpotSymbol(getEntryAt(cpi));
-            s = symbol.asString();
-            // It shouldn't but just in case something went wrong...
-            if (s == null) {
-                throw JVMCIError.shouldNotReachHere("malformed UTF-8 string in constant pool");
-            }
-        } else {
-            s = runtime().getCompilerToVM().getSymbol(getEntryAt(cpi));
-        }
-        return s;
+        return runtime().getCompilerToVM().getSymbol(getEntryAt(cpi));
     }
 
     @Override
@@ -831,21 +522,7 @@
     public JavaConstant lookupAppendix(int cpi, int opcode) {
         assert Bytecodes.isInvoke(opcode);
         final int index = rawIndexToConstantPoolIndex(cpi, opcode);
-
-        Object appendix = null;
-
-        if (Options.UseConstantPoolCacheJavaCode.getValue()) {
-            if (!cache.exists()) {
-                // Nothing to load yet.
-                return null;
-            }
-            final int cacheIndex = decodeConstantPoolCacheIndex(index);
-            Cache.Entry entry = cache.getEntryAt(cacheIndex);
-            appendix = entry.getAppendixIfResolved();
-        } else {
-            appendix = runtime().getCompilerToVM().lookupAppendixInPool(this, index);
-        }
-
+        Object appendix = runtime().getCompilerToVM().lookupAppendixInPool(this, index);
         if (appendix == null) {
             return null;
         } else {
@@ -939,6 +616,7 @@
     }
 
     @Override
+    @SuppressWarnings("fallthrough")
     public void loadReferencedType(int cpi, int opcode) {
         int index;
         switch (opcode) {
@@ -954,17 +632,8 @@
                 break;
             case Bytecodes.INVOKEDYNAMIC: {
                 // invokedynamic instructions point to a constant pool cache entry.
-                if (Options.UseConstantPoolCacheJavaCode.getValue()) {
-                    // index = decodeConstantPoolCacheIndex(cpi) +
-                    // runtime().getConfig().constantPoolCpCacheIndexTag;
-                    // index = cache.constantPoolCacheIndexToConstantPoolIndex(index);
-                    final int cacheIndex = cpi;
-                    index = cache.getEntryAt(decodeInvokedynamicIndex(cacheIndex)).getConstantPoolIndex();
-                    // JVMCIError.guarantee(index == x, index + " != " + x);
-                } else {
-                    index = decodeConstantPoolCacheIndex(cpi) + runtime().getConfig().constantPoolCpCacheIndexTag;
-                    index = runtime().getCompilerToVM().constantPoolRemapInstructionOperandFromCache(this, index);
-                }
+                index = decodeConstantPoolCacheIndex(cpi) + runtime().getConfig().constantPoolCpCacheIndexTag;
+                index = runtime().getCompilerToVM().constantPoolRemapInstructionOperandFromCache(this, index);
                 break;
             }
             case Bytecodes.GETSTATIC:
@@ -976,16 +645,8 @@
             case Bytecodes.INVOKESTATIC:
             case Bytecodes.INVOKEINTERFACE: {
                 // invoke and field instructions point to a constant pool cache entry.
-                if (Options.UseConstantPoolCacheJavaCode.getValue()) {
-                    // index = rawIndexToConstantPoolIndex(cpi, opcode);
-                    // index = cache.constantPoolCacheIndexToConstantPoolIndex(index);
-                    final int cacheIndex = cpi;
-                    index = cache.getEntryAt(cacheIndex).getConstantPoolIndex();
-                    // JVMCIError.guarantee(index == x, index + " != " + x);
-                } else {
-                    index = rawIndexToConstantPoolIndex(cpi, opcode);
-                    index = runtime().getCompilerToVM().constantPoolRemapInstructionOperandFromCache(this, index);
-                }
+                index = rawIndexToConstantPoolIndex(cpi, opcode);
+                index = runtime().getCompilerToVM().constantPoolRemapInstructionOperandFromCache(this, index);
                 break;
             }
             default:
@@ -1012,7 +673,7 @@
                 final HotSpotResolvedObjectTypeImpl type = runtime().getCompilerToVM().resolveTypeInPool(this, index);
                 Class<?> klass = type.mirror();
                 if (!klass.isPrimitive() && !klass.isArray()) {
-                    unsafe.ensureClassInitialized(klass);
+                    UNSAFE.ensureClassInitialized(klass);
                 }
                 switch (tag) {
                     case MethodRef:
@@ -1036,13 +697,7 @@
     }
 
     private boolean isInvokeHandle(int methodRefCacheIndex, HotSpotResolvedObjectTypeImpl klass) {
-        int index;
-        if (Options.UseConstantPoolCacheJavaCode.getValue()) {
-            index = cache.constantPoolCacheIndexToConstantPoolIndex(methodRefCacheIndex);
-        } else {
-            index = runtime().getCompilerToVM().constantPoolRemapInstructionOperandFromCache(this, methodRefCacheIndex);
-        }
-        assertTag(index, JVM_CONSTANT.MethodRef);
+        assertTag(runtime().getCompilerToVM().constantPoolRemapInstructionOperandFromCache(this, methodRefCacheIndex), JVM_CONSTANT.MethodRef);
         return ResolvedJavaMethod.isSignaturePolymorphic(klass, getNameRefAt(methodRefCacheIndex), runtime().getHostJVMCIBackend().getMetaAccess());
     }
 
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotConstantReflectionProvider.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotConstantReflectionProvider.java	Tue Sep 15 18:13:11 2015 -0700
@@ -22,12 +22,25 @@
  */
 package jdk.internal.jvmci.hotspot;
 
-import static jdk.internal.jvmci.hotspot.HotSpotConstantReflectionProvider.Options.*;
+import static jdk.internal.jvmci.hotspot.HotSpotConstantReflectionProvider.Options.TrustFinalDefaultFields;
+import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset;
+import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale;
+
+import java.lang.reflect.Array;
 
-import java.lang.reflect.*;
-
-import jdk.internal.jvmci.meta.*;
-import jdk.internal.jvmci.options.*;
+import jdk.internal.jvmci.meta.Constant;
+import jdk.internal.jvmci.meta.ConstantReflectionProvider;
+import jdk.internal.jvmci.meta.JavaConstant;
+import jdk.internal.jvmci.meta.JavaField;
+import jdk.internal.jvmci.meta.JavaKind;
+import jdk.internal.jvmci.meta.JavaType;
+import jdk.internal.jvmci.meta.MemoryAccessProvider;
+import jdk.internal.jvmci.meta.MethodHandleAccessProvider;
+import jdk.internal.jvmci.meta.ResolvedJavaType;
+import jdk.internal.jvmci.options.Option;
+import jdk.internal.jvmci.options.OptionType;
+import jdk.internal.jvmci.options.OptionValue;
+import jdk.internal.jvmci.options.StableOptionValue;
 
 /**
  * HotSpot implementation of {@link ConstantReflectionProvider}.
@@ -73,7 +86,7 @@
 
     @Override
     public Integer readArrayLength(JavaConstant array) {
-        if (array.getKind() != Kind.Object || array.isNull()) {
+        if (array.getJavaKind() != JavaKind.Object || array.isNull()) {
             return null;
         }
 
@@ -100,13 +113,13 @@
      * @return the computed index or -1 if the offset isn't within the array
      */
     private int indexForOffset(JavaConstant array, long offset) {
-        if (array.getKind() != Kind.Object || array.isNull()) {
+        if (array.getJavaKind() != JavaKind.Object || array.isNull()) {
             return -1;
         }
         Class<?> componentType = ((HotSpotObjectConstantImpl) array).object().getClass().getComponentType();
-        Kind kind = runtime.getHostJVMCIBackend().getMetaAccess().lookupJavaType(componentType).getKind();
-        int arraybase = runtime.getArrayBaseOffset(kind);
-        int scale = runtime.getArrayIndexScale(kind);
+        JavaKind kind = runtime.getHostJVMCIBackend().getMetaAccess().lookupJavaType(componentType).getJavaKind();
+        int arraybase = getArrayBaseOffset(kind);
+        int scale = getArrayIndexScale(kind);
         if (offset < arraybase) {
             return -1;
         }
@@ -130,7 +143,7 @@
 
     @Override
     public JavaConstant readArrayElement(JavaConstant array, int index) {
-        if (array.getKind() != Kind.Object || array.isNull()) {
+        if (array.getJavaKind() != JavaKind.Object || array.isNull()) {
             return null;
         }
         Object a = ((HotSpotObjectConstantImpl) array).object();
@@ -160,7 +173,7 @@
      * @return true if the box is cached
      */
     private static boolean isBoxCached(JavaConstant source) {
-        switch (source.getKind()) {
+        switch (source.getJavaKind()) {
             case Boolean:
                 return true;
             case Char:
@@ -175,13 +188,13 @@
             case Double:
                 return false;
             default:
-                throw new IllegalArgumentException("unexpected kind " + source.getKind());
+                throw new IllegalArgumentException("unexpected kind " + source.getJavaKind());
         }
     }
 
     @Override
     public JavaConstant boxPrimitive(JavaConstant source) {
-        if (!source.getKind().isPrimitive() || !isBoxCached(source)) {
+        if (!source.getJavaKind().isPrimitive() || !isBoxCached(source)) {
             return null;
         }
         return HotSpotObjectConstantImpl.forObject(source.asBoxedPrimitive());
@@ -189,7 +202,7 @@
 
     @Override
     public JavaConstant unboxPrimitive(JavaConstant source) {
-        if (!source.getKind().isObject()) {
+        if (!source.getJavaKind().isObject()) {
             return null;
         }
         if (source.isNull()) {
@@ -331,11 +344,11 @@
         if (hotspotField.isStatic()) {
             HotSpotResolvedJavaType holder = (HotSpotResolvedJavaType) hotspotField.getDeclaringClass();
             if (holder.isInitialized()) {
-                return memoryAccess.readUnsafeConstant(hotspotField.getKind(), HotSpotObjectConstantImpl.forObject(holder.mirror()), hotspotField.offset());
+                return memoryAccess.readUnsafeConstant(hotspotField.getJavaKind(), HotSpotObjectConstantImpl.forObject(holder.mirror()), hotspotField.offset());
             }
         } else {
             if (receiver.isNonNull() && hotspotField.isInObject(((HotSpotObjectConstantImpl) receiver).object())) {
-                return memoryAccess.readUnsafeConstant(hotspotField.getKind(), receiver, hotspotField.offset());
+                return memoryAccess.readUnsafeConstant(hotspotField.getJavaKind(), receiver, hotspotField.offset());
             }
         }
         return null;
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotInstalledCode.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotInstalledCode.java	Tue Sep 15 18:13:11 2015 -0700
@@ -22,10 +22,10 @@
  */
 package jdk.internal.jvmci.hotspot;
 
-import static jdk.internal.jvmci.common.UnsafeAccess.*;
-import jdk.internal.jvmci.code.*;
-import jdk.internal.jvmci.inittimer.*;
-import sun.misc.*;
+import static jdk.internal.jvmci.hotspot.UnsafeAccess.UNSAFE;
+import jdk.internal.jvmci.code.InstalledCode;
+import jdk.internal.jvmci.inittimer.SuppressFBWarnings;
+import sun.misc.Unsafe;
 
 /**
  * Implementation of {@link InstalledCode} for HotSpot.
@@ -66,7 +66,7 @@
             return null;
         }
         byte[] blob = new byte[size];
-        unsafe.copyMemory(null, getAddress(), blob, Unsafe.ARRAY_BYTE_BASE_OFFSET, size);
+        UNSAFE.copyMemory(null, getAddress(), blob, Unsafe.ARRAY_BYTE_BASE_OFFSET, size);
         return blob;
     }
 
@@ -89,7 +89,7 @@
             return null;
         }
         byte[] code = new byte[codeSize];
-        unsafe.copyMemory(null, codeStart, code, Unsafe.ARRAY_BYTE_BASE_OFFSET, codeSize);
+        UNSAFE.copyMemory(null, codeStart, code, Unsafe.ARRAY_BYTE_BASE_OFFSET, codeSize);
         return code;
     }
 }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCICompilerConfig.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCICompilerConfig.java	Tue Sep 15 18:13:11 2015 -0700
@@ -38,10 +38,6 @@
             throw new JVMCIError("no JVMCI compiler selected");
         }
 
-        public void compileTheWorld() throws Throwable {
-            throw new JVMCIError("no JVMCI compiler selected");
-        }
-
         public String getCompilerName() {
             return "<none>";
         }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIMetaAccessContext.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIMetaAccessContext.java	Tue Sep 15 18:13:11 2015 -0700
@@ -46,7 +46,7 @@
      * The set of currently live contexts used for tracking of live metadata. Examined from the VM
      * during garbage collection.
      */
-    @SuppressWarnings("unchecked") private static WeakReference<HotSpotJVMCIMetaAccessContext>[] allContexts = new WeakReference[0];
+    private static WeakReference<?>[] allContexts = new WeakReference<?>[0];
 
     /**
      * This is a chunked list of metadata roots. It can be read from VM native code so it's been
@@ -133,7 +133,7 @@
 
     protected ResolvedJavaType createClass(Class<?> javaClass) {
         if (javaClass.isPrimitive()) {
-            Kind kind = Kind.fromJavaClass(javaClass);
+            JavaKind kind = JavaKind.fromJavaClass(javaClass);
             return new HotSpotResolvedPrimitiveType(kind);
         } else {
             return new HotSpotResolvedObjectTypeImpl(javaClass, this);
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java	Tue Sep 15 18:13:11 2015 -0700
@@ -22,22 +22,39 @@
  */
 package jdk.internal.jvmci.hotspot;
 
-import static jdk.internal.jvmci.inittimer.InitTimer.*;
+import static jdk.internal.jvmci.inittimer.InitTimer.timer;
 
-import java.util.*;
+import java.lang.reflect.Array;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.TreeMap;
 
-import jdk.internal.jvmci.code.*;
-import jdk.internal.jvmci.common.*;
-import jdk.internal.jvmci.compiler.*;
+import jdk.internal.jvmci.code.Architecture;
+import jdk.internal.jvmci.code.CompilationResult;
+import jdk.internal.jvmci.code.InstalledCode;
+import jdk.internal.jvmci.common.JVMCIError;
 import jdk.internal.jvmci.compiler.Compiler;
-import jdk.internal.jvmci.inittimer.*;
-import jdk.internal.jvmci.meta.*;
-import jdk.internal.jvmci.options.*;
-import jdk.internal.jvmci.runtime.*;
-import jdk.internal.jvmci.service.*;
+import jdk.internal.jvmci.compiler.CompilerFactory;
+import jdk.internal.jvmci.compiler.StartupEventListener;
+import jdk.internal.jvmci.inittimer.InitTimer;
+import jdk.internal.jvmci.meta.JVMCIMetaAccessContext;
+import jdk.internal.jvmci.meta.JavaKind;
+import jdk.internal.jvmci.meta.JavaType;
+import jdk.internal.jvmci.meta.ResolvedJavaType;
+import jdk.internal.jvmci.runtime.JVMCI;
+import jdk.internal.jvmci.runtime.JVMCIBackend;
+import jdk.internal.jvmci.service.Services;
 
 //JaCoCo Exclude
 
+/**
+ * HotSpot implementation of a JVMCI runtime.
+ */
 public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider, HotSpotProxified {
 
     /**
@@ -45,13 +62,19 @@
      * initialization of the JVMCI and really should only ever be triggered through
      * {@link JVMCI#getRuntime}. However since {@link #runtime} can also be called directly it
      * should also trigger proper initialization. To ensure proper ordering, the static initializer
-     * of this class initializes {@link JVMCI} and then access to {@link Once#instance} triggers the
-     * final initialization of the {@link HotSpotJVMCIRuntime}.
+     * of this class initializes {@link JVMCI} and then access to
+     * {@link HotSpotJVMCIRuntime.DelayedInit#instance} triggers the final initialization of the
+     * {@link HotSpotJVMCIRuntime}.
      */
-    static {
+    private static void initializeJVMCI() {
         JVMCI.initialize();
     }
 
+    static {
+        initializeJVMCI();
+    }
+
+    @SuppressWarnings("try")
     static class DelayedInit {
         private static final HotSpotJVMCIRuntime instance;
 
@@ -68,7 +91,6 @@
                 }
 
                 try (InitTimer t = timer("HotSpotJVMCIRuntime.completeInitialization")) {
-                    // Why deferred initialization? See comment in completeInitialization().
                     instance.completeInitialization();
                 }
             }
@@ -88,29 +110,6 @@
      */
     public void completeInitialization() {
         compiler = HotSpotJVMCICompilerConfig.getCompilerFactory().createCompiler(this);
-
-        // Proxies for the VM/Compiler interfaces cannot be initialized
-        // in the constructor as proxy creation causes static
-        // initializers to be executed for all the types involved in the
-        // proxied methods. Some of these static initializers (e.g. in
-        // HotSpotMethodData) rely on the static 'instance' field being set
-        // to retrieve configuration details.
-
-        CompilerToVM toVM = this.compilerToVm;
-
-        for (HotSpotVMEventListener vmEventListener : vmEventListeners) {
-            toVM = vmEventListener.completeInitialization(this, toVM);
-        }
-
-        this.compilerToVm = toVM;
-    }
-
-    public static class Options {
-
-        // @formatter:off
-        @Option(help = "File to which logging is sent.  A %p in the name will be replaced with a string identifying the process, usually the process id.", type = OptionType.Expert)
-        public static final PrintStreamOption LogFile = new PrintStreamOption();
-        // @formatter:on
     }
 
     public static HotSpotJVMCIBackendFactory findFactory(String architecture) {
@@ -126,11 +125,11 @@
     /**
      * Gets the kind of a word value on the {@linkplain #getHostJVMCIBackend() host} backend.
      */
-    public static Kind getHostWordKind() {
+    public static JavaKind getHostWordKind() {
         return runtime().getHostJVMCIBackend().getCodeCache().getTarget().wordKind;
     }
 
-    protected/* final */CompilerToVM compilerToVm;
+    protected final CompilerToVM compilerToVm;
 
     protected final HotSpotVMConfig config;
     private final JVMCIBackend hostBackend;
@@ -142,8 +141,10 @@
 
     private final Iterable<HotSpotVMEventListener> vmEventListeners;
 
+    @SuppressWarnings("try")
     private HotSpotJVMCIRuntime() {
-        compilerToVm = new CompilerToVMImpl();
+        compilerToVm = new CompilerToVM();
+
         try (InitTimer t = timer("HotSpotVMConfig<init>")) {
             config = new HotSpotVMConfig(compilerToVm);
         }
@@ -174,6 +175,10 @@
             context = new HotSpotJVMCIMetaAccessContext();
         }
         metaAccessContext = context;
+
+        if (Boolean.valueOf(System.getProperty("jvmci.printconfig"))) {
+            printConfig(config, compilerToVm);
+        }
     }
 
     private JVMCIBackend registerBackend(JVMCIBackend backend) {
@@ -207,7 +212,7 @@
         Objects.requireNonNull(accessingType, "cannot resolve type without an accessing class");
         // If the name represents a primitive type we can short-circuit the lookup.
         if (name.length() == 1) {
-            Kind kind = Kind.fromPrimitiveOrVoidTypeChar(name.charAt(0));
+            JavaKind kind = JavaKind.fromPrimitiveOrVoidTypeChar(name.charAt(0));
             return fromClass(kind.toJavaClass());
         }
 
@@ -231,7 +236,7 @@
         return backends.get(arch);
     }
 
-    public Map<Class<? extends Architecture>, JVMCIBackend> getBackends() {
+    public Map<Class<? extends Architecture>, JVMCIBackend> getJVMCIBackends() {
         return Collections.unmodifiableMap(backends);
     }
 
@@ -244,14 +249,6 @@
     }
 
     /**
-     * Called from the VM.
-     */
-    @SuppressWarnings({"unused"})
-    private void compileTheWorld() throws Throwable {
-        compiler.compileTheWorld();
-    }
-
-    /**
      * Shuts down the runtime.
      *
      * Called from the VM.
@@ -263,16 +260,76 @@
         }
     }
 
-    /**
-     * Shuts down the runtime.
-     *
-     * Called from the VM.
-     *
-     * @param hotSpotCodeCacheProvider
-     */
     void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompilationResult compResult) {
         for (HotSpotVMEventListener vmEventListener : vmEventListeners) {
             vmEventListener.notifyInstall(hotSpotCodeCacheProvider, installedCode, compResult);
         }
     }
+
+    private static void printConfig(HotSpotVMConfig config, CompilerToVM vm) {
+        Field[] fields = config.getClass().getDeclaredFields();
+        Map<String, Field> sortedFields = new TreeMap<>();
+        for (Field f : fields) {
+            if (!f.isSynthetic() && !Modifier.isStatic(f.getModifiers())) {
+                f.setAccessible(true);
+                sortedFields.put(f.getName(), f);
+            }
+        }
+        for (Field f : sortedFields.values()) {
+            try {
+                String line = String.format("%9s %-40s = %s%n", f.getType().getSimpleName(), f.getName(), pretty(f.get(config)));
+                byte[] lineBytes = line.getBytes();
+                vm.writeDebugOutput(lineBytes, 0, lineBytes.length);
+                vm.flushDebugOutput();
+            } catch (Exception e) {
+            }
+        }
+    }
+
+    private static String pretty(Object value) {
+        if (value == null) {
+            return "null";
+        }
+
+        Class<?> klass = value.getClass();
+        if (value instanceof String) {
+            return "\"" + value + "\"";
+        } else if (value instanceof Method) {
+            return "method \"" + ((Method) value).getName() + "\"";
+        } else if (value instanceof Class<?>) {
+            return "class \"" + ((Class<?>) value).getSimpleName() + "\"";
+        } else if (value instanceof Integer) {
+            if ((Integer) value < 10) {
+                return value.toString();
+            }
+            return value + " (0x" + Integer.toHexString((Integer) value) + ")";
+        } else if (value instanceof Long) {
+            if ((Long) value < 10 && (Long) value > -10) {
+                return value + "l";
+            }
+            return value + "l (0x" + Long.toHexString((Long) value) + "l)";
+        } else if (klass.isArray()) {
+            StringBuilder str = new StringBuilder();
+            int dimensions = 0;
+            while (klass.isArray()) {
+                dimensions++;
+                klass = klass.getComponentType();
+            }
+            int length = Array.getLength(value);
+            str.append(klass.getSimpleName()).append('[').append(length).append(']');
+            for (int i = 1; i < dimensions; i++) {
+                str.append("[]");
+            }
+            str.append(" {");
+            for (int i = 0; i < length; i++) {
+                str.append(pretty(Array.get(value, i)));
+                if (i < length - 1) {
+                    str.append(", ");
+                }
+            }
+            str.append('}');
+            return str.toString();
+        }
+        return value.toString();
+    }
 }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntimeProvider.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntimeProvider.java	Tue Sep 15 18:13:11 2015 -0700
@@ -70,7 +70,7 @@
      *
      * @return the offset in bytes
      */
-    default int getArrayBaseOffset(Kind kind) {
+    static int getArrayBaseOffset(JavaKind kind) {
         switch (kind) {
             case Boolean:
                 return Unsafe.ARRAY_BOOLEAN_BASE_OFFSET;
@@ -100,7 +100,7 @@
      *
      * @return the scale in order to convert the index into a byte offset
      */
-    default int getArrayIndexScale(Kind kind) {
+    static int getArrayIndexScale(JavaKind kind) {
         switch (kind) {
             case Boolean:
                 return Unsafe.ARRAY_BOOLEAN_INDEX_SCALE;
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotMemoryAccessProviderImpl.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotMemoryAccessProviderImpl.java	Tue Sep 15 18:13:11 2015 -0700
@@ -22,11 +22,14 @@
  */
 package jdk.internal.jvmci.hotspot;
 
-import static jdk.internal.jvmci.common.UnsafeAccess.*;
-import jdk.internal.jvmci.code.*;
-import jdk.internal.jvmci.common.*;
-import jdk.internal.jvmci.hotspot.HotSpotVMConfig.*;
-import jdk.internal.jvmci.meta.*;
+import static jdk.internal.jvmci.hotspot.UnsafeAccess.UNSAFE;
+import jdk.internal.jvmci.common.JVMCIError;
+import jdk.internal.jvmci.hotspot.HotSpotVMConfig.CompressEncoding;
+import jdk.internal.jvmci.meta.Constant;
+import jdk.internal.jvmci.meta.JavaConstant;
+import jdk.internal.jvmci.meta.JavaKind;
+import jdk.internal.jvmci.meta.MemoryAccessProvider;
+import jdk.internal.jvmci.meta.PrimitiveConstant;
 
 /**
  * HotSpot implementation of {@link MemoryAccessProvider}.
@@ -70,7 +73,7 @@
             return ((HotSpotMetaspaceConstant) base).rawValue();
         } else if (base instanceof PrimitiveConstant) {
             PrimitiveConstant prim = (PrimitiveConstant) base;
-            if (prim.getKind().isNumericInteger()) {
+            if (prim.getJavaKind().isNumericInteger()) {
                 return prim.asLong();
             }
         }
@@ -82,13 +85,13 @@
         if (base != null) {
             switch (bits) {
                 case 8:
-                    return unsafe.getByte(base, displacement);
+                    return UNSAFE.getByte(base, displacement);
                 case 16:
-                    return unsafe.getShort(base, displacement);
+                    return UNSAFE.getShort(base, displacement);
                 case 32:
-                    return unsafe.getInt(base, displacement);
+                    return UNSAFE.getInt(base, displacement);
                 case 64:
-                    return unsafe.getLong(base, displacement);
+                    return UNSAFE.getLong(base, displacement);
                 default:
                     throw new JVMCIError("%d", bits);
             }
@@ -96,13 +99,13 @@
             long pointer = asRawPointer(baseConstant);
             switch (bits) {
                 case 8:
-                    return unsafe.getByte(pointer + displacement);
+                    return UNSAFE.getByte(pointer + displacement);
                 case 16:
-                    return unsafe.getShort(pointer + displacement);
+                    return UNSAFE.getShort(pointer + displacement);
                 case 32:
-                    return unsafe.getInt(pointer + displacement);
+                    return UNSAFE.getInt(pointer + displacement);
                 case 64:
-                    return unsafe.getLong(pointer + displacement);
+                    return UNSAFE.getLong(pointer + displacement);
                 default:
                     throw new JVMCIError("%d", bits);
             }
@@ -113,7 +116,7 @@
         if (compressed == runtime.getConfig().useCompressedOops) {
             Object obj = asObject(base);
             if (obj != null) {
-                assert expected == unsafe.getObject(obj, displacement) : "readUnsafeOop doesn't agree with unsafe.getObject";
+                assert expected == UNSAFE.getObject(obj, displacement) : "readUnsafeOop doesn't agree with unsafe.getObject";
             }
         }
         if (base instanceof HotSpotMetaspaceConstant) {
@@ -140,15 +143,15 @@
             ret = runtime.getCompilerToVM().readUncompressedOop(displacement);
         } else {
             assert runtime.getConfig().useCompressedOops == compressed;
-            ret = unsafe.getObject(base, displacement);
+            ret = UNSAFE.getObject(base, displacement);
         }
         assert verifyReadRawObject(ret, baseConstant, initialDisplacement, compressed);
         return ret;
     }
 
     @Override
-    public JavaConstant readUnsafeConstant(Kind kind, JavaConstant baseConstant, long displacement) {
-        if (kind == Kind.Object) {
+    public JavaConstant readUnsafeConstant(JavaKind kind, JavaConstant baseConstant, long displacement) {
+        if (kind == JavaKind.Object) {
             Object o = readRawObject(baseConstant, displacement, runtime.getConfig().useCompressedOops);
             return HotSpotObjectConstantImpl.forObject(o);
         } else {
@@ -157,7 +160,7 @@
     }
 
     @Override
-    public JavaConstant readPrimitiveConstant(Kind kind, Constant baseConstant, long initialDisplacement, int bits) {
+    public JavaConstant readPrimitiveConstant(JavaKind kind, Constant baseConstant, long initialDisplacement, int bits) {
         try {
             long rawValue = readRawValue(baseConstant, initialDisplacement, bits);
             switch (kind) {
@@ -211,8 +214,7 @@
         if (klass == null) {
             return JavaConstant.NULL_POINTER;
         }
-        TargetDescription target = runtime.getHostJVMCIBackend().getCodeCache().getTarget();
-        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(target.wordKind, klass.getMetaspaceKlass(), klass, false);
+        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(klass.getMetaspaceKlass(), klass, false);
     }
 
     @Override
@@ -221,15 +223,14 @@
         if (klass == null) {
             return HotSpotCompressedNullConstant.COMPRESSED_NULL;
         }
-        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(Kind.Int, encoding.compress(klass.getMetaspaceKlass()), klass, true);
+        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(encoding.compress(klass.getMetaspaceKlass()), klass, true);
     }
 
     @Override
     public Constant readMethodPointerConstant(Constant base, long displacement) {
-        TargetDescription target = runtime.getHostJVMCIBackend().getCodeCache().getTarget();
         assert (base instanceof HotSpotObjectConstantImpl);
         Object baseObject = ((HotSpotObjectConstantImpl) base).object();
         HotSpotResolvedJavaMethodImpl method = runtime.getCompilerToVM().getResolvedJavaMethod(baseObject, displacement);
-        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(target.wordKind, method.getMetaspaceMethod(), method, false);
+        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(method.getMetaspaceMethod(), method, false);
     }
 }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotMetaAccessProvider.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotMetaAccessProvider.java	Tue Sep 15 18:13:11 2015 -0700
@@ -22,8 +22,9 @@
  */
 package jdk.internal.jvmci.hotspot;
 
-import static jdk.internal.jvmci.common.UnsafeAccess.*;
+import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset;
 import static jdk.internal.jvmci.hotspot.HotSpotResolvedObjectTypeImpl.*;
+import static jdk.internal.jvmci.hotspot.UnsafeAccess.UNSAFE;
 
 import java.lang.reflect.*;
 
@@ -65,12 +66,12 @@
     /**
      * {@link Field} object of {@link Method#slot}.
      */
-    @SuppressWarnings("javadoc") private Field reflectionMethodSlot = getReflectionSlotField(Method.class);
+    private Field reflectionMethodSlot = getReflectionSlotField(Method.class);
 
     /**
      * {@link Field} object of {@link Constructor#slot}.
      */
-    @SuppressWarnings("javadoc") private Field reflectionConstructorSlot = getReflectionSlotField(Constructor.class);
+    private Field reflectionConstructorSlot = getReflectionSlotField(Constructor.class);
 
     private static Field getReflectionSlotField(Class<?> reflectionClass) {
         try {
@@ -100,7 +101,7 @@
         // java.lang.reflect.Field's modifiers should be enough here since VM internal modifier bits
         // are not used (yet).
         final int modifiers = reflectionField.getModifiers();
-        final long offset = Modifier.isStatic(modifiers) ? unsafe.staticFieldOffset(reflectionField) : unsafe.objectFieldOffset(reflectionField);
+        final long offset = Modifier.isStatic(modifiers) ? UNSAFE.staticFieldOffset(reflectionField) : UNSAFE.objectFieldOffset(reflectionField);
 
         HotSpotResolvedObjectType holder = fromObjectClass(fieldHolder);
         JavaType type = runtime.fromClass(fieldType);
@@ -281,7 +282,7 @@
 
     @Override
     public long getMemorySize(JavaConstant constant) {
-        if (constant.getKind() == Kind.Object) {
+        if (constant.getJavaKind() == JavaKind.Object) {
             HotSpotResolvedObjectType lookupJavaType = lookupJavaType(constant);
 
             if (lookupJavaType == null) {
@@ -291,8 +292,8 @@
                     // TODO(tw): Add compressed pointer support.
                     int length = Array.getLength(((HotSpotObjectConstantImpl) constant).object());
                     ResolvedJavaType elementType = lookupJavaType.getComponentType();
-                    Kind elementKind = elementType.getKind();
-                    final int headerSize = runtime.getArrayBaseOffset(elementKind);
+                    JavaKind elementKind = elementType.getJavaKind();
+                    final int headerSize = getArrayBaseOffset(elementKind);
                     TargetDescription target = runtime.getHostJVMCIBackend().getTarget();
                     int sizeOfElement = target.getSizeInBytes(elementKind);
                     int alignment = target.wordSize;
@@ -302,7 +303,7 @@
                 return lookupJavaType.instanceSize();
             }
         } else {
-            return constant.getKind().getByteCount();
+            return constant.getJavaKind().getByteCount();
         }
     }
 
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotMetaspaceConstant.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotMetaspaceConstant.java	Tue Sep 15 18:13:11 2015 -0700
@@ -33,5 +33,7 @@
 
     HotSpotResolvedObjectType asResolvedJavaType();
 
+    HotSpotResolvedJavaMethod asResolvedJavaMethod();
+
     long rawValue();
 }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotMetaspaceConstantImpl.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotMetaspaceConstantImpl.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -27,10 +27,10 @@
 import jdk.internal.jvmci.hotspot.HotSpotVMConfig.*;
 import jdk.internal.jvmci.meta.*;
 
-public final class HotSpotMetaspaceConstantImpl extends PrimitiveConstant implements HotSpotMetaspaceConstant, VMConstant, HotSpotProxified {
+public final class HotSpotMetaspaceConstantImpl implements HotSpotMetaspaceConstant, VMConstant, HotSpotProxified {
 
-    static HotSpotMetaspaceConstantImpl forMetaspaceObject(Kind kind, long primitive, Object metaspaceObject, boolean compressed) {
-        return new HotSpotMetaspaceConstantImpl(kind, primitive, metaspaceObject, compressed);
+    static HotSpotMetaspaceConstantImpl forMetaspaceObject(long rawValue, Object metaspaceObject, boolean compressed) {
+        return new HotSpotMetaspaceConstantImpl(rawValue, metaspaceObject, compressed);
     }
 
     static Object getMetaspaceObject(Constant constant) {
@@ -38,43 +38,61 @@
     }
 
     private final Object metaspaceObject;
+    private final long rawValue;
     private final boolean compressed;
 
-    private HotSpotMetaspaceConstantImpl(Kind kind, long primitive, Object metaspaceObject, boolean compressed) {
-        super(kind, primitive);
+    private HotSpotMetaspaceConstantImpl(long rawValue, Object metaspaceObject, boolean compressed) {
         this.metaspaceObject = metaspaceObject;
+        this.rawValue = rawValue;
         this.compressed = compressed;
     }
 
     @Override
     public int hashCode() {
-        return super.hashCode() ^ System.identityHashCode(metaspaceObject);
+        return System.identityHashCode(metaspaceObject) ^ (int) (rawValue ^ (rawValue >>> 32)) ^ (compressed ? 1 : 2);
     }
 
     @Override
     public boolean equals(Object o) {
-        return o == this || (o instanceof HotSpotMetaspaceConstantImpl && super.equals(o) && Objects.equals(metaspaceObject, ((HotSpotMetaspaceConstantImpl) o).metaspaceObject));
+        if (o == this) {
+            return true;
+        }
+        if (!(o instanceof HotSpotMetaspaceConstantImpl)) {
+            return false;
+        }
+
+        HotSpotMetaspaceConstantImpl other = (HotSpotMetaspaceConstantImpl) o;
+        return Objects.equals(this.metaspaceObject, other.metaspaceObject) && this.rawValue == other.rawValue && this.compressed == other.compressed;
+    }
+
+    @Override
+    public String toValueString() {
+        return String.format("meta[%08x]{%s%s}", rawValue, metaspaceObject, compressed ? ";compressed" : "");
     }
 
     @Override
     public String toString() {
-        return super.toString() + "{" + metaspaceObject + (compressed ? ";compressed}" : "}");
+        return toValueString();
+    }
+
+    public boolean isDefaultForKind() {
+        return rawValue == 0;
     }
 
     public boolean isCompressed() {
         return compressed;
     }
 
-    public JavaConstant compress(CompressEncoding encoding) {
+    public Constant compress(CompressEncoding encoding) {
         assert !isCompressed();
-        HotSpotMetaspaceConstantImpl res = HotSpotMetaspaceConstantImpl.forMetaspaceObject(Kind.Int, encoding.compress(asLong()), metaspaceObject, true);
+        HotSpotMetaspaceConstantImpl res = HotSpotMetaspaceConstantImpl.forMetaspaceObject(encoding.compress(rawValue), metaspaceObject, true);
         assert res.isCompressed();
         return res;
     }
 
-    public JavaConstant uncompress(CompressEncoding encoding) {
+    public Constant uncompress(CompressEncoding encoding) {
         assert isCompressed();
-        HotSpotMetaspaceConstantImpl res = HotSpotMetaspaceConstantImpl.forMetaspaceObject(Kind.Long, encoding.uncompress(asInt()), metaspaceObject, false);
+        HotSpotMetaspaceConstantImpl res = HotSpotMetaspaceConstantImpl.forMetaspaceObject(encoding.uncompress((int) rawValue), metaspaceObject, false);
         assert !res.isCompressed();
         return res;
     }
@@ -86,7 +104,14 @@
         return null;
     }
 
+    public HotSpotResolvedJavaMethod asResolvedJavaMethod() {
+        if (metaspaceObject instanceof HotSpotResolvedJavaMethod) {
+            return (HotSpotResolvedJavaMethod) metaspaceObject;
+        }
+        return null;
+    }
+
     public long rawValue() {
-        return asLong();
+        return rawValue;
     }
 }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotMethodData.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotMethodData.java	Tue Sep 15 18:13:11 2015 -0700
@@ -23,8 +23,8 @@
 package jdk.internal.jvmci.hotspot;
 
 import static java.lang.String.*;
-import static jdk.internal.jvmci.common.UnsafeAccess.*;
 import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime.*;
+import static jdk.internal.jvmci.hotspot.UnsafeAccess.UNSAFE;
 
 import java.util.*;
 
@@ -78,7 +78,7 @@
      * @return value of the MethodData::_data_size field
      */
     private int normalDataSize() {
-        return unsafe.getInt(metaspaceMethodData + config.methodDataDataSize);
+        return UNSAFE.getInt(metaspaceMethodData + config.methodDataDataSize);
     }
 
     /**
@@ -89,7 +89,7 @@
      */
     private int extraDataSize() {
         final int extraDataBase = config.methodDataOopDataOffset + normalDataSize();
-        final int extraDataLimit = unsafe.getInt(metaspaceMethodData + config.methodDataSize);
+        final int extraDataLimit = UNSAFE.getInt(metaspaceMethodData + config.methodDataSize);
         return extraDataLimit - extraDataBase;
     }
 
@@ -112,13 +112,13 @@
     public int getDeoptimizationCount(DeoptimizationReason reason) {
         HotSpotMetaAccessProvider metaAccess = (HotSpotMetaAccessProvider) runtime().getHostJVMCIBackend().getMetaAccess();
         int reasonIndex = metaAccess.convertDeoptReason(reason);
-        return unsafe.getByte(metaspaceMethodData + config.methodDataOopTrapHistoryOffset + reasonIndex) & 0xFF;
+        return UNSAFE.getByte(metaspaceMethodData + config.methodDataOopTrapHistoryOffset + reasonIndex) & 0xFF;
     }
 
     public int getOSRDeoptimizationCount(DeoptimizationReason reason) {
         HotSpotMetaAccessProvider metaAccess = (HotSpotMetaAccessProvider) runtime().getHostJVMCIBackend().getMetaAccess();
         int reasonIndex = metaAccess.convertDeoptReason(reason);
-        return unsafe.getByte(metaspaceMethodData + config.methodDataOopTrapHistoryOffset + config.deoptReasonOSROffset + reasonIndex) & 0xFF;
+        return UNSAFE.getByte(metaspaceMethodData + config.methodDataOopTrapHistoryOffset + config.deoptReasonOSROffset + reasonIndex) & 0xFF;
     }
 
     public HotSpotMethodDataAccessor getNormalData(int position) {
@@ -160,12 +160,12 @@
 
     private int readUnsignedByte(int position, int offsetInBytes) {
         long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
-        return unsafe.getByte(metaspaceMethodData + fullOffsetInBytes) & 0xFF;
+        return UNSAFE.getByte(metaspaceMethodData + fullOffsetInBytes) & 0xFF;
     }
 
     private int readUnsignedShort(int position, int offsetInBytes) {
         long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
-        return unsafe.getShort(metaspaceMethodData + fullOffsetInBytes) & 0xFFFF;
+        return UNSAFE.getShort(metaspaceMethodData + fullOffsetInBytes) & 0xFFFF;
     }
 
     /**
@@ -174,7 +174,7 @@
      */
     private long readUnsignedInt(int position, int offsetInBytes) {
         long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
-        return unsafe.getAddress(metaspaceMethodData + fullOffsetInBytes) & 0xFFFFFFFFL;
+        return UNSAFE.getAddress(metaspaceMethodData + fullOffsetInBytes) & 0xFFFFFFFFL;
     }
 
     private int readUnsignedIntAsSignedInt(int position, int offsetInBytes) {
@@ -188,17 +188,17 @@
      */
     private int readInt(int position, int offsetInBytes) {
         long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
-        return (int) unsafe.getAddress(metaspaceMethodData + fullOffsetInBytes);
+        return (int) UNSAFE.getAddress(metaspaceMethodData + fullOffsetInBytes);
     }
 
     private HotSpotResolvedJavaMethod readMethod(int position, int offsetInBytes) {
         long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
-        return runtime().compilerToVm.getResolvedJavaMethod(null, metaspaceMethodData + fullOffsetInBytes);
+        return runtime().getCompilerToVM().getResolvedJavaMethod(null, metaspaceMethodData + fullOffsetInBytes);
     }
 
     private HotSpotResolvedObjectTypeImpl readKlass(int position, int offsetInBytes) {
         long fullOffsetInBytes = computeFullOffset(position, offsetInBytes);
-        return runtime().compilerToVm.getResolvedJavaType(null, metaspaceMethodData + fullOffsetInBytes, false);
+        return runtime().getCompilerToVM().getResolvedJavaType(null, metaspaceMethodData + fullOffsetInBytes, false);
     }
 
     private static int truncateLongToInt(long value) {
@@ -855,10 +855,10 @@
     }
 
     public void setCompiledIRSize(int size) {
-        unsafe.putInt(metaspaceMethodData + config.methodDataIRSizeOffset, size);
+        UNSAFE.putInt(metaspaceMethodData + config.methodDataIRSizeOffset, size);
     }
 
     public int getCompiledIRSize() {
-        return unsafe.getInt(metaspaceMethodData + config.methodDataIRSizeOffset);
+        return UNSAFE.getInt(metaspaceMethodData + config.methodDataIRSizeOffset);
     }
 }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotMethodHandleAccessProvider.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotMethodHandleAccessProvider.java	Tue Sep 15 18:13:11 2015 -0700
@@ -154,6 +154,6 @@
 
         Object object = ((HotSpotObjectConstantImpl) memberName).object();
         /* Read the ResolvedJavaMethod from the injected field MemberName.vmtarget */
-        return runtime().compilerToVm.getResolvedJavaMethod(object, LazyInitialization.memberNameVmtargetField.offset());
+        return runtime().getCompilerToVM().getResolvedJavaMethod(object, LazyInitialization.memberNameVmtargetField.offset());
     }
 }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotNmethod.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotNmethod.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -81,9 +81,9 @@
 
     protected boolean checkThreeObjectArgs() {
         assert method.getSignature().getParameterCount(!method.isStatic()) == 3;
-        assert method.getSignature().getParameterKind(0) == Kind.Object;
-        assert method.getSignature().getParameterKind(1) == Kind.Object;
-        assert !method.isStatic() || method.getSignature().getParameterKind(2) == Kind.Object;
+        assert method.getSignature().getParameterKind(0) == JavaKind.Object;
+        assert method.getSignature().getParameterKind(1) == JavaKind.Object;
+        assert !method.isStatic() || method.getSignature().getParameterKind(2) == JavaKind.Object;
         return true;
     }
 
@@ -93,9 +93,9 @@
         for (int i = 0; i < sig.length; i++) {
             Object arg = args[i];
             if (arg == null) {
-                assert sig[i].getKind() == Kind.Object : method.format("%H.%n(%p): expected arg ") + i + " to be Object, not " + sig[i];
-            } else if (sig[i].getKind() != Kind.Object) {
-                assert sig[i].getKind().toBoxedJavaClass() == arg.getClass() : method.format("%H.%n(%p): expected arg ") + i + " to be " + sig[i] + ", not " + arg.getClass();
+                assert sig[i].getJavaKind() == JavaKind.Object : method.format("%H.%n(%p): expected arg ") + i + " to be Object, not " + sig[i];
+            } else if (sig[i].getJavaKind() != JavaKind.Object) {
+                assert sig[i].getJavaKind().toBoxedJavaClass() == arg.getClass() : method.format("%H.%n(%p): expected arg ") + i + " to be " + sig[i] + ", not " + arg.getClass();
             }
         }
         return true;
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotObjectConstantImpl.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotObjectConstantImpl.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -33,7 +33,7 @@
  * Represents a constant non-{@code null} object reference, within the compiler and across the
  * compiler/runtime interface.
  */
-public final class HotSpotObjectConstantImpl extends AbstractValue implements HotSpotObjectConstant, HotSpotProxified {
+public final class HotSpotObjectConstantImpl implements HotSpotObjectConstant, HotSpotProxified {
 
     public static JavaConstant forObject(Object object) {
         return forObject(object, false);
@@ -56,8 +56,8 @@
         }
     }
 
-    public static JavaConstant forBoxedValue(Kind kind, Object value) {
-        if (kind == Kind.Object) {
+    public static JavaConstant forBoxedValue(JavaKind kind, Object value) {
+        if (kind == JavaKind.Object) {
             return HotSpotObjectConstantImpl.forObject(value);
         } else {
             return JavaConstant.forBoxedPrimitive(value);
@@ -80,7 +80,6 @@
     private final boolean isDefaultStable;
 
     private HotSpotObjectConstantImpl(Object object, boolean compressed, int stableDimension, boolean isDefaultStable) {
-        super(LIRKind.reference(compressed ? Kind.Int : Kind.Object));
         this.object = object;
         this.compressed = compressed;
         this.stableDimension = (byte) stableDimension;
@@ -95,6 +94,11 @@
         this(object, compressed, 0, false);
     }
 
+    @Override
+    public JavaKind getJavaKind() {
+        return JavaKind.Object;
+    }
+
     /**
      * Package-private accessor for the object represented by this constant.
      */
@@ -253,7 +257,7 @@
             return true;
         } else if (o instanceof HotSpotObjectConstantImpl) {
             HotSpotObjectConstantImpl other = (HotSpotObjectConstantImpl) o;
-            return super.equals(o) && object == other.object && compressed == other.compressed && stableDimension == other.stableDimension && isDefaultStable == other.isDefaultStable;
+            return object == other.object && compressed == other.compressed && stableDimension == other.stableDimension && isDefaultStable == other.isDefaultStable;
         }
         return false;
     }
@@ -263,13 +267,13 @@
         if (object instanceof String) {
             return "\"" + (String) object + "\"";
         } else {
-            return Kind.Object.format(object);
+            return JavaKind.Object.format(object);
         }
     }
 
     @Override
     public String toString() {
-        return (compressed ? "NarrowOop" : getKind().getJavaName()) + "[" + Kind.Object.format(object) + "]";
+        return (compressed ? "NarrowOop" : getJavaKind().getJavaName()) + "[" + JavaKind.Object.format(object) + "]";
     }
 
     /**
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethodImpl.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethodImpl.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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,9 +22,9 @@
  */
 package jdk.internal.jvmci.hotspot;
 
-import static jdk.internal.jvmci.common.UnsafeAccess.*;
 import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime.*;
 import static jdk.internal.jvmci.hotspot.HotSpotResolvedJavaMethodImpl.Options.*;
+import static jdk.internal.jvmci.hotspot.UnsafeAccess.UNSAFE;
 
 import java.lang.annotation.*;
 import java.lang.reflect.*;
@@ -67,8 +67,8 @@
      */
     private static HotSpotResolvedObjectTypeImpl getHolder(long metaspaceMethod) {
         HotSpotVMConfig config = runtime().getConfig();
-        final long metaspaceConstMethod = unsafe.getAddress(metaspaceMethod + config.methodConstMethodOffset);
-        final long metaspaceConstantPool = unsafe.getAddress(metaspaceConstMethod + config.constMethodConstantsOffset);
+        final long metaspaceConstMethod = UNSAFE.getAddress(metaspaceMethod + config.methodConstMethodOffset);
+        final long metaspaceConstantPool = UNSAFE.getAddress(metaspaceConstMethod + config.constMethodConstantsOffset);
         return runtime().getCompilerToVM().getResolvedJavaType(null, metaspaceConstantPool + config.constantPoolHolderOffset, false);
     }
 
@@ -102,17 +102,17 @@
          * signature-polymorphic method handle methods) have their own constant pool instead of the
          * one from their holder.
          */
-        final long metaspaceConstantPool = unsafe.getAddress(constMethod + config.constMethodConstantsOffset);
+        final long metaspaceConstantPool = UNSAFE.getAddress(constMethod + config.constMethodConstantsOffset);
         if (metaspaceConstantPool == holder.getConstantPool().getMetaspaceConstantPool()) {
             this.constantPool = holder.getConstantPool();
         } else {
             this.constantPool = runtime().getCompilerToVM().getConstantPool(null, constMethod + config.constMethodConstantsOffset);
         }
 
-        final int nameIndex = unsafe.getChar(constMethod + config.constMethodNameIndexOffset);
+        final int nameIndex = UNSAFE.getChar(constMethod + config.constMethodNameIndexOffset);
         this.name = constantPool.lookupUtf8(nameIndex);
 
-        final int signatureIndex = unsafe.getChar(constMethod + config.constMethodSignatureIndexOffset);
+        final int signatureIndex = UNSAFE.getChar(constMethod + config.constMethodSignatureIndexOffset);
         this.signature = (HotSpotSignature) constantPool.lookupSignature(signatureIndex);
     }
 
@@ -126,7 +126,7 @@
      */
     private long getConstMethod() {
         assert metaspaceMethod != 0;
-        return unsafe.getAddress(metaspaceMethod + runtime().getConfig().methodConstMethodOffset);
+        return UNSAFE.getAddress(metaspaceMethod + runtime().getConfig().methodConstMethodOffset);
     }
 
     @Override
@@ -152,7 +152,7 @@
      * @return flags of this method
      */
     private int getFlags() {
-        return unsafe.getByte(metaspaceMethod + runtime().getConfig().methodFlagsOffset);
+        return UNSAFE.getByte(metaspaceMethod + runtime().getConfig().methodFlagsOffset);
     }
 
     /**
@@ -161,7 +161,7 @@
      * @return flags of this method's ConstMethod
      */
     private int getConstMethodFlags() {
-        return unsafe.getChar(getConstMethod() + runtime().getConfig().constMethodFlagsOffset);
+        return UNSAFE.getChar(getConstMethod() + runtime().getConfig().constMethodFlagsOffset);
     }
 
     @Override
@@ -172,8 +172,8 @@
     /**
      * Gets the address of the C++ Method object for this method.
      */
-    public JavaConstant getMetaspaceMethodConstant() {
-        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(getHostWordKind(), metaspaceMethod, this, false);
+    public Constant getMetaspaceMethodConstant() {
+        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(metaspaceMethod, this, false);
     }
 
     public long getMetaspaceMethod() {
@@ -185,7 +185,7 @@
     }
 
     @Override
-    public JavaConstant getEncoding() {
+    public Constant getEncoding() {
         return getMetaspaceMethodConstant();
     }
 
@@ -194,7 +194,7 @@
      * modifiers as well as the HotSpot internal modifiers.
      */
     public int getAllModifiers() {
-        return unsafe.getInt(metaspaceMethod + runtime().getConfig().methodAccessFlagsOffset);
+        return UNSAFE.getInt(metaspaceMethod + runtime().getConfig().methodAccessFlagsOffset);
     }
 
     @Override
@@ -221,7 +221,7 @@
 
     @Override
     public int getCodeSize() {
-        return unsafe.getChar(getConstMethod() + runtime().getConfig().constMethodCodeSizeOffset);
+        return UNSAFE.getChar(getConstMethod() + runtime().getConfig().constMethodCodeSizeOffset);
     }
 
     @Override
@@ -237,10 +237,10 @@
         long exceptionTableElement = runtime().getCompilerToVM().getExceptionTableStart(this);
 
         for (int i = 0; i < exceptionTableLength; i++) {
-            final int startPc = unsafe.getChar(exceptionTableElement + config.exceptionTableElementStartPcOffset);
-            final int endPc = unsafe.getChar(exceptionTableElement + config.exceptionTableElementEndPcOffset);
-            final int handlerPc = unsafe.getChar(exceptionTableElement + config.exceptionTableElementHandlerPcOffset);
-            int catchTypeIndex = unsafe.getChar(exceptionTableElement + config.exceptionTableElementCatchTypeIndexOffset);
+            final int startPc = UNSAFE.getChar(exceptionTableElement + config.exceptionTableElementStartPcOffset);
+            final int endPc = UNSAFE.getChar(exceptionTableElement + config.exceptionTableElementEndPcOffset);
+            final int handlerPc = UNSAFE.getChar(exceptionTableElement + config.exceptionTableElementHandlerPcOffset);
+            int catchTypeIndex = UNSAFE.getChar(exceptionTableElement + config.exceptionTableElementCatchTypeIndexOffset);
 
             JavaType catchType;
             if (catchTypeIndex == 0) {
@@ -345,7 +345,7 @@
             return 0;
         }
         HotSpotVMConfig config = runtime().getConfig();
-        return unsafe.getChar(getConstMethod() + config.methodMaxLocalsOffset);
+        return UNSAFE.getChar(getConstMethod() + config.methodMaxLocalsOffset);
     }
 
     @Override
@@ -354,7 +354,7 @@
             return 0;
         }
         HotSpotVMConfig config = runtime().getConfig();
-        return config.extraStackEntries + unsafe.getChar(getConstMethod() + config.constMethodMaxStackOffset);
+        return config.extraStackEntries + UNSAFE.getChar(getConstMethod() + config.constMethodMaxStackOffset);
     }
 
     @Override
@@ -394,7 +394,7 @@
      */
     private long getCompiledCode() {
         HotSpotVMConfig config = runtime().getConfig();
-        return unsafe.getAddress(metaspaceMethod + config.methodCodeOffset);
+        return UNSAFE.getAddress(metaspaceMethod + config.methodCodeOffset);
     }
 
     /**
@@ -413,7 +413,7 @@
     public boolean hasCompiledCodeAtLevel(int level) {
         long compiledCode = getCompiledCode();
         if (compiledCode != 0) {
-            return unsafe.getInt(compiledCode + runtime().getConfig().nmethodCompLevelOffset) == level;
+            return UNSAFE.getInt(compiledCode + runtime().getConfig().nmethodCompLevelOffset) == level;
         }
         return false;
     }
@@ -425,7 +425,7 @@
         ProfilingInfo info;
 
         if (UseProfilingInformation.getValue() && methodData == null) {
-            long metaspaceMethodData = unsafe.getAddress(metaspaceMethod + runtime().getConfig().methodDataOffset);
+            long metaspaceMethodData = UNSAFE.getAddress(metaspaceMethod + runtime().getConfig().methodDataOffset);
             if (metaspaceMethodData != 0) {
                 methodData = new HotSpotMethodData(metaspaceMethodData, this);
                 if (TraceMethodDataFilter != null && this.format("%H.%n").contains(TraceMethodDataFilter)) {
@@ -595,11 +595,11 @@
         Local[] locals = new Local[localVariableTableLength];
 
         for (int i = 0; i < localVariableTableLength; i++) {
-            final int startBci = unsafe.getChar(localVariableTableElement + config.localVariableTableElementStartBciOffset);
-            final int endBci = startBci + unsafe.getChar(localVariableTableElement + config.localVariableTableElementLengthOffset);
-            final int nameCpIndex = unsafe.getChar(localVariableTableElement + config.localVariableTableElementNameCpIndexOffset);
-            final int typeCpIndex = unsafe.getChar(localVariableTableElement + config.localVariableTableElementDescriptorCpIndexOffset);
-            final int slot = unsafe.getChar(localVariableTableElement + config.localVariableTableElementSlotOffset);
+            final int startBci = UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementStartBciOffset);
+            final int endBci = startBci + UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementLengthOffset);
+            final int nameCpIndex = UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementNameCpIndexOffset);
+            final int typeCpIndex = UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementDescriptorCpIndexOffset);
+            final int slot = UNSAFE.getChar(localVariableTableElement + config.localVariableTableElementSlotOffset);
 
             String localName = getConstantPool().lookupUtf8(nameCpIndex);
             String localType = getConstantPool().lookupUtf8(typeCpIndex);
@@ -660,7 +660,7 @@
     private int getVtableIndex() {
         assert !holder.isInterface();
         HotSpotVMConfig config = runtime().getConfig();
-        int result = unsafe.getInt(metaspaceMethod + config.methodVtableIndexOffset);
+        int result = UNSAFE.getInt(metaspaceMethod + config.methodVtableIndexOffset);
         assert result >= config.nonvirtualVtableIndex : "must be linked";
         return result;
     }
@@ -701,7 +701,7 @@
 
     public int intrinsicId() {
         HotSpotVMConfig config = runtime().getConfig();
-        return unsafe.getByte(metaspaceMethod + config.methodIntrinsicIdOffset) & 0xff;
+        return UNSAFE.getByte(metaspaceMethod + config.methodIntrinsicIdOffset) & 0xff;
     }
 
     @Override
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedObjectType.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedObjectType.java	Tue Sep 15 18:13:11 2015 -0700
@@ -50,8 +50,8 @@
         return false;
     }
 
-    default Kind getKind() {
-        return Kind.Object;
+    default JavaKind getJavaKind() {
+        return JavaKind.Object;
     }
 
     ConstantPool getConstantPool();
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedObjectTypeImpl.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedObjectTypeImpl.java	Tue Sep 15 18:13:11 2015 -0700
@@ -23,8 +23,8 @@
 package jdk.internal.jvmci.hotspot;
 
 import static java.util.Objects.*;
-import static jdk.internal.jvmci.common.UnsafeAccess.*;
 import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime.*;
+import static jdk.internal.jvmci.hotspot.UnsafeAccess.UNSAFE;
 
 import java.lang.annotation.*;
 import java.lang.reflect.*;
@@ -45,7 +45,6 @@
      * The Java class this type represents.
      */
     private final Class<?> javaClass;
-
     private HashMap<Long, HotSpotResolvedJavaField> fieldCache;
     private HashMap<Long, HotSpotResolvedJavaMethodImpl> methodCache;
     private HotSpotResolvedJavaField[] instanceFields;
@@ -110,10 +109,10 @@
      * Gets the metaspace Klass for this type.
      */
     public long getMetaspaceKlass() {
-        if (HotSpotJVMCIRuntime.getHostWordKind() == Kind.Long) {
-            return unsafe.getLong(javaClass, (long) runtime().getConfig().klassOffset);
+        if (HotSpotJVMCIRuntime.getHostWordKind() == JavaKind.Long) {
+            return UNSAFE.getLong(javaClass, (long) runtime().getConfig().klassOffset);
         }
-        return unsafe.getInt(javaClass, (long) runtime().getConfig().klassOffset) & 0xFFFFFFFFL;
+        return UNSAFE.getInt(javaClass, (long) runtime().getConfig().klassOffset) & 0xFFFFFFFFL;
     }
 
     public long getMetaspacePointer() {
@@ -131,7 +130,7 @@
 
     public int getAccessFlags() {
         HotSpotVMConfig config = runtime().getConfig();
-        return unsafe.getInt(getMetaspaceKlass() + config.klassAccessFlagsOffset);
+        return UNSAFE.getInt(getMetaspaceKlass() + config.klassAccessFlagsOffset);
     }
 
     @Override
@@ -181,7 +180,7 @@
             HotSpotResolvedObjectTypeImpl type = this;
             while (type.isAbstract()) {
                 HotSpotResolvedObjectTypeImpl subklass = type.getSubklass();
-                if (subklass == null || unsafe.getAddress(subklass.getMetaspaceKlass() + config.nextSiblingOffset) != 0) {
+                if (subklass == null || UNSAFE.getAddress(subklass.getMetaspaceKlass() + config.nextSiblingOffset) != 0) {
                     return null;
                 }
                 type = subklass;
@@ -221,7 +220,7 @@
     @Override
     public HotSpotResolvedObjectTypeImpl getSuperclass() {
         Class<?> javaSuperclass = mirror().getSuperclass();
-        return javaSuperclass == null ? null : (HotSpotResolvedObjectTypeImpl) fromObjectClass(javaSuperclass);
+        return javaSuperclass == null ? null : fromObjectClass(javaSuperclass);
     }
 
     @Override
@@ -290,7 +289,7 @@
     }
 
     @Override
-    public JavaConstant getObjectHub() {
+    public Constant getObjectHub() {
         return klass();
     }
 
@@ -337,20 +336,20 @@
      */
     private int getInitState() {
         assert !isArray() : "_init_state only exists in InstanceKlass";
-        return unsafe.getByte(getMetaspaceKlass() + runtime().getConfig().instanceKlassInitStateOffset) & 0xFF;
+        return UNSAFE.getByte(getMetaspaceKlass() + runtime().getConfig().instanceKlassInitStateOffset) & 0xFF;
     }
 
     @Override
     public void initialize() {
         if (!isInitialized()) {
-            unsafe.ensureClassInitialized(mirror());
+            UNSAFE.ensureClassInitialized(mirror());
             assert isInitialized();
         }
     }
 
     @Override
     public boolean isInstance(JavaConstant obj) {
-        if (obj.getKind() == Kind.Object && !obj.isNull()) {
+        if (obj.getJavaKind() == JavaKind.Object && !obj.isNull()) {
             return mirror().isInstance(((HotSpotObjectConstantImpl) obj).object());
         }
         return false;
@@ -382,8 +381,8 @@
     }
 
     @Override
-    public Kind getKind() {
-        return Kind.Object;
+    public JavaKind getJavaKind() {
+        return JavaKind.Object;
     }
 
     @Override
@@ -440,7 +439,7 @@
 
     public int layoutHelper() {
         HotSpotVMConfig config = runtime().getConfig();
-        return unsafe.getInt(getMetaspaceKlass() + config.klassLayoutHelperOffset);
+        return UNSAFE.getInt(getMetaspaceKlass() + config.klassLayoutHelperOffset);
     }
 
     synchronized HotSpotResolvedJavaMethod createMethod(long metaspaceMethod) {
@@ -464,8 +463,8 @@
             /* Everything has the core vtable of java.lang.Object */
             return config.baseVtableLength;
         }
-        int result = unsafe.getInt(getMetaspaceKlass() + config.instanceKlassVtableLengthOffset) / (config.vtableEntrySize / config.heapWordSize);
-        assert result >= config.baseVtableLength : unsafe.getInt(getMetaspaceKlass() + config.instanceKlassVtableLengthOffset) + " " + config.vtableEntrySize;
+        int result = UNSAFE.getInt(getMetaspaceKlass() + config.instanceKlassVtableLengthOffset) / (config.vtableEntrySize / config.heapWordSize);
+        assert result >= config.baseVtableLength : UNSAFE.getInt(getMetaspaceKlass() + config.instanceKlassVtableLengthOffset) + " " + config.vtableEntrySize;
         return result;
     }
 
@@ -476,7 +475,7 @@
 
         final long id = offset + ((long) flags << 32);
 
-        // (thomaswue) Must cache the fields, because the local load elimination only works if the
+        // Must cache the fields, because the local load elimination only works if the
         // objects from two field lookups are identical.
         if (fieldCache == null) {
             fieldCache = new HashMap<>(8);
@@ -550,7 +549,7 @@
         public FieldInfo(int index) {
             HotSpotVMConfig config = runtime().getConfig();
             // Get Klass::_fields
-            final long metaspaceFields = unsafe.getAddress(getMetaspaceKlass() + config.instanceKlassFieldsOffset);
+            final long metaspaceFields = UNSAFE.getAddress(getMetaspaceKlass() + config.instanceKlassFieldsOffset);
             assert config.fieldInfoFieldSlots == 6 : "revisit the field parsing code";
             metaspaceData = metaspaceFields + config.arrayU2DataOffset + config.fieldInfoFieldSlots * Short.BYTES * index;
         }
@@ -580,7 +579,7 @@
          * on top an array of Java shorts.
          */
         private int readFieldSlot(int index) {
-            return unsafe.getChar(metaspaceData + Short.BYTES * index);
+            return UNSAFE.getChar(metaspaceData + Short.BYTES * index);
         }
 
         /**
@@ -709,8 +708,8 @@
      */
     private int getFieldCount() {
         HotSpotVMConfig config = runtime().getConfig();
-        final long metaspaceFields = unsafe.getAddress(getMetaspaceKlass() + config.instanceKlassFieldsOffset);
-        int metaspaceFieldsLength = unsafe.getInt(metaspaceFields + config.arrayU1LengthOffset);
+        final long metaspaceFields = UNSAFE.getAddress(getMetaspaceKlass() + config.instanceKlassFieldsOffset);
+        int metaspaceFieldsLength = UNSAFE.getInt(metaspaceFields + config.arrayU1LengthOffset);
         int fieldCount = 0;
 
         for (int i = 0, index = 0; i < metaspaceFieldsLength; i += config.fieldInfoFieldSlots, index++) {
@@ -731,7 +730,7 @@
     @Override
     public String getSourceFileName() {
         HotSpotVMConfig config = runtime().getConfig();
-        final int sourceFileNameIndex = unsafe.getChar(getMetaspaceKlass() + config.instanceKlassSourceFileNameIndexOffset);
+        final int sourceFileNameIndex = UNSAFE.getChar(getMetaspaceKlass() + config.instanceKlassSourceFileNameIndexOffset);
         if (sourceFileNameIndex == 0) {
             return null;
         }
@@ -785,8 +784,8 @@
     /**
      * Gets the metaspace Klass boxed in a {@link JavaConstant}.
      */
-    public JavaConstant klass() {
-        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(runtime().getHostJVMCIBackend().getTarget().wordKind, getMetaspaceKlass(), this, false);
+    public Constant klass() {
+        return HotSpotMetaspaceConstantImpl.forMetaspaceObject(getMetaspaceKlass(), this, false);
     }
 
     public boolean isPrimaryType() {
@@ -795,7 +794,7 @@
 
     public int superCheckOffset() {
         HotSpotVMConfig config = runtime().getConfig();
-        return unsafe.getInt(getMetaspaceKlass() + config.superCheckOffsetOffset);
+        return UNSAFE.getInt(getMetaspaceKlass() + config.superCheckOffsetOffset);
     }
 
     public long prototypeMarkWord() {
@@ -803,12 +802,12 @@
         if (isArray()) {
             return config.arrayPrototypeMarkWord();
         } else {
-            return unsafe.getAddress(getMetaspaceKlass() + config.prototypeMarkWordOffset);
+            return UNSAFE.getAddress(getMetaspaceKlass() + config.prototypeMarkWordOffset);
         }
     }
 
     @Override
-    public ResolvedJavaField findInstanceFieldWithOffset(long offset, Kind expectedEntryKind) {
+    public ResolvedJavaField findInstanceFieldWithOffset(long offset, JavaKind expectedEntryKind) {
         ResolvedJavaField[] declaredFields = getInstanceFields(true);
         for (ResolvedJavaField field : declaredFields) {
             HotSpotResolvedJavaField resolvedField = (HotSpotResolvedJavaField) field;
@@ -816,11 +815,11 @@
             // @formatter:off
             if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN  &&
                             expectedEntryKind.isPrimitive() &&
-                            !expectedEntryKind.equals(Kind.Void) &&
-                            resolvedField.getKind().isPrimitive()) {
+                            !expectedEntryKind.equals(JavaKind.Void) &&
+                            resolvedField.getJavaKind().isPrimitive()) {
                 resolvedFieldOffset +=
-                                resolvedField.getKind().getByteCount() -
-                                Math.min(resolvedField.getKind().getByteCount(), 4 + expectedEntryKind.getByteCount());
+                                resolvedField.getJavaKind().getByteCount() -
+                                Math.min(resolvedField.getJavaKind().getByteCount(), 4 + expectedEntryKind.getByteCount());
             }
             if (resolvedFieldOffset == offset) {
                 return field;
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedPrimitiveType.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotResolvedPrimitiveType.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -37,10 +37,10 @@
  */
 public final class HotSpotResolvedPrimitiveType extends HotSpotResolvedJavaType implements HotSpotProxified {
 
-    private final Kind kind;
+    private final JavaKind kind;
 
     /**
-     * Creates the JVMCI mirror for a primitive {@link Kind}.
+     * Creates the JVMCI mirror for a primitive {@link JavaKind}.
      *
      * <p>
      * <b>NOTE</b>: Creating an instance of this class does not install the mirror for the
@@ -49,7 +49,7 @@
      *
      * @param kind the Kind to create the mirror for
      */
-    public HotSpotResolvedPrimitiveType(Kind kind) {
+    public HotSpotResolvedPrimitiveType(JavaKind kind) {
         super(String.valueOf(Character.toUpperCase(kind.getTypeChar())));
         this.kind = kind;
         assert mirror().isPrimitive() : mirror() + " not a primitive type";
@@ -62,7 +62,7 @@
 
     @Override
     public HotSpotResolvedObjectTypeImpl getArrayClass() {
-        if (kind == Kind.Void) {
+        if (kind == JavaKind.Void) {
             return null;
         }
         Class<?> javaArrayMirror = Array.newInstance(mirror(), 0).getClass();
@@ -164,7 +164,7 @@
     }
 
     @Override
-    public Kind getKind() {
+    public JavaKind getJavaKind() {
         return kind;
     }
 
@@ -229,7 +229,7 @@
     }
 
     @Override
-    public ResolvedJavaField findInstanceFieldWithOffset(long offset, Kind expectedType) {
+    public ResolvedJavaField findInstanceFieldWithOffset(long offset, JavaKind expectedType) {
         return null;
     }
 
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotSignature.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotSignature.java	Tue Sep 15 18:13:11 2015 -0700
@@ -112,8 +112,8 @@
     }
 
     @Override
-    public Kind getParameterKind(int index) {
-        return Kind.fromTypeString(parameters.get(index));
+    public JavaKind getParameterKind(int index) {
+        return JavaKind.fromTypeString(parameters.get(index));
     }
 
     private static boolean checkValidCache(ResolvedJavaType type, ResolvedJavaType accessingClass) {
@@ -128,7 +128,7 @@
 
     private static JavaType getUnresolvedOrPrimitiveType(HotSpotJVMCIRuntimeProvider runtime, String name) {
         if (name.length() == 1) {
-            Kind kind = Kind.fromPrimitiveOrVoidTypeChar(name.charAt(0));
+            JavaKind kind = JavaKind.fromPrimitiveOrVoidTypeChar(name.charAt(0));
             return runtime.getHostJVMCIBackend().getMetaAccess().lookupJavaType(kind.toJavaClass());
         }
         return new HotSpotUnresolvedJavaType(name, runtime);
@@ -165,8 +165,8 @@
     }
 
     @Override
-    public Kind getReturnKind() {
-        return Kind.fromTypeString(returnType);
+    public JavaKind getReturnKind() {
+        return JavaKind.fromTypeString(returnType);
     }
 
     @Override
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotSymbol.java	Tue Sep 15 18:12:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 2013, 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
- * 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.internal.jvmci.hotspot;
-
-import static jdk.internal.jvmci.common.UnsafeAccess.*;
-import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime.*;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * Represents a metaspace {@code Symbol}.
- */
-public class HotSpotSymbol {
-
-    private final long metaspaceSymbol;
-
-    public HotSpotSymbol(long metaspaceSymbol) {
-        assert metaspaceSymbol != 0;
-        this.metaspaceSymbol = metaspaceSymbol;
-    }
-
-    /**
-     * Decodes this {@code Symbol} and returns the symbol string as {@link java.lang.String}.
-     *
-     * @return the decoded string, or null if there was a decoding error
-     */
-    public String asString() {
-        return readModifiedUTF8(asByteArray());
-    }
-
-    /**
-     * Reads the modified UTF-8 string in {@code buf} and converts it to a {@link String}. The
-     * implementation is taken from {@link java.io.DataInputStream#readUTF(DataInput)} and adapted
-     * to operate on a {@code byte} array directly for performance reasons.
-     *
-     * @see java.io.DataInputStream#readUTF(DataInput)
-     */
-    private static String readModifiedUTF8(byte[] buf) {
-        final int utflen = buf.length;
-        byte[] bytearr = null;
-        char[] chararr = new char[utflen];
-
-        int c;
-        int char2;
-        int char3;
-        int count = 0;
-        int chararrCount = 0;
-
-        bytearr = buf;
-
-        while (count < utflen) {
-            c = bytearr[count] & 0xff;
-            if (c > 127) {
-                break;
-            }
-            count++;
-            chararr[chararrCount++] = (char) c;
-        }
-
-        while (count < utflen) {
-            c = bytearr[count] & 0xff;
-            switch (c >> 4) {
-                case 0:
-                case 1:
-                case 2:
-                case 3:
-                case 4:
-                case 5:
-                case 6:
-                case 7:
-                    /* 0xxxxxxx */
-                    count++;
-                    chararr[chararrCount++] = (char) c;
-                    break;
-                case 12:
-                case 13:
-                    /* 110x xxxx 10xx xxxx */
-                    count += 2;
-                    if (count > utflen) {
-                        // malformed input: partial character at end
-                        return null;
-                    }
-                    char2 = bytearr[count - 1];
-                    if ((char2 & 0xC0) != 0x80) {
-                        // malformed input around byte
-                        return null;
-                    }
-                    chararr[chararrCount++] = (char) (((c & 0x1F) << 6) | (char2 & 0x3F));
-                    break;
-                case 14:
-                    /* 1110 xxxx 10xx xxxx 10xx xxxx */
-                    count += 3;
-                    if (count > utflen) {
-                        // malformed input: partial character at end
-                        return null;
-                    }
-                    char2 = bytearr[count - 2];
-                    char3 = bytearr[count - 1];
-                    if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80)) {
-                        // malformed input around byte
-                        return null;
-                    }
-                    chararr[chararrCount++] = (char) (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0));
-                    break;
-                default:
-                    /* 10xx xxxx, 1111 xxxx */
-                    // malformed input around byte
-                    return null;
-            }
-        }
-        // The number of chars produced may be less than utflen
-        char[] value = Arrays.copyOf(chararr, chararrCount);
-        return new String(value);
-    }
-
-    private byte[] asByteArray() {
-        final int length = getLength();
-        byte[] result = new byte[length];
-        for (int index = 0; index < length; index++) {
-            result[index] = getByteAt(index);
-        }
-        return result;
-    }
-
-    private int getLength() {
-        return unsafe.getShort(metaspaceSymbol + runtime().getConfig().symbolLengthOffset);
-    }
-
-    private byte getByteAt(int index) {
-        return unsafe.getByte(metaspaceSymbol + runtime().getConfig().symbolBodyOffset + index);
-    }
-}
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotUnresolvedJavaType.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotUnresolvedJavaType.java	Tue Sep 15 18:13:11 2015 -0700
@@ -56,8 +56,8 @@
     }
 
     @Override
-    public Kind getKind() {
-        return Kind.Object;
+    public JavaKind getJavaKind() {
+        return JavaKind.Object;
     }
 
     @Override
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotVMConfig.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotVMConfig.java	Tue Sep 15 18:13:11 2015 -0700
@@ -22,7 +22,8 @@
  */
 package jdk.internal.jvmci.hotspot;
 
-import static jdk.internal.jvmci.common.UnsafeAccess.*;
+import static jdk.internal.jvmci.common.UnsafeUtil.readCString;
+import static jdk.internal.jvmci.hotspot.UnsafeAccess.UNSAFE;
 
 import java.lang.reflect.*;
 import java.util.*;
@@ -58,6 +59,10 @@
         return false;
     }
 
+    public static HotSpotVMConfig config() {
+        return HotSpotJVMCIRuntime.runtime().getConfig();
+    }
+
     /**
      * Maximum allowed size of allocated area for a frame.
      */
@@ -75,13 +80,13 @@
         oopEncoding = new CompressEncoding(narrowOopBase, narrowOopShift, logMinObjAlignment());
         klassEncoding = new CompressEncoding(narrowKlassBase, narrowKlassShift, logKlassAlignment);
 
-        codeCacheLowBoundary = unsafe.getAddress(codeCacheHeap + codeHeapMemoryOffset + virtualSpaceLowBoundaryOffset);
-        codeCacheHighBoundary = unsafe.getAddress(codeCacheHeap + codeHeapMemoryOffset + virtualSpaceHighBoundaryOffset);
+        codeCacheLowBound = UNSAFE.getAddress(codeCacheHeap + codeHeapMemoryOffset + virtualSpaceLowBoundaryOffset);
+        codeCacheHighBound = UNSAFE.getAddress(codeCacheHeap + codeHeapMemoryOffset + virtualSpaceHighBoundaryOffset);
 
-        final long barrierSetAddress = unsafe.getAddress(universeCollectedHeap + collectedHeapBarrierSetOffset);
-        final int kind = unsafe.getInt(barrierSetAddress + barrierSetKindOffset);
+        final long barrierSetAddress = UNSAFE.getAddress(universeCollectedHeap + collectedHeapBarrierSetOffset);
+        final int kind = UNSAFE.getInt(barrierSetAddress + barrierSetKindOffset);
         if ((kind == barrierSetCardTableModRef) || (kind == barrierSetCardTableExtension) || (kind == barrierSetG1SATBCT) || (kind == barrierSetG1SATBCTLogging)) {
-            final long base = unsafe.getAddress(barrierSetAddress + cardTableModRefBSByteMapBaseOffset);
+            final long base = UNSAFE.getAddress(barrierSetAddress + cardTableModRefBSByteMapBaseOffset);
             assert base != 0 : "unexpected byte_map_base: " + base;
             cardtableStartAddress = base;
             cardtableShift = cardTableModRefBSCardShift;
@@ -94,7 +99,7 @@
             cardtableShift = -1;
         }
 
-        inlineCacheMissStub = inlineCacheMissBlob + unsafe.getInt(inlineCacheMissBlob + codeBlobCodeOffsetOffset);
+        inlineCacheMissStub = inlineCacheMissBlob + UNSAFE.getInt(inlineCacheMissBlob + codeBlobCodeOffsetOffset);
 
         assert check();
         assert HotSpotVMConfigVerifier.check();
@@ -328,30 +333,30 @@
             }
 
             public String getTypeName() {
-                long typeNameAddress = unsafe.getAddress(entryAddress + gHotSpotVMStructEntryTypeNameOffset);
-                return readCString(typeNameAddress);
+                long typeNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryTypeNameOffset);
+                return readCString(UNSAFE, typeNameAddress);
             }
 
             public String getFieldName() {
-                long fieldNameAddress = unsafe.getAddress(entryAddress + gHotSpotVMStructEntryFieldNameOffset);
-                return readCString(fieldNameAddress);
+                long fieldNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryFieldNameOffset);
+                return readCString(UNSAFE, fieldNameAddress);
             }
 
             public String getTypeString() {
-                long typeStringAddress = unsafe.getAddress(entryAddress + gHotSpotVMStructEntryTypeStringOffset);
-                return readCString(typeStringAddress);
+                long typeStringAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryTypeStringOffset);
+                return readCString(UNSAFE, typeStringAddress);
             }
 
             public boolean isStatic() {
-                return unsafe.getInt(entryAddress + gHotSpotVMStructEntryIsStaticOffset) != 0;
+                return UNSAFE.getInt(entryAddress + gHotSpotVMStructEntryIsStaticOffset) != 0;
             }
 
             public long getOffset() {
-                return unsafe.getLong(entryAddress + gHotSpotVMStructEntryOffsetOffset);
+                return UNSAFE.getLong(entryAddress + gHotSpotVMStructEntryOffsetOffset);
             }
 
             public long getAddress() {
-                return unsafe.getAddress(entryAddress + gHotSpotVMStructEntryAddressOffset);
+                return UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryAddressOffset);
             }
 
             public String getName() {
@@ -364,14 +369,14 @@
                 String type = getTypeString();
                 switch (type) {
                     case "int":
-                        return unsafe.getInt(getAddress());
+                        return UNSAFE.getInt(getAddress());
                     case "address":
                     case "intptr_t":
-                        return unsafe.getAddress(getAddress());
+                        return UNSAFE.getAddress(getAddress());
                     default:
                         // All foo* types are addresses.
                         if (type.endsWith("*")) {
-                            return unsafe.getAddress(getAddress());
+                            return UNSAFE.getAddress(getAddress());
                         }
                         throw new JVMCIError(type);
                 }
@@ -439,29 +444,29 @@
             }
 
             public String getTypeName() {
-                long typeNameAddress = unsafe.getAddress(entryAddress + gHotSpotVMTypeEntryTypeNameOffset);
-                return readCString(typeNameAddress);
+                long typeNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMTypeEntryTypeNameOffset);
+                return readCString(UNSAFE, typeNameAddress);
             }
 
             public String getSuperclassName() {
-                long superclassNameAddress = unsafe.getAddress(entryAddress + gHotSpotVMTypeEntrySuperclassNameOffset);
-                return readCString(superclassNameAddress);
+                long superclassNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMTypeEntrySuperclassNameOffset);
+                return readCString(UNSAFE, superclassNameAddress);
             }
 
             public boolean isOopType() {
-                return unsafe.getInt(entryAddress + gHotSpotVMTypeEntryIsOopTypeOffset) != 0;
+                return UNSAFE.getInt(entryAddress + gHotSpotVMTypeEntryIsOopTypeOffset) != 0;
             }
 
             public boolean isIntegerType() {
-                return unsafe.getInt(entryAddress + gHotSpotVMTypeEntryIsIntegerTypeOffset) != 0;
+                return UNSAFE.getInt(entryAddress + gHotSpotVMTypeEntryIsIntegerTypeOffset) != 0;
             }
 
             public boolean isUnsigned() {
-                return unsafe.getInt(entryAddress + gHotSpotVMTypeEntryIsUnsignedOffset) != 0;
+                return UNSAFE.getInt(entryAddress + gHotSpotVMTypeEntryIsUnsignedOffset) != 0;
             }
 
             public long getSize() {
-                return unsafe.getLong(entryAddress + gHotSpotVMTypeEntrySizeOffset);
+                return UNSAFE.getLong(entryAddress + gHotSpotVMTypeEntrySizeOffset);
             }
 
             @Override
@@ -485,8 +490,8 @@
         }
 
         public String getName() {
-            long nameAddress = unsafe.getAddress(address + nameOffset);
-            return readCString(nameAddress);
+            long nameAddress = UNSAFE.getAddress(address + nameOffset);
+            return readCString(UNSAFE, nameAddress);
         }
 
         public abstract long getValue();
@@ -541,7 +546,7 @@
 
             @Override
             public long getValue() {
-                return unsafe.getInt(address + valueOffset);
+                return UNSAFE.getInt(address + valueOffset);
             }
 
             @Override
@@ -600,7 +605,7 @@
 
             @Override
             public long getValue() {
-                return unsafe.getLong(address + valueOffset);
+                return UNSAFE.getLong(address + valueOffset);
             }
 
             @Override
@@ -664,32 +669,32 @@
             }
 
             public String getType() {
-                long typeAddress = unsafe.getAddress(entryAddress + typeOffset);
-                return readCString(typeAddress);
+                long typeAddress = UNSAFE.getAddress(entryAddress + typeOffset);
+                return readCString(UNSAFE, typeAddress);
             }
 
             public String getName() {
-                long nameAddress = unsafe.getAddress(entryAddress + nameOffset);
-                return readCString(nameAddress);
+                long nameAddress = UNSAFE.getAddress(entryAddress + nameOffset);
+                return readCString(UNSAFE, nameAddress);
             }
 
             public long getAddr() {
-                return unsafe.getAddress(entryAddress + addrOffset);
+                return UNSAFE.getAddress(entryAddress + addrOffset);
             }
 
             public Object getValue() {
                 switch (getType()) {
                     case "bool":
-                        return Boolean.valueOf(unsafe.getByte(getAddr()) != 0);
+                        return Boolean.valueOf(UNSAFE.getByte(getAddr()) != 0);
                     case "intx":
                     case "uintx":
                     case "uint64_t":
-                        return Long.valueOf(unsafe.getLong(getAddr()));
+                        return Long.valueOf(UNSAFE.getLong(getAddr()));
                     case "double":
-                        return Double.valueOf(unsafe.getDouble(getAddr()));
+                        return Double.valueOf(UNSAFE.getDouble(getAddr()));
                     case "ccstr":
                     case "ccstrlist":
-                        return readCString(getAddr());
+                        return readCString(UNSAFE, getAddr());
                     default:
                         throw new JVMCIError(getType());
                 }
@@ -745,7 +750,6 @@
     }
 
     @HotSpotVMFlag(name = "ReduceInitialCardMarks") @Stable public boolean useDeferredInitBarriers;
-    @HotSpotVMFlag(name = "JVMCIHProfEnabled") @Stable public boolean useHeapProfiler;
 
     // Compressed Oops related values.
     @HotSpotVMFlag(name = "UseCompressedOops") @Stable public boolean useCompressedOops;
@@ -810,8 +814,6 @@
     @HotSpotVMField(name = "oopDesc::_mark", type = "markOop", get = HotSpotVMField.Type.OFFSET) @Stable public int markOffset;
     @HotSpotVMField(name = "oopDesc::_metadata._klass", type = "Klass*", get = HotSpotVMField.Type.OFFSET) @Stable public int hubOffset;
 
-    @HotSpotVMField(name = "Handle::_handle", type = "oop*", get = HotSpotVMField.Type.OFFSET) @Stable public int handleHandleOffset;
-
     @HotSpotVMField(name = "Klass::_prototype_header", type = "markOop", get = HotSpotVMField.Type.OFFSET) @Stable public int prototypeMarkWordOffset;
     @HotSpotVMField(name = "Klass::_subklass", type = "Klass*", get = HotSpotVMField.Type.OFFSET) @Stable public int subklassOffset;
     @HotSpotVMField(name = "Klass::_next_sibling", type = "Klass*", get = HotSpotVMField.Type.OFFSET) @Stable public int nextSiblingOffset;
@@ -864,7 +866,16 @@
     /**
      * The offset of the array length word in an array object's header.
      */
-    @HotSpotVMValue(expression = "arrayOopDesc::length_offset_in_bytes()") @Stable public int arrayLengthOffset;
+    @HotSpotVMValue(expression = "arrayOopDesc::length_offset_in_bytes()") @Stable private int arrayLengthOffset;
+
+    /**
+     * The offset of the array length word in an array object's header.
+     *
+     * See {@code arrayOopDesc::length_offset_in_bytes()}.
+     */
+    public final int arrayOopDescLengthOffset() {
+        return arrayLengthOffset;
+    }
 
     @HotSpotVMField(name = "Array<int>::_length", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int arrayU1LengthOffset;
     @HotSpotVMField(name = "Array<u1>::_data", type = "", get = HotSpotVMField.Type.OFFSET) @Stable public int arrayU1DataOffset;
@@ -1086,29 +1097,11 @@
 
     @HotSpotVMType(name = "ConstantPool", get = HotSpotVMType.Type.SIZE) @Stable public int constantPoolSize;
     @HotSpotVMField(name = "ConstantPool::_tags", type = "Array<u1>*", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolTagsOffset;
-    @HotSpotVMField(name = "ConstantPool::_cache", type = "ConstantPoolCache*", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolCacheOffset;
     @HotSpotVMField(name = "ConstantPool::_pool_holder", type = "InstanceKlass*", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolHolderOffset;
     @HotSpotVMField(name = "ConstantPool::_length", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolLengthOffset;
-    @HotSpotVMField(name = "ConstantPool::_resolved_references", type = "jobject", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolResolvedReferencesOffset;
-    @HotSpotVMField(name = "ConstantPool::_reference_map", type = "Array<u2>*", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolReferenceMapOffset;
 
     @HotSpotVMConstant(name = "ConstantPool::CPCACHE_INDEX_TAG") @Stable public int constantPoolCpCacheIndexTag;
 
-    @HotSpotVMType(name = "ConstantPoolCache", get = HotSpotVMType.Type.SIZE) @Stable public int constantPoolCacheSize;
-    @HotSpotVMField(name = "ConstantPoolCache::_length", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolCacheLengthOffset;
-
-    @HotSpotVMType(name = "ConstantPoolCacheEntry", get = HotSpotVMType.Type.SIZE) @Stable public int constantPoolCacheEntrySize;
-    @HotSpotVMField(name = "ConstantPoolCacheEntry::_indices", type = "intx", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolCacheEntryIndicesOffset;
-    @HotSpotVMField(name = "ConstantPoolCacheEntry::_f1", type = "volatile Metadata*", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolCacheEntryF1Offset;
-    @HotSpotVMField(name = "ConstantPoolCacheEntry::_f2", type = "intx", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolCacheEntryF2Offset;
-    @HotSpotVMField(name = "ConstantPoolCacheEntry::_flags", type = "intx", get = HotSpotVMField.Type.OFFSET) @Stable public int constantPoolCacheEntryFlagsOffset;
-
-    @HotSpotVMConstant(name = "ConstantPoolCacheEntry::has_appendix_shift") @Stable public int constantPoolCacheEntryHasAppendixShift;
-
-    @HotSpotVMConstant(name = "ConstantPoolCacheEntry::cp_index_mask") @Stable public int constantPoolCacheEntryCpIndexMask;
-
-    @HotSpotVMConstant(name = "ConstantPoolCacheEntry::_indy_resolved_references_appendix_offset") @Stable public int constantPoolCacheEntryIndyResolvedReferencesAppendixOffset;
-
     @HotSpotVMConstant(name = "JVM_CONSTANT_Utf8") @Stable public int jvmConstantUtf8;
     @HotSpotVMConstant(name = "JVM_CONSTANT_Integer") @Stable public int jvmConstantInteger;
     @HotSpotVMConstant(name = "JVM_CONSTANT_Long") @Stable public int jvmConstantLong;
@@ -1334,33 +1327,15 @@
     @HotSpotVMValue(expression = "SharedRuntime::deopt_blob()->unpack()", get = HotSpotVMValue.Type.ADDRESS) @Stable public long handleDeoptStub;
     @HotSpotVMValue(expression = "SharedRuntime::deopt_blob()->uncommon_trap()", get = HotSpotVMValue.Type.ADDRESS) @Stable public long uncommonTrapStub;
 
-    private final long inlineCacheMissStub;
-
-    public long inlineCacheMissStub() {
-        return inlineCacheMissStub;
-    }
+    public final long inlineCacheMissStub;
 
     @HotSpotVMField(name = "CodeCache::_heap", type = "CodeHeap*", get = HotSpotVMField.Type.VALUE) @Stable private long codeCacheHeap;
     @HotSpotVMField(name = "CodeHeap::_memory", type = "VirtualSpace", get = HotSpotVMField.Type.OFFSET) @Stable private int codeHeapMemoryOffset;
     @HotSpotVMField(name = "VirtualSpace::_low_boundary", type = "char*", get = HotSpotVMField.Type.OFFSET) @Stable private int virtualSpaceLowBoundaryOffset;
     @HotSpotVMField(name = "VirtualSpace::_high_boundary", type = "char*", get = HotSpotVMField.Type.OFFSET) @Stable private int virtualSpaceHighBoundaryOffset;
 
-    private final long codeCacheLowBoundary;
-    private final long codeCacheHighBoundary;
-
-    /**
-     * @return CodeCache::_heap-&gt;_memory._low_boundary
-     */
-    public long codeCacheLowBoundary() {
-        return codeCacheLowBoundary;
-    }
-
-    /**
-     * @return CodeCache::_heap-&gt;_memory._high_boundary
-     */
-    public long codeCacheHighBoundary() {
-        return codeCacheHighBoundary;
-    }
+    public final long codeCacheLowBound;
+    public final long codeCacheHighBound;
 
     @HotSpotVMField(name = "StubRoutines::_aescrypt_encryptBlock", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long aescryptEncryptBlockStub;
     @HotSpotVMField(name = "StubRoutines::_aescrypt_decryptBlock", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long aescryptDecryptBlockStub;
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotVMEventListener.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotVMEventListener.java	Tue Sep 15 18:13:11 2015 -0700
@@ -34,7 +34,7 @@
     }
 
     /**
-     * Notify on successful install into the CodeCache.
+     * Notify on successful install into the code cache.
      *
      * @param hotSpotCodeCacheProvider
      * @param installedCode
@@ -44,17 +44,6 @@
     }
 
     /**
-     * Perform any extra initialization required.
-     *
-     * @param hotSpotJVMCIRuntime
-     * @param compilerToVM the current {@link CompilerToVM instance}
-     * @return the original compilerToVM instance or a proxied version.
-     */
-    default CompilerToVM completeInitialization(HotSpotJVMCIRuntime hotSpotJVMCIRuntime, CompilerToVM compilerToVM) {
-        return compilerToVM;
-    }
-
-    /**
      * Create a custom {@link JVMCIMetaAccessContext} to be used for managing the lifetime of loaded
      * metadata. It a custom one isn't created then the default implementation will be a single
      * context with globally shared instances of {@link ResolvedJavaType} that are never released.
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotVmSymbols.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotVmSymbols.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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
@@ -22,10 +22,8 @@
  */
 package jdk.internal.jvmci.hotspot;
 
-import static jdk.internal.jvmci.common.UnsafeAccess.*;
 import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime.*;
-
-import jdk.internal.jvmci.common.*;
+import static jdk.internal.jvmci.hotspot.UnsafeAccess.UNSAFE;
 import sun.misc.*;
 
 /**
@@ -45,17 +43,6 @@
         HotSpotVMConfig config = runtime.getConfig();
         assert config.vmSymbolsFirstSID <= index && index < config.vmSymbolsSIDLimit : "index " + index + " is out of bounds";
         assert config.symbolPointerSize == Unsafe.ADDRESS_SIZE : "the following address read is broken";
-        final long metaspaceSymbol = unsafe.getAddress(config.vmSymbolsSymbols + index * config.symbolPointerSize);
-        if (HotSpotConstantPool.Options.UseConstantPoolCacheJavaCode.getValue()) {
-            HotSpotSymbol symbol = new HotSpotSymbol(metaspaceSymbol);
-            String s = symbol.asString();
-            // It shouldn't but just in case something went wrong...
-            if (s == null) {
-                throw JVMCIError.shouldNotReachHere("malformed UTF-8 string in constant pool");
-            }
-            return s;
-        } else {
-            return runtime.getCompilerToVM().getSymbol(metaspaceSymbol);
-        }
+        return runtime.getCompilerToVM().getSymbol(UNSAFE.getAddress(config.vmSymbolsSymbols + index * config.symbolPointerSize));
     }
 }
--- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/PrintStreamOption.java	Tue Sep 15 18:12:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 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.internal.jvmci.hotspot;
-
-import java.io.*;
-import java.lang.management.*;
-
-import jdk.internal.jvmci.options.*;
-
-/**
- * An option that encapsulates and configures a print stream.
- */
-public class PrintStreamOption extends OptionValue<String> {
-
-    public PrintStreamOption() {
-        super(null);
-    }
-
-    /**
-     * The print stream to which output will be written.
-     *
-     * Declared {@code volatile} to enable safe use of double-checked locking in
-     * {@link #getStream()} and {@link #setValue(Object)}.
-     */
-    private volatile PrintStream ps;
-
-    /**
-     * Replace any instance of %p with a an identifying name. Try to get it from the RuntimeMXBean
-     * name.
-     *
-     * @return the name of the file to log to
-     */
-    private String getFilename() {
-        String name = getValue();
-        if (name.contains("%p")) {
-            String runtimeName = ManagementFactory.getRuntimeMXBean().getName();
-            try {
-                int index = runtimeName.indexOf('@');
-                if (index != -1) {
-                    long pid = Long.parseLong(runtimeName.substring(0, index));
-                    runtimeName = Long.toString(pid);
-                }
-                name = name.replaceAll("%p", runtimeName);
-            } catch (NumberFormatException e) {
-
-            }
-        }
-        return name;
-    }
-
-    /**
-     * Gets the print stream configured by this option. If no file is configured, the print stream
-     * will output to {@link CompilerToVM#writeDebugOutput(byte[], int, int)}.
-     */
-    public PrintStream getStream() {
-        if (ps == null) {
-            if (getValue() != null) {
-                synchronized (this) {
-                    if (ps == null) {
-                        try {
-                            final boolean enableAutoflush = true;
-                            ps = new PrintStream(new FileOutputStream(getFilename()), enableAutoflush);
-                            /* Add the JVM and Java arguments to the log file to help identity it. */
-                            String inputArguments = String.join(" ", ManagementFactory.getRuntimeMXBean().getInputArguments());
-                            ps.println("VM Arguments: " + inputArguments);
-                            String cmd = System.getProperty("sun.java.command");
-                            if (cmd != null) {
-                                ps.println("sun.java.command=" + cmd);
-                            }
-                        } catch (FileNotFoundException e) {
-                            throw new RuntimeException("couldn't open file: " + getValue(), e);
-                        }
-                    }
-                }
-            } else {
-                OutputStream ttyOut = new OutputStream() {
-                    CompilerToVM vm;
-
-                    private CompilerToVM vm() {
-                        if (vm == null) {
-                            vm = HotSpotJVMCIRuntime.runtime().getCompilerToVM();
-                        }
-                        return vm;
-                    }
-
-                    @Override
-                    public void write(byte[] b, int off, int len) throws IOException {
-                        if (b == null) {
-                            throw new NullPointerException();
-                        } else if (off < 0 || off > b.length || len < 0 || (off + len) > b.length || (off + len) < 0) {
-                            throw new IndexOutOfBoundsException();
-                        } else if (len == 0) {
-                            return;
-                        }
-                        vm().writeDebugOutput(b, off, len);
-                    }
-
-                    @Override
-                    public void write(int b) throws IOException {
-                        write(new byte[]{(byte) b}, 0, 1);
-                    }
-
-                    @Override
-                    public void flush() throws IOException {
-                        vm().flushDebugOutput();
-                    }
-                };
-                ps = new PrintStream(ttyOut);
-            }
-        }
-        return ps;
-    }
-
-    @Override
-    public void setValue(Object v) {
-        if (ps != null) {
-            synchronized (this) {
-                if (ps != null) {
-                    ps.close();
-                    ps = null;
-                }
-            }
-        }
-        super.setValue(v);
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/UnsafeAccess.java	Tue Sep 15 18:13:11 2015 -0700
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2012, 2012, 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.internal.jvmci.hotspot;
+
+import java.lang.reflect.Field;
+
+import sun.misc.Unsafe;
+
+/**
+ * Package private access to the {@link Unsafe} capability.
+ */
+class UnsafeAccess {
+
+    static final Unsafe UNSAFE = initUnsafe();
+
+    private static Unsafe initUnsafe() {
+        try {
+            // Fast path when we are trusted.
+            return Unsafe.getUnsafe();
+        } catch (SecurityException se) {
+            // Slow path when we are not trusted.
+            try {
+                Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
+                theUnsafe.setAccessible(true);
+                return (Unsafe) theUnsafe.get(Unsafe.class);
+            } catch (Exception e) {
+                throw new RuntimeException("exception while trying to get Unsafe", e);
+            }
+        }
+    }
+}
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/AbstractValue.java	Tue Sep 15 18:12:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2009, 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.internal.jvmci.meta;
-
-/**
- * Abstract base class for values.
- */
-public abstract class AbstractValue implements Value {
-
-    public static final AllocatableValue ILLEGAL = Value.ILLEGAL;
-
-    private final Kind kind;
-    private final LIRKind lirKind;
-
-    /**
-     * Initializes a new value of the specified kind.
-     *
-     * @param lirKind the kind
-     */
-    protected AbstractValue(LIRKind lirKind) {
-        this.lirKind = lirKind;
-        if (getPlatformKind() instanceof Kind) {
-            this.kind = (Kind) getPlatformKind();
-        } else {
-            this.kind = Kind.Illegal;
-        }
-    }
-
-    /**
-     * Returns a String representation of the kind, which should be the end of all
-     * {@link #toString()} implementation of subclasses.
-     */
-    protected final String getKindSuffix() {
-        return "|" + getKind().getTypeChar();
-    }
-
-    /**
-     * Returns the kind of this value.
-     */
-    public final Kind getKind() {
-        return kind;
-    }
-
-    public final LIRKind getLIRKind() {
-        return lirKind;
-    }
-
-    /**
-     * Returns the platform specific kind used to store this value.
-     */
-    public final PlatformKind getPlatformKind() {
-        return lirKind.getPlatformKind();
-    }
-
-    @Override
-    public int hashCode() {
-        return 41 + lirKind.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof AbstractValue) {
-            AbstractValue that = (AbstractValue) obj;
-            return kind.equals(that.kind) && lirKind.equals(that.lirKind);
-        }
-        return false;
-    }
-
-    /**
-     * Checks if this value is identical to {@code other}.
-     *
-     * Warning: Use with caution! Usually equivalence {@link #equals(Object)} is sufficient and
-     * should be used.
-     */
-    public final boolean identityEquals(AbstractValue other) {
-        return this == other;
-    }
-}
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/AllocatableValue.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/AllocatableValue.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -26,7 +26,7 @@
  * Common base class for values that are stored in some location that's managed by the register
  * allocator (e.g. register, stack slot).
  */
-public abstract class AllocatableValue extends AbstractValue implements JavaValue {
+public abstract class AllocatableValue extends Value implements JavaValue {
 
     public static final AllocatableValue[] NONE = {};
 
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/ConstantReflectionProvider.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/ConstantReflectionProvider.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -26,11 +26,11 @@
 
 /**
  * Reflection operations on values represented as {@linkplain JavaConstant constants}. All methods
- * in this interface require the VM to access the actual object encapsulated in {@link Kind#Object
- * object} constants. This access is not always possible, depending on kind of VM and the state that
- * the VM is in. Therefore, all methods can return {@code null} at any time, to indicate that the
- * result is not available at this point. The caller is responsible to check for {@code null}
- * results and handle them properly, e.g., not perform an optimization.
+ * in this interface require the VM to access the actual object encapsulated in
+ * {@link JavaKind#Object object} constants. This access is not always possible, depending on kind
+ * of VM and the state that the VM is in. Therefore, all methods can return {@code null} at any
+ * time, to indicate that the result is not available at this point. The caller is responsible to
+ * check for {@code null} results and handle them properly, e.g., not perform an optimization.
  */
 public interface ConstantReflectionProvider {
 
@@ -113,18 +113,18 @@
     JavaConstant readStableFieldValue(JavaField field, JavaConstant receiver, boolean isDefaultStable);
 
     /**
-     * Converts the given {@link Kind#isPrimitive() primitive} constant to a boxed
-     * {@link Kind#Object object} constant, according to the Java boxing rules. Returns {@code null}
-     * if the source is is not a primitive constant, or the boxed value is not available at this
-     * point.
+     * Converts the given {@link JavaKind#isPrimitive() primitive} constant to a boxed
+     * {@link JavaKind#Object object} constant, according to the Java boxing rules. Returns
+     * {@code null} if the source is is not a primitive constant, or the boxed value is not
+     * available at this point.
      */
     JavaConstant boxPrimitive(JavaConstant source);
 
     /**
-     * Converts the given {@link Kind#Object object} constant to a {@link Kind#isPrimitive()
-     * primitive} constant, according to the Java unboxing rules. Returns {@code null} if the source
-     * is is not an object constant that can be unboxed, or the unboxed value is not available at
-     * this point.
+     * Converts the given {@link JavaKind#Object object} constant to a
+     * {@link JavaKind#isPrimitive() primitive} constant, according to the Java unboxing rules.
+     * Returns {@code null} if the source is is not an object constant that can be unboxed, or the
+     * unboxed value is not available at this point.
      */
     JavaConstant unboxPrimitive(JavaConstant source);
 
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/JavaConstant.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/JavaConstant.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -28,25 +28,29 @@
  * {@code JavaConstant} instances that represent frequently used constant values, such as
  * {@link #NULL_POINTER}.
  */
-public interface JavaConstant extends Constant, JavaValue, Value {
-
+public interface JavaConstant extends Constant, JavaValue {
     /*
      * Using a larger cache for integers leads to only a slight increase in cache hit ratio which is
      * not enough to justify the impact on startup time.
      */
     JavaConstant NULL_POINTER = new NullConstant();
-    PrimitiveConstant INT_MINUS_1 = new PrimitiveConstant(Kind.Int, -1);
-    PrimitiveConstant INT_0 = new PrimitiveConstant(Kind.Int, 0);
-    PrimitiveConstant INT_1 = new PrimitiveConstant(Kind.Int, 1);
-    PrimitiveConstant INT_2 = new PrimitiveConstant(Kind.Int, 2);
-    PrimitiveConstant LONG_0 = new PrimitiveConstant(Kind.Long, 0L);
-    PrimitiveConstant LONG_1 = new PrimitiveConstant(Kind.Long, 1L);
-    PrimitiveConstant FLOAT_0 = new PrimitiveConstant(Kind.Float, Float.floatToRawIntBits(0.0F));
-    PrimitiveConstant FLOAT_1 = new PrimitiveConstant(Kind.Float, Float.floatToRawIntBits(1.0F));
-    PrimitiveConstant DOUBLE_0 = new PrimitiveConstant(Kind.Double, Double.doubleToRawLongBits(0.0D));
-    PrimitiveConstant DOUBLE_1 = new PrimitiveConstant(Kind.Double, Double.doubleToRawLongBits(1.0D));
-    PrimitiveConstant TRUE = new PrimitiveConstant(Kind.Boolean, 1L);
-    PrimitiveConstant FALSE = new PrimitiveConstant(Kind.Boolean, 0L);
+    PrimitiveConstant INT_MINUS_1 = new PrimitiveConstant(JavaKind.Int, -1);
+    PrimitiveConstant INT_0 = new PrimitiveConstant(JavaKind.Int, 0);
+    PrimitiveConstant INT_1 = new PrimitiveConstant(JavaKind.Int, 1);
+    PrimitiveConstant INT_2 = new PrimitiveConstant(JavaKind.Int, 2);
+    PrimitiveConstant LONG_0 = new PrimitiveConstant(JavaKind.Long, 0L);
+    PrimitiveConstant LONG_1 = new PrimitiveConstant(JavaKind.Long, 1L);
+    PrimitiveConstant FLOAT_0 = new PrimitiveConstant(JavaKind.Float, Float.floatToRawIntBits(0.0F));
+    PrimitiveConstant FLOAT_1 = new PrimitiveConstant(JavaKind.Float, Float.floatToRawIntBits(1.0F));
+    PrimitiveConstant DOUBLE_0 = new PrimitiveConstant(JavaKind.Double, Double.doubleToRawLongBits(0.0D));
+    PrimitiveConstant DOUBLE_1 = new PrimitiveConstant(JavaKind.Double, Double.doubleToRawLongBits(1.0D));
+    PrimitiveConstant TRUE = new PrimitiveConstant(JavaKind.Boolean, 1L);
+    PrimitiveConstant FALSE = new PrimitiveConstant(JavaKind.Boolean, 0L);
+
+    /**
+     * Returns the Java kind of this constant.
+     */
+    JavaKind getJavaKind();
 
     /**
      * Checks whether this constant is null.
@@ -88,7 +92,7 @@
 
     /**
      * Returns the primitive int value this constant represents. The constant must have a
-     * {@link Kind#getStackKind()} of {@link Kind#Int}.
+     * {@link JavaKind#getStackKind()} of {@link JavaKind#Int}.
      *
      * @return the constant value
      */
@@ -96,7 +100,7 @@
 
     /**
      * Returns the primitive boolean value this constant represents. The constant must have kind
-     * {@link Kind#Boolean}.
+     * {@link JavaKind#Boolean}.
      *
      * @return the constant value
      */
@@ -104,7 +108,7 @@
 
     /**
      * Returns the primitive long value this constant represents. The constant must have kind
-     * {@link Kind#Long}, a {@link Kind#getStackKind()} of {@link Kind#Int}.
+     * {@link JavaKind#Long}, a {@link JavaKind#getStackKind()} of {@link JavaKind#Int}.
      *
      * @return the constant value
      */
@@ -112,7 +116,7 @@
 
     /**
      * Returns the primitive float value this constant represents. The constant must have kind
-     * {@link Kind#Float}.
+     * {@link JavaKind#Float}.
      *
      * @return the constant value
      */
@@ -120,25 +124,25 @@
 
     /**
      * Returns the primitive double value this constant represents. The constant must have kind
-     * {@link Kind#Double}.
+     * {@link JavaKind#Double}.
      *
      * @return the constant value
      */
     double asDouble();
 
     default String toValueString() {
-        if (getKind() == Kind.Illegal) {
+        if (getJavaKind() == JavaKind.Illegal) {
             return "illegal";
         } else {
-            return getKind().format(asBoxedPrimitive());
+            return getJavaKind().format(asBoxedPrimitive());
         }
     }
 
     static String toString(JavaConstant constant) {
-        if (constant.getKind() == Kind.Illegal) {
+        if (constant.getJavaKind() == JavaKind.Illegal) {
             return "illegal";
         } else {
-            return constant.getKind().getJavaName() + "[" + constant.toValueString() + "]";
+            return constant.getJavaKind().getJavaName() + "[" + constant.toValueString() + "]";
         }
     }
 
@@ -155,7 +159,7 @@
         if (Double.compare(d, 1.0D) == 0) {
             return DOUBLE_1;
         }
-        return new PrimitiveConstant(Kind.Double, Double.doubleToRawLongBits(d));
+        return new PrimitiveConstant(JavaKind.Double, Double.doubleToRawLongBits(d));
     }
 
     /**
@@ -171,7 +175,7 @@
         if (Float.compare(f, 1.0F) == 0) {
             return FLOAT_1;
         }
-        return new PrimitiveConstant(Kind.Float, Float.floatToRawIntBits(f));
+        return new PrimitiveConstant(JavaKind.Float, Float.floatToRawIntBits(f));
     }
 
     /**
@@ -186,7 +190,7 @@
         } else if (i == 1) {
             return LONG_1;
         } else {
-            return new PrimitiveConstant(Kind.Long, i);
+            return new PrimitiveConstant(JavaKind.Long, i);
         }
     }
 
@@ -207,7 +211,7 @@
             case 2:
                 return INT_2;
             default:
-                return new PrimitiveConstant(Kind.Int, i);
+                return new PrimitiveConstant(JavaKind.Int, i);
         }
     }
 
@@ -218,7 +222,7 @@
      * @return a boxed copy of {@code value}
      */
     static PrimitiveConstant forByte(byte i) {
-        return new PrimitiveConstant(Kind.Byte, i);
+        return new PrimitiveConstant(JavaKind.Byte, i);
     }
 
     /**
@@ -238,7 +242,7 @@
      * @return a boxed copy of {@code value}
      */
     static PrimitiveConstant forChar(char i) {
-        return new PrimitiveConstant(Kind.Char, i);
+        return new PrimitiveConstant(JavaKind.Char, i);
     }
 
     /**
@@ -248,13 +252,13 @@
      * @return a boxed copy of {@code value}
      */
     static PrimitiveConstant forShort(short i) {
-        return new PrimitiveConstant(Kind.Short, i);
+        return new PrimitiveConstant(JavaKind.Short, i);
     }
 
     /**
      * Creates a {@link JavaConstant} from a primitive integer of a certain kind.
      */
-    static PrimitiveConstant forIntegerKind(Kind kind, long i) {
+    static PrimitiveConstant forIntegerKind(JavaKind kind, long i) {
         switch (kind) {
             case Boolean:
                 return forBoolean(i != 0);
@@ -323,13 +327,13 @@
     }
 
     static PrimitiveConstant forIllegal() {
-        return new PrimitiveConstant(Kind.Illegal, 0);
+        return new PrimitiveConstant(JavaKind.Illegal, 0);
     }
 
     /**
      * Returns a constant with the default value for the given kind.
      */
-    static JavaConstant defaultForKind(Kind kind) {
+    static JavaConstant defaultForKind(JavaKind kind) {
         switch (kind) {
             case Boolean:
                 return FALSE;
@@ -357,7 +361,7 @@
     /**
      * Returns the zero value for a given numeric kind.
      */
-    static JavaConstant zero(Kind kind) {
+    static JavaConstant zero(JavaKind kind) {
         switch (kind) {
             case Boolean:
                 return FALSE;
@@ -383,7 +387,7 @@
     /**
      * Returns the one value for a given numeric kind.
      */
-    static JavaConstant one(Kind kind) {
+    static JavaConstant one(JavaKind kind) {
         switch (kind) {
             case Boolean:
                 return TRUE;
@@ -410,8 +414,8 @@
      * Adds two numeric constants.
      */
     static JavaConstant add(JavaConstant x, JavaConstant y) {
-        assert x.getKind() == y.getKind();
-        switch (x.getKind()) {
+        assert x.getJavaKind() == y.getJavaKind();
+        switch (x.getJavaKind()) {
             case Byte:
                 return forByte((byte) (x.asInt() + y.asInt()));
             case Char:
@@ -427,7 +431,7 @@
             case Short:
                 return forShort((short) (x.asInt() + y.asInt()));
             default:
-                throw new IllegalArgumentException(x.getKind().toString());
+                throw new IllegalArgumentException(x.getJavaKind().toString());
         }
     }
 
@@ -435,8 +439,8 @@
      * Multiplies two numeric constants.
      */
     static PrimitiveConstant mul(JavaConstant x, JavaConstant y) {
-        assert x.getKind() == y.getKind();
-        switch (x.getKind()) {
+        assert x.getJavaKind() == y.getJavaKind();
+        switch (x.getJavaKind()) {
             case Byte:
                 return forByte((byte) (x.asInt() * y.asInt()));
             case Char:
@@ -452,7 +456,7 @@
             case Short:
                 return forShort((short) (x.asInt() * y.asInt()));
             default:
-                throw new IllegalArgumentException(x.getKind().toString());
+                throw new IllegalArgumentException(x.getJavaKind().toString());
         }
     }
 }
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/JavaField.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/JavaField.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -42,10 +42,10 @@
 
     /**
      * Returns the kind of this field. This is the same as calling {@link #getType}.
-     * {@link JavaType#getKind getKind}.
+     * {@link JavaType#getJavaKind getJavaKind}.
      */
-    default Kind getKind() {
-        return getType().getKind();
+    default JavaKind getJavaKind() {
+        return getType().getJavaKind();
     }
 
     /**
@@ -88,20 +88,15 @@
                     throw new UnknownFormatConversionException("An unquoted '%' character cannot terminate a field format specification");
                 }
                 char specifier = format.charAt(index++);
-                boolean qualified = false;
                 switch (specifier) {
                     case 'T':
-                        qualified = true;
-                        // fall through
                     case 't': {
-                        sb.append(type.toJavaName(qualified));
+                        sb.append(type.toJavaName(specifier == 'T'));
                         break;
                     }
                     case 'H':
-                        qualified = true;
-                        // fall through
                     case 'h': {
-                        sb.append(getDeclaringClass().toJavaName(qualified));
+                        sb.append(getDeclaringClass().toJavaName(specifier == 'H'));
                         break;
                     }
                     case 'n': {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/JavaKind.java	Tue Sep 15 18:13:11 2015 -0700
@@ -0,0 +1,496 @@
+/*
+ * Copyright (c) 2009, 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
+ * 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.internal.jvmci.meta;
+
+import java.lang.reflect.*;
+
+//JaCoCo Exclude
+
+/**
+ * Denotes the basic kinds of types in CRI, including the all the Java primitive types, for example,
+ * {@link JavaKind#Int} for {@code int} and {@link JavaKind#Object} for all object types. A kind has
+ * a single character short name, a Java name, and a set of flags further describing its behavior.
+ */
+public enum JavaKind implements PlatformKind {
+    /** The primitive boolean kind, represented as an int on the stack. */
+    Boolean('z', "boolean", 1, true, java.lang.Boolean.TYPE, java.lang.Boolean.class),
+
+    /** The primitive byte kind, represented as an int on the stack. */
+    Byte('b', "byte", 1, true, java.lang.Byte.TYPE, java.lang.Byte.class),
+
+    /** The primitive short kind, represented as an int on the stack. */
+    Short('s', "short", 1, true, java.lang.Short.TYPE, java.lang.Short.class),
+
+    /** The primitive char kind, represented as an int on the stack. */
+    Char('c', "char", 1, true, java.lang.Character.TYPE, java.lang.Character.class),
+
+    /** The primitive int kind, represented as an int on the stack. */
+    Int('i', "int", 1, true, java.lang.Integer.TYPE, java.lang.Integer.class),
+
+    /** The primitive float kind. */
+    Float('f', "float", 1, false, java.lang.Float.TYPE, java.lang.Float.class),
+
+    /** The primitive long kind. */
+    Long('j', "long", 2, false, java.lang.Long.TYPE, java.lang.Long.class),
+
+    /** The primitive double kind. */
+    Double('d', "double", 2, false, java.lang.Double.TYPE, java.lang.Double.class),
+
+    /** The Object kind, also used for arrays. */
+    Object('a', "Object", 1, false, null, null),
+
+    /** The void float kind. */
+    Void('v', "void", 0, false, java.lang.Void.TYPE, java.lang.Void.class),
+
+    /** The non-type. */
+    Illegal('-', "illegal", 0, false, null, null);
+
+    private final char typeChar;
+    private final String javaName;
+    private final boolean isStackInt;
+    private final Class<?> primitiveJavaClass;
+    private final Class<?> boxedJavaClass;
+    private final EnumKey<JavaKind> key = new EnumKey<>(this);
+    private final int slotCount;
+
+    private JavaKind(char typeChar, String javaName, int slotCount, boolean isStackInt, Class<?> primitiveJavaClass, Class<?> boxedJavaClass) {
+        this.typeChar = typeChar;
+        this.javaName = javaName;
+        this.slotCount = slotCount;
+        this.isStackInt = isStackInt;
+        this.primitiveJavaClass = primitiveJavaClass;
+        this.boxedJavaClass = boxedJavaClass;
+        assert primitiveJavaClass == null || javaName.equals(primitiveJavaClass.getName());
+    }
+
+    /**
+     * Returns the number of stack slots occupied by this kind according to the Java bytecodes
+     * specification.
+     */
+    public int getSlotCount() {
+        return this.slotCount;
+    }
+
+    /**
+     * Returns whether this kind occupied two stack slots.
+     */
+    public boolean needsTwoSlots() {
+        return this.slotCount == 2;
+    }
+
+    /**
+     * Returns the name of the kind as a single character.
+     */
+    public char getTypeChar() {
+        return typeChar;
+    }
+
+    /**
+     * Returns the name of this kind which will also be it Java programming language name if it is
+     * {@linkplain #isPrimitive() primitive} or {@code void}.
+     */
+    public String getJavaName() {
+        return javaName;
+    }
+
+    public Key getKey() {
+        return key;
+    }
+
+    /**
+     * Checks whether this type is a Java primitive type.
+     *
+     * @return {@code true} if this is {@link #Boolean}, {@link #Byte}, {@link #Char},
+     *         {@link #Short}, {@link #Int}, {@link #Long}, {@link #Float}, {@link #Double}, or
+     *         {@link #Void}.
+     */
+    public boolean isPrimitive() {
+        return primitiveJavaClass != null;
+    }
+
+    /**
+     * Returns the kind that represents this kind when on the Java operand stack.
+     *
+     * @return the kind used on the operand stack
+     */
+    public JavaKind getStackKind() {
+        if (isStackInt) {
+            return Int;
+        }
+        return this;
+    }
+
+    /**
+     * Checks whether this type is a Java primitive type representing an integer number.
+     *
+     * @return {@code true} if the stack kind is {@link #Int} or {@link #Long}.
+     */
+    public boolean isNumericInteger() {
+        return isStackInt || this == JavaKind.Long;
+    }
+
+    /**
+     * Checks whether this type is a Java primitive type representing an unsigned number.
+     *
+     * @return {@code true} if the kind is {@link #Boolean} or {@link #Char}.
+     */
+    public boolean isUnsigned() {
+        return this == JavaKind.Boolean || this == JavaKind.Char;
+    }
+
+    /**
+     * Checks whether this type is a Java primitive type representing a floating point number.
+     *
+     * @return {@code true} if this is {@link #Float} or {@link #Double}.
+     */
+    public boolean isNumericFloat() {
+        return this == JavaKind.Float || this == JavaKind.Double;
+    }
+
+    /**
+     * Checks whether this represent an Object of some sort.
+     *
+     * @return {@code true} if this is {@link #Object}.
+     */
+    public boolean isObject() {
+        return this == JavaKind.Object;
+    }
+
+    /**
+     * Returns the kind corresponding to the Java type string.
+     *
+     * @param typeString the Java type string
+     * @return the kind
+     */
+    public static JavaKind fromTypeString(String typeString) {
+        assert typeString.length() > 0;
+        final char first = typeString.charAt(0);
+        if (first == '[' || first == 'L') {
+            return JavaKind.Object;
+        }
+        return JavaKind.fromPrimitiveOrVoidTypeChar(first);
+    }
+
+    /**
+     * Returns the kind of a word given the size of a word in bytes.
+     *
+     * @param wordSizeInBytes the size of a word in bytes
+     * @return the kind representing a word value
+     */
+    public static JavaKind fromWordSize(int wordSizeInBytes) {
+        if (wordSizeInBytes == 8) {
+            return JavaKind.Long;
+        } else {
+            assert wordSizeInBytes == 4 : "Unsupported word size!";
+            return JavaKind.Int;
+        }
+    }
+
+    /**
+     * Returns the kind from the character describing a primitive or void.
+     *
+     * @param ch the character
+     * @return the kind
+     */
+    public static JavaKind fromPrimitiveOrVoidTypeChar(char ch) {
+        switch (ch) {
+            case 'Z':
+                return Boolean;
+            case 'C':
+                return Char;
+            case 'F':
+                return Float;
+            case 'D':
+                return Double;
+            case 'B':
+                return Byte;
+            case 'S':
+                return Short;
+            case 'I':
+                return Int;
+            case 'J':
+                return Long;
+            case 'V':
+                return Void;
+        }
+        throw new IllegalArgumentException("unknown primitive or void type character: " + ch);
+    }
+
+    /**
+     * Returns the Kind representing the given Java class.
+     *
+     * @param klass the class
+     * @return the kind
+     */
+    public static JavaKind fromJavaClass(Class<?> klass) {
+        if (klass == Boolean.primitiveJavaClass) {
+            return Boolean;
+        } else if (klass == Byte.primitiveJavaClass) {
+            return Byte;
+        } else if (klass == Short.primitiveJavaClass) {
+            return Short;
+        } else if (klass == Char.primitiveJavaClass) {
+            return Char;
+        } else if (klass == Int.primitiveJavaClass) {
+            return Int;
+        } else if (klass == Long.primitiveJavaClass) {
+            return Long;
+        } else if (klass == Float.primitiveJavaClass) {
+            return Float;
+        } else if (klass == Double.primitiveJavaClass) {
+            return Double;
+        } else if (klass == Void.primitiveJavaClass) {
+            return Void;
+        } else {
+            return Object;
+        }
+    }
+
+    /**
+     * Returns the Java class representing this kind.
+     *
+     * @return the Java class
+     */
+    public Class<?> toJavaClass() {
+        return primitiveJavaClass;
+    }
+
+    /**
+     * Returns the Java class for instances of boxed values of this kind.
+     *
+     * @return the Java class
+     */
+    public Class<?> toBoxedJavaClass() {
+        return boxedJavaClass;
+    }
+
+    /**
+     * Converts this value type to a string.
+     */
+    @Override
+    public String toString() {
+        return javaName;
+    }
+
+    /**
+     * Marker interface for types that should be {@linkplain JavaKind#format(Object) formatted} with
+     * their {@link Object#toString()} value. Calling {@link Object#toString()} on other objects
+     * poses a security risk because it can potentially call user code.
+     */
+    public interface FormatWithToString {
+    }
+
+    /**
+     * Classes for which invoking {@link Object#toString()} does not run user code.
+     */
+    private static boolean isToStringSafe(Class<?> c) {
+        return c == Boolean.class || c == Byte.class || c == Character.class || c == Short.class || c == Integer.class || c == Float.class || c == Long.class || c == Double.class;
+    }
+
+    /**
+     * Gets a formatted string for a given value of this kind.
+     *
+     * @param value a value of this kind
+     * @return a formatted string for {@code value} based on this kind
+     */
+    public String format(Object value) {
+        if (isPrimitive()) {
+            assert isToStringSafe(value.getClass());
+            return value.toString();
+        } else {
+            if (value == null) {
+                return "null";
+            } else {
+                if (value instanceof String) {
+                    String s = (String) value;
+                    if (s.length() > 50) {
+                        return "String:\"" + s.substring(0, 30) + "...\"";
+                    } else {
+                        return "String:\"" + s + '"';
+                    }
+                } else if (value instanceof JavaType) {
+                    return "JavaType:" + ((JavaType) value).toJavaName();
+                } else if (value instanceof Enum) {
+                    return MetaUtil.getSimpleName(value.getClass(), true) + ":" + ((Enum<?>) value).name();
+                } else if (value instanceof FormatWithToString) {
+                    return MetaUtil.getSimpleName(value.getClass(), true) + ":" + String.valueOf(value);
+                } else if (value instanceof Class<?>) {
+                    return "Class:" + ((Class<?>) value).getName();
+                } else if (isToStringSafe(value.getClass())) {
+                    return value.toString();
+                } else if (value.getClass().isArray()) {
+                    return formatArray(value);
+                } else {
+                    return MetaUtil.getSimpleName(value.getClass(), true) + "@" + System.identityHashCode(value);
+                }
+            }
+        }
+    }
+
+    private static final int MAX_FORMAT_ARRAY_LENGTH = 5;
+
+    private static String formatArray(Object array) {
+        Class<?> componentType = array.getClass().getComponentType();
+        assert componentType != null;
+        int arrayLength = Array.getLength(array);
+        StringBuilder buf = new StringBuilder(MetaUtil.getSimpleName(componentType, true)).append('[').append(arrayLength).append("]{");
+        int length = Math.min(MAX_FORMAT_ARRAY_LENGTH, arrayLength);
+        boolean primitive = componentType.isPrimitive();
+        for (int i = 0; i < length; i++) {
+            if (primitive) {
+                buf.append(Array.get(array, i));
+            } else {
+                Object o = ((Object[]) array)[i];
+                buf.append(JavaKind.Object.format(o));
+            }
+            if (i != length - 1) {
+                buf.append(", ");
+            }
+        }
+        if (arrayLength != length) {
+            buf.append(", ...");
+        }
+        return buf.append('}').toString();
+    }
+
+    /**
+     * The minimum value that can be represented as a value of this kind.
+     *
+     * @return the minimum value
+     */
+    public long getMinValue() {
+        switch (this) {
+            case Boolean:
+                return 0;
+            case Byte:
+                return java.lang.Byte.MIN_VALUE;
+            case Char:
+                return java.lang.Character.MIN_VALUE;
+            case Short:
+                return java.lang.Short.MIN_VALUE;
+            case Int:
+                return java.lang.Integer.MIN_VALUE;
+            case Long:
+                return java.lang.Long.MIN_VALUE;
+            default:
+                throw new IllegalArgumentException("illegal call to minValue on " + this);
+        }
+    }
+
+    /**
+     * The maximum value that can be represented as a value of this kind.
+     *
+     * @return the maximum value
+     */
+    public long getMaxValue() {
+        switch (this) {
+            case Boolean:
+                return 1;
+            case Byte:
+                return java.lang.Byte.MAX_VALUE;
+            case Char:
+                return java.lang.Character.MAX_VALUE;
+            case Short:
+                return java.lang.Short.MAX_VALUE;
+            case Int:
+                return java.lang.Integer.MAX_VALUE;
+            case Long:
+                return java.lang.Long.MAX_VALUE;
+            default:
+                throw new IllegalArgumentException("illegal call to maxValue on " + this);
+        }
+    }
+
+    /**
+     * Number of bytes that are necessary to represent a value of this kind.
+     *
+     * @return the number of bytes
+     */
+    public int getByteCount() {
+        if (this == Boolean) {
+            return 1;
+        } else {
+            return getBitCount() >> 3;
+        }
+    }
+
+    /**
+     * Number of bits that are necessary to represent a value of this kind.
+     *
+     * @return the number of bits
+     */
+    public int getBitCount() {
+        switch (this) {
+            case Boolean:
+                return 1;
+            case Byte:
+                return 8;
+            case Char:
+            case Short:
+                return 16;
+            case Float:
+                return 32;
+            case Int:
+                return 32;
+            case Double:
+                return 64;
+            case Long:
+                return 64;
+            default:
+                throw new IllegalArgumentException("illegal call to bits on " + this);
+        }
+    }
+
+    public JavaConstant getDefaultValue() {
+        switch (this) {
+            case Boolean:
+                return JavaConstant.FALSE;
+            case Int:
+                return JavaConstant.INT_0;
+            case Long:
+                return JavaConstant.LONG_0;
+            case Float:
+                return JavaConstant.FLOAT_0;
+            case Double:
+                return JavaConstant.DOUBLE_0;
+            case Object:
+                return JavaConstant.NULL_POINTER;
+            case Byte:
+            case Char:
+            case Short:
+                return new PrimitiveConstant(this, 0);
+            default:
+                throw new IllegalArgumentException("illegal call to getDefaultValue on " + this);
+        }
+    }
+
+    @Override
+    public int getSizeInBytes() {
+        return getByteCount();
+    }
+
+    @Override
+    public int getVectorLength() {
+        return 1;
+    }
+}
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/JavaMethod.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/JavaMethod.java	Tue Sep 15 18:13:11 2015 -0700
@@ -82,23 +82,18 @@
                     throw new UnknownFormatConversionException("An unquoted '%' character cannot terminate a method format specification");
                 }
                 char specifier = format.charAt(index++);
-                boolean qualified = false;
                 switch (specifier) {
                     case 'R':
-                        qualified = true;
-                        // fall through
                     case 'r': {
                         if (sig == null) {
                             sig = getSignature();
                         }
-                        sb.append(sig.getReturnType(null).toJavaName(qualified));
+                        sb.append(sig.getReturnType(null).toJavaName(specifier == 'R'));
                         break;
                     }
                     case 'H':
-                        qualified = true;
-                        // fall through
                     case 'h': {
-                        sb.append(getDeclaringClass().toJavaName(qualified));
+                        sb.append(getDeclaringClass().toJavaName(specifier == 'H'));
                         break;
                     }
                     case 'n': {
@@ -106,8 +101,6 @@
                         break;
                     }
                     case 'P':
-                        qualified = true;
-                        // fall through
                     case 'p': {
                         if (sig == null) {
                             sig = getSignature();
@@ -116,7 +109,7 @@
                             if (i != 0) {
                                 sb.append(", ");
                             }
-                            sb.append(sig.getParameterType(i, null).toJavaName(qualified));
+                            sb.append(sig.getParameterType(i, null).toJavaName(specifier == 'P'));
                         }
                         break;
                     }
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/JavaType.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/JavaType.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -86,9 +86,9 @@
     JavaType getArrayClass();
 
     /**
-     * Gets the kind of this type.
+     * Gets the {@link JavaKind} of this type.
      */
-    Kind getKind();
+    JavaKind getJavaKind();
 
     /**
      * Resolves this type to a {@link ResolvedJavaType}.
@@ -136,11 +136,11 @@
      * @return the Java name corresponding to this type
      */
     default String toJavaName(boolean qualified) {
-        Kind kind = getKind();
-        if (kind == Kind.Object) {
+        JavaKind kind = getJavaKind();
+        if (kind == JavaKind.Object) {
             return internalNameToJava(getName(), qualified, false);
         }
-        return getKind().getJavaName();
+        return getJavaKind().getJavaName();
     }
 
     /**
@@ -149,5 +149,4 @@
     default String toClassName() {
         return internalNameToJava(getName(), true, true);
     }
-
 }
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/JavaValue.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/JavaValue.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -23,12 +23,7 @@
 package jdk.internal.jvmci.meta;
 
 /**
- * Interface for things that represent a Java value.
+ * Marker interface for things that represent a Java value.
  */
 public interface JavaValue {
-
-    /**
-     * Returns the kind of this value.
-     */
-    Kind getKind();
 }
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/Kind.java	Tue Sep 15 18:12:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,486 +0,0 @@
-/*
- * Copyright (c) 2009, 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.internal.jvmci.meta;
-
-import java.lang.reflect.*;
-
-//JaCoCo Exclude
-
-/**
- * Denotes the basic kinds of types in CRI, including the all the Java primitive types, for example,
- * {@link Kind#Int} for {@code int} and {@link Kind#Object} for all object types. A kind has a
- * single character short name, a Java name, and a set of flags further describing its behavior.
- */
-public enum Kind implements PlatformKind {
-    /** The primitive boolean kind, represented as an int on the stack. */
-    Boolean('z', "boolean", 1, true, java.lang.Boolean.TYPE, java.lang.Boolean.class),
-
-    /** The primitive byte kind, represented as an int on the stack. */
-    Byte('b', "byte", 1, true, java.lang.Byte.TYPE, java.lang.Byte.class),
-
-    /** The primitive short kind, represented as an int on the stack. */
-    Short('s', "short", 1, true, java.lang.Short.TYPE, java.lang.Short.class),
-
-    /** The primitive char kind, represented as an int on the stack. */
-    Char('c', "char", 1, true, java.lang.Character.TYPE, java.lang.Character.class),
-
-    /** The primitive int kind, represented as an int on the stack. */
-    Int('i', "int", 1, true, java.lang.Integer.TYPE, java.lang.Integer.class),
-
-    /** The primitive float kind. */
-    Float('f', "float", 1, false, java.lang.Float.TYPE, java.lang.Float.class),
-
-    /** The primitive long kind. */
-    Long('j', "long", 2, false, java.lang.Long.TYPE, java.lang.Long.class),
-
-    /** The primitive double kind. */
-    Double('d', "double", 2, false, java.lang.Double.TYPE, java.lang.Double.class),
-
-    /** The Object kind, also used for arrays. */
-    Object('a', "Object", 1, false, null, null),
-
-    /** The void float kind. */
-    Void('v', "void", 0, false, java.lang.Void.TYPE, java.lang.Void.class),
-
-    /** The non-type. */
-    Illegal('-', "illegal", 0, false, null, null);
-
-    private final char typeChar;
-    private final String javaName;
-    private final boolean isStackInt;
-    private final Class<?> primitiveJavaClass;
-    private final Class<?> boxedJavaClass;
-    private final EnumKey key = new EnumKey(this);
-    private final int slotCount;
-
-    private Kind(char typeChar, String javaName, int slotCount, boolean isStackInt, Class<?> primitiveJavaClass, Class<?> boxedJavaClass) {
-        this.typeChar = typeChar;
-        this.javaName = javaName;
-        this.slotCount = slotCount;
-        this.isStackInt = isStackInt;
-        this.primitiveJavaClass = primitiveJavaClass;
-        this.boxedJavaClass = boxedJavaClass;
-        assert primitiveJavaClass == null || javaName.equals(primitiveJavaClass.getName());
-    }
-
-    /**
-     * Returns the number of stack slots occupied by this kind according to the Java bytecodes
-     * specification.
-     */
-    public int getSlotCount() {
-        return this.slotCount;
-    }
-
-    /**
-     * Returns whether this kind occupied two stack slots.
-     */
-    public boolean needsTwoSlots() {
-        return this.slotCount == 2;
-    }
-
-    /**
-     * Returns the name of the kind as a single character.
-     */
-    public char getTypeChar() {
-        return typeChar;
-    }
-
-    /**
-     * Returns the name of this kind which will also be it Java programming language name if it is
-     * {@linkplain #isPrimitive() primitive} or {@code void}.
-     */
-    public String getJavaName() {
-        return javaName;
-    }
-
-    public Key getKey() {
-        return key;
-    }
-
-    /**
-     * Checks whether this type is a Java primitive type.
-     *
-     * @return {@code true} if this is {@link #Boolean}, {@link #Byte}, {@link #Char},
-     *         {@link #Short}, {@link #Int}, {@link #Long}, {@link #Float}, {@link #Double}, or
-     *         {@link #Void}.
-     */
-    public boolean isPrimitive() {
-        return primitiveJavaClass != null;
-    }
-
-    /**
-     * Returns the kind that represents this kind when on the Java operand stack.
-     *
-     * @return the kind used on the operand stack
-     */
-    public Kind getStackKind() {
-        if (isStackInt) {
-            return Int;
-        }
-        return this;
-    }
-
-    /**
-     * Checks whether this type is a Java primitive type representing an integer number.
-     *
-     * @return {@code true} if the stack kind is {@link #Int} or {@link #Long}.
-     */
-    public boolean isNumericInteger() {
-        return isStackInt || this == Kind.Long;
-    }
-
-    /**
-     * Checks whether this type is a Java primitive type representing an unsigned number.
-     *
-     * @return {@code true} if the kind is {@link #Boolean} or {@link #Char}.
-     */
-    public boolean isUnsigned() {
-        return this == Kind.Boolean || this == Kind.Char;
-    }
-
-    /**
-     * Checks whether this type is a Java primitive type representing a floating point number.
-     *
-     * @return {@code true} if this is {@link #Float} or {@link #Double}.
-     */
-    public boolean isNumericFloat() {
-        return this == Kind.Float || this == Kind.Double;
-    }
-
-    /**
-     * Checks whether this represent an Object of some sort.
-     *
-     * @return {@code true} if this is {@link #Object}.
-     */
-    public boolean isObject() {
-        return this == Kind.Object;
-    }
-
-    /**
-     * Returns the kind corresponding to the Java type string.
-     *
-     * @param typeString the Java type string
-     * @return the kind
-     */
-    public static Kind fromTypeString(String typeString) {
-        assert typeString.length() > 0;
-        final char first = typeString.charAt(0);
-        if (first == '[' || first == 'L') {
-            return Kind.Object;
-        }
-        return Kind.fromPrimitiveOrVoidTypeChar(first);
-    }
-
-    /**
-     * Returns the kind of a word given the size of a word in bytes.
-     *
-     * @param wordSizeInBytes the size of a word in bytes
-     * @return the kind representing a word value
-     */
-    public static Kind fromWordSize(int wordSizeInBytes) {
-        if (wordSizeInBytes == 8) {
-            return Kind.Long;
-        } else {
-            assert wordSizeInBytes == 4 : "Unsupported word size!";
-            return Kind.Int;
-        }
-    }
-
-    /**
-     * Returns the kind from the character describing a primitive or void.
-     *
-     * @param ch the character
-     * @return the kind
-     */
-    public static Kind fromPrimitiveOrVoidTypeChar(char ch) {
-        switch (ch) {
-            case 'Z':
-                return Boolean;
-            case 'C':
-                return Char;
-            case 'F':
-                return Float;
-            case 'D':
-                return Double;
-            case 'B':
-                return Byte;
-            case 'S':
-                return Short;
-            case 'I':
-                return Int;
-            case 'J':
-                return Long;
-            case 'V':
-                return Void;
-        }
-        throw new IllegalArgumentException("unknown primitive or void type character: " + ch);
-    }
-
-    /**
-     * Returns the Kind representing the given Java class.
-     *
-     * @param klass the class
-     * @return the kind
-     */
-    public static Kind fromJavaClass(Class<?> klass) {
-        if (klass == Boolean.primitiveJavaClass) {
-            return Boolean;
-        } else if (klass == Byte.primitiveJavaClass) {
-            return Byte;
-        } else if (klass == Short.primitiveJavaClass) {
-            return Short;
-        } else if (klass == Char.primitiveJavaClass) {
-            return Char;
-        } else if (klass == Int.primitiveJavaClass) {
-            return Int;
-        } else if (klass == Long.primitiveJavaClass) {
-            return Long;
-        } else if (klass == Float.primitiveJavaClass) {
-            return Float;
-        } else if (klass == Double.primitiveJavaClass) {
-            return Double;
-        } else if (klass == Void.primitiveJavaClass) {
-            return Void;
-        } else {
-            return Object;
-        }
-    }
-
-    /**
-     * Returns the Java class representing this kind.
-     *
-     * @return the Java class
-     */
-    public Class<?> toJavaClass() {
-        return primitiveJavaClass;
-    }
-
-    /**
-     * Returns the Java class for instances of boxed values of this kind.
-     *
-     * @return the Java class
-     */
-    public Class<?> toBoxedJavaClass() {
-        return boxedJavaClass;
-    }
-
-    /**
-     * Converts this value type to a string.
-     */
-    @Override
-    public String toString() {
-        return javaName;
-    }
-
-    /**
-     * Marker interface for types that should be {@linkplain Kind#format(Object) formatted} with
-     * their {@link Object#toString()} value. Calling {@link Object#toString()} on other objects
-     * poses a security risk because it can potentially call user code.
-     */
-    public interface FormatWithToString {
-    }
-
-    /**
-     * Classes for which invoking {@link Object#toString()} does not run user code.
-     */
-    private static boolean isToStringSafe(Class<?> c) {
-        return c == Boolean.class || c == Byte.class || c == Character.class || c == Short.class || c == Integer.class || c == Float.class || c == Long.class || c == Double.class;
-    }
-
-    /**
-     * Gets a formatted string for a given value of this kind.
-     *
-     * @param value a value of this kind
-     * @return a formatted string for {@code value} based on this kind
-     */
-    public String format(Object value) {
-        if (isPrimitive()) {
-            assert isToStringSafe(value.getClass());
-            return value.toString();
-        } else {
-            if (value == null) {
-                return "null";
-            } else {
-                if (value instanceof String) {
-                    String s = (String) value;
-                    if (s.length() > 50) {
-                        return "String:\"" + s.substring(0, 30) + "...\"";
-                    } else {
-                        return "String:\"" + s + '"';
-                    }
-                } else if (value instanceof JavaType) {
-                    return "JavaType:" + ((JavaType) value).toJavaName();
-                } else if (value instanceof Enum) {
-                    return MetaUtil.getSimpleName(value.getClass(), true) + ":" + ((Enum<?>) value).name();
-                } else if (value instanceof FormatWithToString) {
-                    return MetaUtil.getSimpleName(value.getClass(), true) + ":" + String.valueOf(value);
-                } else if (value instanceof Class<?>) {
-                    return "Class:" + ((Class<?>) value).getName();
-                } else if (isToStringSafe(value.getClass())) {
-                    return value.toString();
-                } else if (value.getClass().isArray()) {
-                    return formatArray(value);
-                } else {
-                    return MetaUtil.getSimpleName(value.getClass(), true) + "@" + System.identityHashCode(value);
-                }
-            }
-        }
-    }
-
-    private static final int MAX_FORMAT_ARRAY_LENGTH = 5;
-
-    private static String formatArray(Object array) {
-        Class<?> componentType = array.getClass().getComponentType();
-        assert componentType != null;
-        int arrayLength = Array.getLength(array);
-        StringBuilder buf = new StringBuilder(MetaUtil.getSimpleName(componentType, true)).append('[').append(arrayLength).append("]{");
-        int length = Math.min(MAX_FORMAT_ARRAY_LENGTH, arrayLength);
-        boolean primitive = componentType.isPrimitive();
-        for (int i = 0; i < length; i++) {
-            if (primitive) {
-                buf.append(Array.get(array, i));
-            } else {
-                Object o = ((Object[]) array)[i];
-                buf.append(Kind.Object.format(o));
-            }
-            if (i != length - 1) {
-                buf.append(", ");
-            }
-        }
-        if (arrayLength != length) {
-            buf.append(", ...");
-        }
-        return buf.append('}').toString();
-    }
-
-    /**
-     * The minimum value that can be represented as a value of this kind.
-     *
-     * @return the minimum value
-     */
-    public long getMinValue() {
-        switch (this) {
-            case Boolean:
-                return 0;
-            case Byte:
-                return java.lang.Byte.MIN_VALUE;
-            case Char:
-                return java.lang.Character.MIN_VALUE;
-            case Short:
-                return java.lang.Short.MIN_VALUE;
-            case Int:
-                return java.lang.Integer.MIN_VALUE;
-            case Long:
-                return java.lang.Long.MIN_VALUE;
-            default:
-                throw new IllegalArgumentException("illegal call to minValue on " + this);
-        }
-    }
-
-    /**
-     * The maximum value that can be represented as a value of this kind.
-     *
-     * @return the maximum value
-     */
-    public long getMaxValue() {
-        switch (this) {
-            case Boolean:
-                return 1;
-            case Byte:
-                return java.lang.Byte.MAX_VALUE;
-            case Char:
-                return java.lang.Character.MAX_VALUE;
-            case Short:
-                return java.lang.Short.MAX_VALUE;
-            case Int:
-                return java.lang.Integer.MAX_VALUE;
-            case Long:
-                return java.lang.Long.MAX_VALUE;
-            default:
-                throw new IllegalArgumentException("illegal call to maxValue on " + this);
-        }
-    }
-
-    /**
-     * Number of bytes that are necessary to represent a value of this kind.
-     *
-     * @return the number of bytes
-     */
-    public int getByteCount() {
-        if (this == Boolean) {
-            return 1;
-        } else {
-            return getBitCount() >> 3;
-        }
-    }
-
-    /**
-     * Number of bits that are necessary to represent a value of this kind.
-     *
-     * @return the number of bits
-     */
-    public int getBitCount() {
-        switch (this) {
-            case Boolean:
-                return 1;
-            case Byte:
-                return 8;
-            case Char:
-            case Short:
-                return 16;
-            case Float:
-                return 32;
-            case Int:
-                return 32;
-            case Double:
-                return 64;
-            case Long:
-                return 64;
-            default:
-                throw new IllegalArgumentException("illegal call to bits on " + this);
-        }
-    }
-
-    public JavaConstant getDefaultValue() {
-        switch (this) {
-            case Boolean:
-                return JavaConstant.FALSE;
-            case Int:
-                return JavaConstant.INT_0;
-            case Long:
-                return JavaConstant.LONG_0;
-            case Float:
-                return JavaConstant.FLOAT_0;
-            case Double:
-                return JavaConstant.DOUBLE_0;
-            case Object:
-                return JavaConstant.NULL_POINTER;
-            case Byte:
-            case Char:
-            case Short:
-                return new PrimitiveConstant(this, 0);
-            default:
-                throw new IllegalArgumentException("illegal call to getDefaultValue on " + this);
-        }
-    }
-}
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/LIRKind.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/LIRKind.java	Tue Sep 15 18:13:11 2015 -0700
@@ -60,7 +60,7 @@
     /**
      * The non-type. This uses {@link #unknownReference}, so it can never be part of an oop map.
      */
-    public static final LIRKind Illegal = unknownReference(Kind.Illegal);
+    public static final LIRKind Illegal = unknownReference(JavaKind.Illegal);
 
     private final PlatformKind platformKind;
     private final int referenceMask;
@@ -70,6 +70,7 @@
     private static final int UNKNOWN_REFERENCE = -1;
 
     private LIRKind(PlatformKind platformKind, int referenceMask, AllocatableValue derivedReferenceBase) {
+        assert platformKind != JavaKind.Object : "Kind.Object shouldn't be used in the backend";
         this.platformKind = platformKind;
         this.referenceMask = referenceMask;
         this.derivedReferenceBase = derivedReferenceBase;
@@ -83,7 +84,6 @@
      * reference. Otherwise, {@link #combine(Value...)} should be used instead.
      */
     public static LIRKind value(PlatformKind platformKind) {
-        assert platformKind != Kind.Object : "Object should always be used as reference type";
         return new LIRKind(platformKind, 0, null);
     }
 
@@ -443,8 +443,8 @@
     }
 
     private static PlatformKind toStackKind(PlatformKind platformKind) {
-        if (platformKind instanceof Kind) {
-            return ((Kind) platformKind).getStackKind();
+        if (platformKind instanceof JavaKind) {
+            return ((JavaKind) platformKind).getStackKind();
         }
         return platformKind;
     }
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/MemoryAccessProvider.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/MemoryAccessProvider.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -36,18 +36,18 @@
      * @return the read value encapsulated in a {@link JavaConstant} object, or {@code null} if the
      *         value cannot be read.
      */
-    JavaConstant readUnsafeConstant(Kind kind, JavaConstant base, long displacement);
+    JavaConstant readUnsafeConstant(JavaKind kind, JavaConstant base, long displacement);
 
     /**
      * Reads a primitive value using a base address and a displacement.
      *
-     * @param kind the {@link Kind} of the returned {@link JavaConstant} object
+     * @param kind the {@link JavaKind} of the returned {@link JavaConstant} object
      * @param base the base address from which the value is read
      * @param displacement the displacement within the object in bytes
      * @param bits the number of bits to read from memory
-     * @return the read value encapsulated in a {@link JavaConstant} object of {@link Kind} kind
+     * @return the read value encapsulated in a {@link JavaConstant} object of {@link JavaKind} kind
      */
-    JavaConstant readPrimitiveConstant(Kind kind, Constant base, long displacement, int bits);
+    JavaConstant readPrimitiveConstant(JavaKind kind, Constant base, long displacement, int bits);
 
     /**
      * Reads a Java {@link Object} value using a base address and a displacement.
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/MetaUtil.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/MetaUtil.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -53,7 +53,7 @@
     public static long getMemorySizeRecursive(MetaAccessProvider access, ConstantReflectionProvider constantReflection, JavaConstant constant, PrintStream out, int printTopN) {
         Set<JavaConstant> marked = new HashSet<>();
         Deque<JavaConstant> stack = new ArrayDeque<>();
-        if (constant.getKind() == Kind.Object && constant.isNonNull()) {
+        if (constant.getJavaKind() == JavaKind.Object && constant.isNonNull()) {
             marked.add(constant);
         }
         final HashMap<ResolvedJavaType, ClassInfo> histogram = new HashMap<>();
@@ -63,7 +63,7 @@
             JavaConstant c = stack.pop();
             long memorySize = access.getMemorySize(constant);
             sum += memorySize;
-            if (c.getKind() == Kind.Object && c.isNonNull()) {
+            if (c.getJavaKind() == JavaKind.Object && c.isNonNull()) {
                 ResolvedJavaType clazz = access.lookupJavaType(c);
                 if (!histogram.containsKey(clazz)) {
                     histogram.put(clazz, new ClassInfo());
@@ -83,7 +83,7 @@
                 } else {
                     ResolvedJavaField[] instanceFields = type.getInstanceFields(true);
                     for (ResolvedJavaField f : instanceFields) {
-                        if (f.getKind() == Kind.Object) {
+                        if (f.getJavaKind() == JavaKind.Object) {
                             JavaConstant value = constantReflection.readFieldValue(f, c);
                             pushConstant(marked, stack, value);
                         }
@@ -195,7 +195,7 @@
                 if (name.length() != 1) {
                     throw new IllegalArgumentException("Illegal internal name: " + name);
                 }
-                return Kind.fromPrimitiveOrVoidTypeChar(name.charAt(0)).getJavaName();
+                return JavaKind.fromPrimitiveOrVoidTypeChar(name.charAt(0)).getJavaName();
         }
     }
 
@@ -203,7 +203,7 @@
      * Turns an class name in internal format into a resolved Java type.
      */
     public static ResolvedJavaType classForName(String internal, MetaAccessProvider metaAccess, ClassLoader cl) {
-        Kind k = Kind.fromTypeString(internal);
+        JavaKind k = JavaKind.fromTypeString(internal);
         try {
             String n = internalNameToJava(internal, true, true);
             return metaAccess.lookupJavaType(k.isPrimitive() ? k.toJavaClass() : Class.forName(n, true, cl));
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/NullConstant.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/NullConstant.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -25,10 +25,14 @@
 /**
  * The implementation type of the {@link JavaConstant#NULL_POINTER null constant}.
  */
-final class NullConstant extends AbstractValue implements JavaConstant {
+final class NullConstant implements JavaConstant {
 
     protected NullConstant() {
-        super(LIRKind.reference(Kind.Object));
+    }
+
+    @Override
+    public JavaKind getJavaKind() {
+        return JavaKind.Object;
     }
 
     @Override
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/PlatformKind.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/PlatformKind.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -35,11 +35,10 @@
 
     }
 
-    public class EnumKey implements Key {
-        @SuppressWarnings("rawtypes") private final Enum e;
+    public class EnumKey<E extends Enum<E>> implements Key {
+        private final Enum<E> e;
 
-        @SuppressWarnings("rawtypes")
-        public EnumKey(Enum e) {
+        public EnumKey(Enum<E> e) {
             this.e = e;
         }
 
@@ -54,7 +53,7 @@
                 return true;
             }
             if (obj instanceof EnumKey) {
-                EnumKey that = (EnumKey) obj;
+                EnumKey<?> that = (EnumKey<?>) obj;
                 return this.e == that.e;
             }
             return false;
@@ -68,7 +67,19 @@
      */
     Key getKey();
 
-    default int getVectorLength() {
-        return 1;
-    }
+    /**
+     * Get the size in bytes of this {@link PlatformKind}.
+     */
+    int getSizeInBytes();
+
+    /**
+     * Returns how many primitive values fit in this {@link PlatformKind}. For scalar types this is
+     * one, for SIMD types it may be higher.
+     */
+    int getVectorLength();
+
+    /**
+     * Gets a single type char that identifies this type for use in debug output.
+     */
+    char getTypeChar();
 }
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/PrimitiveConstant.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/PrimitiveConstant.java	Tue Sep 15 18:13:11 2015 -0700
@@ -28,7 +28,9 @@
  * Represents a primitive constant value, such as an integer or floating point number, within the
  * compiler and across the compiler/runtime interface.
  */
-public class PrimitiveConstant extends AbstractValue implements JavaConstant, SerializableConstant {
+public class PrimitiveConstant implements JavaConstant, SerializableConstant {
+
+    private final JavaKind kind;
 
     /**
      * The boxed primitive value as a {@code long}. For {@code float} and {@code double} values,
@@ -37,11 +39,16 @@
      */
     private final long primitive;
 
-    protected PrimitiveConstant(Kind kind, long primitive) {
-        super(LIRKind.value(kind));
+    protected PrimitiveConstant(JavaKind kind, long primitive) {
         this.primitive = primitive;
+        this.kind = kind;
 
-        assert kind.isPrimitive() || kind == Kind.Illegal;
+        assert kind.isPrimitive() || kind == JavaKind.Illegal;
+    }
+
+    @Override
+    public JavaKind getJavaKind() {
+        return kind;
     }
 
     @Override
@@ -56,37 +63,37 @@
 
     @Override
     public boolean asBoolean() {
-        assert getKind() == Kind.Boolean;
+        assert getJavaKind() == JavaKind.Boolean;
         return primitive != 0L;
     }
 
     @Override
     public int asInt() {
-        assert getKind().getStackKind() == Kind.Int : getKind().getStackKind();
+        assert getJavaKind().getStackKind() == JavaKind.Int : getJavaKind().getStackKind();
         return (int) primitive;
     }
 
     @Override
     public long asLong() {
-        assert getKind().isNumericInteger();
+        assert getJavaKind().isNumericInteger();
         return primitive;
     }
 
     @Override
     public float asFloat() {
-        assert getKind() == Kind.Float;
+        assert getJavaKind() == JavaKind.Float;
         return Float.intBitsToFloat((int) primitive);
     }
 
     @Override
     public double asDouble() {
-        assert getKind() == Kind.Double;
+        assert getJavaKind() == JavaKind.Double;
         return Double.longBitsToDouble(primitive);
     }
 
     @Override
     public Object asBoxedPrimitive() {
-        switch (getKind()) {
+        switch (getJavaKind()) {
             case Byte:
                 return Byte.valueOf((byte) primitive);
             case Boolean:
@@ -104,18 +111,18 @@
             case Double:
                 return Double.valueOf(asDouble());
             default:
-                throw new IllegalArgumentException("unexpected kind " + getKind());
+                throw new IllegalArgumentException("unexpected kind " + getJavaKind());
         }
     }
 
     @Override
     public int getSerializedSize() {
-        return getKind().getByteCount();
+        return getJavaKind().getByteCount();
     }
 
     @Override
     public void serialize(ByteBuffer buffer) {
-        switch (getKind()) {
+        switch (getJavaKind()) {
             case Byte:
             case Boolean:
                 buffer.put((byte) primitive);
@@ -139,26 +146,33 @@
                 buffer.putDouble(asDouble());
                 break;
             default:
-                throw new IllegalArgumentException("unexpected kind " + getKind());
+                throw new IllegalArgumentException("unexpected kind " + getJavaKind());
         }
     }
 
     @Override
     public int hashCode() {
-        return (int) (primitive ^ (primitive >>> 32)) * (getKind().ordinal() + 31);
+        return (int) (primitive ^ (primitive >>> 32)) * (getJavaKind().ordinal() + 31);
     }
 
     @Override
     public boolean equals(Object o) {
-        return o == this || (o instanceof PrimitiveConstant && super.equals(o) && primitive == ((PrimitiveConstant) o).primitive);
+        if (o == this) {
+            return true;
+        }
+        if (!(o instanceof PrimitiveConstant)) {
+            return false;
+        }
+        PrimitiveConstant other = (PrimitiveConstant) o;
+        return this.kind.equals(other.kind) && this.primitive == other.primitive;
     }
 
     @Override
     public String toString() {
-        if (getKind() == Kind.Illegal) {
+        if (getJavaKind() == JavaKind.Illegal) {
             return "illegal";
         } else {
-            return getKind().getJavaName() + "[" + asBoxedPrimitive() + "|0x" + Long.toHexString(primitive) + "]";
+            return getJavaKind().getJavaName() + "[" + asBoxedPrimitive() + "|0x" + Long.toHexString(primitive) + "]";
         }
     }
 }
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/RawConstant.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/RawConstant.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -25,6 +25,6 @@
 public class RawConstant extends PrimitiveConstant {
 
     public RawConstant(long rawValue) {
-        super(Kind.Int, rawValue);
+        super(JavaKind.Int, rawValue);
     }
 }
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/ResolvedJavaType.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/ResolvedJavaType.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -33,7 +33,6 @@
  * .
  */
 public interface ResolvedJavaType extends JavaType, ModifiersProvider {
-
     /**
      * Gets the runtime representation of the Java class object of this type.
      */
@@ -138,7 +137,7 @@
      */
     default boolean isJavaLangObject() {
         // Removed assertion due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=434442
-        return getSuperclass() == null && !isInterface() && getKind() == Kind.Object;
+        return getSuperclass() == null && !isInterface() && getJavaKind() == JavaKind.Object;
     }
 
     /**
@@ -312,7 +311,7 @@
      * @param offset the offset of the field to look for
      * @return the field with the given offset, or {@code null} if there is no such field.
      */
-    ResolvedJavaField findInstanceFieldWithOffset(long offset, Kind expectedKind);
+    ResolvedJavaField findInstanceFieldWithOffset(long offset, JavaKind expectedKind);
 
     /**
      * Returns name of source file of this type.
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/Signature.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/Signature.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -54,13 +54,13 @@
 
     /**
      * Gets the parameter kind at the specified position. This is the same as calling
-     * {@link #getParameterType}. {@link JavaType#getKind getKind}.
+     * {@link #getParameterType}. {@link JavaType#getJavaKind getJavaKind}.
      *
      * @param index the index into the parameters, with {@code 0} indicating the first parameter
      * @return the kind of the parameter at the specified position
      */
-    default Kind getParameterKind(int index) {
-        return getParameterType(index, null).getKind();
+    default JavaKind getParameterKind(int index) {
+        return getParameterType(index, null).getJavaKind();
     }
 
     /**
@@ -77,10 +77,10 @@
 
     /**
      * Gets the return kind of this signature. This is the same as calling {@link #getReturnType}.
-     * {@link JavaType#getKind getKind}.
+     * {@link JavaType#getJavaKind getJavaKind}.
      */
-    default Kind getReturnKind() {
-        return getReturnType(null).getKind();
+    default JavaKind getReturnKind() {
+        return getReturnType(null).getJavaKind();
     }
 
     /**
@@ -120,16 +120,16 @@
         return result;
     }
 
-    default Kind[] toParameterKinds(boolean receiver) {
+    default JavaKind[] toParameterKinds(boolean receiver) {
         int args = getParameterCount(false);
-        Kind[] result;
+        JavaKind[] result;
         int i = 0;
         if (receiver) {
-            result = new Kind[args + 1];
-            result[0] = Kind.Object;
+            result = new JavaKind[args + 1];
+            result[0] = JavaKind.Object;
             i = 1;
         } else {
-            result = new Kind[args];
+            result = new JavaKind[args];
         }
         for (int j = 0; j < args; j++) {
             result[i + j] = getParameterKind(j);
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/TrustedInterface.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/TrustedInterface.java	Tue Sep 15 18:13:11 2015 -0700
@@ -23,7 +23,7 @@
 package jdk.internal.jvmci.meta;
 
 /**
- * Interfaces extanding this interface should be trusted by the compiler. See
+ * Interfaces extending this interface should be trusted by the compiler. See
  * {@link ResolvedJavaType#isTrustedInterfaceType()}.
  *
  */
--- a/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/Value.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/Value.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -23,16 +23,15 @@
 package jdk.internal.jvmci.meta;
 
 /**
- * Interface for values manipulated by the compiler. All values have a {@linkplain Kind kind} and
- * are immutable.
+ * Abstract base class for values.
  */
-public interface Value extends TrustedInterface {
+public abstract class Value {
 
-    Value[] NO_VALUES = new Value[0];
+    public static final Value[] NO_VALUES = new Value[0];
 
-    AllocatableValue ILLEGAL = new IllegalValue();
+    public static final AllocatableValue ILLEGAL = new IllegalValue();
 
-    public final class IllegalValue extends AllocatableValue {
+    private static final class IllegalValue extends AllocatableValue {
         private IllegalValue() {
             super(LIRKind.Illegal);
         }
@@ -50,14 +49,49 @@
         }
     }
 
-    Kind getKind();
+    private final LIRKind lirKind;
+
+    /**
+     * Initializes a new value of the specified kind.
+     *
+     * @param lirKind the kind
+     */
+    protected Value(LIRKind lirKind) {
+        this.lirKind = lirKind;
+    }
 
-    LIRKind getLIRKind();
+    /**
+     * Returns a String representation of the kind, which should be the end of all
+     * {@link #toString()} implementation of subclasses.
+     */
+    protected final String getKindSuffix() {
+        return "|" + getPlatformKind().getTypeChar();
+    }
+
+    public final LIRKind getLIRKind() {
+        return lirKind;
+    }
 
     /**
      * Returns the platform specific kind used to store this value.
      */
-    PlatformKind getPlatformKind();
+    public final PlatformKind getPlatformKind() {
+        return lirKind.getPlatformKind();
+    }
+
+    @Override
+    public int hashCode() {
+        return 41 + lirKind.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (obj instanceof Value) {
+            Value that = (Value) obj;
+            return lirKind.equals(that.lirKind);
+        }
+        return false;
+    }
 
     /**
      * Checks if this value is identical to {@code other}.
@@ -65,7 +99,7 @@
      * Warning: Use with caution! Usually equivalence {@link #equals(Object)} is sufficient and
      * should be used.
      */
-    default boolean identityEquals(Value other) {
+    public final boolean identityEquals(Value other) {
         return this == other;
     }
 }
--- a/jvmci/jdk.internal.jvmci.options.processor/src/jdk/internal/jvmci/options/processor/OptionProcessor.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.options.processor/src/jdk/internal/jvmci/options/processor/OptionProcessor.java	Tue Sep 15 18:13:11 2015 -0700
@@ -239,19 +239,6 @@
             }
             out.println("}");
         }
-
-        try {
-            createOptionsFile(pkg, topDeclaringClass.toString(), originatingElements);
-        } catch (IOException e) {
-            processingEnv.getMessager().printMessage(Kind.ERROR, e.getMessage(), info.topDeclaringType);
-        }
-    }
-
-    private void createOptionsFile(String pkg, String relativeName, Element... originatingElements) throws IOException {
-        String filename = "META-INF/jvmci.options/" + pkg + "." + relativeName;
-        FileObject file = processingEnv.getFiler().createResource(StandardLocation.CLASS_OUTPUT, "", filename, originatingElements);
-        PrintWriter writer = new PrintWriter(new OutputStreamWriter(file.openOutputStream(), "UTF-8"));
-        writer.close();
     }
 
     protected PrintWriter createSourceFile(String pkg, String relativeName, Filer filer, Element... originatingElements) {
--- a/jvmci/jdk.internal.jvmci.options.test/src/jdk/internal/jvmci/options/test/NestedBooleanOptionValueTest.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.options.test/src/jdk/internal/jvmci/options/test/NestedBooleanOptionValueTest.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -20,6 +20,12 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @run junit jdk.internal.jvmci.options.test.NestedBooleanOptionValueTest
+ */
+
 package jdk.internal.jvmci.options.test;
 
 import static jdk.internal.jvmci.options.test.NestedBooleanOptionValueTest.Options.*;
@@ -47,6 +53,7 @@
     static final OptionDescriptor master2 = OptionDescriptor.create("Master2", Boolean.class, "", Options.class, "Master2", Master2);
     static final OptionDescriptor nestedOption2 = OptionDescriptor.create("NestedOption2", Boolean.class, "", Options.class, "NestedOption2", NestedOption2);
 
+    @SuppressWarnings("try")
     @Test
     public void runOverrides() {
         assertTrue(Master0.getValue());
--- a/jvmci/jdk.internal.jvmci.options.test/src/jdk/internal/jvmci/options/test/TestOptionValue.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.options.test/src/jdk/internal/jvmci/options/test/TestOptionValue.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -20,6 +20,12 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @run junit jdk.internal.jvmci.options.test.TestOptionValue
+ */
+
 package jdk.internal.jvmci.options.test;
 
 import static jdk.internal.jvmci.options.test.TestOptionValue.Options.*;
@@ -32,6 +38,7 @@
 
 import org.junit.*;
 
+@SuppressWarnings("try")
 public class TestOptionValue {
 
     public static class Options {
--- a/jvmci/jdk.internal.jvmci.options/src/jdk/internal/jvmci/options/OptionsParser.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.options/src/jdk/internal/jvmci/options/OptionsParser.java	Tue Sep 15 18:13:11 2015 -0700
@@ -36,6 +36,11 @@
  */
 public class OptionsParser {
 
+    /**
+     * Character used to escape a space or a literal % in a JVMCI option value.
+     */
+    private static final char ESCAPE = '%';
+
     private static final OptionValue<Boolean> PrintFlags = new OptionValue<>(false);
 
     /**
@@ -54,36 +59,104 @@
     }
 
     /**
-     * Finds the index of the next character in {@code s} starting at {@code from} that is a space
-     * iff {@code spaces == true}.
+     * Finds the index of the next character in {@code s} starting at {@code from} that is a
+     * {@linkplain #ESCAPE non-escaped} space iff {@code spaces == true}.
      */
     private static int skip(String s, int from, boolean spaces) {
-        for (int i = from; i < s.length(); i++) {
-            if ((s.charAt(i) != ' ') == spaces) {
+        int len = s.length();
+        int i = from;
+        while (i < len) {
+            char ch = s.charAt(i);
+            if (ch == ESCAPE) {
+                if (i == len - 1) {
+                    throw new InternalError("Escape character " + ESCAPE + " cannot be at end of jvmci.options value: " + s);
+                }
+                ch = s.charAt(i + 1);
+                if (ch != ESCAPE && ch != ' ') {
+                    throw new InternalError("Escape character " + ESCAPE + " must be followed by space or another " + ESCAPE + " character");
+                }
+                if (spaces) {
+                    return i;
+                }
+                i++;
+            } else if (ch == ' ' != spaces) {
                 return i;
             }
+            i++;
         }
-        return s.length();
+        return len;
+    }
+
+    private static String unescape(String s) {
+        int esc = s.indexOf(ESCAPE);
+        if (esc == -1) {
+            return s;
+        }
+        StringBuilder sb = new StringBuilder(s.length());
+        int start = 0;
+        do {
+            sb.append(s.substring(start, esc));
+            char escaped = s.charAt(esc + 1);
+            if (escaped == ' ') {
+                sb.append(' ');
+            } else {
+                assert escaped == ESCAPE;
+                sb.append(ESCAPE);
+            }
+            start = esc + 2;
+            esc = s.indexOf(ESCAPE, start);
+        } while (esc != -1);
+        if (start < s.length()) {
+            sb.append(s.substring(start));
+        }
+        return sb.toString();
     }
 
     /**
-     * Parses the set of space separated JVMCI options in {@code options}.
+     * Parses the options in {@code <jre>/lib/jvmci/options} if {@code parseOptionsFile == true} and
+     * the file exists followed by the {@linkplain #ESCAPE non-escaped} space separated JVMCI
+     * options in {@code options} if {@code options != null}.
      *
      * Called from VM. This method has an object return type to allow it to be called with a VM
      * utility function used to call other static initialization methods.
      *
-     * @param options space separated set of JVMCI options to parse
+     * @param options {@linkplain #ESCAPE non-escaped} space separated set of JVMCI options to parse
+     * @param parseOptionsFile specifies whether to look for and parse
+     *            {@code <jre>/lib/jvmci.options}
      */
-    public static Boolean parseOptionsFromVM(String options) {
+    @SuppressWarnings("try")
+    public static Boolean parseOptionsFromVM(String options, boolean parseOptionsFile) {
         try (InitTimer t = timer("ParseOptions")) {
             JVMCIJarsOptionDescriptorsProvider odp = new JVMCIJarsOptionDescriptorsProvider();
-            assert options != null;
-            int index = skip(options, 0, true);
-            while (index < options.length()) {
-                int end = skip(options, index, false);
-                String option = options.substring(index, end);
-                parseOption(option, null, odp);
-                index = skip(options, end, true);
+
+            if (parseOptionsFile) {
+                File javaHome = new File(System.getProperty("java.home"));
+                File lib = new File(javaHome, "lib");
+                File jvmci = new File(lib, "jvmci");
+                File jvmciOptions = new File(jvmci, "options");
+                if (jvmciOptions.exists()) {
+                    try (BufferedReader br = new BufferedReader(new FileReader(jvmciOptions))) {
+                        String option = null;
+                        while ((option = br.readLine()) != null) {
+                            option = option.trim();
+                            if (!option.isEmpty() && option.charAt(0) != '#') {
+                                parseOption(option, null, odp);
+                            }
+                        }
+                    } catch (IOException e) {
+                        throw new InternalError("Error reading " + jvmciOptions, e);
+                    }
+                }
+            }
+
+            if (options != null) {
+                int index = skip(options, 0, true);
+                while (index < options.length()) {
+                    int end = skip(options, index, false);
+                    String option = unescape(options.substring(index, end));
+                    parseOption(option, null, odp);
+                    index = skip(options, end, true);
+                }
             }
         }
         return Boolean.TRUE;
--- a/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/ConstantTest.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/ConstantTest.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 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
@@ -20,6 +20,13 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @compile ConstantTest.java FieldUniverse.java TypeUniverse.java TestMetaAccessProvider.java
+ * @run junit jdk.internal.jvmci.runtime.test.ConstantTest
+ */
+
 package jdk.internal.jvmci.runtime.test;
 
 import jdk.internal.jvmci.meta.*;
@@ -41,27 +48,27 @@
 
     @Test
     public void testOne() {
-        for (Kind kind : Kind.values()) {
+        for (JavaKind kind : JavaKind.values()) {
             if (kind.isNumericInteger() || kind.isNumericFloat()) {
-                Assert.assertTrue(JavaConstant.one(kind).getKind() == kind);
+                Assert.assertTrue(JavaConstant.one(kind).getJavaKind() == kind);
             }
         }
-        Assert.assertEquals(1, JavaConstant.one(Kind.Int).asInt());
-        Assert.assertEquals(1L, JavaConstant.one(Kind.Long).asLong());
-        Assert.assertEquals(1, JavaConstant.one(Kind.Byte).asInt());
-        Assert.assertEquals(1, JavaConstant.one(Kind.Short).asInt());
-        Assert.assertEquals(1, JavaConstant.one(Kind.Char).asInt());
-        Assert.assertTrue(1F == JavaConstant.one(Kind.Float).asFloat());
-        Assert.assertTrue(1D == JavaConstant.one(Kind.Double).asDouble());
+        Assert.assertEquals(1, JavaConstant.one(JavaKind.Int).asInt());
+        Assert.assertEquals(1L, JavaConstant.one(JavaKind.Long).asLong());
+        Assert.assertEquals(1, JavaConstant.one(JavaKind.Byte).asInt());
+        Assert.assertEquals(1, JavaConstant.one(JavaKind.Short).asInt());
+        Assert.assertEquals(1, JavaConstant.one(JavaKind.Char).asInt());
+        Assert.assertTrue(1F == JavaConstant.one(JavaKind.Float).asFloat());
+        Assert.assertTrue(1D == JavaConstant.one(JavaKind.Double).asDouble());
     }
 
     @Test(expected = IllegalArgumentException.class)
     public void testIllegalOne() {
-        JavaConstant.one(Kind.Illegal);
+        JavaConstant.one(JavaKind.Illegal);
     }
 
     @Test(expected = IllegalArgumentException.class)
     public void testVoidOne() {
-        JavaConstant.one(Kind.Void);
+        JavaConstant.one(JavaKind.Void);
     }
 }
--- a/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/RedefineClassTest.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/RedefineClassTest.java	Tue Sep 15 18:13:11 2015 -0700
@@ -138,7 +138,7 @@
                 for (int i = 0; i < allClasses.length; i++) {
                     Class<?> c = allClasses[i];
                     if (c == Foo.class) {
-                        inst.retransformClasses(new Class[]{c});
+                        inst.retransformClasses(new Class<?>[]{c});
                     }
                 }
             }
--- a/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestConstantReflectionProvider.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestConstantReflectionProvider.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -44,7 +44,7 @@
             for (ConstantValue c2 : constants()) {
                 // test symmetry
                 assertEquals(constantReflection.constantEquals(c1.value, c2.value), constantReflection.constantEquals(c2.value, c1.value));
-                if (c1.value.getKind() != Kind.Object && c2.value.getKind() != Kind.Object) {
+                if (c1.value.getJavaKind() != JavaKind.Object && c2.value.getJavaKind() != JavaKind.Object) {
                     assertEquals(c1.value.equals(c2.value), constantReflection.constantEquals(c2.value, c1.value));
                 }
             }
@@ -56,7 +56,7 @@
         for (ConstantValue cv : constants()) {
             JavaConstant c = cv.value;
             Integer actual = constantReflection.readArrayLength(c);
-            if (c.getKind() != Kind.Object || c.isNull() || !cv.boxed.getClass().isArray()) {
+            if (c.getJavaKind() != JavaKind.Object || c.isNull() || !cv.boxed.getClass().isArray()) {
                 assertNull(actual);
             } else {
                 assertNotNull(actual);
@@ -85,8 +85,8 @@
         for (ConstantValue cv : constants()) {
             JavaConstant c = cv.value;
             JavaConstant boxed = constantReflection.boxPrimitive(c);
-            if (boxed != null && c.getKind().isPrimitive()) {
-                assertTrue(boxed.getKind().isObject());
+            if (boxed != null && c.getJavaKind().isPrimitive()) {
+                assertTrue(boxed.getJavaKind().isObject());
                 assertFalse(boxed.isNull());
             }
         }
@@ -108,7 +108,7 @@
             JavaConstant c = cv.value;
             JavaConstant unboxed = c.isNull() ? null : constantReflection.unboxPrimitive(c);
             if (unboxed != null) {
-                assertFalse(unboxed.getKind().isObject());
+                assertFalse(unboxed.getJavaKind().isObject());
             }
         }
         List<ConstantValue> primitiveConstants = readConstants(PrimitiveConstants.class);
--- a/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestJavaField.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestJavaField.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -20,6 +20,13 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @compile TestJavaField.java FieldUniverse.java TypeUniverse.java
+ * @run junit jdk.internal.jvmci.runtime.test.TestJavaField
+ */
+
 package jdk.internal.jvmci.runtime.test;
 
 import static org.junit.Assert.*;
@@ -57,10 +64,10 @@
     }
 
     @Test
-    public void getKindTest() {
+    public void getJavaKindTest() {
         for (Map.Entry<Field, ResolvedJavaField> e : fields.entrySet()) {
-            Kind expected = metaAccess.lookupJavaType(e.getKey().getType()).getKind();
-            Kind actual = e.getValue().getKind();
+            JavaKind expected = metaAccess.lookupJavaType(e.getKey().getType()).getJavaKind();
+            JavaKind actual = e.getValue().getJavaKind();
             assertEquals(expected, actual);
         }
     }
--- a/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestJavaMethod.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestJavaMethod.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -20,6 +20,13 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @compile TestJavaMethod.java MethodUniverse.java TypeUniverse.java TestMetaAccessProvider.java NameAndSignature.java
+ * @run junit jdk.internal.jvmci.runtime.test.TestJavaMethod
+ */
+
 package jdk.internal.jvmci.runtime.test;
 
 import static org.junit.Assert.*;
--- a/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestJavaType.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestJavaType.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -20,6 +20,13 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @compile TestJavaType.java TypeUniverse.java TestMetaAccessProvider.java
+ * @run junit jdk.internal.jvmci.runtime.test.TestJavaType
+ */
+
 package jdk.internal.jvmci.runtime.test;
 
 import jdk.internal.jvmci.meta.*;
@@ -36,11 +43,11 @@
     }
 
     @Test
-    public void getKindTest() {
+    public void getJavaKindTest() {
         for (Class<?> c : classes) {
             JavaType type = metaAccess.lookupJavaType(c);
-            Kind expected = Kind.fromJavaClass(c);
-            Kind actual = type.getKind();
+            JavaKind expected = JavaKind.fromJavaClass(c);
+            JavaKind actual = type.getJavaKind();
             assertEquals(expected, actual);
         }
     }
--- a/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestMetaAccessProvider.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestMetaAccessProvider.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -20,6 +20,13 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @compile TestMetaAccessProvider.java TypeUniverse.java TestMetaAccessProvider.java
+ * @run junit jdk.internal.jvmci.runtime.test.TestMetaAccessProvider
+ */
+
 package jdk.internal.jvmci.runtime.test;
 
 import static jdk.internal.jvmci.meta.MetaUtil.*;
@@ -76,7 +83,7 @@
     public void lookupJavaTypeConstantTest() {
         for (ConstantValue cv : constants()) {
             JavaConstant c = cv.value;
-            if (c.getKind() == Kind.Object && !c.isNull()) {
+            if (c.getJavaKind() == JavaKind.Object && !c.isNull()) {
                 Object o = cv.boxed;
                 ResolvedJavaType type = metaAccess.lookupJavaType(c);
                 assertNotNull(type);
--- a/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestResolvedJavaField.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestResolvedJavaField.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -20,6 +20,13 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @compile TestResolvedJavaField.java FieldUniverse.java TypeUniverse.java TestMetaAccessProvider.java
+ * @run junit jdk.internal.jvmci.runtime.test.TestResolvedJavaField
+ */
+
 package jdk.internal.jvmci.runtime.test;
 
 import static org.junit.Assert.*;
--- a/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestResolvedJavaMethod.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestResolvedJavaMethod.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -20,6 +20,13 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @compile TestResolvedJavaMethod.java MethodUniverse.java TypeUniverse.java TestMetaAccessProvider.java
+ * @run junit jdk.internal.jvmci.runtime.test.TestResolvedJavaMethod
+ */
+
 package jdk.internal.jvmci.runtime.test;
 
 import static org.junit.Assert.*;
--- a/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestResolvedJavaType.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.runtime.test/src/jdk/internal/jvmci/runtime/test/TestResolvedJavaType.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -20,6 +20,13 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
+
+/**
+ * @test
+ * @compile TestResolvedJavaType.java TypeUniverse.java TestMetaAccessProvider.java
+ * @run junit jdk.internal.jvmci.runtime.test.TestResolvedJavaType
+ */
+
 package jdk.internal.jvmci.runtime.test;
 
 import static java.lang.reflect.Modifier.*;
@@ -55,7 +62,7 @@
                 ResolvedJavaField rf = lookupField(type.getInstanceFields(true), f);
                 assertNotNull(rf);
                 long offset = isStatic(f.getModifiers()) ? unsafe.staticFieldOffset(f) : unsafe.objectFieldOffset(f);
-                ResolvedJavaField result = type.findInstanceFieldWithOffset(offset, rf.getKind());
+                ResolvedJavaField result = type.findInstanceFieldWithOffset(offset, rf.getJavaKind());
                 assertNotNull(result);
                 assertTrue(fieldsEqual(f, result));
             }
@@ -114,7 +121,7 @@
 
     @Test
     public void isAssignableFromTest() {
-        Class<?>[] all = classes.toArray(new Class[classes.size()]);
+        Class<?>[] all = classes.toArray(new Class<?>[classes.size()]);
         for (int i = 0; i < all.length; i++) {
             Class<?> c1 = all[i];
             for (int j = i; j < all.length; j++) {
@@ -135,7 +142,7 @@
     public void isInstanceTest() {
         for (ConstantValue cv : constants()) {
             JavaConstant c = cv.value;
-            if (c.getKind() == Kind.Object && !c.isNull()) {
+            if (c.getJavaKind() == JavaKind.Object && !c.isNull()) {
                 ResolvedJavaType cType = metaAccess.lookupJavaType(c);
                 for (ResolvedJavaType t : javaTypes) {
                     if (t.isAssignableFrom(cType)) {
@@ -240,7 +247,7 @@
 
     @Test
     public void findLeastCommonAncestorTest() {
-        Class<?>[] all = classes.toArray(new Class[classes.size()]);
+        Class<?>[] all = classes.toArray(new Class<?>[classes.size()]);
         for (int i = 0; i < all.length; i++) {
             Class<?> c1 = all[i];
             for (int j = i; j < all.length; j++) {
--- a/jvmci/jdk.internal.jvmci.sparc/src/jdk/internal/jvmci/sparc/SPARC.java	Tue Sep 15 18:12:33 2015 -0700
+++ b/jvmci/jdk.internal.jvmci.sparc/src/jdk/internal/jvmci/sparc/SPARC.java	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -252,31 +252,31 @@
     public final Set<CPUFeature> features;
 
     public SPARC(Set<CPUFeature> features) {
-        super("SPARC", 8, BIG_ENDIAN, false, allRegisters, LOAD_LOAD | LOAD_STORE | STORE_STORE, 1, r31.encoding + FLOAT_REGISTER_COUNT + 1, 8);
+        super("SPARC", JavaKind.Long, BIG_ENDIAN, false, allRegisters, LOAD_LOAD | LOAD_STORE | STORE_STORE, 1, r31.encoding + FLOAT_REGISTER_COUNT + 1, 8);
         this.features = features;
     }
 
     @Override
     public boolean canStoreValue(RegisterCategory category, PlatformKind lirKind) {
-        if (!(lirKind instanceof Kind)) {
+        if (!(lirKind instanceof JavaKind)) {
             return false;
         }
 
-        Kind kind = (Kind) lirKind;
+        JavaKind kind = (JavaKind) lirKind;
         if (category.equals(CPU)) {
             switch (kind) {
+                case Object:
                 case Boolean:
                 case Byte:
                 case Char:
                 case Short:
                 case Int:
                 case Long:
-                case Object:
                     return true;
             }
-        } else if (category.equals(FPUs) && kind.equals(Kind.Float)) {
+        } else if (category.equals(FPUs) && kind.equals(JavaKind.Float)) {
             return true;
-        } else if (category.equals(FPUd) && kind.equals(Kind.Double)) {
+        } else if (category.equals(FPUd) && kind.equals(JavaKind.Double)) {
             return true;
         }
         return false;
@@ -285,13 +285,22 @@
     @Override
     public PlatformKind getLargestStorableKind(RegisterCategory category) {
         if (category.equals(CPU)) {
-            return Kind.Long;
+            return JavaKind.Long;
         } else if (category.equals(FPUd)) {
-            return Kind.Double;
+            return JavaKind.Double;
         } else if (category.equals(FPUs)) {
-            return Kind.Float;
+            return JavaKind.Float;
         } else {
-            return Kind.Illegal;
+            return JavaKind.Illegal;
+        }
+    }
+
+    @Override
+    public PlatformKind getPlatformKind(JavaKind javaKind) {
+        if (javaKind.isObject()) {
+            return JavaKind.Long;
+        } else {
+            return javaKind;
         }
     }
 
--- a/make/bsd/makefiles/vm.make	Tue Sep 15 18:12:33 2015 -0700
+++ b/make/bsd/makefiles/vm.make	Tue Sep 15 18:13:11 2015 -0700
@@ -134,10 +134,6 @@
   LIBS += -pthread
 endif
 
-ifeq ($(OS_VENDOR),Darwin)
-  LIBS         += -framework ApplicationServices -framework IOKit
-endif
-
 # By default, link the *.o into the library, not the executable.
 LINK_INTO$(LINK_INTO) = LIBJVM
 
@@ -387,10 +383,7 @@
 DEST_JVM_DEBUGINFO = $(DEST_SUBDIR)/$(LIBJVM_DEBUGINFO)
 DEST_JVM_DIZ       = $(DEST_SUBDIR)/$(LIBJVM_DIZ)
 
-$(DEST_SUBDIR):
-	mkdir $(DEST_SUBDIR)
-
-install_jvm: $(LIBJVM) $(DEST_SUBDIR)
+install_jvm: $(LIBJVM)
 	@echo "Copying $(LIBJVM) to $(DEST_JVM)"
 ifeq ($(OS_VENDOR), Darwin)
 	$(QUIETLY) test ! -d $(LIBJVM_DEBUGINFO) || \
--- a/make/jvmci.make	Tue Sep 15 18:12:33 2015 -0700
+++ b/make/jvmci.make	Tue Sep 15 18:13:11 2015 -0700
@@ -44,16 +44,15 @@
     $(QUIETLY) test ! -f $(vmconfig) || (mkdir -p $(vmconfigDest) && cp $(vmconfig) $(vmconfigDest))
 endef
 
-# Reads the files in jvmci.options/ created by OptionProcessor (the processor for the @Option annotation)
-# and appends to services/jdk.internal.jvmci.options.Options entries for the providers
-# also created by the same processor.
+# Finds the *_OptionsDescriptors classes created by OptionProcessor (the processor for the @Option annotation)
+# and appends their names to services/jdk.internal.jvmci.options.OptionDescriptors.
 # Arguments:
 #  1: directory with contents of the JAR file
 define process_options
-    $(eval options := $(1)/$(OPTIONS_INF))
     $(eval services := $(1)/META-INF/services)
     $(QUIETLY) test -d $(services) || mkdir -p $(services)
-    $(QUIETLY) test ! -d $(options) || (cd $(options) && for i in $$(ls); do echo $${i}_OptionDescriptors >> $(abspath $(services))/jdk.internal.jvmci.options.Options; done)
+    $(eval optionDescriptors := $(1)/META-INF/services/jdk.internal.jvmci.options.OptionDescriptors)
+    $(QUIETLY) cd $(1) && for i in $$(find . -name '*_OptionDescriptors.class' 2>/dev/null); do echo $${i} | sed 's:\./\(.*\)\.class:\1:g' | tr '/' '.' >> $(abspath $(optionDescriptors)); done
 endef
 
 # Extracts META-INF/jvmci.services from a JAR file into a given directory
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mx.jvmci/eclipse-settings/org.eclipse.jdt.core.prefs	Tue Sep 15 18:13:11 2015 -0700
@@ -0,0 +1,1 @@
+org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
--- a/mx.jvmci/mx_jvmci.py	Tue Sep 15 18:12:33 2015 -0700
+++ b/mx.jvmci/mx_jvmci.py	Tue Sep 15 18:13:11 2015 -0700
@@ -48,11 +48,17 @@
     'server-nojvmci' : None,  # all compilation with tiered system (i.e., client + server), JVMCI omitted
     'client-nojvmci' : None,  # all compilation with client compiler, JVMCI omitted
     'original' : None,  # default VM copied from bootstrap JDK
-    'graal' : None, # alias for jvmci
-    'server-nograal' : None,  # alias for server-nojvmci
-    'client-nograal' : None,  # alias for client-nojvmci
 }
 
+# Aliases for legacy VM names
+_vmAliases = {
+    'graal' : 'jvmci',
+    'server-nograal' : 'server-nojvmci',
+    'client-nograal' : 'client-nograal',
+}
+
+_JVMCI_JDK_TAG = 'jvmci'
+
 """ The VM that will be run by the 'vm' command and built by default by the 'build' command.
     This can be set via the global '--vm' option or the DEFAULT_VM environment variable.
     It can also be temporarily set by using of a VM context manager object in a 'with' statement. """
@@ -160,6 +166,9 @@
         return mx.distribution(name)
 
     def deploy(self, jdkDir):
+        vmbuild = _vmbuildFromJdkDir(jdkDir)
+        if vmbuild != _vmbuild:
+            return
         _hs_deploy_map = {
             'jvmti.h' : 'include',
             'sa-jdi.jar' : 'lib',
@@ -178,6 +187,7 @@
                     mx.logv('Deploying {} from {} to {}'.format(m.name, dist.name, targetDir))
                     tar.extract(m, targetDir)
         updateJvmCfg(jdkDir, get_vm())
+
 """
 List of distributions that are deployed into a JDK by mx.
 """
@@ -212,14 +222,27 @@
     """
     return _installed_jdks
 
-def get_vm_prefix():
+def get_vm_prefix(asList=True):
     """
     Get the prefix for running the VM ("/usr/bin/gdb --args").
     """
+    if asList:
+        return _vm_prefix.split() if _vm_prefix is not None else []
     return _vm_prefix
 
 def get_vm_choices():
-    return _vmChoices
+    """
+    Get the names of available VMs.
+    """
+    return _vmChoices.viewkeys()
+
+def dealiased_vm(vm):
+    """
+    If 'vm' is an alias, returns the aliased name otherwise returns 'vm'.
+    """
+    if vm and vm in _vmAliases:
+        return _vmAliases[vm]
+    return vm
 
 def get_vm():
     """
@@ -230,12 +253,12 @@
         return _vm
     vm = mx.get_env('DEFAULT_VM')
     envPath = join(_suite.mxDir, 'env')
-    if vm and 'graal' in vm:
+    if vm and vm in _vmAliases:
         if exists(envPath):
             with open(envPath) as fp:
                 if 'DEFAULT_VM=' + vm in fp.read():
-                    mx.log('Please update the DEFAULT_VM value in ' + envPath + ' to replace "graal" with "jvmci"')
-        vm = vm.replace('graal', 'jvmci')
+                    mx.log('Please update the DEFAULT_VM value in ' + envPath + ' to replace "' + vm + '" with "' + _vmAliases[vm] + '"')
+        vm = _vmAliases[vm]
     if vm is None:
         if not mx.is_interactive():
             mx.abort('Need to specify VM with --vm option or DEFAULT_VM environment variable')
@@ -299,7 +322,7 @@
     infos['revision'] = hgcfg.tip('.') + ('+' if hgcfg.isDirty('.') else '')
     # TODO: infos['repository']
 
-    infos['jdkversion'] = str(mx.get_jdk().version)
+    infos['jdkversion'] = str(get_jvmci_bootstrap_jdk().version)
 
     infos['architecture'] = mx.get_arch()
     infos['platform'] = mx.get_os()
@@ -323,19 +346,19 @@
         return jsonFileName
 
 
-    def _genFileName(archivtype, middle):
+    def _genFileName(archivetype, middle):
         idPrefix = infos['revision'] + '_'
         idSuffix = '.tar.gz'
-        return join(_suite.dir, "graalvm_" + archivtype + "_" + idPrefix + middle + idSuffix)
+        return join(_suite.dir, "graalvm_" + archivetype + "_" + idPrefix + middle + idSuffix)
 
-    def _genFileArchPlatformName(archivtype, middle):
-        return _genFileName(archivtype, infos['platform'] + '_' + infos['architecture'] + '_' + middle)
+    def _genFileArchPlatformName(archivetype, middle):
+        return _genFileName(archivetype, infos['platform'] + '_' + infos['architecture'] + '_' + middle)
 
 
     # archive different build types of hotspot
     for vmBuild in _vmbuildChoices:
-        jdkpath = join(_jdksDir(), vmBuild)
-        if not exists(jdkpath):
+        jdkDir = join(_jdksDir(), vmBuild)
+        if not exists(jdkDir):
             mx.logv("skipping " + vmBuild)
             continue
 
@@ -343,7 +366,7 @@
         mx.logv("creating basejdk " + tarName)
         vmSet = set()
         with tarfile.open(tarName, 'w:gz') as tar:
-            for root, _, files in os.walk(jdkpath):
+            for root, _, files in os.walk(jdkDir):
                 if basename(root) in _vmChoices.keys():
                     # TODO: add some assert to check path assumption
                     vmSet.add(root)
@@ -411,35 +434,35 @@
         return join('jre', 'bin')
     return join('jre', 'lib', mx.get_arch())
 
-def vmLibDirInJdk(jdk):
+def vmLibDirInJdk(jdkDir):
     """
     Gets the directory within a JDK where the server and client
     sub-directories are located.
     """
-    return join(jdk, relativeVmLibDirInJdk())
+    return join(jdkDir, relativeVmLibDirInJdk())
 
-def getVmJliLibDirs(jdk):
+def getVmJliLibDirs(jdkDir):
     """
     Get the directories within a JDK where the jli library designates to.
     """
     mxos = mx.get_os()
     if mxos == 'darwin':
-        return [join(jdk, 'jre', 'lib', 'jli')]
+        return [join(jdkDir, 'jre', 'lib', 'jli')]
     if mxos == 'windows' or mxos == 'cygwin':
-        return [join(jdk, 'jre', 'bin'), join(jdk, 'bin')]
-    return [join(jdk, 'jre', 'lib', mx.get_arch(), 'jli'), join(jdk, 'lib', mx.get_arch(), 'jli')]
+        return [join(jdkDir, 'jre', 'bin'), join(jdkDir, 'bin')]
+    return [join(jdkDir, 'jre', 'lib', mx.get_arch(), 'jli'), join(jdkDir, 'lib', mx.get_arch(), 'jli')]
 
-def getVmCfgInJdk(jdk, jvmCfgFile='jvm.cfg'):
+def getVmCfgInJdk(jdkDir, jvmCfgFile='jvm.cfg'):
     """
     Get the jvm.cfg file.
     """
     mxos = mx.get_os()
     if mxos == "windows" or mxos == "cygwin":
-        return join(jdk, 'jre', 'lib', mx.get_arch(), jvmCfgFile)
-    return join(vmLibDirInJdk(jdk), jvmCfgFile)
+        return join(jdkDir, 'jre', 'lib', mx.get_arch(), jvmCfgFile)
+    return join(vmLibDirInJdk(jdkDir), jvmCfgFile)
 
 def _jdksDir():
-    return os.path.abspath(join(_installed_jdks if _installed_jdks else _suite.dir, 'jdk' + str(mx.get_jdk().version)))
+    return os.path.abspath(join(_installed_jdks if _installed_jdks else _suite.dir, 'jdk' + str(get_jvmci_bootstrap_jdk().version)))
 
 def _handle_missing_VM(bld, vm=None):
     if not vm:
@@ -452,22 +475,38 @@
             return
     mx.abort('You need to run "mx --vm ' + vm + ' --vmbuild ' + bld + ' build" to build the selected VM')
 
-def get_jvmci_jdk(build=None, vmToCheck=None, create=False, installJars=True):
+def check_VM_exists(vm, jdkDir, build=None):
+    if not build:
+        build = _vmbuild
+    jvmCfg = getVmCfgInJdk(jdkDir)
+    found = False
+    with open(jvmCfg) as f:
+        for line in f:
+            if line.strip() == '-' + vm + ' KNOWN':
+                found = True
+                break
+    if not found:
+        _handle_missing_VM(build, vm)
+
+def get_jvmci_jdk_dir(build=None, vmToCheck=None, create=False, deployDists=True):
     """
-    Gets the JDK into which JVMCI is installed, creating it first if necessary.
+    Gets the path of the JVMCI JDK corresponding to 'build' (or '_vmbuild'), creating it
+    first if it does not exist and 'create' is True. If the JDK was created or
+    'deployDists' is True, then the JDK deployable distributions are deployed into
+    the JDK.
     """
     if not build:
         build = _vmbuild
-    jdk = join(_jdksDir(), build)
+    jdkDir = join(_jdksDir(), build)
     if create:
-        srcJdk = mx.get_jdk().home
-        if not exists(jdk):
-            mx.log('Creating ' + jdk + ' from ' + srcJdk)
-            shutil.copytree(srcJdk, jdk)
+        srcJdk = get_jvmci_bootstrap_jdk().home
+        if not exists(jdkDir):
+            mx.log('Creating ' + jdkDir + ' from ' + srcJdk)
+            shutil.copytree(srcJdk, jdkDir)
 
             # Make a copy of the default VM so that this JDK can be
             # reliably used as the bootstrap for a HotSpot build.
-            jvmCfg = getVmCfgInJdk(jdk)
+            jvmCfg = getVmCfgInJdk(jdkDir)
             if not exists(jvmCfg):
                 mx.abort(jvmCfg + ' does not exist')
 
@@ -489,8 +528,8 @@
                         jvmCfgLines += [line]
 
             assert defaultVM is not None, 'Could not find default VM in ' + jvmCfg
-            chmodRecursive(jdk, JDK_UNIX_PERMISSIONS_DIR)
-            shutil.move(join(vmLibDirInJdk(jdk), defaultVM), join(vmLibDirInJdk(jdk), 'original'))
+            chmodRecursive(jdkDir, JDK_UNIX_PERMISSIONS_DIR)
+            shutil.move(join(vmLibDirInJdk(jdkDir), defaultVM), join(vmLibDirInJdk(jdkDir), 'original'))
 
             if mx.get_os() != 'windows':
                 os.chmod(jvmCfg, JDK_UNIX_PERMISSIONS_FILE)
@@ -499,7 +538,7 @@
                     fp.write(line)
 
             # patch 'release' file (append jvmci revision)
-            releaseFile = join(jdk, 'release')
+            releaseFile = join(jdkDir, 'release')
             if exists(releaseFile):
                 releaseFileLines = []
                 with open(releaseFile) as f:
@@ -524,23 +563,23 @@
 
             # Install a copy of the disassembler library
             try:
-                hsdis([], copyToDir=vmLibDirInJdk(jdk))
+                hsdis([], copyToDir=vmLibDirInJdk(jdkDir))
             except SystemExit:
                 pass
     else:
-        if not exists(jdk):
+        if not exists(jdkDir):
             if _installed_jdks:
-                mx.log("The selected JDK directory does not (yet) exist: " + jdk)
+                mx.log("The selected JDK directory does not (yet) exist: " + jdkDir)
             _handle_missing_VM(build, vmToCheck)
 
-    if installJars:
+    if deployDists:
         for jdkDist in jdkDeployedDists:
             dist = jdkDist.dist()
             if exists(dist.path):
                 _installDistInJdks(jdkDist)
 
     if vmToCheck is not None:
-        jvmCfg = getVmCfgInJdk(jdk)
+        jvmCfg = getVmCfgInJdk(jdkDir)
         found = False
         with open(jvmCfg) as f:
             for line in f:
@@ -550,15 +589,15 @@
         if not found:
             _handle_missing_VM(build, vmToCheck)
 
-    return jdk
+    return jdkDir
 
-def _updateInstalledJVMCIOptionsFile(jdk):
+def _updateInstalledJVMCIOptionsFile(jdkDir):
     jvmciOptions = join(_suite.dir, 'jvmci.options')
-    jreLibDir = join(jdk, 'jre', 'lib')
+    jreLibDir = join(jdkDir, 'jre', 'lib')
     if exists(jvmciOptions):
-        shutil.copy(jvmciOptions, join(jreLibDir, 'jvmci.options'))
+        shutil.copy(jvmciOptions, join(jreLibDir, 'jvmci', 'options'))
     else:
-        toDelete = join(jreLibDir, 'jvmci.options')
+        toDelete = join(jreLibDir, 'jvmci', 'options')
         if exists(toDelete):
             os.unlink(toDelete)
 
@@ -630,29 +669,27 @@
 
 def _updateJVMCIProperties(jdkDir, compilers):
     jvmciProperties = join(jdkDir, 'jre', 'lib', 'jvmci', 'jvmci.properties')
-    def createFile(compilers):
+    def createFile(lines):
         with open(jvmciProperties, 'w') as fp:
-            print >> fp, "# the first entry wins, reorder entries to change the default compiler"
-            for compiler in compilers:
-                print >> fp, "jvmci.compiler=" + compiler
+            header = "# the last definition of a property wins (i.e., it overwrites any earlier definitions)"
+            if header not in lines:
+                print >> fp, header
+            for line in lines:
+                print >> fp, line
 
-    if not exists(jvmciProperties):
-        createFile(compilers)
-    else:
-        oldCompilers = []
+    lines = []
+    if exists(jvmciProperties):
         with open(jvmciProperties) as fp:
             for line in fp:
                 if line.startswith('jvmci.compiler='):
-                    oldCompilers += [line.strip().split('=')[1]]
-        changed = False
-        newCompilers = []
-        for c in compilers:
-            if not c in oldCompilers:
-                changed = True
-                newCompilers += [c]
-        if changed:
-            # prepend new compilers, since the first property wins
-            createFile(newCompilers + oldCompilers)
+                    compiler = line.strip().split('=')[1]
+                    if compiler not in compilers:
+                        lines.append(line.strip())
+                else:
+                    lines.append(line.strip())
+    for compiler in compilers:
+        lines.append("jvmci.compiler=" + compiler)
+    createFile(lines)
 
 def _installDistInJdks(deployableDist):
     """
@@ -664,6 +701,16 @@
             jdkDir = join(jdks, e)
             deployableDist.deploy(jdkDir)
 
+def _vmbuildFromJdkDir(jdkDir):
+    """
+    Determines the VM build corresponding to 'jdkDir'.
+    """
+    jdksDir = _jdksDir()
+    assert jdkDir.startswith(jdksDir)
+    vmbuild = os.path.relpath(jdkDir, jdksDir)
+    assert vmbuild in _vmbuildChoices, 'The vmbuild derived from ' + jdkDir + ' is unknown: ' + vmbuild
+    return vmbuild
+
 def _check_for_obsolete_jvmci_files():
     jdks = _jdksDir()
     if exists(jdks):
@@ -752,7 +799,7 @@
 
 def jdkhome(vm=None):
     """return the JDK directory selected for the 'vm' command"""
-    return get_jvmci_jdk(installJars=False)
+    return get_jvmci_jdk_dir(deployDists=False)
 
 def print_jdkhome(args, vm=None):
     """print the JDK directory selected for the 'vm' command"""
@@ -762,7 +809,7 @@
     """describe the variables that can be set by the -D option to the 'mx build' commmand"""
 
     buildVars = {
-        'ALT_BOOTDIR' : 'The location of the bootstrap JDK installation (default: ' + mx.get_jdk().home + ')',
+        'ALT_BOOTDIR' : 'The location of the bootstrap JDK installation (default: ' + get_jvmci_bootstrap_jdk().home + ')',
         'ALT_OUTPUTDIR' : 'Build directory',
         'HOTSPOT_BUILD_JOBS' : 'Number of CPUs used by make (default: ' + str(mx.cpu_count()) + ')',
         'INSTALL' : 'Install the built VM into the JDK? (default: y)',
@@ -778,8 +825,6 @@
     mx.log('')
     mx.log('Note that these variables can be given persistent values in the file ' + join(_suite.mxDir, 'env') + ' (see \'mx about\').')
 
-cached_graal_version = None
-
 def _hotspotReplaceResultsVar(m):
     var = m.group(1)
     if var == 'os':
@@ -839,14 +884,14 @@
             buildSuffix = 'jvmci'
 
         if isWindows:
-            t_compilelogfile = mx._cygpathU2W(os.path.join(_suite.dir, "graalCompile.log"))
+            t_compilelogfile = mx._cygpathU2W(os.path.join(_suite.dir, "jvmciCompile.log"))
             mksHome = mx.get_env('MKS_HOME', 'C:\\cygwin\\bin')
 
             variant = _hotspotGetVariant(self.vm)
             project_config = variant + '_' + self.vmbuild
             jvmciHome = mx._cygpathU2W(_suite.dir)
             _runInDebugShell('msbuild ' + jvmciHome + r'\build\vs-amd64\jvm.vcproj /p:Configuration=' + project_config + ' /target:clean', jvmciHome)
-            winCompileCmd = r'set HotSpotMksHome=' + mksHome + r'& set JAVA_HOME=' + mx._cygpathU2W(mx.get_jdk().home) + r'& set path=%JAVA_HOME%\bin;%path%;%HotSpotMksHome%& cd /D "' + jvmciHome + r'\make\windows"& call create.bat ' + jvmciHome
+            winCompileCmd = r'set HotSpotMksHome=' + mksHome + r'& set JAVA_HOME=' + mx._cygpathU2W(get_jvmci_bootstrap_jdk().home) + r'& set path=%JAVA_HOME%\bin;%path%;%HotSpotMksHome%& cd /D "' + jvmciHome + r'\make\windows"& call create.bat ' + jvmciHome
             print winCompileCmd
             winCompileSuccess = re.compile(r"^Writing \.vcxproj file:")
             if not _runInDebugShell(winCompileCmd, jvmciHome, t_compilelogfile, winCompileSuccess):
@@ -882,7 +927,7 @@
 
             setMakeVar('ARCH_DATA_MODEL', '64', env=env)
             setMakeVar('HOTSPOT_BUILD_JOBS', str(cpus), env=env)
-            setMakeVar('ALT_BOOTDIR', mx.get_jdk().home, env=env)
+            setMakeVar('ALT_BOOTDIR', get_jvmci_bootstrap_jdk().home, env=env)
             # setMakeVar("EXPORT_PATH", jdk)
 
             setMakeVar('MAKE_VERBOSE', 'y' if mx._opts.verbose else '')
@@ -940,7 +985,7 @@
         newestOutput = self.newestOutput()
         for d in ['src', 'make', join('jvmci', 'jdk.internal.jvmci.hotspot', 'src_gen', 'hotspot')]:  # TODO should this be replaced by a dependency to the project?
             for root, dirnames, files in os.walk(join(_suite.dir, d)):
-                # ignore <graal>/src/share/tools
+                # ignore src/share/tools
                 if root == join(_suite.dir, 'src', 'share'):
                     dirnames.remove('tools')
                 for f in (join(root, name) for name in files):
@@ -1010,13 +1055,13 @@
     parser.add_argument('-D', action='append', help='set a HotSpot build variable (run \'mx buildvars\' to list variables)', metavar='name=value')
 
     # initialize jdk
-    get_jvmci_jdk(create=True)
+    get_jvmci_jdk_dir(create=True)
 
     mx.build(['--source', '1.7'] + args, parser=parser)
 
 
-def updateJvmCfg(jdk, vm):
-    jvmCfg = getVmCfgInJdk(jdk)
+def updateJvmCfg(jdkDir, vm):
+    jvmCfg = getVmCfgInJdk(jdkDir)
     if not exists(jvmCfg):
         mx.abort(jvmCfg + ' does not exist')
 
@@ -1042,9 +1087,9 @@
                     continue
                 if not written:
                     f.write(vmKnown)
-                    if vm == 'jvmci':
-                        # Legacy support
-                        f.write('-graal ALIASED_TO -jvmci\n')
+                    for alias, aliased in _vmAliases.iteritems():
+                        if vm == aliased:
+                            f.write('-' + alias + ' ALIASED_TO -' + aliased + '\n')
                     written = True
                 if line.startswith(prefix):
                     line = vmKnown
@@ -1054,61 +1099,15 @@
 
 mx_gate.add_jacoco_includes(['jdk.internal.jvmci.*'])
 
-def parseVmArgs(args, vm=None, cwd=None, vmbuild=None):
-    """run the VM selected by the '--vm' option"""
-
-    if vm is None:
-        vm = get_vm()
-
-    if not isVMSupported(vm):
-        mx.abort('The ' + vm + ' is not supported on this platform')
-
-    if cwd is None:
-        cwd = _vm_cwd
-    elif _vm_cwd is not None and _vm_cwd != cwd:
-        mx.abort("conflicting working directories: do not set --vmcwd for this command")
-
-    build = vmbuild if vmbuild else _vmbuild
-    jdk = get_jvmci_jdk(build, vmToCheck=vm, installJars=False)
-    _updateInstalledJVMCIOptionsFile(jdk)
-    mx.expand_project_in_args(args)
-    if _make_eclipse_launch:
-        mx.make_eclipse_launch(_suite, args, _suite.name + '-' + build, name=None, deps=mx.dependencies())
-    jacocoArgs = mx_gate.get_jacoco_agent_args()
-    if jacocoArgs:
-        args = jacocoArgs + args
-    exe = join(jdk, 'bin', mx.exe_suffix('java'))
-    pfx = _vm_prefix.split() if _vm_prefix is not None else []
-
-    # Support for -G: options
-    jvmciArgs = []
-    nonJvmciArgs = []
-    existingJvmciOptionsProperty = None
-    for a in args:
-        if a.startswith('-G:'):
-            jvmciArg = a[len('-G:'):]
-            assert ' ' not in jvmciArg, 'space not supported in JVMCI arg: ' + a
-            jvmciArgs.append(a[len('-G:'):])
-        else:
-            if a.startswith('-Djvmci.options=') or a == '-Djvmci.options':
-                existingJvmciOptionsProperty = a
-            nonJvmciArgs.append(a)
-    if jvmciArgs:
-        if existingJvmciOptionsProperty:
-            mx.abort('defining jvmci.option property is incompatible with defining one or more -G: options: ' + existingJvmciOptionsProperty)
-        args = ['-Djvmci.options=' + ' '.join(jvmciArgs)] + nonJvmciArgs
-
-    if '-version' in args:
-        ignoredArgs = args[args.index('-version') + 1:]
-        if  len(ignoredArgs) > 0:
-            mx.log("Warning: The following options will be ignored by the vm because they come after the '-version' argument: " + ' '.join(ignoredArgs))
-
-    args = mx.get_jdk().processArgs(args)
-    return (pfx, exe, vm, args, cwd)
-
-def vm(args, vm=None, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=None, vmbuild=None):
-    (pfx_, exe_, vm_, args_, cwd) = parseVmArgs(args, vm, cwd, vmbuild)
-    return mx.run(pfx_ + [exe_, '-' + vm_] + args_, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout)
+def run_vm(args, vm=None, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=None, vmbuild=None):
+    """
+    Runs a Java program by executing the java executable in a JVMCI JDK.
+    """
+    jdkTag = mx.get_jdk_option().tag
+    if jdkTag and jdkTag != _JVMCI_JDK_TAG:
+        mx.abort('The "--jdk" option must have the tag "' + _JVMCI_JDK_TAG + '" when running a command requiring a JVMCI VM')
+    jdk = get_jvmci_jdk(vmbuild=vmbuild)
+    return jdk.run_java(args, vm=vm, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout)
 
 def _unittest_config_participant(config):
     vmArgs, mainClass, mainClassArgs = config
@@ -1130,7 +1129,7 @@
     return config
 
 def _unittest_vm_launcher(vmArgs, mainClass, mainClassArgs):
-    vm(vmArgs + [mainClass] + mainClassArgs)
+    run_vm(vmArgs + [mainClass] + mainClassArgs)
 
 mx_unittest.add_config_participant(_unittest_config_participant)
 mx_unittest.set_vm_launcher('JVMCI VM launcher', _unittest_vm_launcher)
@@ -1158,34 +1157,34 @@
     builds = args.builds.split(',')
 
     allStart = time.time()
-    for v in vms:
-        if not isVMSupported(v):
-            mx.log('The ' + v + ' VM is not supported on this platform - skipping')
+    for vm in vms:
+        if not isVMSupported(vm):
+            mx.log('The ' + vm + ' VM is not supported on this platform - skipping')
             continue
 
         for vmbuild in builds:
-            if v == 'original' and vmbuild != 'product':
+            if vm == 'original' and vmbuild != 'product':
                 continue
             if not args.console:
-                logFile = join(v + '-' + vmbuild + '.log')
+                logFile = join(vm + '-' + vmbuild + '.log')
                 log = open(join(_suite.dir, logFile), 'wb')
                 start = time.time()
-                mx.log('BEGIN: ' + v + '-' + vmbuild + '\t(see: ' + logFile + ')')
+                mx.log('BEGIN: ' + vm + '-' + vmbuild + '\t(see: ' + logFile + ')')
                 verbose = ['-v'] if mx._opts.verbose else []
                 # Run as subprocess so that output can be directed to a file
-                cmd = [sys.executable, '-u', mx.__file__] + verbose + ['--vm', v, '--vmbuild', vmbuild, 'build']
+                cmd = [sys.executable, '-u', mx.__file__] + verbose + ['--vm', vm, '--vmbuild', vmbuild, 'build']
                 mx.logv("executing command: " + str(cmd))
                 subprocess.check_call(cmd, cwd=_suite.dir, stdout=log, stderr=subprocess.STDOUT)
                 duration = datetime.timedelta(seconds=time.time() - start)
-                mx.log('END:   ' + v + '-' + vmbuild + '\t[' + str(duration) + ']')
+                mx.log('END:   ' + vm + '-' + vmbuild + '\t[' + str(duration) + ']')
             else:
-                with VM(v, vmbuild):
+                with VM(vm, vmbuild):
                     build([])
             if not args.no_check:
                 vmargs = ['-version']
-                if v == 'jvmci':
+                if vm == 'jvmci':
                     vmargs.insert(0, '-XX:-BootstrapJVMCI')
-                vm(vmargs, vm=v, vmbuild=vmbuild)
+                run_vm(vmargs, vm=vm, vmbuild=vmbuild)
     allDuration = datetime.timedelta(seconds=time.time() - allStart)
     mx.log('TOTAL TIME:   ' + '[' + str(allDuration) + ']')
 
@@ -1237,7 +1236,7 @@
         del args[0]
 
     for _ in range(count):
-        if not vm(['-XX:-TieredCompilation', '-XX:+DeoptimizeALot', '-XX:+VerifyOops'] + args + ['-version']) == 0:
+        if not run_vm(['-XX:-TieredCompilation', '-XX:+DeoptimizeALot', '-XX:+VerifyOops'] + args + ['-version']) == 0:
             mx.abort("Failed")
 
 def longtests(args):
@@ -1373,13 +1372,16 @@
                     mx.log('Skipping dependency ' + groupId + '.' + artifactId + ' as ' + name + ' cannot be resolved')
                     return
                 if dep.isDistribution():
-                    allDeps = allDeps + [d.name for d in dep.archived_deps() if d.isJavaProject()]
+                    allDeps = allDeps + [d for d in dep.archived_deps() if d.isJavaProject()]
                 else:
-                    allDeps.append(name)
-        d = mx.Distribution(_suite, name=artifactId, subDir=_suite.dir, path=path, sourcesPath=path, deps=allDeps, mainClass=None, excludedLibs=[], distDependencies=[], javaCompliance=None)
+                    allDeps.append(dep)
+        d = mx.JARDistribution(_suite, name=artifactId, subDir=_suite.dir, path=path, sourcesPath=path, deps=allDeps, \
+                               mainClass=None, excludedLibs=[], distDependencies=[], javaCompliance=None, platformDependent=False, theLicense=None)
         d.make_archive()
         env = os.environ.copy()
-        env['JAVA_HOME'] = get_jvmci_jdk(vmToCheck='server')
+        jdkDir = get_jvmci_jdk_dir()
+        check_VM_exists('server', jdkDir)
+        env['JAVA_HOME'] = jdkDir
         env['MAVEN_OPTS'] = '-server -XX:-UseJVMCIClassLoader'
         cmd = ['mvn', 'install:install-file', '-DgroupId=' + groupId, '-DartifactId=' + artifactId,
                '-Dversion=1.0-SNAPSHOT', '-Dpackaging=jar', '-Dfile=' + d.path]
@@ -1436,7 +1438,9 @@
             else:
                 buildOutput.append(x)
         env = os.environ.copy()
-        env['JAVA_HOME'] = get_jvmci_jdk(vmToCheck='server')
+        jdkDir = get_jvmci_jdk_dir()
+        check_VM_exists('server', jdkDir)
+        env['JAVA_HOME'] = jdkDir
         env['MAVEN_OPTS'] = '-server -XX:-UseJVMCIClassLoader'
         mx.log("Building benchmarks...")
         cmd = ['mvn']
@@ -1529,11 +1533,20 @@
 
     for suite in matchedSuites:
         absoluteMicro = os.path.join(jmhPath, suite)
-        (pfx, exe, vm, forkedVmArgs, _) = parseVmArgs(vmArgs)
+        jdk = get_jvmci_jdk()
+        vm = get_vm()
+        pfx = get_vm_prefix()
+        forkedVmArgs = jdk.parseVmArgs(vmArgs)
+        def quoteSpace(s):
+            if " " in s:
+                return '"' + s + '"'
+            return s
+
+        forkedVmArgs = map(quoteSpace, forkedVmArgs)
         if pfx:
             mx.log("JMH ignores prefix: \"" + ' '.join(pfx) + "\"")
         javaArgs = ['-jar', os.path.join(absoluteMicro, "target", "microbenchmarks.jar"),
-                    '--jvm', exe,
+                    '--jvm', jdk.java,
                     '--jvmArgs', ' '.join(["-" + vm] + forkedVmArgs)]
         for k, v in jmhArgs.iteritems():
             javaArgs.append(k)
@@ -1541,46 +1554,6 @@
                 javaArgs.append(str(v))
         mx.run_java(javaArgs + regex, addDefaultArgs=False, cwd=jmhPath)
 
-def microbench(args):
-    """run JMH microbenchmark projects"""
-    vmArgs, jmhArgs = mx.extract_VM_args(args, useDoubleDash=True)
-
-    # look for -f in JMH arguments
-    containsF = False
-    forking = True
-    for i in range(len(jmhArgs)):
-        arg = jmhArgs[i]
-        if arg.startswith('-f'):
-            containsF = True
-            if arg == '-f' and (i+1) < len(jmhArgs):
-                arg += jmhArgs[i+1]
-            try:
-                if int(arg[2:]) == 0:
-                    forking = False
-            except ValueError:
-                pass
-
-    # default to -f1 if not specified otherwise
-    if not containsF:
-        jmhArgs += ['-f1']
-
-    # find all projects with a direct JMH dependency
-    jmhProjects = []
-    for p in mx.projects():
-        if 'JMH' in p.deps:
-            jmhProjects.append(p.name)
-    cp = mx.classpath(jmhProjects)
-
-    # execute JMH runner
-    args = ['-cp', cp]
-    if not forking:
-        args += vmArgs
-    args += ['org.openjdk.jmh.Main']
-    if forking:
-        (_, _, jvm, _, _) = parseVmArgs(vmArgs)
-        args += ['--jvmArgsPrepend', ' '.join(['-' + jvm] + vmArgs)]
-    vm(args + jmhArgs)
-
 def hsdis(args, copyToDir=None):
     """download the hsdis library
 
@@ -1611,7 +1584,7 @@
     if not exists(path):
         sha1 = sha1s[flavoredLib]
         sha1path = path + '.sha1'
-        mx.download_file_with_sha1('hsdis', path, ['http://lafo.ssw.uni-linz.ac.at/hsdis/' + flavoredLib], sha1, sha1path, True, True, sources=False)
+        mx.download_file_with_sha1('hsdis', path, ['https://lafo.ssw.uni-linz.ac.at/pub/hsdis/' + flavoredLib], sha1, sha1path, True, True, sources=False)
     if copyToDir is not None and exists(copyToDir):
         shutil.copy(path, copyToDir)
 
@@ -1676,7 +1649,7 @@
         # mx.findclass can be mistaken, don't give up yet
         candidates = args
 
-    vm(['-javaagent:' + joljar, '-cp', os.pathsep.join([mx.classpath(), joljar]), "org.openjdk.jol.MainObjectInternals"] + candidates)
+    run_vm(['-javaagent:' + joljar, '-cp', os.pathsep.join([mx.classpath(), joljar]), "org.openjdk.jol.MainObjectInternals"] + candidates)
 
 mx.update_commands(_suite, {
     'build': [build, ''],
@@ -1692,7 +1665,7 @@
     'jmh': [jmh, '[VM options] [filters|JMH-args-as-json...]'],
     'makejmhdeps' : [makejmhdeps, ''],
     'shortunittest' : [shortunittest, '[unittest options] [--] [VM options] [filters...]', mx_unittest.unittestHelpSuffix],
-    'vm': [vm, '[-options] class [args...]'],
+    'vm': [run_vm, '[-options] class [args...]'],
     'deoptalot' : [deoptalot, '[n]'],
     'longtests' : [longtests, ''],
     'jol' : [jol, ''],
@@ -1704,7 +1677,7 @@
                 'The VM selected by --vm and --vmbuild options is under this directory (i.e., ' +
                 join('<path>', '<jdk-version>', '<vmbuild>', 'jre', 'lib', '<vm>', mx.add_lib_prefix(mx.add_lib_suffix('jvm'))) + ')', default=None, metavar='<path>')
 
-mx.add_argument('--vm', action='store', dest='vm', choices=_vmChoices.keys(), help='the VM type to build/run')
+mx.add_argument('--vm', action='store', dest='vm', choices=_vmChoices.keys() + _vmAliases.keys(), help='the VM type to build/run')
 mx.add_argument('--vmbuild', action='store', dest='vmbuild', choices=_vmbuildChoices, help='the VM build to build/run (default: ' + _vmbuildChoices[0] + ')')
 mx.add_argument('--ecl', action='store_true', dest='make_eclipse_launch', help='create launch configuration for running VM execution(s) in Eclipse')
 mx.add_argument('--vmprefix', action='store', dest='vm_prefix', help='prefix for running the VM (e.g. "/usr/bin/gdb --args")', metavar='<prefix>')
@@ -1719,7 +1692,6 @@
     def __opened__(self, arc, srcArc, services):
         self.services = services
         self.arc = arc
-        self.expectedOptionsProviders = set()
 
     def __add__(self, arcname, contents):
         if arcname.startswith('META-INF/jvmci.services/'):
@@ -1731,13 +1703,11 @@
             for service in contents.split(os.linesep):
                 self.jvmciServices.setdefault(service, []).append(provider)
             return True
-        elif arcname.startswith('META-INF/jvmci.options/'):
+        elif arcname.endswith('_OptionDescriptors.class'):
             # Need to create service files for the providers of the
             # jdk.internal.jvmci.options.Options service created by
             # jdk.internal.jvmci.options.processor.OptionProcessor.
-            optionsOwner = arcname[len('META-INF/jvmci.options/'):]
-            provider = optionsOwner + '_OptionDescriptors'
-            self.expectedOptionsProviders.add(provider.replace('.', '/') + '.class')
+            provider = arcname[:-len('.class'):].replace('/', '.')
             self.services.setdefault('jdk.internal.jvmci.options.OptionDescriptors', []).append(provider)
         return False
 
@@ -1745,29 +1715,142 @@
         return False
 
     def __closing__(self):
-        self.expectedOptionsProviders -= set(self.arc.zf.namelist())
-        assert len(self.expectedOptionsProviders) == 0, 'missing generated Options providers:\n  ' + '\n  '.join(self.expectedOptionsProviders)
         for service, providers in self.jvmciServices.iteritems():
             arcname = 'META-INF/jvmci.services/' + service
             # Convert providers to a set before printing to remove duplicates
             self.arc.zf.writestr(arcname, '\n'.join(frozenset(providers))+ '\n')
 
+_jvmci_bootstrap_jdk = None
+
+def get_jvmci_bootstrap_jdk():
+    """
+    Gets the JDK from which a JVMCI JDK is created.
+    """
+    global _jvmci_bootstrap_jdk
+    if not _jvmci_bootstrap_jdk:
+        def _versionCheck(version):
+            return version >= _minVersion and (not _untilVersion or version >= _untilVersion)
+        versionDesc = ">=" + str(_minVersion)
+        if _untilVersion:
+            versionDesc += " and <=" + str(_untilVersion)
+        _jvmci_bootstrap_jdk = mx.get_jdk(_versionCheck, versionDescription=versionDesc, tag='default')
+    return _jvmci_bootstrap_jdk
+
+_jvmci_bootclasspath_prepends = []
+
+def add_bootclasspath_prepend(dep):
+    assert isinstance(dep, mx.ClasspathDependency)
+    _jvmci_bootclasspath_prepends.append(dep)
+
+class JVMCIJDKConfig(mx.JDKConfig):
+    def __init__(self, vmbuild):
+        # Ignore the deployable distributions here - they are only deployed during building.
+        # This significantly reduces the latency of the "mx java" command.
+        self.vmbuild = vmbuild
+        jdkDir = get_jvmci_jdk_dir(build=self.vmbuild, create=True, deployDists=False)
+        mx.JDKConfig.__init__(self, jdkDir, tag=_JVMCI_JDK_TAG)
+
+    def parseVmArgs(self, args, addDefaultArgs=True):
+        args = mx.expand_project_in_args(args, insitu=False)
+        jacocoArgs = mx_gate.get_jacoco_agent_args()
+        if jacocoArgs:
+            args = jacocoArgs + args
+
+        # Support for -G: options
+        jvmciArgs = []
+        nonJvmciArgs = []
+        existingJvmciOptionsProperty = None
+        for a in args:
+            if a.startswith('-G:'):
+                # Escape space with % and % with %%
+                jvmciArg = a[len('-G:'):].replace('%', '%%').replace(' ', '% ')
+                jvmciArgs.append(jvmciArg)
+            else:
+                if a.startswith('-Djvmci.options=') or a == '-Djvmci.options':
+                    existingJvmciOptionsProperty = a
+                nonJvmciArgs.append(a)
+        if jvmciArgs:
+            if existingJvmciOptionsProperty:
+                mx.abort('defining jvmci.option property is incompatible with defining one or more -G: options: ' + existingJvmciOptionsProperty)
+            args = ['-Djvmci.options=' + ' '.join(jvmciArgs)] + nonJvmciArgs
+
+        args = ['-Xbootclasspath/p:' + dep.classpath_repr() for dep in _jvmci_bootclasspath_prepends] + args
+
+        if '-version' in args:
+            ignoredArgs = args[args.index('-version') + 1:]
+            if  len(ignoredArgs) > 0:
+                mx.log("Warning: The following options will be ignored by the vm because they come after the '-version' argument: " + ' '.join(ignoredArgs))
+        return self.processArgs(args, addDefaultArgs=addDefaultArgs)
+
+    # Overrides JDKConfig
+    def run_java(self, args, vm=None, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=None, env=None, addDefaultArgs=True):
+        if vm is None:
+            vm = get_vm()
+
+        if not isVMSupported(vm):
+            mx.abort('The ' + vm + ' is not supported on this platform')
+
+        if cwd is None:
+            cwd = _vm_cwd
+        elif _vm_cwd is not None and _vm_cwd != cwd:
+            mx.abort("conflicting working directories: do not set --vmcwd for this command")
+
+        _updateInstalledJVMCIOptionsFile(self.home)
+
+        args = self.parseVmArgs(args, addDefaultArgs=addDefaultArgs)
+        if _make_eclipse_launch:
+            mx.make_eclipse_launch(_suite, args, _suite.name + '-' + build, name=None, deps=mx.dependencies())
+
+        pfx = _vm_prefix.split() if _vm_prefix is not None else []
+        cmd = pfx + [self.java] + ['-' + vm] + args
+        return mx.run(cmd, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd)
+
+"""
+The dict of JVMCI JDKs indexed by vmbuild names.
+"""
+_jvmci_jdks = {}
+
+def get_jvmci_jdk(vmbuild=None):
+    """
+    Gets the JVMCI JDK corresponding to 'vmbuild'.
+    """
+    if not vmbuild:
+        vmbuild = _vmbuild
+    jdk = _jvmci_jdks.get(vmbuild)
+    if jdk is None:
+        jdk = JVMCIJDKConfig(vmbuild)
+        _jvmci_jdks[vmbuild] = jdk
+    return jdk
+
+class JVMCIJDKFactory(mx.JDKFactory):
+    def getJDKConfig(self):
+        jdk = get_jvmci_jdk(_vmbuild)
+        check_VM_exists(get_vm(), jdk.home)
+        return jdk
+
+    def description(self):
+        return "JVMCI JDK"
+
 def mx_post_parse_cmd_line(opts):
-    # TODO _minVersion check could probably be part of a Suite in mx?
-    def _versionCheck(version):
-        return version >= _minVersion and (not _untilVersion or version >= _untilVersion)
-    versionDesc = ">=" + str(_minVersion)
-    if _untilVersion:
-        versionDesc += " and <=" + str(_untilVersion)
-    mx.get_jdk(_versionCheck, versionDescription=versionDesc, defaultJdk=True)
+    mx.addJDKFactory(_JVMCI_JDK_TAG, mx.JavaCompliance('8'), JVMCIJDKFactory())
+    mx.set_java_command_default_jdk_tag(_JVMCI_JDK_TAG)
 
+    # Execute for the side-effect of checking that the
+    # boot strap JDK has a compatible version
+    get_jvmci_bootstrap_jdk()
+
+    jdkTag = mx.get_jdk_option().tag
     if hasattr(opts, 'vm') and opts.vm is not None:
         global _vm
-        _vm = opts.vm
-        _vm = _vm.replace('graal', 'jvmci')
+        _vm = dealiased_vm(opts.vm)
+        if jdkTag and jdkTag != _JVMCI_JDK_TAG:
+            mx.warn('Ignoring "--vm" option as "--jdk" tag is not "' + _JVMCI_JDK_TAG + '"')
     if hasattr(opts, 'vmbuild') and opts.vmbuild is not None:
         global _vmbuild
         _vmbuild = opts.vmbuild
+        if jdkTag and jdkTag != _JVMCI_JDK_TAG:
+            mx.warn('Ignoring "--vmbuild" option as "--jdk" tag is not "' + _JVMCI_JDK_TAG + '"')
+
     global _make_eclipse_launch
     _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False)
     global _vm_cwd
--- a/mx.jvmci/mx_jvmci_makefile.py	Tue Sep 15 18:12:33 2015 -0700
+++ b/mx.jvmci/mx_jvmci_makefile.py	Tue Sep 15 18:13:11 2015 -0700
@@ -193,16 +193,15 @@
     $(QUIETLY) test ! -f $(vmconfig) || (mkdir -p $(vmconfigDest) && cp $(vmconfig) $(vmconfigDest))
 endef
 
-# Reads the files in jvmci.options/ created by OptionProcessor (the processor for the @Option annotation)
-# and appends to services/jdk.internal.jvmci.options.Options entries for the providers
-# also created by the same processor.
+# Finds the *_OptionsDescriptors classes created by OptionProcessor (the processor for the @Option annotation)
+# and appends their names to services/jdk.internal.jvmci.options.OptionDescriptors.
 # Arguments:
 #  1: directory with contents of the JAR file
 define process_options
-    $(eval options := $(1)/$(OPTIONS_INF))
     $(eval services := $(1)/META-INF/services)
     $(QUIETLY) test -d $(services) || mkdir -p $(services)
-    $(QUIETLY) test ! -d $(options) || (cd $(options) && for i in $$(ls); do echo $${i}_OptionDescriptors >> $(abspath $(services))/jdk.internal.jvmci.options.Options; done)
+    $(eval optionDescriptors := $(1)/META-INF/services/jdk.internal.jvmci.options.OptionDescriptors)
+    $(QUIETLY) cd $(1) && for i in $$(find . -name '*_OptionDescriptors.class' 2>/dev/null); do echo $${i} | sed 's:\\./\\(.*\\)\\.class:\\1:g' | tr '/' '.' >> $(abspath $(optionDescriptors)); done
 endef
 
 # Extracts META-INF/jvmci.services from a JAR file into a given directory
--- a/mx.jvmci/suite.py	Tue Sep 15 18:12:33 2015 -0700
+++ b/mx.jvmci/suite.py	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 suite = {
-  "mxversion" : "5.3.3",
+  "mxversion" : "5.5.1",
   "name" : "jvmci",
   "url" : "http://openjdk.java.net/projects/graal",
   "developer" : {
@@ -10,7 +10,7 @@
   },
   "repositories" : {
     "lafo-snapshots" : {
-      "url" : "http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots",
+      "url" : "https://curio.ssw.jku.at/nexus/content/repositories/snapshots",
       "licenses" : ["GPLv2-CPE", "UPL"]
     },
   },
@@ -32,7 +32,7 @@
 
     "HCFDIS" : {
       "path" : "lib/hcfdis-3.jar",
-      "urls" : ["http://lafo.ssw.uni-linz.ac.at/hcfdis-3.jar"],
+      "urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/hcfdis-3.jar"],
       "sha1" : "a71247c6ddb90aad4abf7c77e501acc60674ef57",
     },
 
@@ -44,14 +44,14 @@
 
     "JOL_INTERNALS" : {
       "path" : "lib/jol-internals.jar",
-      "urls" : ["http://lafo.ssw.uni-linz.ac.at/truffle/jol/jol-internals.jar"],
+      "urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/truffle/jol/jol-internals.jar"],
       "sha1" : "508bcd26a4d7c4c44048990c6ea789a3b11a62dc",
     },
 
     "BATIK" : {
       "path" : "lib/batik-all-1.7.jar",
       "sha1" : "122b87ca88e41a415cf8b523fd3d03b4325134a3",
-      "urls" : ["http://lafo.ssw.uni-linz.ac.at/graal-external-deps/batik-all-1.7.jar"],
+      "urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/batik-all-1.7.jar"],
     },
   },
 
--- a/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -24,7 +24,7 @@
 #include "jvmci/jvmciCodeInstaller.hpp"
 #include "jvmci/jvmciRuntime.hpp"
 #include "jvmci/jvmciCompilerToVM.hpp"
-#include "jvmci/jvmciJavaAccess.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
 #include "vmreg_sparc.inline.hpp"
 
 jint CodeInstaller::pd_next_offset(NativeInstruction* inst, jint pc_offset, oop method) {
--- a/src/cpu/sparc/vm/jvmciGlobals_sparc.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, 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.
- *
- */
-
-#ifndef CPU_SPARC_VM_JVMCIGLOBALS_SPARC_HPP
-#define CPU_SPARC_VM_JVMCIGLOBALS_SPARC_HPP
-
-#include "utilities/globalDefinitions.hpp"
-#include "utilities/macros.hpp"
-
-// Sets the default values for platform dependent flags used by the JVMCI compiler.
-// (see jvmciGlobals.hpp)
-
-#ifdef COMPILERJVMCI
-define_pd_global(bool, BackgroundCompilation,        true );
-define_pd_global(bool, UseTLAB,                      true );
-define_pd_global(bool, ResizeTLAB,                   true );
-define_pd_global(bool, InlineIntrinsics,             true );
-define_pd_global(bool, PreferInterpreterNativeStubs, false);
-define_pd_global(bool, TieredCompilation,            trueInTiered);
-define_pd_global(intx, BackEdgeThreshold,            100000);
-
-define_pd_global(intx, OnStackReplacePercentage,     933  );
-define_pd_global(intx, FreqInlineSize,               325  );
-define_pd_global(intx, NewSizeThreadIncrease,        4*K  );
-define_pd_global(uintx,MetaspaceSize,                12*M );
-define_pd_global(bool, NeverActAsServerClassMachine, false);
-define_pd_global(uint64_t,MaxRAM,                    128ULL*G);
-define_pd_global(bool, CICompileOSR,                 true );
-define_pd_global(bool, ProfileTraps,                 true );
-define_pd_global(bool, UseOnStackReplacement,        true );
-define_pd_global(intx, CompileThreshold,             10000);
-define_pd_global(intx, InitialCodeCacheSize,         16*M );
-define_pd_global(intx, ReservedCodeCacheSize,        64*M );
-define_pd_global(bool, ProfileInterpreter,           true );
-define_pd_global(intx, CodeCacheExpansionSize,       64*K );
-define_pd_global(uintx,CodeCacheMinBlockLength,      4);
-define_pd_global(uintx, CodeCacheMinimumUseSpace,    400*K);
-define_pd_global(intx, TypeProfileWidth,             8);
-define_pd_global(intx, MethodProfileWidth,           0);
-#endif // COMPILERJVMCI
-
-define_pd_global(intx, MaxVectorSize,                8);
-
-#endif // CPU_SPARC_VM_JVMCIGLOBALS_SPARC_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cpu/sparc/vm/jvmci_globals_sparc.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2000, 2012, 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.
+ *
+ */
+
+#ifndef CPU_SPARC_VM_JVMCI_GLOBALS_SPARC_HPP
+#define CPU_SPARC_VM_JVMCI_GLOBALS_SPARC_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
+// Sets the default values for platform dependent flags used by the JVMCI compiler.
+// (see jvmci_globals.hpp)
+
+#ifdef COMPILERJVMCI
+define_pd_global(bool, BackgroundCompilation,        true );
+define_pd_global(bool, UseTLAB,                      true );
+define_pd_global(bool, ResizeTLAB,                   true );
+define_pd_global(bool, InlineIntrinsics,             true );
+define_pd_global(bool, PreferInterpreterNativeStubs, false);
+define_pd_global(bool, TieredCompilation,            trueInTiered);
+define_pd_global(intx, BackEdgeThreshold,            100000);
+
+define_pd_global(intx, OnStackReplacePercentage,     933  );
+define_pd_global(intx, FreqInlineSize,               325  );
+define_pd_global(intx, NewSizeThreadIncrease,        4*K  );
+define_pd_global(uintx,MetaspaceSize,                12*M );
+define_pd_global(bool, NeverActAsServerClassMachine, false);
+define_pd_global(uint64_t,MaxRAM,                    128ULL*G);
+define_pd_global(bool, CICompileOSR,                 true );
+define_pd_global(bool, ProfileTraps,                 true );
+define_pd_global(bool, UseOnStackReplacement,        true );
+define_pd_global(intx, CompileThreshold,             10000);
+define_pd_global(intx, InitialCodeCacheSize,         16*M );
+define_pd_global(intx, ReservedCodeCacheSize,        64*M );
+define_pd_global(bool, ProfileInterpreter,           true );
+define_pd_global(intx, CodeCacheExpansionSize,       64*K );
+define_pd_global(uintx,CodeCacheMinBlockLength,      4);
+define_pd_global(uintx, CodeCacheMinimumUseSpace,    400*K);
+define_pd_global(intx, TypeProfileWidth,             8);
+define_pd_global(intx, MethodProfileWidth,           0);
+#endif // COMPILERJVMCI
+
+define_pd_global(intx, MaxVectorSize,                8);
+
+#endif // CPU_SPARC_VM_JVMCI_GLOBALS_SPARC_HPP
--- a/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -44,7 +44,7 @@
 #include "shark/sharkCompiler.hpp"
 #endif
 #if INCLUDE_JVMCI
-#include "jvmci/jvmciJavaAccess.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
 #endif
 
 #define __ masm->
@@ -3469,10 +3469,10 @@
   }
 #endif
 #if INCLUDE_JVMCI
-  pad += 1000; // Increase the buffer size when compiling for JVMCI
+  pad += 512; // Increase the buffer size when compiling for JVMCI
 #endif
 #ifdef _LP64
-  CodeBuffer buffer("deopt_blob", 2100+pad+1000, 512);
+  CodeBuffer buffer("deopt_blob", 2100+pad, 512);
 #else
   // Measured 8/7/03 at 1212 in 32bit debug build (no VerifyThread)
   // Measured 8/7/03 at 1396 in 32bit debug build (VerifyThread)
@@ -3539,25 +3539,21 @@
 
 
 #if INCLUDE_JVMCI
-  masm->block_comment("BEGIN JVMCI");
+  masm->block_comment("BEGIN implicit_exception_uncommon_trap");
   int implicit_exception_uncommon_trap_offset = __ offset() - start;
   __ ld_ptr(G2_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset()), O7);
-  DEBUG_ONLY(__ st(G0, Address(G2_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));)
+  __ st_ptr(G0, Address(G2_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
   __ add(O7, -8, O7);
 
   int uncommon_trap_offset = __ offset() - start;
 
   // Save everything in sight.
-  masm->block_comment("save_live_regs");
   (void) RegisterSaver::save_live_registers(masm, 0, &frame_size_words);
-  masm->block_comment("/save_live_regs");
-  masm->block_comment("set_last_java_frame");
   __ set_last_Java_frame(SP, NULL);
-  masm->block_comment("/set_last_java_frame");
 
   __ ld(G2_thread, in_bytes(JavaThread::pending_deoptimization_offset()), O1);
   __ sub(G0, 1, L1);
-  __ st_ptr(L1, G2_thread, in_bytes(JavaThread::pending_deoptimization_offset()));
+  __ st(L1, G2_thread, in_bytes(JavaThread::pending_deoptimization_offset()));
 
   __ mov((int32_t)Deoptimization::Unpack_reexecute, L0deopt_mode);
   __ mov(G2_thread, O0);
@@ -3571,7 +3567,7 @@
   Label after_fetch_unroll_info_call;
   __ ba(after_fetch_unroll_info_call);
   __ delayed()->nop(); // Delay slot
-  masm->block_comment("END JVMCI");
+  masm->block_comment("END implicit_exception_uncommon_trap");
 #endif // INCLUDE_JVMCI
 
   int exception_offset = __ offset() - start;
--- a/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -207,8 +207,6 @@
   // Check if we need to take lock at entry of synchronized method.
   {
     Label L;
-
-    //__ cmp(, 0);
     Address pending_monitor_enter_addr(G2_thread, JavaThread::pending_monitorenter_offset());
     __ ldbool(pending_monitor_enter_addr, Gtemp);  // Load if pending monitor enter
     __ cmp_and_br_short(Gtemp, G0, Assembler::equal, Assembler::pn, L);
@@ -1723,12 +1721,8 @@
       // make sure I5_savedSP and the entry frames notion of saved SP
       // agree.  This assertion duplicate a check in entry frame code
       // but catches the failure earlier.
-      /*
-       * Sanzinger: This does not make sense to me, since when we call stub_call -> i2c, the i2c may change the
-       * sp, which then is not in sync with Lscratch anymore.
-       */
-      /*assert(*caller->register_addr(Lscratch) == *interpreter_frame->register_addr(I5_savedSP),
-             "would change callers SP");*/
+      assert(*caller->register_addr(Lscratch) == *interpreter_frame->register_addr(I5_savedSP),
+             "would change callers SP");
     }
     if (caller->is_entry_frame()) {
       tty->print("entry ");
--- a/src/cpu/x86/vm/c2_globals_x86.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/cpu/x86/vm/c2_globals_x86.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -86,11 +86,7 @@
 define_pd_global(bool, OptoScheduling,               false);
 define_pd_global(bool, OptoBundling,                 false);
 
-#if INCLUDE_JVMCI
-define_pd_global(intx, ReservedCodeCacheSize,        64*M);
-#else
 define_pd_global(intx, ReservedCodeCacheSize,        48*M);
-#endif
 define_pd_global(uintx, CodeCacheMinBlockLength,     4);
 define_pd_global(uintx, CodeCacheMinimumUseSpace,    400*K);
 
--- a/src/cpu/x86/vm/jvmciCodeInstaller_x86.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/cpu/x86/vm/jvmciCodeInstaller_x86.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -26,7 +26,7 @@
 #include "runtime/javaCalls.hpp"
 #include "jvmci/jvmciEnv.hpp"
 #include "jvmci/jvmciCodeInstaller.hpp"
-#include "jvmci/jvmciJavaAccess.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
 #include "jvmci/jvmciCompilerToVM.hpp"
 #include "jvmci/jvmciRuntime.hpp"
 #include "asm/register.hpp"
--- a/src/cpu/x86/vm/jvmciGlobals_x86.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, 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.
- *
- */
-
-#ifndef CPU_X86_VM_JVMCIGLOBALS_X86_HPP
-#define CPU_X86_VM_JVMCIGLOBALS_X86_HPP
-
-#include "utilities/globalDefinitions.hpp"
-#include "utilities/macros.hpp"
-
-// Sets the default values for platform dependent flags used by the JVMCI compiler.
-// (see jvmciGlobals.hpp)
-
-#ifdef COMPILERJVMCI
-define_pd_global(bool, BackgroundCompilation,        true );
-define_pd_global(bool, UseTLAB,                      true );
-define_pd_global(bool, ResizeTLAB,                   true );
-define_pd_global(bool, InlineIntrinsics,             true );
-define_pd_global(bool, PreferInterpreterNativeStubs, false);
-define_pd_global(bool, TieredCompilation,            trueInTiered);
-define_pd_global(intx, BackEdgeThreshold,            100000);
-
-define_pd_global(intx, OnStackReplacePercentage,     933  );
-define_pd_global(intx, FreqInlineSize,               325  );
-define_pd_global(intx, NewSizeThreadIncrease,        4*K  );
-define_pd_global(uintx,MetaspaceSize,                12*M );
-define_pd_global(bool, NeverActAsServerClassMachine, false);
-define_pd_global(uint64_t,MaxRAM,                    128ULL*G);
-define_pd_global(bool, CICompileOSR,                 true );
-define_pd_global(bool, ProfileTraps,                 true );
-define_pd_global(bool, UseOnStackReplacement,        true );
-define_pd_global(intx, CompileThreshold,             10000);
-define_pd_global(intx, InitialCodeCacheSize,         16*M );
-define_pd_global(intx, ReservedCodeCacheSize,        64*M );
-define_pd_global(bool, ProfileInterpreter,           true );
-define_pd_global(intx, CodeCacheExpansionSize,       64*K );
-define_pd_global(uintx,CodeCacheMinBlockLength,      4);
-define_pd_global(uintx, CodeCacheMinimumUseSpace,    400*K);
-define_pd_global(intx, TypeProfileWidth,             8);
-define_pd_global(intx, MethodProfileWidth,           0);
-#endif // COMPILERJVMCI
-
-define_pd_global(intx, MaxVectorSize,                32);
-
-#endif // CPU_X86_VM_JVMCIGLOBALS_X86_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cpu/x86/vm/jvmci_globals_x86.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2000, 2012, 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.
+ *
+ */
+
+#ifndef CPU_X86_VM_JVMCI_GLOBALS_X86_HPP
+#define CPU_X86_VM_JVMCI_GLOBALS_X86_HPP
+
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/macros.hpp"
+
+// Sets the default values for platform dependent flags used by the JVMCI compiler.
+// (see jvmci_globals.hpp)
+
+#ifdef COMPILERJVMCI
+define_pd_global(bool, BackgroundCompilation,        true );
+define_pd_global(bool, UseTLAB,                      true );
+define_pd_global(bool, ResizeTLAB,                   true );
+define_pd_global(bool, InlineIntrinsics,             true );
+define_pd_global(bool, PreferInterpreterNativeStubs, false);
+define_pd_global(bool, TieredCompilation,            trueInTiered);
+define_pd_global(intx, BackEdgeThreshold,            100000);
+
+define_pd_global(intx, OnStackReplacePercentage,     933  );
+define_pd_global(intx, FreqInlineSize,               325  );
+define_pd_global(intx, NewSizeThreadIncrease,        4*K  );
+define_pd_global(uintx,MetaspaceSize,                12*M );
+define_pd_global(bool, NeverActAsServerClassMachine, false);
+define_pd_global(uint64_t,MaxRAM,                    128ULL*G);
+define_pd_global(bool, CICompileOSR,                 true );
+define_pd_global(bool, ProfileTraps,                 true );
+define_pd_global(bool, UseOnStackReplacement,        true );
+define_pd_global(intx, CompileThreshold,             10000);
+define_pd_global(intx, InitialCodeCacheSize,         16*M );
+define_pd_global(intx, ReservedCodeCacheSize,        64*M );
+define_pd_global(bool, ProfileInterpreter,           true );
+define_pd_global(intx, CodeCacheExpansionSize,       64*K );
+define_pd_global(uintx,CodeCacheMinBlockLength,      4);
+define_pd_global(uintx, CodeCacheMinimumUseSpace,    400*K);
+define_pd_global(intx, TypeProfileWidth,             8);
+define_pd_global(intx, MethodProfileWidth,           0);
+#endif // COMPILERJVMCI
+
+define_pd_global(intx, MaxVectorSize,                32);
+
+#endif // CPU_X86_VM_JVMCI_GLOBALS_X86_HPP
--- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -41,7 +41,7 @@
 #include "opto/runtime.hpp"
 #endif
 #if INCLUDE_JVMCI
-#include "jvmci/jvmciJavaAccess.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
 #endif
 
 #define __ masm->
@@ -3397,7 +3397,7 @@
   int implicit_exception_uncommon_trap_offset = __ pc() - start;
 
   __ pushptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())));
-  DEBUG_ONLY(__ movptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())), (int32_t)NULL_WORD);)
+  __ movptr(Address(r15_thread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset())), (int32_t)NULL_WORD);
 
   int uncommon_trap_offset = __ pc() - start;
 
--- a/src/os/bsd/vm/os_bsd.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/os/bsd/vm/os_bsd.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -3834,11 +3834,6 @@
   return fetcher.result();
 }
 
-address os::get_pc(void* context) {
-  ucontext_t *uc = (ucontext_t*)context;
-  return os::Bsd::ucontext_get_pc(uc);
-}
-
 int os::Bsd::safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime)
 {
   return pthread_cond_timedwait(_cond, _mutex, _abstime);
--- a/src/os/linux/vm/os_linux.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/os/linux/vm/os_linux.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -5031,11 +5031,6 @@
   return fetcher.result();
 }
 
-address os::get_pc(void* context) {
-  ucontext_t *uc = (ucontext_t*)context;
-  return os::Linux::ucontext_get_pc(uc);
-}
-
 int os::Linux::safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime)
 {
    if (is_NPTL()) {
--- a/src/os/solaris/vm/os_solaris.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/os/solaris/vm/os_solaris.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -4265,11 +4265,6 @@
   return fetcher.result();
 }
 
-address os::get_pc(void* context) {
-  ucontext_t *uc = (ucontext_t*)context;
-  return os::Solaris::ucontext_get_pc(uc);
-}
-
 // This does not do anything on Solaris. This is basically a hook for being
 // able to use structured exception handling (thread-local exception filters) on, e.g., Win32.
 void os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread) {
--- a/src/os/windows/vm/os_windows.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/os/windows/vm/os_windows.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -3710,16 +3710,6 @@
 #endif
 }
 
-address os::get_pc(void* context) {
-  CONTEXT* uc = (CONTEXT*)context;
-#ifdef _M_AMD64
-  return (address) uc->Rip;
-#else
-  return (address) uc->Eip;
-#endif
-}
-
-
 // GetCurrentThreadId() returns DWORD
 intx os::current_thread_id()          { return GetCurrentThreadId(); }
 
--- a/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -484,15 +484,6 @@
       }
 #endif  // COMPILER2
 
-#if INCLUDE_JVMCI
-      else if (sig == SIGILL && info->si_trapno == 0x100 + ST_RESERVED_FOR_USER_0) {
-        printf("SIGILL 0x%x 0x%x\n", info->si_trapno, ST_RESERVED_FOR_USER_0);
-        uc->uc_mcontext.gregs[REG_PC] = (greg_t)pc+4;
-        uc->uc_mcontext.gregs[REG_nPC] = (greg_t)npc + 4;
-        return true;
-      }
-#endif
-
       else if (sig == SIGSEGV && info->si_code > 0 && !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
         // Determination of interpreter/vtable stub/compiled code null exception
         stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
--- a/src/share/vm/classfile/classFileParser.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/classfile/classFileParser.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -4215,10 +4215,6 @@
         tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
                    InstanceKlass::cast(class_loader->klass())->external_name());
       }
-      if (WizardMode) {
-        // useful when investigating why a class is loaded
-        JavaThread::current()->print_stack_on(tty);
-      }
     }
 
     if (TraceClassResolution) {
--- a/src/share/vm/classfile/javaClasses.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/classfile/javaClasses.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -154,7 +154,7 @@
       return java_string->int_field(count_offset);
     } else {
       typeArrayOop value_array = ((typeArrayOop)java_string->obj_field(value_offset));
-      if(value_array == NULL) {
+      if (value_array == NULL) {
         return 0;
       } else {
         return value_array->length();
--- a/src/share/vm/classfile/systemDictionary.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/classfile/systemDictionary.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -33,6 +33,7 @@
 #include "runtime/reflectionUtils.hpp"
 #include "utilities/hashtable.hpp"
 #include "utilities/hashtable.inline.hpp"
+#include "jvmci/systemDictionary_jvmci.hpp"
 
 
 // The system dictionary stores all loaded classes and maps:
@@ -196,56 +197,8 @@
   do_klass(Integer_klass,                               java_lang_Integer,                         Pre                 ) \
   do_klass(Long_klass,                                  java_lang_Long,                            Pre                 ) \
                                                                                                                          \
-  /* JVMCI classes. These are loaded on-demand. */                                                                                   \
-  JVMCI_ONLY(do_klass(HotSpotCompiledCode_klass,             jdk_internal_jvmci_hotspot_HotSpotCompiledCode,                 Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotCompiledCode_Comment_klass,     jdk_internal_jvmci_hotspot_HotSpotCompiledCode_Comment,         Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotCompiledNmethod_klass,          jdk_internal_jvmci_hotspot_HotSpotCompiledNmethod,              Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotForeignCallTarget_klass,        jdk_internal_jvmci_hotspot_HotSpotForeignCallTarget,            Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotReferenceMap_klass,             jdk_internal_jvmci_hotspot_HotSpotReferenceMap,                 Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotInstalledCode_klass,            jdk_internal_jvmci_hotspot_HotSpotInstalledCode,                Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotNmethod_klass,                  jdk_internal_jvmci_hotspot_HotSpotNmethod,                      Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotResolvedJavaMethodImpl_klass,   jdk_internal_jvmci_hotspot_HotSpotResolvedJavaMethodImpl,       Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotResolvedObjectTypeImpl_klass,   jdk_internal_jvmci_hotspot_HotSpotResolvedObjectTypeImpl,       Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotCompressedNullConstant_klass,   jdk_internal_jvmci_hotspot_HotSpotCompressedNullConstant,       Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotObjectConstantImpl_klass,       jdk_internal_jvmci_hotspot_HotSpotObjectConstantImpl,           Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotMetaspaceConstantImpl_klass,    jdk_internal_jvmci_hotspot_HotSpotMetaspaceConstantImpl,        Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotStackFrameReference_klass,      jdk_internal_jvmci_hotspot_HotSpotStackFrameReference,          Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotConstantPool_klass,             jdk_internal_jvmci_hotspot_HotSpotConstantPool,                 Jvmci)) \
-  JVMCI_ONLY(do_klass(HotSpotJVMCIMetaAccessContext_klass,   jdk_internal_jvmci_hotspot_HotSpotJVMCIMetaAccessContext,       Jvmci)) \
-  JVMCI_ONLY(do_klass(Assumptions_ConcreteMethod_klass,      jdk_internal_jvmci_meta_Assumptions_ConcreteMethod,             Jvmci)) \
-  JVMCI_ONLY(do_klass(Assumptions_NoFinalizableSubclass_klass, jdk_internal_jvmci_meta_Assumptions_NoFinalizableSubclass,    Jvmci)) \
-  JVMCI_ONLY(do_klass(Assumptions_ConcreteSubtype_klass,     jdk_internal_jvmci_meta_Assumptions_ConcreteSubtype,            Jvmci)) \
-  JVMCI_ONLY(do_klass(Assumptions_LeafType_klass,            jdk_internal_jvmci_meta_Assumptions_LeafType,                   Jvmci)) \
-  JVMCI_ONLY(do_klass(Assumptions_CallSiteTargetValue_klass, jdk_internal_jvmci_meta_Assumptions_CallSiteTargetValue,        Jvmci)) \
-  JVMCI_ONLY(do_klass(BytecodePosition_klass,                jdk_internal_jvmci_code_BytecodePosition,                       Jvmci)) \
-  JVMCI_ONLY(do_klass(DebugInfo_klass,                       jdk_internal_jvmci_code_DebugInfo,                              Jvmci)) \
-  JVMCI_ONLY(do_klass(RegisterSaveLayout_klass,              jdk_internal_jvmci_code_RegisterSaveLayout,                     Jvmci)) \
-  JVMCI_ONLY(do_klass(BytecodeFrame_klass,                   jdk_internal_jvmci_code_BytecodeFrame,                          Jvmci)) \
-  JVMCI_ONLY(do_klass(CompilationResult_Call_klass,          jdk_internal_jvmci_code_CompilationResult_Call,                 Jvmci)) \
-  JVMCI_ONLY(do_klass(CompilationResult_ConstantReference_klass, jdk_internal_jvmci_code_CompilationResult_ConstantReference, Jvmci)) \
-  JVMCI_ONLY(do_klass(CompilationResult_DataPatch_klass,     jdk_internal_jvmci_code_CompilationResult_DataPatch,            Jvmci)) \
-  JVMCI_ONLY(do_klass(CompilationResult_DataSectionReference_klass, jdk_internal_jvmci_code_CompilationResult_DataSectionReference, Jvmci)) \
-  JVMCI_ONLY(do_klass(CompilationResult_ExceptionHandler_klass, jdk_internal_jvmci_code_CompilationResult_ExceptionHandler,  Jvmci))\
-  JVMCI_ONLY(do_klass(CompilationResult_Mark_klass,          jdk_internal_jvmci_code_CompilationResult_Mark,                 Jvmci)) \
-  JVMCI_ONLY(do_klass(CompilationResult_Infopoint_klass,     jdk_internal_jvmci_code_CompilationResult_Infopoint,            Jvmci)) \
-  JVMCI_ONLY(do_klass(CompilationResult_Site_klass,          jdk_internal_jvmci_code_CompilationResult_Site,                 Jvmci)) \
-  JVMCI_ONLY(do_klass(InfopointReason_klass,                 jdk_internal_jvmci_code_InfopointReason,                        Jvmci)) \
-  JVMCI_ONLY(do_klass(InstalledCode_klass,                   jdk_internal_jvmci_code_InstalledCode,                          Jvmci)) \
-  JVMCI_ONLY(do_klass(code_Location_klass,                   jdk_internal_jvmci_code_Location,                               Jvmci)) \
-  JVMCI_ONLY(do_klass(code_Register_klass,                   jdk_internal_jvmci_code_Register,                               Jvmci)) \
-  JVMCI_ONLY(do_klass(RegisterValue_klass,                   jdk_internal_jvmci_code_RegisterValue,                          Jvmci)) \
-  JVMCI_ONLY(do_klass(StackSlot_klass,                       jdk_internal_jvmci_code_StackSlot,                              Jvmci)) \
-  JVMCI_ONLY(do_klass(StackLockValue_klass,                  jdk_internal_jvmci_code_StackLockValue,                         Jvmci)) \
-  JVMCI_ONLY(do_klass(VirtualObject_klass,                   jdk_internal_jvmci_code_VirtualObject,                          Jvmci)) \
-  JVMCI_ONLY(do_klass(SpeculationLog_klass,                  jdk_internal_jvmci_meta_SpeculationLog,                         Jvmci)) \
-  JVMCI_ONLY(do_klass(JavaConstant_klass,                    jdk_internal_jvmci_meta_JavaConstant,                           Jvmci)) \
-  JVMCI_ONLY(do_klass(PrimitiveConstant_klass,               jdk_internal_jvmci_meta_PrimitiveConstant,                      Jvmci)) \
-  JVMCI_ONLY(do_klass(RawConstant_klass,                     jdk_internal_jvmci_meta_RawConstant,                            Jvmci)) \
-  JVMCI_ONLY(do_klass(NullConstant_klass,                    jdk_internal_jvmci_meta_NullConstant,                           Jvmci)) \
-  JVMCI_ONLY(do_klass(ExceptionHandler_klass,                jdk_internal_jvmci_meta_ExceptionHandler,                       Jvmci)) \
-  JVMCI_ONLY(do_klass(Kind_klass,                            jdk_internal_jvmci_meta_Kind,                                   Jvmci)) \
-  JVMCI_ONLY(do_klass(LIRKind_klass,                         jdk_internal_jvmci_meta_LIRKind,                                Jvmci)) \
-  JVMCI_ONLY(do_klass(AbstractValue_klass,                   jdk_internal_jvmci_meta_AbstractValue,                          Jvmci)) \
+  /* JVMCI classes. These are loaded on-demand. */                                                                       \
+  JVMCI_WK_KLASSES_DO(do_klass) \
 
   /*end*/
 
@@ -266,7 +219,7 @@
 
 #if INCLUDE_JVMCI
     FIRST_JVMCI_WKID = WK_KLASS_ENUM_NAME(HotSpotCompiledCode_klass),
-    LAST_JVMCI_WKID  = WK_KLASS_ENUM_NAME(AbstractValue_klass),
+    LAST_JVMCI_WKID  = WK_KLASS_ENUM_NAME(Value_klass),
 #endif
 
     FIRST_WKID = NO_WKID + 1
--- a/src/share/vm/classfile/vmSymbols.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/classfile/vmSymbols.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -28,6 +28,7 @@
 #include "oops/symbol.hpp"
 #include "memory/iterator.hpp"
 #include "trace/traceMacros.hpp"
+#include "jvmci/vmSymbols_jvmci.hpp"
 
 // The class vmSymbols is a name space for fast lookup of
 // symbols commonly used in the VM.
@@ -44,7 +45,6 @@
 #define VM_SYMBOL_IGNORE(id, name)                       /*ignored*/
 #define VM_ALIAS_IGNORE(id, id2)                         /*ignored*/
 
-
 // Mapping function names to values. New entries should be added below.
 
 #define VM_SYMBOLS_DO(template, do_alias)                                                         \
@@ -299,65 +299,7 @@
   template(selectAlternative_signature, "(ZLjava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodHandle;)Ljava/lang/invoke/MethodHandle;") \
                                                                                                                                       \
   /* Support for JVMCI */                                                                                                             \
-  template(java_util_BitSet,                                         "java/util/BitSet")                                              \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotCompiledCode,             "jdk/internal/jvmci/hotspot/HotSpotCompiledCode"))                  \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotCompiledCode_Comment,     "jdk/internal/jvmci/hotspot/HotSpotCompiledCode$Comment"))          \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotCompiledNmethod,          "jdk/internal/jvmci/hotspot/HotSpotCompiledNmethod"))               \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotForeignCallTarget,        "jdk/internal/jvmci/hotspot/HotSpotForeignCallTarget"))             \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotReferenceMap,             "jdk/internal/jvmci/hotspot/HotSpotReferenceMap"))                  \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_CompilerToVMImpl,                "jdk/internal/jvmci/hotspot/CompilerToVMImpl"))                     \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotInstalledCode,            "jdk/internal/jvmci/hotspot/HotSpotInstalledCode"))                 \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotNmethod,                  "jdk/internal/jvmci/hotspot/HotSpotNmethod"))                       \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotResolvedJavaMethodImpl,   "jdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethodImpl"))        \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotResolvedObjectTypeImpl,   "jdk/internal/jvmci/hotspot/HotSpotResolvedObjectTypeImpl"))        \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotCompressedNullConstant,   "jdk/internal/jvmci/hotspot/HotSpotCompressedNullConstant"))        \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotObjectConstantImpl,       "jdk/internal/jvmci/hotspot/HotSpotObjectConstantImpl"))            \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotMetaspaceConstantImpl,    "jdk/internal/jvmci/hotspot/HotSpotMetaspaceConstantImpl"))         \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotStackFrameReference,      "jdk/internal/jvmci/hotspot/HotSpotStackFrameReference"))           \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotConstantPool,             "jdk/internal/jvmci/hotspot/HotSpotConstantPool"))                  \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_HotSpotJVMCIMetaAccessContext,   "jdk/internal/jvmci/hotspot/HotSpotJVMCIMetaAccessContext"))        \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_JavaConstant,                       "jdk/internal/jvmci/meta/JavaConstant"))                            \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_PrimitiveConstant,                  "jdk/internal/jvmci/meta/PrimitiveConstant"))                       \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_RawConstant,                        "jdk/internal/jvmci/meta/RawConstant"))                             \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_NullConstant,                       "jdk/internal/jvmci/meta/NullConstant"))                            \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_ExceptionHandler,                   "jdk/internal/jvmci/meta/ExceptionHandler"))                        \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_Kind,                               "jdk/internal/jvmci/meta/Kind"))                                    \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_LIRKind,                            "jdk/internal/jvmci/meta/LIRKind"))                                 \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_AbstractValue,                      "jdk/internal/jvmci/meta/AbstractValue"))                           \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_Assumptions_ConcreteSubtype,        "jdk/internal/jvmci/meta/Assumptions$ConcreteSubtype"))             \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_Assumptions_LeafType,               "jdk/internal/jvmci/meta/Assumptions$LeafType"))                    \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_Assumptions_NoFinalizableSubclass,  "jdk/internal/jvmci/meta/Assumptions$NoFinalizableSubclass"))       \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_Assumptions_ConcreteMethod,         "jdk/internal/jvmci/meta/Assumptions$ConcreteMethod"))              \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_Assumptions_CallSiteTargetValue,    "jdk/internal/jvmci/meta/Assumptions$CallSiteTargetValue"))         \
-  JVMCI_ONLY(template(jdk_internal_jvmci_meta_SpeculationLog,                     "jdk/internal/jvmci/meta/SpeculationLog"))                          \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_CompilationResult_Call,             "jdk/internal/jvmci/code/CompilationResult$Call"))                  \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_CompilationResult_ConstantReference, "jdk/internal/jvmci/code/CompilationResult$ConstantReference"))    \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_CompilationResult_DataPatch,        "jdk/internal/jvmci/code/CompilationResult$DataPatch"))             \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_CompilationResult_DataSectionReference, "jdk/internal/jvmci/code/CompilationResult$DataSectionReference")) \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_CompilationResult_ExceptionHandler, "jdk/internal/jvmci/code/CompilationResult$ExceptionHandler"))      \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_CompilationResult_Mark,             "jdk/internal/jvmci/code/CompilationResult$Mark"))                  \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_CompilationResult_Infopoint,        "jdk/internal/jvmci/code/CompilationResult$Infopoint"))             \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_CompilationResult_Site,             "jdk/internal/jvmci/code/CompilationResult$Site"))                  \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_InfopointReason,                    "jdk/internal/jvmci/code/InfopointReason"))                         \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_InstalledCode,                      "jdk/internal/jvmci/code/InstalledCode"))                           \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_BytecodeFrame,                      "jdk/internal/jvmci/code/BytecodeFrame"))                           \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_BytecodePosition,                   "jdk/internal/jvmci/code/BytecodePosition"))                        \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_DebugInfo,                          "jdk/internal/jvmci/code/DebugInfo"))                               \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_Location,                           "jdk/internal/jvmci/code/Location"))                                \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_Register,                           "jdk/internal/jvmci/code/Register"))                                \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_RegisterValue,                      "jdk/internal/jvmci/code/RegisterValue"))                           \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_StackSlot,                          "jdk/internal/jvmci/code/StackSlot"))                               \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_StackLockValue,                     "jdk/internal/jvmci/code/StackLockValue"))                          \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_VirtualObject,                      "jdk/internal/jvmci/code/VirtualObject"))                           \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_RegisterSaveLayout,                 "jdk/internal/jvmci/code/RegisterSaveLayout"))                      \
-  JVMCI_ONLY(template(jdk_internal_jvmci_code_InvalidInstalledCodeException,      "jdk/internal/jvmci/code/InvalidInstalledCodeException"))           \
-  JVMCI_ONLY(template(compileMethod_name,                                         "compileMethod"))                                                   \
-  JVMCI_ONLY(template(compileMethod_signature,                                    "(Ljdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethod;IJI)V"))    \
-  JVMCI_ONLY(template(fromMetaspace_name,                                         "fromMetaspace"))                                                   \
-  JVMCI_ONLY(template(method_fromMetaspace_signature,                             "(J)Ljdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethod;"))       \
-  JVMCI_ONLY(template(constantPool_fromMetaspace_signature,                       "(J)Ljdk/internal/jvmci/hotspot/HotSpotConstantPool;"))             \
-  JVMCI_ONLY(template(klass_fromMetaspace_signature,                              "(Ljava/lang/Class;)Ljdk/internal/jvmci/hotspot/HotSpotResolvedObjectTypeImpl;"))   \
-  JVMCI_ONLY(template(jdk_internal_jvmci_hotspot_Stable_signature, "Ljdk/internal/jvmci/hotspot/Stable;"))                                            \
+  JVMCI_VM_SYMBOLS_DO(template, do_alias)                                                         \
                                                                                                   \
   /* common method and field names */                                                             \
   template(object_initializer_name,                   "<init>")                                   \
--- a/src/share/vm/code/codeBlob.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/code/codeBlob.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -358,7 +358,7 @@
   int _unpack_with_exception_in_tls;
 
 #if INCLUDE_JVMCI
-  // (thomaswue) Offset when JVMCI calls uncommon_trap.
+  // Offset when JVMCI calls uncommon_trap.
   int _uncommon_trap_offset;
   int _implicit_exception_uncommon_trap_offset;
 #endif
@@ -417,7 +417,7 @@
   address unpack_with_exception_in_tls() const   { return code_begin() + _unpack_with_exception_in_tls; }
 
 #if INCLUDE_JVMCI
-  // (thomaswue) Offset when JVMCI calls uncommon_trap.
+  // Offset when JVMCI calls uncommon_trap.
   void set_uncommon_trap_offset(int offset) {
     _uncommon_trap_offset = offset;
     assert(contains(code_begin() + _uncommon_trap_offset), "must be PC inside codeblob");
--- a/src/share/vm/code/debugInfoRec.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/code/debugInfoRec.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -85,7 +85,7 @@
   }
 
 #if INCLUDE_JVMCI
-  static int compare(DIR_Chunk* a, DIR_Chunk* b) {
+  static int compare(DIR_Chunk*& a, DIR_Chunk*& b) {
     if (b->_hash > a->_hash) {
       return 1;
     }
@@ -278,7 +278,7 @@
   DIR_Chunk* ns = new(this) DIR_Chunk(stream_offset, stream_length, this);
 
 #if INCLUDE_JVMCI
-  DIR_Chunk* match = _all_chunks->find_insert_binary<DIR_Chunk::compare>(ns);
+  DIR_Chunk* match = _all_chunks->insert_sorted<DIR_Chunk::compare>(ns);
   if (match != ns) {
     // Found an existing chunk
     NOT_PRODUCT(++dir_stats.chunks_shared);
--- a/src/share/vm/code/nmethod.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/code/nmethod.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -62,7 +62,7 @@
 #include "shark/sharkCompiler.hpp"
 #endif
 #if INCLUDE_JVMCI
-#include "jvmci/jvmciJavaAccess.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
 #endif
 
 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
--- a/src/share/vm/code/oopRecorder.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/code/oopRecorder.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -181,7 +181,7 @@
   return sort_by_address(a->oop_value(), b->oop_value());
 }
 
-int ObjectLookup::sort_oop_by_address(oop a, ObjectEntry b) {
+int ObjectLookup::sort_oop_by_address(oop& a, ObjectEntry& b) {
   return sort_by_address(a, b.oop_value());
 }
   
@@ -192,12 +192,12 @@
   oop object = JNIHandles::resolve(handle);
   maybe_resort();
   bool found;
-  int location = _values.find_binary<oop, sort_oop_by_address>(object, found);
+  int location = _values.find_sorted<oop, sort_oop_by_address>(object, found);
   if (!found) {
     assert(location <= _values.length(), "out of range");
     jobject handle = JNIHandles::make_local(object);
     ObjectEntry r(handle, oop_recorder->allocate_oop_index(handle));
-    _values.insert_binary(location, r);
+    _values.insert_before(location, r);
     return r.index();
   }
   return _values.at(location).index();
--- a/src/share/vm/code/oopRecorder.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/code/oopRecorder.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -168,7 +168,7 @@
   // Utility sort functions
   static int sort_by_address(oop a, oop b);
   static int sort_by_address(ObjectEntry* a, ObjectEntry* b);
-  static int sort_oop_by_address(oop a, ObjectEntry b);
+  static int sort_oop_by_address(oop& a, ObjectEntry& b);
 
  public:
   ObjectLookup();
--- a/src/share/vm/compiler/abstractCompiler.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/compiler/abstractCompiler.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -58,7 +58,7 @@
 }
 
 void AbstractCompiler::set_state(int state) {
-  // Ensure that ste is only set by one thread at a time
+  // Ensure that state is only set by one thread at a time
   MutexLocker only_one(CompileThread_lock);
   _compiler_state =  state;
   CompileThread_lock->notify_all();
--- a/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -126,8 +126,8 @@
     jbyte val = _byte_map[card_index];
     return (val & (clean_card_mask_val() | deferred_card_val())) == deferred_card_val();
   }
-  void write_ref_nmethod_pre(oop* dst, nmethod* nm);
-  void write_ref_nmethod_post(oop* dst, nmethod* nm);
+  virtual void write_ref_nmethod_pre(oop* dst, nmethod* nm);
+  virtual void write_ref_nmethod_post(oop* dst, nmethod* nm);
 
 };
 
--- a/src/share/vm/jvmci/jvmciCodeInstaller.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/jvmci/jvmciCodeInstaller.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -29,7 +29,7 @@
 #include "jvmci/jvmciEnv.hpp"
 #include "jvmci/jvmciCompiler.hpp"
 #include "jvmci/jvmciCodeInstaller.hpp"
-#include "jvmci/jvmciJavaAccess.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
 #include "jvmci/jvmciCompilerToVM.hpp"
 #include "jvmci/jvmciRuntime.hpp"
 #include "asm/register.hpp"
@@ -165,54 +165,51 @@
 static void record_metadata_in_constant(oop constant, OopRecorder* oop_recorder) {
   if (constant->is_a(HotSpotMetaspaceConstantImpl::klass())) {
     oop obj = HotSpotMetaspaceConstantImpl::metaspaceObject(constant);
-    jlong prim = HotSpotMetaspaceConstantImpl::primitive(constant);
-    assert(Kind::typeChar(AbstractValue::kind(constant)) == 'j', "must have word kind");
+    jlong raw = HotSpotMetaspaceConstantImpl::rawValue(constant);
     assert(obj != NULL, "must have an object");
-    assert(prim != 0, "must have a primitive value");
+    assert(raw != 0, "must have a raw value");
 
-    record_metadata_reference(obj, prim, false, oop_recorder);
+    record_metadata_reference(obj, raw, false, oop_recorder);
   }
 }
 
 static void record_metadata_in_patch(Handle& constant, OopRecorder* oop_recorder) {
-  record_metadata_reference(HotSpotMetaspaceConstantImpl::metaspaceObject(constant), HotSpotMetaspaceConstantImpl::primitive(constant), HotSpotMetaspaceConstantImpl::compressed(constant), oop_recorder);
+  record_metadata_reference(HotSpotMetaspaceConstantImpl::metaspaceObject(constant), HotSpotMetaspaceConstantImpl::rawValue(constant), HotSpotMetaspaceConstantImpl::compressed(constant), oop_recorder);
 }
 
-ScopeValue* CodeInstaller::get_scope_value(oop value, GrowableArray<ScopeValue*>* objects, ScopeValue* &second) {
-  second = NULL;
-  if (value == AbstractValue::ILLEGAL()) {
-    return _illegal_value;
-  }
-
-  oop lirKind = AbstractValue::lirKind(value);
+Location::Type CodeInstaller::get_oop_type(oop value) {
+  oop lirKind = Value::lirKind(value);
   oop platformKind = LIRKind::platformKind(lirKind);
-  jint referenceMask = LIRKind::referenceMask(lirKind);
-  assert(referenceMask != -1, "derived pointers are not allowed");
-  assert(referenceMask == 0 || referenceMask == 1, "unexpected referenceMask");
-  bool reference = referenceMask == 1;
+  assert(LIRKind::referenceMask(lirKind) == 1, "unexpected referenceMask");
+  
+  if (platformKind == word_kind()) {
+    return Location::oop;
+  } else {
+    return Location::narrowoop;
+  }
+}
 
-  BasicType type = JVMCIRuntime::kindToBasicType(Kind::typeChar(platformKind));
-
-  if (value->is_a(RegisterValue::klass())) {
+ScopeValue* CodeInstaller::get_scope_value(oop value, BasicType type, GrowableArray<ScopeValue*>* objects, ScopeValue* &second) {
+  second = NULL;
+  if (value == Value::ILLEGAL()) {
+    assert(type == T_ILLEGAL, "expected legal value");
+    return _illegal_value;
+  } else if (value->is_a(RegisterValue::klass())) {
     oop reg = RegisterValue::reg(value);
     jint number = code_Register::number(reg);
     VMReg hotspotRegister = get_hotspot_reg(number);
     if (is_general_purpose_reg(hotspotRegister)) {
       Location::Type locationType;
-      if (type == T_INT) {
-        locationType = reference ? Location::narrowoop : Location::int_in_long;
-      } else if(type == T_SHORT || type == T_CHAR || type == T_BYTE || type == T_BOOLEAN) {
-        locationType = Location::int_in_long;
-      } else if (type == T_FLOAT) {
+      if (type == T_OBJECT) {
+        locationType = get_oop_type(value);
+      } else if (type == T_LONG) {
+        locationType = Location::lng;
+      } else {
+        assert(type == T_INT || type == T_FLOAT || type == T_SHORT || type == T_CHAR || type == T_BYTE || type == T_BOOLEAN, "unexpected type in cpu register");
         locationType = Location::int_in_long;
-      } else if (type == T_LONG) {
-        locationType = reference ? Location::oop : Location::lng;
-      } else {
-        assert(type == T_OBJECT && reference, "unexpected type in cpu register");
-        locationType = Location::oop;
       }
       ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, hotspotRegister));
-      if (type == T_LONG && !reference) {
+      if (type == T_LONG) {
         second = value;
       }
       return value;
@@ -225,7 +222,6 @@
       } else {
         locationType = Location::dbl;
       }
-      assert(!reference, "unexpected type in floating point register");
       ScopeValue* value = new LocationValue(Location::new_reg_loc(locationType, hotspotRegister));
       if (type == T_DOUBLE) {
         second = value;
@@ -239,51 +235,47 @@
     }
 
     Location::Type locationType;
-    if (type == T_LONG) {
-      locationType = reference ? Location::oop : Location::lng;
-    } else if (type == T_INT) {
-      locationType = reference ? Location::narrowoop : Location::normal;
-    } else if(type == T_SHORT || type == T_CHAR || type == T_BYTE || type == T_BOOLEAN) {
-      locationType = Location::normal;
-    } else if (type == T_FLOAT) {
-      assert(!reference, "unexpected type in stack slot");
-      locationType = Location::normal;
+    if (type == T_OBJECT) {
+      locationType = get_oop_type(value);
+    } else if (type == T_LONG) {
+      locationType = Location::lng;
     } else if (type == T_DOUBLE) {
-      assert(!reference, "unexpected type in stack slot");
       locationType = Location::dbl;
     } else {
-      assert(type == T_OBJECT && reference, "unexpected type in stack slot");
-      locationType = Location::oop;
+      assert(type == T_INT || type == T_FLOAT || type == T_SHORT || type == T_CHAR || type == T_BYTE || type == T_BOOLEAN, "unexpected type in stack slot");
+      locationType = Location::normal;
     }
     ScopeValue* value = new LocationValue(Location::new_stk_loc(locationType, offset));
-    if (type == T_DOUBLE || (type == T_LONG && !reference)) {
+    if (type == T_DOUBLE || type == T_LONG) {
       second = value;
     }
     return value;
-  } else if (value->is_a(JavaConstant::klass())){
+  } else if (value->is_a(JavaConstant::klass())) {
     record_metadata_in_constant(value, _oop_recorder);
     if (value->is_a(PrimitiveConstant::klass())) {
-      assert(!reference, "unexpected primitive constant type");
-      if(value->is_a(RawConstant::klass())) {
+      if (value->is_a(RawConstant::klass())) {
         jlong prim = PrimitiveConstant::primitive(value);
         return new ConstantLongValue(prim);
-      } else if (type == T_INT || type == T_FLOAT) {
-        jint prim = (jint)PrimitiveConstant::primitive(value);
-        switch (prim) {
-          case -1: return _int_m1_scope_value;
-          case  0: return _int_0_scope_value;
-          case  1: return _int_1_scope_value;
-          case  2: return _int_2_scope_value;
-          default: return new ConstantIntValue(prim);
+      } else {
+        assert(type == JVMCIRuntime::kindToBasicType(JavaKind::typeChar(PrimitiveConstant::kind(value))), "primitive constant type doesn't match");
+        if (type == T_INT || type == T_FLOAT) {
+          jint prim = (jint)PrimitiveConstant::primitive(value);
+          switch (prim) {
+            case -1: return _int_m1_scope_value;
+            case  0: return _int_0_scope_value;
+            case  1: return _int_1_scope_value;
+            case  2: return _int_2_scope_value;
+            default: return new ConstantIntValue(prim);
+          }
+        } else {
+          assert(type == T_LONG || type == T_DOUBLE, "unexpected primitive constant type");
+          jlong prim = PrimitiveConstant::primitive(value);
+          second = _int_1_scope_value;
+          return new ConstantLongValue(prim);
         }
-      } else {
-        assert(type == T_LONG || type == T_DOUBLE, "unexpected primitive constant type");
-        jlong prim = PrimitiveConstant::primitive(value);
-        second = _int_1_scope_value;
-        return new ConstantLongValue(prim);
       }
     } else {
-        assert(reference, "unexpected object constant type");
+      assert(type == T_OBJECT, "unexpected object constant");
       if (value->is_a(NullConstant::klass()) || value->is_a(HotSpotCompressedNullConstant::klass())) {
         return _oop_null_scope_value;
       } else {
@@ -294,6 +286,7 @@
       }
     }
   } else if (value->is_a(VirtualObject::klass())) {
+    assert(type == T_OBJECT, "unexpected virtual object");
     int id = VirtualObject::id(value);
     ScopeValue* object = objects->at(id);
     assert(object != NULL, "missing value");
@@ -314,10 +307,13 @@
   bool isLongArray = klass == Universe::longArrayKlassObj();
 
   objArrayOop values = VirtualObject::values(value);
+  objArrayOop slotKinds = VirtualObject::slotKinds(value);
   for (jint i = 0; i < values->length(); i++) {
     ScopeValue* cur_second = NULL;
     oop object = values->obj_at(i);
-    ScopeValue* value = get_scope_value(object, objects, cur_second);
+    oop kind = slotKinds->obj_at(i);
+    BasicType type = JVMCIRuntime::kindToBasicType(JavaKind::typeChar(kind));
+    ScopeValue* value = get_scope_value(object, type, objects, cur_second);
 
     if (isLongArray && cur_second == NULL) {
       // we're trying to put ints into a long array... this isn't really valid, but it's used for some optimizations.
@@ -334,13 +330,13 @@
 }
 
 MonitorValue* CodeInstaller::get_monitor_value(oop value, GrowableArray<ScopeValue*>* objects) {
-  guarantee(value->is_a(StackLockValue::klass()), "Monitors must be of type MonitorValue");
+  guarantee(value->is_a(StackLockValue::klass()), "Monitors must be of type StackLockValue");
 
   ScopeValue* second = NULL;
-  ScopeValue* owner_value = get_scope_value(StackLockValue::owner(value), objects, second);
+  ScopeValue* owner_value = get_scope_value(StackLockValue::owner(value), T_OBJECT, objects, second);
   assert(second == NULL, "monitor cannot occupy two stack slots");
 
-  ScopeValue* lock_data_value = get_scope_value(StackLockValue::slot(value), objects, second);
+  ScopeValue* lock_data_value = get_scope_value(StackLockValue::slot(value), T_LONG, objects, second);
   assert(second == lock_data_value, "monitor is LONG value that occupies two stack slots");
   assert(lock_data_value->is_location(), "invalid monitor location");
   Location lock_data_loc = ((LocationValue*)lock_data_value)->location();
@@ -393,13 +389,8 @@
 }
 
 // constructor used to create a method
-JVMCIEnv::CodeInstallResult CodeInstaller::install(Handle& compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log) {
-  BufferBlob* buffer_blob = JVMCIRuntime::initialize_buffer_blob();
-  if (buffer_blob == NULL) {
-    return JVMCIEnv::cache_full;
-  }
-
-  CodeBuffer buffer(buffer_blob);
+JVMCIEnv::CodeInstallResult CodeInstaller::install(Handle target, Handle& compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log) {
+  CodeBuffer buffer("JVMCI Compiler CodeBuffer");
   jobject compiled_code_obj = JNIHandles::make_local(compiled_code());
   initialize_dependencies(JNIHandles::resolve(compiled_code_obj));
 
@@ -407,17 +398,15 @@
   _instructions = buffer.insts();
   _constants = buffer.consts();
 
-  {
-    initialize_fields(JNIHandles::resolve(compiled_code_obj));
-    if (!initialize_buffer(buffer)) {
-      return JVMCIEnv::code_too_large;
-    }
-    process_exception_handlers();
+  initialize_fields(target(), JNIHandles::resolve(compiled_code_obj));
+  JVMCIEnv::CodeInstallResult result = initialize_buffer(buffer);
+  if (result != JVMCIEnv::ok) {
+    return result;
   }
+  process_exception_handlers();
 
   int stack_slots = _total_frame_size / HeapWordSize; // conversion to words
 
-  JVMCIEnv::CodeInstallResult result;
   if (!compiled_code->is_a(HotSpotCompiledNmethod::klass())) {
     oop stubName = HotSpotCompiledCode::name(compiled_code_obj);
     char* name = strdup(java_lang_String::as_utf8_string(stubName));
@@ -453,15 +442,15 @@
   return result;
 }
 
-void CodeInstaller::initialize_fields(oop compiled_code) {
+void CodeInstaller::initialize_fields(oop target, oop compiled_code) {
   if (compiled_code->is_a(HotSpotCompiledNmethod::klass())) {
     Handle hotspotJavaMethod = HotSpotCompiledNmethod::method(compiled_code);
     methodHandle method = getMethodFromHotSpotMethod(hotspotJavaMethod());
     _parameter_count = method->size_of_parameters();
-    TRACE_jvmci_1("installing code for %s", method->name_and_sig_as_C_string());
+    TRACE_jvmci_2("installing code for %s", method->name_and_sig_as_C_string());
   } else {
-    // Must be a HotSpotCompiledRuntimeStub
-    // TODO (ds) not sure if this is correct - only used in OopMap constructor for non-product builds
+    // Must be a HotSpotCompiledRuntimeStub.
+    // Only used in OopMap constructor for non-product builds
     _parameter_count = 0;
   }
   _sites_handle = JNIHandles::make_local(HotSpotCompiledCode::sites(compiled_code));
@@ -486,9 +475,12 @@
   _next_call_type = INVOKE_INVALID;
 
   _has_wide_vector = false;
+
+  oop arch = TargetDescription::arch(target);
+  _word_kind_handle = JNIHandles::make_local(Architecture::wordKind(arch));
 }
 
-int CodeInstaller::estimate_stub_entries() {
+int CodeInstaller::estimate_stubs_size() {
   // Estimate the number of static call stubs that might be emitted.
   int static_call_stubs = 0;
   objArrayOop sites = this->sites();
@@ -505,21 +497,31 @@
       }
     }
   }
-  return static_call_stubs;
+  return static_call_stubs * CompiledStaticCall::to_interp_stub_size();
 }
 
 // perform data and call relocation on the CodeBuffer
-bool CodeInstaller::initialize_buffer(CodeBuffer& buffer) {
+JVMCIEnv::CodeInstallResult CodeInstaller::initialize_buffer(CodeBuffer& buffer) {
   HandleMark hm;
   objArrayHandle sites = this->sites();
   int locs_buffer_size = sites->length() * (relocInfo::length_limit + sizeof(relocInfo));
-  char* locs_buffer = NEW_RESOURCE_ARRAY(char, locs_buffer_size);
-  buffer.insts()->initialize_shared_locs((relocInfo*)locs_buffer, locs_buffer_size / sizeof(relocInfo));
+
   // Allocate enough space in the stub section for the static call
   // stubs.  Stubs have extra relocs but they are managed by the stub
   // section itself so they don't need to be accounted for in the
   // locs_buffer above.
-  buffer.initialize_stubs_size(estimate_stub_entries() * CompiledStaticCall::to_interp_stub_size());
+  int stubs_size = estimate_stubs_size();
+  int total_size = round_to(_code_size, buffer.insts()->alignment()) + round_to(_constants_size, buffer.consts()->alignment()) + round_to(stubs_size, buffer.stubs()->alignment());
+
+  if (total_size > JVMCINMethodSizeLimit) {
+    return JVMCIEnv::code_too_large;
+  }
+
+  buffer.initialize(total_size, locs_buffer_size);
+  if (buffer.blob() == NULL) {
+    return JVMCIEnv::cache_full;
+  }
+  buffer.initialize_stubs_size(stubs_size);
   buffer.initialize_consts_size(_constants_size);
 
   _debug_recorder = new DebugInformationRecorder(_oop_recorder);
@@ -534,9 +536,7 @@
 
   // copy the code into the newly created CodeBuffer
   address end_pc = _instructions->start() + _code_size;
-  if (!_instructions->allocates2(end_pc)) {
-    return false;
-  }
+  guarantee(_instructions->allocates2(end_pc), "initialize should have reserved enough space for all the code");
   memcpy(_instructions->start(), code()->base(T_BYTE), _code_size);
   _instructions->set_end(end_pc);
 
@@ -617,7 +617,7 @@
     }
   }
 #endif
-  return true;
+  return JVMCIEnv::ok;
 }
 
 void CodeInstaller::assumption_NoFinalizableSubclass(Handle assumption) {
@@ -726,7 +726,7 @@
     // Stubs do not record scope info, just oop maps
     return;
   }
-  
+
   GrowableArray<ScopeValue*>* objectMapping = record_virtual_objects(debug_info);
   record_scope(pc_offset, position, objectMapping);
 }
@@ -748,9 +748,7 @@
     bci = SynchronizationEntryBCI;
   }
 
-  if (TraceJVMCI >= 2) {
-    tty->print_cr("Recording scope pc_offset=%d bci=%d method=%s", pc_offset, bci, method->name_and_sig_as_C_string());
-  }
+  TRACE_jvmci_2("Recording scope pc_offset=%d bci=%d method=%s", pc_offset, bci, method->name_and_sig_as_C_string());
 
   bool reexecute = false;
   if (frame != NULL) {
@@ -775,29 +773,33 @@
     jint expression_count = BytecodeFrame::numStack(frame);
     jint monitor_count = BytecodeFrame::numLocks(frame);
     objArrayOop values = BytecodeFrame::values(frame);
+    objArrayOop slotKinds = BytecodeFrame::slotKinds(frame);
 
     assert(local_count + expression_count + monitor_count == values->length(), "unexpected values length");
+    assert(local_count + expression_count == slotKinds->length(), "unexpected slotKinds length");
 
     GrowableArray<ScopeValue*>* locals = local_count > 0 ? new GrowableArray<ScopeValue*> (local_count) : NULL;
     GrowableArray<ScopeValue*>* expressions = expression_count > 0 ? new GrowableArray<ScopeValue*> (expression_count) : NULL;
     GrowableArray<MonitorValue*>* monitors = monitor_count > 0 ? new GrowableArray<MonitorValue*> (monitor_count) : NULL;
 
-    if (TraceJVMCI >= 2) {
-      tty->print_cr("Scope at bci %d with %d values", bci, values->length());
-      tty->print_cr("%d locals %d expressions, %d monitors", local_count, expression_count, monitor_count);
-    }
+    TRACE_jvmci_2("Scope at bci %d with %d values", bci, values->length());
+    TRACE_jvmci_2("%d locals %d expressions, %d monitors", local_count, expression_count, monitor_count);
 
     for (jint i = 0; i < values->length(); i++) {
       ScopeValue* second = NULL;
       oop value = values->obj_at(i);
       if (i < local_count) {
-        ScopeValue* first = get_scope_value(value, objects, second);
+        oop kind = slotKinds->obj_at(i);
+        BasicType type = JVMCIRuntime::kindToBasicType(JavaKind::typeChar(kind));
+        ScopeValue* first = get_scope_value(value, type, objects, second);
         if (second != NULL) {
           locals->append(second);
         }
         locals->append(first);
       } else if (i < local_count + expression_count) {
-        ScopeValue* first = get_scope_value(value, objects, second);
+        oop kind = slotKinds->obj_at(i);
+        BasicType type = JVMCIRuntime::kindToBasicType(JavaKind::typeChar(kind));
+        ScopeValue* first = get_scope_value(value, type, objects, second);
         if (second != NULL) {
           expressions->append(second);
         }
@@ -808,7 +810,7 @@
       if (second != NULL) {
         i++;
         assert(i < values->length(), "double-slot value not followed by Value.ILLEGAL");
-        assert(values->obj_at(i) == AbstractValue::ILLEGAL(), "double-slot value not followed by Value.ILLEGAL");
+        assert(values->obj_at(i) == Value::ILLEGAL(), "double-slot value not followed by Value.ILLEGAL");
       }
     }
 
--- a/src/share/vm/jvmci/jvmciCodeInstaller.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/jvmci/jvmciCodeInstaller.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
@@ -71,6 +71,7 @@
 #endif
 
   bool          _has_wide_vector;
+  jobject       _word_kind_handle;
 
   MarkId        _next_call_type;
   address       _invoke_mark_pc;
@@ -107,27 +108,30 @@
   objArrayOop comments() { return (objArrayOop) JNIHandles::resolve(_comments_handle); }
 #endif
 
+  oop word_kind() { return (oop) JNIHandles::resolve(_word_kind_handle); }
+
 public:
 
   CodeInstaller() : _arena(mtCompiler) {}
-  JVMCIEnv::CodeInstallResult install(Handle& compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log);
+  JVMCIEnv::CodeInstallResult install(Handle target, Handle& compiled_code, CodeBlob*& cb, Handle installed_code, Handle speculation_log);
 
   static address runtime_call_target_address(oop runtime_call);
   static VMReg get_hotspot_reg(jint jvmciRegisterNumber);
   static bool is_general_purpose_reg(VMReg hotspotRegister);
 
 private:
-  ScopeValue* get_scope_value(oop value, GrowableArray<ScopeValue*>* objects, ScopeValue* &second);
+  Location::Type get_oop_type(oop value);
+  ScopeValue* get_scope_value(oop value, BasicType type, GrowableArray<ScopeValue*>* objects, ScopeValue* &second);
   MonitorValue* get_monitor_value(oop value, GrowableArray<ScopeValue*>* objects);
 
   // extract the fields of the CompilationResult
-  void initialize_fields(oop target_method);
+  void initialize_fields(oop target, oop target_method);
   void initialize_dependencies(oop target_method);
   
-  int estimate_stub_entries();
+  int estimate_stubs_size();
   
   // perform data and call relocation on the CodeBuffer
-  bool initialize_buffer(CodeBuffer& buffer);
+  JVMCIEnv::CodeInstallResult initialize_buffer(CodeBuffer& buffer);
 
   void assumption_NoFinalizableSubclass(Handle assumption);
   void assumption_ConcreteSubtype(Handle assumption);
--- a/src/share/vm/jvmci/jvmciCompiler.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/jvmci/jvmciCompiler.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -24,7 +24,7 @@
 #include "precompiled.hpp"
 #include "memory/oopFactory.hpp"
 #include "runtime/javaCalls.hpp"
-#include "jvmci/jvmciJavaAccess.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
 #include "jvmci/jvmciCompiler.hpp"
 #include "jvmci/jvmciEnv.hpp"
 #include "jvmci/jvmciRuntime.hpp"
@@ -50,12 +50,8 @@
     return;
   }
 
-  BufferBlob* buffer_blob = JVMCIRuntime::initialize_buffer_blob();
-  if (buffer_blob == NULL) {
-    set_state(failed);
-  } else {
-    set_state(initialized);
-  }
+  set_state(initialized);
+
   // JVMCI is considered as application code so we need to
   // stop the VM deferring compilation now.
   CompilationPolicy::completed_vm_startup();
@@ -64,6 +60,12 @@
 
 #ifdef COMPILERJVMCI
 void JVMCICompiler::bootstrap() {
+#ifndef PRODUCT
+  // We turn off CompileTheWorld so that compilation requests are not
+  // ignored during bootstrap or that JVMCI can be compiled by C1/C2.
+  FlagSetting ctwOff(CompileTheWorld, false);
+#endif
+
   JavaThread* THREAD = JavaThread::current();
   _bootstrapping = true;
   // Allow bootstrap to perform JVMCI compilations of itself
--- a/src/share/vm/jvmci/jvmciCompilerToVM.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/jvmci/jvmciCompilerToVM.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -35,7 +35,7 @@
 #include "jvmci/jvmciCompilerToVM.hpp"
 #include "jvmci/jvmciCompiler.hpp"
 #include "jvmci/jvmciEnv.hpp"
-#include "jvmci/jvmciJavaAccess.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
 #include "jvmci/jvmciCodeInstaller.hpp"
 #include "gc_implementation/g1/heapRegion.hpp"
 #include "runtime/javaCalls.hpp"
@@ -48,7 +48,8 @@
 // Entry to native method implementation that transitions current thread to '_thread_in_vm'.
 #define C2V_VMENTRY(result_type, name, signature) \
   JNIEXPORT result_type JNICALL c2v_ ## name signature { \
-  TRACE_jvmci_3("CompilerToVM::" #name); \
+  TRACE_jvmci_1("CompilerToVM::" #name); \
+  TRACE_CALL(result_type, jvmci_ ## name signature) \
   JVMCI_VM_ENTRY_MARK; \
 
 #define C2V_END }
@@ -267,10 +268,13 @@
 }
 
 C2V_VMENTRY(jobject, findUniqueConcreteMethod, (JNIEnv *, jobject, jobject jvmci_type, jobject jvmci_method))
+  ResourceMark rm;
   methodHandle method = CompilerToVM::asMethod(jvmci_method);
   KlassHandle holder = CompilerToVM::asKlass(jvmci_type);
-  assert(!holder->is_interface(), "should be handled in Java code");
-  ResourceMark rm;
+  if (holder->is_interface()) {
+    THROW_MSG_0(vmSymbols::java_lang_InternalError(), err_msg("Interface %s should be handled in Java code", holder->external_name()));
+  }
+
   methodHandle ucm;
   {
     MutexLocker locker(Compile_lock);
@@ -304,15 +308,16 @@
 C2V_VMENTRY(jobject, lookupType, (JNIEnv*, jobject, jstring jname, jclass accessing_class, jboolean resolve))
   ResourceMark rm;
   Handle name = JNIHandles::resolve(jname);
-  Symbol* class_name = java_lang_String::as_symbol(name, THREAD);
-  assert(class_name != NULL, "name to symbol creation failed");
-  assert(class_name->size() > 1, "primitive types should be handled in Java code");
+  Symbol* class_name = java_lang_String::as_symbol(name, CHECK_0);
+  if (java_lang_String::length(name()) <= 1) {
+    THROW_MSG_0(vmSymbols::java_lang_InternalError(), err_msg("Primitive type %s should be handled in Java code", class_name->as_C_string()));
+  }
 
   Klass* resolved_klass = NULL;
   Handle class_loader;
   Handle protection_domain;
   if (JNIHandles::resolve(accessing_class) == NULL) {
-    THROW_(vmSymbols::java_lang_NullPointerException(), 0L);
+    THROW_0(vmSymbols::java_lang_NullPointerException());
   }
   Klass* accessing_klass = java_lang_Class::as_Klass(JNIHandles::resolve(accessing_class));
   class_loader = accessing_klass->class_loader();
@@ -465,7 +470,10 @@
 C2V_VMENTRY(jint, getVtableIndexForInterface, (JNIEnv *, jobject, jobject jvmci_type, jobject jvmci_method))
   Klass* klass = CompilerToVM::asKlass(jvmci_type);
   Method* method = CompilerToVM::asMethod(jvmci_method);
-  assert(!klass->is_interface(), "");
+  if (klass->is_interface()) {
+    ResourceMark rm;
+    THROW_MSG_0(vmSymbols::java_lang_InternalError(), err_msg("Interface %s should be handled in Java code", klass->external_name()));
+  }
   return LinkResolver::vtable_index_of_interface_method(klass, method);
 C2V_END
 
@@ -565,9 +573,10 @@
   method->set_dont_inline(true);
 C2V_END
 
-C2V_VMENTRY(jint, installCode, (JNIEnv *jniEnv, jobject, jobject compiled_code, jobject installed_code, jobject speculation_log))
+C2V_VMENTRY(jint, installCode, (JNIEnv *jniEnv, jobject, jobject target, jobject compiled_code, jobject installed_code, jobject speculation_log))
   ResourceMark rm;
   HandleMark hm;
+  Handle target_handle = JNIHandles::resolve(target);
   Handle compiled_code_handle = JNIHandles::resolve(compiled_code);
   CodeBlob* cb = NULL;
   Handle installed_code_handle = JNIHandles::resolve(installed_code);
@@ -575,7 +584,7 @@
 
   TraceTime install_time("installCode", JVMCICompiler::codeInstallTimer());
   CodeInstaller installer;
-  JVMCIEnv::CodeInstallResult result = installer.install(compiled_code_handle, cb, installed_code_handle, speculation_log_handle);
+  JVMCIEnv::CodeInstallResult result = installer.install(target_handle, compiled_code_handle, cb, installed_code_handle, speculation_log_handle);
 
   if (PrintCodeCacheOnCompilation) {
     stringStream s;
@@ -691,7 +700,7 @@
 
   jlong nmethodValue = InstalledCode::address(hotspotInstalledCode);
   if (nmethodValue == 0L) {
-    THROW_(vmSymbols::jdk_internal_jvmci_code_InvalidInstalledCodeException(), NULL);
+    THROW_NULL(vmSymbols::jdk_internal_jvmci_code_InvalidInstalledCodeException());
   }
   nmethod* nm = (nmethod*) (address) nmethodValue;
   methodHandle mh = nm->method();
@@ -835,12 +844,6 @@
   return method->lookup_osr_nmethod_for(entry_bci, comp_level, true) != NULL;
 C2V_END
 
-C2V_VMENTRY(jlong, getTimeStamp, (JNIEnv*, jobject))
-  // tty->time_stamp is the time since VM start which should be used
-  // for all HotSpot log output when a timestamp is required.
-  return tty->time_stamp().milliseconds();
-C2V_END
-
 C2V_VMENTRY(jobject, getSymbol, (JNIEnv*, jobject, jlong symbol))
   Handle sym = java_lang_String::create_from_symbol((Symbol*)(address)symbol, CHECK_NULL);
   return JNIHandles::make_local(THREAD, sym());
@@ -861,7 +864,7 @@
   ResourceMark rm;
 
   if (!thread->has_last_Java_frame()) return NULL;
-  Handle result = InstanceKlass::cast(HotSpotStackFrameReference::klass())->allocate_instance(thread);
+  Handle result = HotSpotStackFrameReference::klass()->allocate_instance(thread);
   HotSpotStackFrameReference::klass()->initialize(thread);
 
   StackFrameStream fst(thread);
@@ -1129,6 +1132,7 @@
 #define CLASS                 "Ljava/lang/Class;"
 #define STACK_TRACE_ELEMENT   "Ljava/lang/StackTraceElement;"
 #define INSTALLED_CODE        "Ljdk/internal/jvmci/code/InstalledCode;"
+#define TARGET_DESCRIPTION    "Ljdk/internal/jvmci/code/TargetDescription;"
 #define RESOLVED_METHOD       "Ljdk/internal/jvmci/meta/ResolvedJavaMethod;"
 #define HS_RESOLVED_METHOD    "Ljdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethodImpl;"
 #define HS_RESOLVED_KLASS     "Ljdk/internal/jvmci/hotspot/HotSpotResolvedObjectTypeImpl;"
@@ -1151,16 +1155,16 @@
   {CC"canInlineMethod",                              CC"("HS_RESOLVED_METHOD")Z",                                                      FN_PTR(canInlineMethod)},
   {CC"shouldInlineMethod",                           CC"("HS_RESOLVED_METHOD")Z",                                                      FN_PTR(shouldInlineMethod)},
   {CC"lookupType",                                   CC"("STRING CLASS"Z)"HS_RESOLVED_KLASS,                                           FN_PTR(lookupType)},
-  {CC"lookupNameRefInPool0",                         CC"("HS_CONSTANT_POOL"I)"STRING,                                                  FN_PTR(lookupNameRefInPool)},
+  {CC"lookupNameRefInPool",                          CC"("HS_CONSTANT_POOL"I)"STRING,                                                  FN_PTR(lookupNameRefInPool)},
   {CC"lookupNameAndTypeRefIndexInPool",              CC"("HS_CONSTANT_POOL"I)I",                                                       FN_PTR(lookupNameAndTypeRefIndexInPool)},
-  {CC"lookupSignatureRefInPool0",                    CC"("HS_CONSTANT_POOL"I)"STRING,                                                  FN_PTR(lookupSignatureRefInPool)},
-  {CC"lookupKlassRefIndexInPool0",                   CC"("HS_CONSTANT_POOL"I)I",                                                       FN_PTR(lookupKlassRefIndexInPool)},
+  {CC"lookupSignatureRefInPool",                     CC"("HS_CONSTANT_POOL"I)"STRING,                                                  FN_PTR(lookupSignatureRefInPool)},
+  {CC"lookupKlassRefIndexInPool",                    CC"("HS_CONSTANT_POOL"I)I",                                                       FN_PTR(lookupKlassRefIndexInPool)},
   {CC"lookupKlassInPool",                            CC"("HS_CONSTANT_POOL"I)Ljava/lang/Object;",                                      FN_PTR(lookupKlassInPool)},
-  {CC"lookupAppendixInPool0",                        CC"("HS_CONSTANT_POOL"I)"OBJECT,                                                  FN_PTR(lookupAppendixInPool)},
+  {CC"lookupAppendixInPool",                         CC"("HS_CONSTANT_POOL"I)"OBJECT,                                                  FN_PTR(lookupAppendixInPool)},
   {CC"lookupMethodInPool",                           CC"("HS_CONSTANT_POOL"IB)"HS_RESOLVED_METHOD,                                     FN_PTR(lookupMethodInPool)},
-  {CC"constantPoolRemapInstructionOperandFromCache0",CC"("HS_CONSTANT_POOL"I)I",                                                       FN_PTR(constantPoolRemapInstructionOperandFromCache)},
+  {CC"constantPoolRemapInstructionOperandFromCache", CC"("HS_CONSTANT_POOL"I)I",                                                       FN_PTR(constantPoolRemapInstructionOperandFromCache)},
   {CC"resolveConstantInPool",                        CC"("HS_CONSTANT_POOL"I)"OBJECT,                                                  FN_PTR(resolveConstantInPool)},
-  {CC"resolvePossiblyCachedConstantInPool0",         CC"("HS_CONSTANT_POOL"I)"OBJECT,                                                  FN_PTR(resolvePossiblyCachedConstantInPool)},
+  {CC"resolvePossiblyCachedConstantInPool",          CC"("HS_CONSTANT_POOL"I)"OBJECT,                                                  FN_PTR(resolvePossiblyCachedConstantInPool)},
   {CC"resolveTypeInPool",                            CC"("HS_CONSTANT_POOL"I)"HS_RESOLVED_KLASS,                                       FN_PTR(resolveTypeInPool)},
   {CC"resolveFieldInPool",                           CC"("HS_CONSTANT_POOL"IB[J)"HS_RESOLVED_KLASS,                                    FN_PTR(resolveFieldInPool)},
   {CC"resolveInvokeDynamicInPool",                   CC"("HS_CONSTANT_POOL"I)V",                                                       FN_PTR(resolveInvokeDynamicInPool)},
@@ -1175,7 +1179,7 @@
   {CC"getConstantPool",                              CC"(Ljava/lang/Object;J)"HS_CONSTANT_POOL,                                        FN_PTR(getConstantPool)},
   {CC"getResolvedJavaType",                          CC"(Ljava/lang/Object;JZ)"HS_RESOLVED_KLASS,                                      FN_PTR(getResolvedJavaType)},
   {CC"initializeConfiguration",                      CC"("HS_CONFIG")V",                                                               FN_PTR(initializeConfiguration)},
-  {CC"installCode",                                  CC"("HS_COMPILED_CODE INSTALLED_CODE SPECULATION_LOG")I",                         FN_PTR(installCode)},
+  {CC"installCode",                                  CC"("TARGET_DESCRIPTION HS_COMPILED_CODE INSTALLED_CODE SPECULATION_LOG")I",      FN_PTR(installCode)},
   {CC"notifyCompilationStatistics",                  CC"(I"HS_RESOLVED_METHOD"ZIJJ"INSTALLED_CODE")V",                                 FN_PTR(notifyCompilationStatistics)},
   {CC"resetCompilationStatistics",                   CC"()V",                                                                          FN_PTR(resetCompilationStatistics)},
   {CC"disassembleCodeBlob",                          CC"(J)"STRING,                                                                    FN_PTR(disassembleCodeBlob)},
@@ -1190,8 +1194,7 @@
   {CC"allocateCompileId",                            CC"("HS_RESOLVED_METHOD"I)I",                                                     FN_PTR(allocateCompileId)},
   {CC"isMature",                                     CC"("METASPACE_METHOD_DATA")Z",                                                   FN_PTR(isMature)},
   {CC"hasCompiledCodeForOSR",                        CC"("HS_RESOLVED_METHOD"II)Z",                                                    FN_PTR(hasCompiledCodeForOSR)},
-  {CC"getSymbol0",                                   CC"(J)"STRING,                                                                    FN_PTR(getSymbol)},
-  {CC"getTimeStamp",                                 CC"()J",                                                                          FN_PTR(getTimeStamp)},
+  {CC"getSymbol",                                    CC"(J)"STRING,                                                                    FN_PTR(getSymbol)},
   {CC"getNextStackFrame",                            CC"("HS_STACK_FRAME_REF "["HS_RESOLVED_METHOD"I)"HS_STACK_FRAME_REF,              FN_PTR(getNextStackFrame)},
   {CC"materializeVirtualObjects",                    CC"("HS_STACK_FRAME_REF"Z)V",                                                     FN_PTR(materializeVirtualObjects)},
   {CC"shouldDebugNonSafepoints",                     CC"()Z",                                                                          FN_PTR(shouldDebugNonSafepoints)},
--- a/src/share/vm/jvmci/jvmciCompilerToVM.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/jvmci/jvmciCompilerToVM.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -26,7 +26,7 @@
 
 #include "prims/jni.h"
 #include "runtime/javaCalls.hpp"
-#include "jvmci/jvmciJavaAccess.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
 
 class CompilerToVM {
 public:
--- a/src/share/vm/jvmci/jvmciEnv.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/jvmci/jvmciEnv.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -27,6 +27,7 @@
 #include "classfile/javaAssertions.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
+#include "code/codeCache.hpp"
 #include "code/scopeDesc.hpp"
 #include "runtime/sweeper.hpp"
 #include "compiler/compileBroker.hpp"
@@ -38,13 +39,14 @@
 #include "memory/universe.inline.hpp"
 #include "oops/methodData.hpp"
 #include "oops/objArrayKlass.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvmtiExport.hpp"
 #include "runtime/init.hpp"
 #include "runtime/reflection.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "utilities/dtrace.hpp"
 #include "jvmci/jvmciRuntime.hpp"
-#include "jvmci/jvmciJavaAccess.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
 
 JVMCIEnv::JVMCIEnv(CompileTask* task, int system_dictionary_modification_counter) {
   _task = task;
@@ -180,25 +182,7 @@
   KlassHandle klass (THREAD, ConstantPool::klass_at_if_loaded(cpool, index));
   Symbol* klass_name = NULL;
   if (klass.is_null()) {
-    // The klass has not been inserted into the constant pool.
-    // Try to look it up by name.
-    {
-      // We have to lock the cpool to keep the oop from being resolved
-      // while we are accessing it.
-      MonitorLockerEx ml(cpool->lock());
-
-      constantTag tag = cpool->tag_at(index);
-      if (tag.is_klass()) {
-        // The klass has been inserted into the constant pool
-        // very recently.
-        klass = KlassHandle(THREAD, cpool->resolved_klass_at(index));
-      } else if (tag.is_symbol()) {
-        klass_name = cpool->symbol_at(index);
-      } else {
-        assert(cpool->tag_at(index).is_unresolved_klass(), "wrong tag");
-        klass_name = cpool->unresolved_klass_at(index);
-      }
-    }
+    klass_name = cpool->klass_name_at(index);
   }
 
   if (klass.is_null()) {
@@ -512,12 +496,12 @@
       MethodData* mdp = method()->method_data();
       if (mdp != NULL) {
         mdp->inc_decompile_count();
+#ifdef DEBUG
         if (mdp->decompile_count() > (uint)PerMethodRecompilationCutoff) {
-          // TODO (chaeubl) enable this in the fastdebug build only once we are more stable
           ResourceMark m;
           tty->print_cr("WARN: endless recompilation of %s. Method was set to not compilable.", method()->name_and_sig_as_C_string());
-          //ShouldNotReachHere();
         }
+#endif
       }
 
       // All buffers in the CodeBuffer are allocated in the CodeCache.
@@ -538,7 +522,6 @@
 
       // Free codeBlobs
       //code_buffer->free_blob();
-
       if (nm == NULL) {
         // The CodeCache is full.  Print out warning and disable compilation.
         {
--- a/src/share/vm/jvmci/jvmciGlobals.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2000, 2010, 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.
- *
- */
-
-#include "precompiled.hpp"
-#include "jvmci/jvmciGlobals.hpp"
-
-JVMCI_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, MATERIALIZE_NOTPRODUCT_FLAG)
--- a/src/share/vm/jvmci/jvmciGlobals.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2000, 2012, 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.
- *
- */
-
-#ifndef SHARE_VM_JVMCI_JVMCIGLOBALS_HPP
-#define SHARE_VM_JVMCI_JVMCIGLOBALS_HPP
-
-#include "runtime/globals.hpp"
-#ifdef TARGET_ARCH_x86
-# include "jvmciGlobals_x86.hpp"
-#endif
-#ifdef TARGET_ARCH_sparc
-# include "jvmciGlobals_sparc.hpp"
-#endif
-#ifdef TARGET_ARCH_arm
-# include "jvmciGlobals_arm.hpp"
-#endif
-#ifdef TARGET_ARCH_ppc
-# include "jvmciGlobals_ppc.hpp"
-#endif
-
-//
-// Defines all global flags used by the JVMCI compiler. Only flags that need
-// to be accessible to the JVMCI C++ code should be defined here. All other
-// JVMCI flags should be defined in JVMCIOptions.java.
-//
-#define JVMCI_FLAGS(develop, develop_pd, product, product_pd, notproduct)   \
-                                                                            \
-  product(bool, DebugJVMCI, true,                                           \
-          "Enable JVMTI for the compiler thread")                           \
-                                                                            \
-  product(bool, UseJVMCIClassLoader, true,                                  \
-          "Load JVMCI classes with separate class loader")                  \
-                                                                            \
-  product(ccstr, JVMCIServicesDir, NULL,                                    \
-          "Alternate directory to use for JVMCI services")                  \
-                                                                            \
-  COMPILERJVMCI_PRESENT(product(bool, BootstrapJVMCI, false,                \
-          "Bootstrap JVMCI before running Java main method"))               \
-                                                                            \
-  COMPILERJVMCI_PRESENT(product(bool, PrintBootstrap, true,                 \
-          "Print JVMCI bootstrap progress and summary"))                    \
-                                                                            \
-  COMPILERJVMCI_PRESENT(product(intx, JVMCIThreads, 1,                      \
-          "Force number of JVMCI compiler threads to use"))                 \
-                                                                            \
-  COMPILERJVMCI_PRESENT(product(intx, JVMCIHostThreads, 1,                  \
-          "Force number of compiler threads for JVMCI host compiler"))      \
-                                                                            \
-  JVMCI_ONLY(product(bool, CodeInstallSafepointChecks, true,                \
-          "Perform explicit safepoint checks while installing code"))       \
-                                                                            \
-  NOT_COMPILER2(product_pd(intx, MaxVectorSize,                             \
-          "Max vector size in bytes, "                                      \
-          "actual size could be less depending on elements type"))          \
-                                                                            \
-  NOT_COMPILER2(product(bool, ReduceInitialCardMarks, true,                 \
-          "Defer write barriers of young objects"))                         \
-                                                                            \
-  product(intx, TraceJVMCI, 0,                                              \
-          "Trace level for JVMCI")                                          \
-                                                                            \
-  product(intx, JVMCICounterSize, 0,                                        \
-          "Reserved size for benchmark counters")                           \
-                                                                            \
-  product(bool, JVMCICountersExcludeCompiler, true,                         \
-          "Exclude JVMCI compiler threads from benchmark counters")         \
-                                                                            \
-  product(bool, JVMCIHProfEnabled, false,                                   \
-          "Is Heap  Profiler enabled")                                      \
-                                                                            \
-  product(bool, JVMCICompileWithC1Only, true,                               \
-          "Only compile JVMCI classes with C1")                             \
-                                                                            \
-  product(bool, JVMCICompileAppFirst, false,                                \
-          "Prioritize application compilations over JVMCI compilations")    \
-                                                                            \
-  develop(bool, JVMCIUseFastLocking, true,                                  \
-          "Use fast inlined locking code")                                  \
-                                                                            \
-  develop(bool, JVMCIUseFastNewTypeArray, true,                             \
-          "Use fast inlined type array allocation")                         \
-                                                                            \
-  develop(bool, JVMCIUseFastNewObjectArray, true,                           \
-          "Use fast inlined object array allocation")                       \
-                                                                            \
-  product(intx, JVMCINMethodSizeLimit, (80*K)*wordSize,                     \
-          "Maximum size of a compiled method.")                             \
-                                                                            \
-  notproduct(bool, JVMCIPrintSimpleStubs, false,                            \
-          "Print simple JVMCI stubs")                                       \
-                                                                            \
-  develop(bool, TraceUncollectedSpeculations, false,                        \
-          "Print message when a failed speculation was not collected")      \
-
-
-// Read default values for JVMCI globals
-
-JVMCI_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_NOTPRODUCT_FLAG)
-
-#endif // SHARE_VM_JVMCI_JVMCIGLOBALS_HPP
--- a/src/share/vm/jvmci/jvmciJavaAccess.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2011, 2012 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.
- */
-
-#include "precompiled.hpp"
-#include "jvmci/jvmciJavaAccess.hpp"
-#include "runtime/jniHandles.hpp"
-#include "classfile/symbolTable.hpp"
-// This function is similar to javaClasses.cpp, it computes the field offset of a (static or instance) field.
-// It looks up the name and signature symbols without creating new ones, all the symbols of these classes need to be already loaded.
-
-void compute_offset(int &dest_offset, Klass* klass, const char* name, const char* signature, bool static_field) {
-  InstanceKlass* ik = InstanceKlass::cast(klass);
-  Symbol* name_symbol = SymbolTable::probe(name, (int)strlen(name));
-  Symbol* signature_symbol = SymbolTable::probe(signature, (int)strlen(signature));
-  if (name_symbol == NULL || signature_symbol == NULL) {
-#ifndef PRODUCT
-    ik->print_on(tty);
-#endif
-    fatal(err_msg("symbol with name %s and signature %s was not found in symbol table (klass=%s)", name, signature, klass->name()->as_C_string()));
-  }
-
-  fieldDescriptor fd;
-  if (!ik->find_field(name_symbol, signature_symbol, &fd)) {
-    ResourceMark rm;
-    fatal(err_msg("Invalid layout of %s at %s", name_symbol->as_C_string(), ik->external_name()));
-  }
-  guarantee(fd.is_static() == static_field, "static/instance mismatch");
-  dest_offset = fd.offset();
-  assert(dest_offset != 0, "must be valid offset");
-}
-
-// This piece of macro magic creates the contents of the jvmci_compute_offsets method that initializes the field indices of all the access classes.
-
-#define START_CLASS(name) { Klass* k = SystemDictionary::name##_klass(); assert(k != NULL, "Could not find class " #name "");
-
-#define END_CLASS }
-
-#define FIELD(klass, name, signature, static_field) compute_offset(klass::_##name##_offset, k, #name, signature, static_field);
-#define CHAR_FIELD(klass, name) FIELD(klass, name, "C", false)
-#define INT_FIELD(klass, name) FIELD(klass, name, "I", false)
-#define BOOLEAN_FIELD(klass, name) FIELD(klass, name, "Z", false)
-#define LONG_FIELD(klass, name) FIELD(klass, name, "J", false)
-#define FLOAT_FIELD(klass, name) FIELD(klass, name, "F", false)
-#define OOP_FIELD(klass, name, signature) FIELD(klass, name, signature, false)
-#define STATIC_OOP_FIELD(klass, name, signature) FIELD(klass, name, signature, true)
-#define STATIC_INT_FIELD(klass, name) FIELD(klass, name, "I", true)
-#define STATIC_BOOLEAN_FIELD(klass, name) FIELD(klass, name, "Z", true)
-
-
-void jvmci_compute_offsets() {
-  COMPILER_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, FLOAT_FIELD, OOP_FIELD, OOP_FIELD, OOP_FIELD, STATIC_OOP_FIELD, STATIC_OOP_FIELD, STATIC_INT_FIELD, STATIC_BOOLEAN_FIELD)
-  guarantee(InstalledCode::_address_offset == sizeof(oopDesc), "codeBlob must be first field!");
-}
-
-#define EMPTY0
-#define EMPTY1(x)
-#define EMPTY2(x,y)
-#define FIELD2(klass, name) int klass::_##name##_offset = 0;
-#define FIELD3(klass, name, sig) FIELD2(klass, name)
-
-COMPILER_CLASSES_DO(EMPTY1, EMPTY0, FIELD2, FIELD2, FIELD2, FIELD2, FIELD2, FIELD3, FIELD3, FIELD3, FIELD3, FIELD3, FIELD2, FIELD2)
-
-
-
-
-
--- a/src/share/vm/jvmci/jvmciJavaAccess.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,363 +0,0 @@
-/*
- * Copyright (c) 2011, 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
- * 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.
- */
-
-#ifndef SHARE_VM_JVMCI_JVMCI_JAVA_ACCESS_HPP
-#define SHARE_VM_JVMCI_JVMCI_JAVA_ACCESS_HPP
-
-void jvmci_compute_offsets();
-
-#include "classfile/systemDictionary.hpp"
-#include "oops/instanceMirrorKlass.hpp"
-
-/* This macro defines the structure of the CompilationResult - classes.
- * It will generate classes with accessors similar to javaClasses.hpp, but with specializations for oops, Handles and jni handles.
- *
- * The public interface of these classes will look like this:
-
- * class StackSlot : AllStatic {
- * public:
- *   static Klass* klass();
- *   static jint  index(oop obj);
- *   static jint  index(Handle obj);
- *   static jint  index(jobject obj);
- *   static void set_index(oop obj, jint x);
- *   static void set_index(Handle obj, jint x);
- *   static void set_index(jobject obj, jint x);
- * };
- *
- */
-
-#define COMPILER_CLASSES_DO(start_class, end_class, char_field, int_field, boolean_field, long_field, float_field, oop_field, typeArrayOop_field, objArrayOop_field, static_oop_field, static_objArrayOop_field, static_int_field, static_boolean_field) \
-  start_class(HotSpotResolvedObjectTypeImpl)                                                                                                                   \
-    oop_field(HotSpotResolvedObjectTypeImpl, javaClass, "Ljava/lang/Class;")                                                                                   \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotResolvedJavaMethodImpl)                                                                                                                   \
-    long_field(HotSpotResolvedJavaMethodImpl, metaspaceMethod)                                                                                                 \
-  end_class                                                                                                                                                    \
-  start_class(InstalledCode)                                                                                                                                   \
-    long_field(InstalledCode, address)                                                                                                                         \
-    long_field(InstalledCode, version)                                                                                                                         \
-    oop_field(InstalledCode, name, "Ljava/lang/String;")                                                                                                       \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotInstalledCode)                                                                                                                            \
-    int_field(HotSpotInstalledCode, size)                                                                                                                      \
-    long_field(HotSpotInstalledCode, codeStart)                                                                                                                \
-    int_field(HotSpotInstalledCode, codeSize)                                                                                                                  \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotNmethod)                                                                                                                                  \
-    boolean_field(HotSpotNmethod, isDefault)                                                                                                                   \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotCompiledCode)                                                                                                                             \
-    oop_field(HotSpotCompiledCode, name, "Ljava/lang/String;")                                                                                                 \
-    objArrayOop_field(HotSpotCompiledCode, sites, "[Ljdk/internal/jvmci/code/CompilationResult$Site;")                                                           \
-    objArrayOop_field(HotSpotCompiledCode, exceptionHandlers, "[Ljdk/internal/jvmci/code/CompilationResult$ExceptionHandler;")                                   \
-    objArrayOop_field(HotSpotCompiledCode, comments, "[Ljdk/internal/jvmci/hotspot/HotSpotCompiledCode$Comment;")                                                \
-    objArrayOop_field(HotSpotCompiledCode, assumptions, "[Ljdk/internal/jvmci/meta/Assumptions$Assumption;")                                                     \
-    typeArrayOop_field(HotSpotCompiledCode, targetCode, "[B")                                                                                                  \
-    int_field(HotSpotCompiledCode, targetCodeSize)                                                                                                             \
-    typeArrayOop_field(HotSpotCompiledCode, dataSection, "[B")                                                                                                 \
-    int_field(HotSpotCompiledCode, dataSectionAlignment)                                                                                                       \
-    objArrayOop_field(HotSpotCompiledCode, dataSectionPatches, "[Ljdk/internal/jvmci/code/CompilationResult$DataPatch;")                                         \
-    int_field(HotSpotCompiledCode, totalFrameSize)                                                                                                             \
-    int_field(HotSpotCompiledCode, customStackAreaOffset)                                                                                                      \
-    objArrayOop_field(HotSpotCompiledCode, methods, "[Ljdk/internal/jvmci/meta/ResolvedJavaMethod;")                                                             \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotCompiledCode_Comment)                                                                                                                     \
-    oop_field(HotSpotCompiledCode_Comment, text, "Ljava/lang/String;")                                                                                         \
-    int_field(HotSpotCompiledCode_Comment, pcOffset)                                                                                                           \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotCompiledNmethod)                                                                                                                          \
-    oop_field(HotSpotCompiledNmethod, method, "Ljdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethod;")                                                          \
-    oop_field(HotSpotCompiledNmethod, installationFailureMessage, "Ljava/lang/String;")                                                                        \
-    int_field(HotSpotCompiledNmethod, entryBCI)                                                                                                                \
-    int_field(HotSpotCompiledNmethod, id)                                                                                                                      \
-    long_field(HotSpotCompiledNmethod, jvmciEnv)                                                                                                               \
-    boolean_field(HotSpotCompiledNmethod, hasUnsafeAccess)                                                                                                     \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotJVMCIMetaAccessContext)                                                                                                                      \
-    static_objArrayOop_field(HotSpotJVMCIMetaAccessContext, allContexts, "[Ljava/lang/ref/WeakReference;")                                                        \
-    objArrayOop_field(HotSpotJVMCIMetaAccessContext, metadataRoots, "[Ljava/lang/Object;")                                                                        \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotForeignCallTarget)                                                                                                                        \
-    long_field(HotSpotForeignCallTarget, address)                                                                                                              \
-  end_class                                                                                                                                                    \
-  start_class(Assumptions_NoFinalizableSubclass)                                                                                                               \
-    oop_field(Assumptions_NoFinalizableSubclass, receiverType, "Ljdk/internal/jvmci/meta/ResolvedJavaType;")                                                     \
-  end_class                                                                                                                                                    \
-  start_class(Assumptions_ConcreteSubtype)                                                                                                                     \
-    oop_field(Assumptions_ConcreteSubtype, context, "Ljdk/internal/jvmci/meta/ResolvedJavaType;")                                                                \
-    oop_field(Assumptions_ConcreteSubtype, subtype, "Ljdk/internal/jvmci/meta/ResolvedJavaType;")                                                                \
-  end_class                                                                                                                                                    \
-  start_class(Assumptions_LeafType)                                                                                                                            \
-    oop_field(Assumptions_LeafType, context, "Ljdk/internal/jvmci/meta/ResolvedJavaType;")                                                                       \
-  end_class                                                                                                                                                    \
-  start_class(Assumptions_ConcreteMethod)                                                                                                                      \
-    oop_field(Assumptions_ConcreteMethod, method, "Ljdk/internal/jvmci/meta/ResolvedJavaMethod;")                                                                \
-    oop_field(Assumptions_ConcreteMethod, context, "Ljdk/internal/jvmci/meta/ResolvedJavaType;")                                                                 \
-    oop_field(Assumptions_ConcreteMethod, impl, "Ljdk/internal/jvmci/meta/ResolvedJavaMethod;")                                                                  \
-  end_class                                                                                                                                                    \
-  start_class(Assumptions_CallSiteTargetValue)                                                                                                                 \
-    oop_field(Assumptions_CallSiteTargetValue, callSite, "Ljava/lang/invoke/CallSite;")                                                                        \
-    oop_field(Assumptions_CallSiteTargetValue, methodHandle, "Ljava/lang/invoke/MethodHandle;")                                                                \
-  end_class                                                                                                                                                    \
-  start_class(CompilationResult_Site)                                                                                                                          \
-    int_field(CompilationResult_Site, pcOffset)                                                                                                                \
-  end_class                                                                                                                                                    \
-  start_class(CompilationResult_Call)                                                                                                                          \
-    oop_field(CompilationResult_Call, target, "Ljdk/internal/jvmci/meta/InvokeTarget;")                                                                          \
-    oop_field(CompilationResult_Call, debugInfo, "Ljdk/internal/jvmci/code/DebugInfo;")                                                                          \
-  end_class                                                                                                                                                    \
-  start_class(CompilationResult_DataPatch)                                                                                                                     \
-    oop_field(CompilationResult_DataPatch, reference, "Ljdk/internal/jvmci/code/CompilationResult$Reference;")                                                   \
-  end_class                                                                                                                                                    \
-  start_class(CompilationResult_ConstantReference)                                                                                                             \
-    oop_field(CompilationResult_ConstantReference, constant, "Ljdk/internal/jvmci/meta/VMConstant;")                                                             \
-  end_class                                                                                                                                                    \
-  start_class(CompilationResult_DataSectionReference)                                                                                                          \
-    int_field(CompilationResult_DataSectionReference, offset)                                                                                                  \
-  end_class                                                                                                                                                    \
-  start_class(InfopointReason)                                                                                                                                 \
-    static_oop_field(InfopointReason, UNKNOWN, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                      \
-    static_oop_field(InfopointReason, SAFEPOINT, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                    \
-    static_oop_field(InfopointReason, CALL, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                         \
-    static_oop_field(InfopointReason, IMPLICIT_EXCEPTION, "Ljdk/internal/jvmci/code/InfopointReason;")                                                           \
-    static_oop_field(InfopointReason, METHOD_START, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                 \
-    static_oop_field(InfopointReason, METHOD_END, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                   \
-    static_oop_field(InfopointReason, LINE_NUMBER, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                  \
-  end_class                                                                                                                                                    \
-  start_class(CompilationResult_Infopoint)                                                                                                                     \
-    oop_field(CompilationResult_Infopoint, debugInfo, "Ljdk/internal/jvmci/code/DebugInfo;")                                                                     \
-    oop_field(CompilationResult_Infopoint, reason, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                  \
-  end_class                                                                                                                                                    \
-  start_class(CompilationResult_ExceptionHandler)                                                                                                              \
-    int_field(CompilationResult_ExceptionHandler, handlerPos)                                                                                                  \
-  end_class                                                                                                                                                    \
-  start_class(CompilationResult_Mark)                                                                                                                          \
-    oop_field(CompilationResult_Mark, id, "Ljava/lang/Object;")                                                                                                \
-  end_class                                                                                                                                                    \
-  start_class(DebugInfo)                                                                                                                                       \
-    oop_field(DebugInfo, bytecodePosition, "Ljdk/internal/jvmci/code/BytecodePosition;")                                                                         \
-    oop_field(DebugInfo, referenceMap, "Ljdk/internal/jvmci/code/ReferenceMap;")                                                                                 \
-    oop_field(DebugInfo, calleeSaveInfo, "Ljdk/internal/jvmci/code/RegisterSaveLayout;")                                                                         \
-    objArrayOop_field(DebugInfo, virtualObjectMapping, "[Ljdk/internal/jvmci/code/VirtualObject;")                                                               \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotReferenceMap)                                                                                                                             \
-    objArrayOop_field(HotSpotReferenceMap, objects, "[Ljdk/internal/jvmci/code/Location;")                                                                       \
-    objArrayOop_field(HotSpotReferenceMap, derivedBase, "[Ljdk/internal/jvmci/code/Location;")                                                                   \
-    typeArrayOop_field(HotSpotReferenceMap, sizeInBytes, "[I")                                                                                                 \
-    int_field(HotSpotReferenceMap, maxRegisterSize)                                                                                                            \
-  end_class                                                                                                                                                    \
-  start_class(RegisterSaveLayout)                                                                                                                              \
-    objArrayOop_field(RegisterSaveLayout, registers, "[Ljdk/internal/jvmci/code/Register;")                                                                      \
-    typeArrayOop_field(RegisterSaveLayout, slots, "[I")                                                                                                        \
-  end_class                                                                                                                                                    \
-  start_class(BytecodeFrame)                                                                                                                                   \
-    objArrayOop_field(BytecodeFrame, values, "[Ljdk/internal/jvmci/meta/Value;")                                                                                 \
-    int_field(BytecodeFrame, numLocals)                                                                                                                        \
-    int_field(BytecodeFrame, numStack)                                                                                                                         \
-    int_field(BytecodeFrame, numLocks)                                                                                                                         \
-    boolean_field(BytecodeFrame, rethrowException)                                                                                                             \
-    boolean_field(BytecodeFrame, duringCall)                                                                                                                   \
-    static_int_field(BytecodeFrame, BEFORE_BCI)                                                                                                                \
-  end_class                                                                                                                                                    \
-  start_class(BytecodePosition)                                                                                                                                \
-    oop_field(BytecodePosition, caller, "Ljdk/internal/jvmci/code/BytecodePosition;")                                                                            \
-    oop_field(BytecodePosition, method, "Ljdk/internal/jvmci/meta/ResolvedJavaMethod;")                                                                          \
-    int_field(BytecodePosition, bci)                                                                                                                           \
-  end_class                                                                                                                                                    \
-  start_class(JavaConstant)                                                                                                                                    \
-  end_class                                                                                                                                                    \
-  start_class(PrimitiveConstant)                                                                                                                               \
-    long_field(PrimitiveConstant, primitive)                                                                                                                   \
-  end_class                                                                                                                                                    \
-  start_class(RawConstant)                                                                                                                                     \
-    long_field(RawConstant, primitive)                                                                                                                         \
-  end_class                                                                                                                                                    \
-  start_class(NullConstant)                                                                                                                                    \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotCompressedNullConstant)                                                                                                                   \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotObjectConstantImpl)                                                                                                                       \
-    oop_field(HotSpotObjectConstantImpl, object, "Ljava/lang/Object;")                                                                                         \
-    boolean_field(HotSpotObjectConstantImpl, compressed)                                                                                                       \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotMetaspaceConstantImpl)                                                                                                                    \
-    long_field(HotSpotMetaspaceConstantImpl, primitive)                                                                                                        \
-    oop_field(HotSpotMetaspaceConstantImpl, metaspaceObject, "Ljava/lang/Object;")                                                                             \
-    boolean_field(HotSpotMetaspaceConstantImpl, compressed)                                                                                                    \
-  end_class                                                                                                                                                    \
-  start_class(Kind)                                                                                                                                            \
-    char_field(Kind, typeChar)                                                                                                                                 \
-    static_oop_field(Kind, Boolean, "Ljdk/internal/jvmci/meta/Kind;");                                                                                           \
-    static_oop_field(Kind, Byte, "Ljdk/internal/jvmci/meta/Kind;");                                                                                              \
-    static_oop_field(Kind, Char, "Ljdk/internal/jvmci/meta/Kind;");                                                                                              \
-    static_oop_field(Kind, Short, "Ljdk/internal/jvmci/meta/Kind;");                                                                                             \
-    static_oop_field(Kind, Int, "Ljdk/internal/jvmci/meta/Kind;");                                                                                               \
-    static_oop_field(Kind, Long, "Ljdk/internal/jvmci/meta/Kind;");                                                                                              \
-  end_class                                                                                                                                                    \
-  start_class(LIRKind)                                                                                                                                         \
-    oop_field(LIRKind, platformKind, "Ljdk/internal/jvmci/meta/PlatformKind;")                                                                                   \
-    int_field(LIRKind, referenceMask)                                                                                                                          \
-  end_class                                                                                                                                                    \
-  start_class(AbstractValue)                                                                                                                                   \
-    oop_field(AbstractValue, kind, "Ljdk/internal/jvmci/meta/Kind;")                                                                                             \
-    oop_field(AbstractValue, lirKind, "Ljdk/internal/jvmci/meta/LIRKind;")                                                                                       \
-    static_oop_field(AbstractValue, ILLEGAL, "Ljdk/internal/jvmci/meta/AllocatableValue;");                                                                      \
-  end_class                                                                                                                                                    \
-  start_class(RegisterValue)                                                                                                                                   \
-    oop_field(RegisterValue, reg, "Ljdk/internal/jvmci/code/Register;")                                                                                          \
-  end_class                                                                                                                                                    \
-  start_class(code_Location)                                                                                                                                   \
-    oop_field(code_Location, reg, "Ljdk/internal/jvmci/code/Register;")                                                                                          \
-    int_field(code_Location, offset)                                                                                                                           \
-  end_class                                                                                                                                                    \
-  start_class(code_Register)                                                                                                                                   \
-    int_field(code_Register, number)                                                                                                                           \
-    int_field(code_Register, encoding)                                                                                                                         \
-  end_class                                                                                                                                                    \
-  start_class(StackSlot)                                                                                                                                       \
-    int_field(StackSlot, offset)                                                                                                                               \
-    boolean_field(StackSlot, addFrameSize)                                                                                                                     \
-  end_class                                                                                                                                                    \
-  start_class(VirtualObject)                                                                                                                                   \
-    int_field(VirtualObject, id)                                                                                                                               \
-    oop_field(VirtualObject, type, "Ljdk/internal/jvmci/meta/ResolvedJavaType;")                                                                                 \
-    objArrayOop_field(VirtualObject, values, "[Ljdk/internal/jvmci/meta/Value;")                                                                                 \
-  end_class                                                                                                                                                    \
-  start_class(StackLockValue)                                                                                                                                  \
-    oop_field(StackLockValue, owner, "Ljdk/internal/jvmci/meta/Value;")                                                                                          \
-    oop_field(StackLockValue, slot, "Ljdk/internal/jvmci/code/StackSlotValue;")                                                                                  \
-    boolean_field(StackLockValue, eliminated)                                                                                                                  \
-  end_class                                                                                                                                                    \
-  start_class(SpeculationLog)                                                                                                                                  \
-    oop_field(SpeculationLog, lastFailed, "Ljava/lang/Object;")                                                                                                \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotStackFrameReference)                                                                                                                      \
-    oop_field(HotSpotStackFrameReference, compilerToVM, "Ljdk/internal/jvmci/hotspot/CompilerToVM;")                                                             \
-    long_field(HotSpotStackFrameReference, stackPointer)                                                                                                       \
-    int_field(HotSpotStackFrameReference, frameNumber)                                                                                                         \
-    int_field(HotSpotStackFrameReference, bci)                                                                                                                 \
-    oop_field(HotSpotStackFrameReference, method, "Ljdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethod;")                                                    \
-    objArrayOop_field(HotSpotStackFrameReference, locals, "[Ljava/lang/Object;")                                                                               \
-    typeArrayOop_field(HotSpotStackFrameReference, localIsVirtual, "[Z")                                                                                       \
-  end_class                                                                                                                                                    \
-  start_class(HotSpotConstantPool)                                                                                                                             \
-    long_field(HotSpotConstantPool, metaspaceConstantPool)                                                                                                     \
-  end_class                                                                                                                                                    \
-  /* end*/
-
-#define START_CLASS(name)                                                                                                                                      \
-class name : AllStatic {                                                                                                                                       \
-  private:                                                                                                                                                     \
-    friend class JVMCICompiler;                                                                                                                                \
-    static void check(oop obj, const char* field_name, int offset) {                                                                                           \
-        assert(obj != NULL, err_msg("NULL field access of %s.%s", #name, field_name));                                                                         \
-        assert(obj->is_a(SystemDictionary::name##_klass()), err_msg("wrong class, " #name " expected, found %s", obj->klass()->external_name())); \
-        assert(offset != 0, "must be valid offset");                                                                                                           \
-    }                                                                                                                                                          \
-    static void compute_offsets();                                                                                                                             \
-  public:                                                                                                                                                      \
-    static Klass* klass() { return SystemDictionary::name##_klass(); }
-
-#define END_CLASS };
-
-#define FIELD(name, type, accessor, cast)                                                                                                                         \
-    static int _##name##_offset;                                                                                                                                  \
-    static type name(oop obj)                   { check(obj, #name, _##name##_offset); return cast obj->accessor(_##name##_offset); }                                               \
-    static type name(Handle& obj)                { check(obj(), #name, _##name##_offset); return cast obj->accessor(_##name##_offset); }                                            \
-    static type name(jobject obj)               { check(JNIHandles::resolve(obj), #name, _##name##_offset); return cast JNIHandles::resolve(obj)->accessor(_##name##_offset); }     \
-    static void set_##name(oop obj, type x)     { check(obj, #name, _##name##_offset); obj->accessor##_put(_##name##_offset, x); }                                                  \
-    static void set_##name(Handle& obj, type x)  { check(obj(), #name, _##name##_offset); obj->accessor##_put(_##name##_offset, x); }                                               \
-    static void set_##name(jobject obj, type x) { check(JNIHandles::resolve(obj), #name, _##name##_offset); JNIHandles::resolve(obj)->accessor##_put(_##name##_offset, x); }
-
-#define EMPTY_CAST 
-#define CHAR_FIELD(klass, name) FIELD(name, jchar, char_field, EMPTY_CAST)
-#define INT_FIELD(klass, name) FIELD(name, jint, int_field, EMPTY_CAST)
-#define BOOLEAN_FIELD(klass, name) FIELD(name, jboolean, bool_field, EMPTY_CAST)
-#define LONG_FIELD(klass, name) FIELD(name, jlong, long_field, EMPTY_CAST)
-#define FLOAT_FIELD(klass, name) FIELD(name, jfloat, float_field, EMPTY_CAST)
-#define OOP_FIELD(klass, name, signature) FIELD(name, oop, obj_field, EMPTY_CAST)
-#define OBJARRAYOOP_FIELD(klass, name, signature) FIELD(name, objArrayOop, obj_field, (objArrayOop))
-#define TYPEARRAYOOP_FIELD(klass, name, signature) FIELD(name, typeArrayOop, obj_field, (typeArrayOop))
-#define STATIC_OOP_FIELD(klassName, name, signature) STATIC_OOPISH_FIELD(klassName, name, oop, signature)
-#define STATIC_OBJARRAYOOP_FIELD(klassName, name, signature) STATIC_OOPISH_FIELD(klassName, name, objArrayOop, signature)
-#define STATIC_OOPISH_FIELD(klassName, name, type, signature)                                                  \
-    static int _##name##_offset;                                                                               \
-    static type name() {                                                                                       \
-      assert(klassName::klass() != NULL, "Class not yet loaded: " #klassName);                                 \
-      InstanceKlass* ik = InstanceKlass::cast(klassName::klass());                                             \
-      address addr = ik->static_field_addr(_##name##_offset - InstanceMirrorKlass::offset_of_static_fields()); \
-      if (UseCompressedOops) {                                                                                 \
-        return (type) oopDesc::load_decode_heap_oop((narrowOop *)addr);                                        \
-      } else {                                                                                                 \
-        return (type) oopDesc::load_decode_heap_oop((oop*)addr);                                               \
-      }                                                                                                        \
-    }                                                                                                          \
-    static void set_##name(type x) {                                                                           \
-      assert(klassName::klass() != NULL, "Class not yet loaded: " #klassName);                                 \
-      InstanceKlass* ik = InstanceKlass::cast(klassName::klass());                                             \
-      address addr = ik->static_field_addr(_##name##_offset - InstanceMirrorKlass::offset_of_static_fields()); \
-      if (UseCompressedOops) {                                                                                 \
-        oop_store((narrowOop *)addr, x);                                                                       \
-      } else {                                                                                                 \
-        oop_store((oop*)addr, x);                                                                              \
-      }                                                                                                        \
-    }
-#define STATIC_PRIMITIVE_FIELD(klassName, name, jtypename)                                                     \
-    static int _##name##_offset;                                                                               \
-    static jtypename name() {                                                                                  \
-      InstanceKlass* ik = InstanceKlass::cast(klassName::klass());                                             \
-      address addr = ik->static_field_addr(_##name##_offset - InstanceMirrorKlass::offset_of_static_fields()); \
-      return *((jtypename *)addr);                                                                             \
-    }                                                                                                          \
-    static void set_##name(jtypename x) {                                                                      \
-      InstanceKlass* ik = InstanceKlass::cast(klassName::klass());                                             \
-      address addr = ik->static_field_addr(_##name##_offset - InstanceMirrorKlass::offset_of_static_fields()); \
-      *((jtypename *)addr) = x;                                                                                \
-    }
-
-#define STATIC_INT_FIELD(klassName, name) STATIC_PRIMITIVE_FIELD(klassName, name, jint)
-#define STATIC_BOOLEAN_FIELD(klassName, name) STATIC_PRIMITIVE_FIELD(klassName, name, jboolean)
-
-COMPILER_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, FLOAT_FIELD, OOP_FIELD, TYPEARRAYOOP_FIELD, OBJARRAYOOP_FIELD, STATIC_OOP_FIELD, STATIC_OBJARRAYOOP_FIELD, STATIC_INT_FIELD, STATIC_BOOLEAN_FIELD)
-#undef START_CLASS
-#undef END_CLASS
-#undef FIELD
-#undef CHAR_FIELD
-#undef INT_FIELD
-#undef BOOLEAN_FIELD
-#undef LONG_FIELD
-#undef FLOAT_FIELD
-#undef OOP_FIELD
-#undef TYPEARRAYOOP_FIELD
-#undef OBJARRAYOOP_FIELD
-#undef STATIC_OOPISH_FIELD
-#undef STATIC_OOP_FIELD
-#undef STATIC_OBJARRAYOOP_FIELD
-#undef STATIC_INT_FIELD
-#undef STATIC_BOOLEAN_FIELD
-#undef EMPTY_CAST
-
-void compute_offset(int &dest_offset, Klass* klass, const char* name, const char* signature, bool static_field);
-
-#endif // SHARE_VM_JVMCI_JVMCI_JAVA_ACCESS_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/jvmci/jvmciJavaClasses.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2011, 2012 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.
+ */
+
+#include "precompiled.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
+#include "runtime/jniHandles.hpp"
+#include "classfile/symbolTable.hpp"
+// This function is similar to javaClasses.cpp, it computes the field offset of a (static or instance) field.
+// It looks up the name and signature symbols without creating new ones, all the symbols of these classes need to be already loaded.
+
+void compute_offset(int &dest_offset, Klass* klass, const char* name, const char* signature, bool static_field) {
+  InstanceKlass* ik = InstanceKlass::cast(klass);
+  Symbol* name_symbol = SymbolTable::probe(name, (int)strlen(name));
+  Symbol* signature_symbol = SymbolTable::probe(signature, (int)strlen(signature));
+  if (name_symbol == NULL || signature_symbol == NULL) {
+#ifndef PRODUCT
+    ik->print_on(tty);
+#endif
+    fatal(err_msg("symbol with name %s and signature %s was not found in symbol table (klass=%s)", name, signature, klass->name()->as_C_string()));
+  }
+
+  fieldDescriptor fd;
+  if (!ik->find_field(name_symbol, signature_symbol, &fd)) {
+    ResourceMark rm;
+    fatal(err_msg("Invalid layout of %s at %s", name_symbol->as_C_string(), ik->external_name()));
+  }
+  guarantee(fd.is_static() == static_field, "static/instance mismatch");
+  dest_offset = fd.offset();
+  assert(dest_offset != 0, "must be valid offset");
+}
+
+// This piece of macro magic creates the contents of the jvmci_compute_offsets method that initializes the field indices of all the access classes.
+
+#define START_CLASS(name) { Klass* k = SystemDictionary::name##_klass(); assert(k != NULL, "Could not find class " #name "");
+
+#define END_CLASS }
+
+#define FIELD(klass, name, signature, static_field) compute_offset(klass::_##name##_offset, k, #name, signature, static_field);
+#define CHAR_FIELD(klass, name) FIELD(klass, name, "C", false)
+#define INT_FIELD(klass, name) FIELD(klass, name, "I", false)
+#define BOOLEAN_FIELD(klass, name) FIELD(klass, name, "Z", false)
+#define LONG_FIELD(klass, name) FIELD(klass, name, "J", false)
+#define FLOAT_FIELD(klass, name) FIELD(klass, name, "F", false)
+#define OOP_FIELD(klass, name, signature) FIELD(klass, name, signature, false)
+#define STATIC_OOP_FIELD(klass, name, signature) FIELD(klass, name, signature, true)
+#define STATIC_INT_FIELD(klass, name) FIELD(klass, name, "I", true)
+#define STATIC_BOOLEAN_FIELD(klass, name) FIELD(klass, name, "Z", true)
+
+
+void jvmci_compute_offsets() {
+  COMPILER_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, FLOAT_FIELD, OOP_FIELD, OOP_FIELD, OOP_FIELD, STATIC_OOP_FIELD, STATIC_OOP_FIELD, STATIC_INT_FIELD, STATIC_BOOLEAN_FIELD)
+  guarantee(InstalledCode::_address_offset == sizeof(oopDesc), "codeBlob must be first field!");
+}
+
+#define EMPTY0
+#define EMPTY1(x)
+#define EMPTY2(x,y)
+#define FIELD2(klass, name) int klass::_##name##_offset = 0;
+#define FIELD3(klass, name, sig) FIELD2(klass, name)
+
+COMPILER_CLASSES_DO(EMPTY1, EMPTY0, FIELD2, FIELD2, FIELD2, FIELD2, FIELD2, FIELD3, FIELD3, FIELD3, FIELD3, FIELD3, FIELD2, FIELD2)
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/jvmci/jvmciJavaClasses.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -0,0 +1,374 @@
+/*
+ * Copyright (c) 2011, 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
+ * 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.
+ */
+
+#ifndef SHARE_VM_JVMCI_JVMCIJAVACLASSES_HPP
+#define SHARE_VM_JVMCI_JVMCIJAVACLASSES_HPP
+
+void jvmci_compute_offsets();
+
+#include "classfile/systemDictionary.hpp"
+#include "oops/instanceMirrorKlass.hpp"
+
+/* This macro defines the structure of the CompilationResult - classes.
+ * It will generate classes with accessors similar to javaClasses.hpp, but with specializations for oops, Handles and jni handles.
+ *
+ * The public interface of these classes will look like this:
+
+ * class StackSlot : AllStatic {
+ * public:
+ *   static Klass* klass();
+ *   static jint  index(oop obj);
+ *   static jint  index(Handle obj);
+ *   static jint  index(jobject obj);
+ *   static void set_index(oop obj, jint x);
+ *   static void set_index(Handle obj, jint x);
+ *   static void set_index(jobject obj, jint x);
+ * };
+ *
+ */
+
+#define COMPILER_CLASSES_DO(start_class, end_class, char_field, int_field, boolean_field, long_field, float_field, oop_field, typeArrayOop_field, objArrayOop_field, static_oop_field, static_objArrayOop_field, static_int_field, static_boolean_field) \
+  start_class(Architecture)                                                                                                                                    \
+    oop_field(Architecture, wordKind, "Ljdk/internal/jvmci/meta/PlatformKind;")                                                                                \
+  end_class                                                                                                                                                    \
+  start_class(TargetDescription)                                                                                                                               \
+    oop_field(TargetDescription, arch, "Ljdk/internal/jvmci/code/Architecture;")                                                                               \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotResolvedObjectTypeImpl)                                                                                                                   \
+    oop_field(HotSpotResolvedObjectTypeImpl, javaClass, "Ljava/lang/Class;")                                                                                   \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotResolvedJavaMethodImpl)                                                                                                                   \
+    long_field(HotSpotResolvedJavaMethodImpl, metaspaceMethod)                                                                                                 \
+  end_class                                                                                                                                                    \
+  start_class(InstalledCode)                                                                                                                                   \
+    long_field(InstalledCode, address)                                                                                                                         \
+    long_field(InstalledCode, version)                                                                                                                         \
+    oop_field(InstalledCode, name, "Ljava/lang/String;")                                                                                                       \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotInstalledCode)                                                                                                                            \
+    int_field(HotSpotInstalledCode, size)                                                                                                                      \
+    long_field(HotSpotInstalledCode, codeStart)                                                                                                                \
+    int_field(HotSpotInstalledCode, codeSize)                                                                                                                  \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotNmethod)                                                                                                                                  \
+    boolean_field(HotSpotNmethod, isDefault)                                                                                                                   \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotCompiledCode)                                                                                                                             \
+    oop_field(HotSpotCompiledCode, name, "Ljava/lang/String;")                                                                                                 \
+    objArrayOop_field(HotSpotCompiledCode, sites, "[Ljdk/internal/jvmci/code/CompilationResult$Site;")                                                           \
+    objArrayOop_field(HotSpotCompiledCode, exceptionHandlers, "[Ljdk/internal/jvmci/code/CompilationResult$ExceptionHandler;")                                   \
+    objArrayOop_field(HotSpotCompiledCode, comments, "[Ljdk/internal/jvmci/hotspot/HotSpotCompiledCode$Comment;")                                                \
+    objArrayOop_field(HotSpotCompiledCode, assumptions, "[Ljdk/internal/jvmci/meta/Assumptions$Assumption;")                                                     \
+    typeArrayOop_field(HotSpotCompiledCode, targetCode, "[B")                                                                                                  \
+    int_field(HotSpotCompiledCode, targetCodeSize)                                                                                                             \
+    typeArrayOop_field(HotSpotCompiledCode, dataSection, "[B")                                                                                                 \
+    int_field(HotSpotCompiledCode, dataSectionAlignment)                                                                                                       \
+    objArrayOop_field(HotSpotCompiledCode, dataSectionPatches, "[Ljdk/internal/jvmci/code/CompilationResult$DataPatch;")                                         \
+    int_field(HotSpotCompiledCode, totalFrameSize)                                                                                                             \
+    int_field(HotSpotCompiledCode, customStackAreaOffset)                                                                                                      \
+    objArrayOop_field(HotSpotCompiledCode, methods, "[Ljdk/internal/jvmci/meta/ResolvedJavaMethod;")                                                             \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotCompiledCode_Comment)                                                                                                                     \
+    oop_field(HotSpotCompiledCode_Comment, text, "Ljava/lang/String;")                                                                                         \
+    int_field(HotSpotCompiledCode_Comment, pcOffset)                                                                                                           \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotCompiledNmethod)                                                                                                                          \
+    oop_field(HotSpotCompiledNmethod, method, "Ljdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethod;")                                                          \
+    oop_field(HotSpotCompiledNmethod, installationFailureMessage, "Ljava/lang/String;")                                                                        \
+    int_field(HotSpotCompiledNmethod, entryBCI)                                                                                                                \
+    int_field(HotSpotCompiledNmethod, id)                                                                                                                      \
+    long_field(HotSpotCompiledNmethod, jvmciEnv)                                                                                                               \
+    boolean_field(HotSpotCompiledNmethod, hasUnsafeAccess)                                                                                                     \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotJVMCIMetaAccessContext)                                                                                                                      \
+    static_objArrayOop_field(HotSpotJVMCIMetaAccessContext, allContexts, "[Ljava/lang/ref/WeakReference;")                                                        \
+    objArrayOop_field(HotSpotJVMCIMetaAccessContext, metadataRoots, "[Ljava/lang/Object;")                                                                        \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotForeignCallTarget)                                                                                                                        \
+    long_field(HotSpotForeignCallTarget, address)                                                                                                              \
+  end_class                                                                                                                                                    \
+  start_class(Assumptions_NoFinalizableSubclass)                                                                                                               \
+    oop_field(Assumptions_NoFinalizableSubclass, receiverType, "Ljdk/internal/jvmci/meta/ResolvedJavaType;")                                                     \
+  end_class                                                                                                                                                    \
+  start_class(Assumptions_ConcreteSubtype)                                                                                                                     \
+    oop_field(Assumptions_ConcreteSubtype, context, "Ljdk/internal/jvmci/meta/ResolvedJavaType;")                                                                \
+    oop_field(Assumptions_ConcreteSubtype, subtype, "Ljdk/internal/jvmci/meta/ResolvedJavaType;")                                                                \
+  end_class                                                                                                                                                    \
+  start_class(Assumptions_LeafType)                                                                                                                            \
+    oop_field(Assumptions_LeafType, context, "Ljdk/internal/jvmci/meta/ResolvedJavaType;")                                                                       \
+  end_class                                                                                                                                                    \
+  start_class(Assumptions_ConcreteMethod)                                                                                                                      \
+    oop_field(Assumptions_ConcreteMethod, method, "Ljdk/internal/jvmci/meta/ResolvedJavaMethod;")                                                                \
+    oop_field(Assumptions_ConcreteMethod, context, "Ljdk/internal/jvmci/meta/ResolvedJavaType;")                                                                 \
+    oop_field(Assumptions_ConcreteMethod, impl, "Ljdk/internal/jvmci/meta/ResolvedJavaMethod;")                                                                  \
+  end_class                                                                                                                                                    \
+  start_class(Assumptions_CallSiteTargetValue)                                                                                                                 \
+    oop_field(Assumptions_CallSiteTargetValue, callSite, "Ljava/lang/invoke/CallSite;")                                                                        \
+    oop_field(Assumptions_CallSiteTargetValue, methodHandle, "Ljava/lang/invoke/MethodHandle;")                                                                \
+  end_class                                                                                                                                                    \
+  start_class(CompilationResult_Site)                                                                                                                          \
+    int_field(CompilationResult_Site, pcOffset)                                                                                                                \
+  end_class                                                                                                                                                    \
+  start_class(CompilationResult_Call)                                                                                                                          \
+    oop_field(CompilationResult_Call, target, "Ljdk/internal/jvmci/meta/InvokeTarget;")                                                                          \
+    oop_field(CompilationResult_Call, debugInfo, "Ljdk/internal/jvmci/code/DebugInfo;")                                                                          \
+  end_class                                                                                                                                                    \
+  start_class(CompilationResult_DataPatch)                                                                                                                     \
+    oop_field(CompilationResult_DataPatch, reference, "Ljdk/internal/jvmci/code/CompilationResult$Reference;")                                                   \
+  end_class                                                                                                                                                    \
+  start_class(CompilationResult_ConstantReference)                                                                                                             \
+    oop_field(CompilationResult_ConstantReference, constant, "Ljdk/internal/jvmci/meta/VMConstant;")                                                             \
+  end_class                                                                                                                                                    \
+  start_class(CompilationResult_DataSectionReference)                                                                                                          \
+    int_field(CompilationResult_DataSectionReference, offset)                                                                                                  \
+  end_class                                                                                                                                                    \
+  start_class(InfopointReason)                                                                                                                                 \
+    static_oop_field(InfopointReason, UNKNOWN, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                      \
+    static_oop_field(InfopointReason, SAFEPOINT, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                    \
+    static_oop_field(InfopointReason, CALL, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                         \
+    static_oop_field(InfopointReason, IMPLICIT_EXCEPTION, "Ljdk/internal/jvmci/code/InfopointReason;")                                                           \
+    static_oop_field(InfopointReason, METHOD_START, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                 \
+    static_oop_field(InfopointReason, METHOD_END, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                   \
+    static_oop_field(InfopointReason, LINE_NUMBER, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                  \
+  end_class                                                                                                                                                    \
+  start_class(CompilationResult_Infopoint)                                                                                                                     \
+    oop_field(CompilationResult_Infopoint, debugInfo, "Ljdk/internal/jvmci/code/DebugInfo;")                                                                     \
+    oop_field(CompilationResult_Infopoint, reason, "Ljdk/internal/jvmci/code/InfopointReason;")                                                                  \
+  end_class                                                                                                                                                    \
+  start_class(CompilationResult_ExceptionHandler)                                                                                                              \
+    int_field(CompilationResult_ExceptionHandler, handlerPos)                                                                                                  \
+  end_class                                                                                                                                                    \
+  start_class(CompilationResult_Mark)                                                                                                                          \
+    oop_field(CompilationResult_Mark, id, "Ljava/lang/Object;")                                                                                                \
+  end_class                                                                                                                                                    \
+  start_class(DebugInfo)                                                                                                                                       \
+    oop_field(DebugInfo, bytecodePosition, "Ljdk/internal/jvmci/code/BytecodePosition;")                                                                         \
+    oop_field(DebugInfo, referenceMap, "Ljdk/internal/jvmci/code/ReferenceMap;")                                                                                 \
+    oop_field(DebugInfo, calleeSaveInfo, "Ljdk/internal/jvmci/code/RegisterSaveLayout;")                                                                         \
+    objArrayOop_field(DebugInfo, virtualObjectMapping, "[Ljdk/internal/jvmci/code/VirtualObject;")                                                               \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotReferenceMap)                                                                                                                             \
+    objArrayOop_field(HotSpotReferenceMap, objects, "[Ljdk/internal/jvmci/code/Location;")                                                                       \
+    objArrayOop_field(HotSpotReferenceMap, derivedBase, "[Ljdk/internal/jvmci/code/Location;")                                                                   \
+    typeArrayOop_field(HotSpotReferenceMap, sizeInBytes, "[I")                                                                                                 \
+    int_field(HotSpotReferenceMap, maxRegisterSize)                                                                                                            \
+  end_class                                                                                                                                                    \
+  start_class(RegisterSaveLayout)                                                                                                                              \
+    objArrayOop_field(RegisterSaveLayout, registers, "[Ljdk/internal/jvmci/code/Register;")                                                                      \
+    typeArrayOop_field(RegisterSaveLayout, slots, "[I")                                                                                                        \
+  end_class                                                                                                                                                    \
+  start_class(BytecodeFrame)                                                                                                                                   \
+    objArrayOop_field(BytecodeFrame, values, "[Ljdk/internal/jvmci/meta/JavaValue;")                                                                           \
+    objArrayOop_field(BytecodeFrame, slotKinds, "[Ljdk/internal/jvmci/meta/JavaKind;")                                                                         \
+    int_field(BytecodeFrame, numLocals)                                                                                                                        \
+    int_field(BytecodeFrame, numStack)                                                                                                                         \
+    int_field(BytecodeFrame, numLocks)                                                                                                                         \
+    boolean_field(BytecodeFrame, rethrowException)                                                                                                             \
+    boolean_field(BytecodeFrame, duringCall)                                                                                                                   \
+    static_int_field(BytecodeFrame, BEFORE_BCI)                                                                                                                \
+  end_class                                                                                                                                                    \
+  start_class(BytecodePosition)                                                                                                                                \
+    oop_field(BytecodePosition, caller, "Ljdk/internal/jvmci/code/BytecodePosition;")                                                                            \
+    oop_field(BytecodePosition, method, "Ljdk/internal/jvmci/meta/ResolvedJavaMethod;")                                                                          \
+    int_field(BytecodePosition, bci)                                                                                                                           \
+  end_class                                                                                                                                                    \
+  start_class(JavaConstant)                                                                                                                                    \
+  end_class                                                                                                                                                    \
+  start_class(PrimitiveConstant)                                                                                                                               \
+    oop_field(PrimitiveConstant, kind, "Ljdk/internal/jvmci/meta/JavaKind;")                                                                                   \
+    long_field(PrimitiveConstant, primitive)                                                                                                                   \
+  end_class                                                                                                                                                    \
+  start_class(RawConstant)                                                                                                                                     \
+    long_field(RawConstant, primitive)                                                                                                                         \
+  end_class                                                                                                                                                    \
+  start_class(NullConstant)                                                                                                                                    \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotCompressedNullConstant)                                                                                                                   \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotObjectConstantImpl)                                                                                                                       \
+    oop_field(HotSpotObjectConstantImpl, object, "Ljava/lang/Object;")                                                                                         \
+    boolean_field(HotSpotObjectConstantImpl, compressed)                                                                                                       \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotMetaspaceConstantImpl)                                                                                                                    \
+    oop_field(HotSpotMetaspaceConstantImpl, metaspaceObject, "Ljava/lang/Object;")                                                                             \
+    long_field(HotSpotMetaspaceConstantImpl, rawValue)                                                                                                         \
+    boolean_field(HotSpotMetaspaceConstantImpl, compressed)                                                                                                    \
+  end_class                                                                                                                                                    \
+  start_class(JavaKind)                                                                                                                                        \
+    char_field(JavaKind, typeChar)                                                                                                                             \
+    static_oop_field(JavaKind, Boolean, "Ljdk/internal/jvmci/meta/JavaKind;");                                                                                 \
+    static_oop_field(JavaKind, Byte, "Ljdk/internal/jvmci/meta/JavaKind;");                                                                                    \
+    static_oop_field(JavaKind, Char, "Ljdk/internal/jvmci/meta/JavaKind;");                                                                                    \
+    static_oop_field(JavaKind, Short, "Ljdk/internal/jvmci/meta/JavaKind;");                                                                                   \
+    static_oop_field(JavaKind, Int, "Ljdk/internal/jvmci/meta/JavaKind;");                                                                                     \
+    static_oop_field(JavaKind, Long, "Ljdk/internal/jvmci/meta/JavaKind;");                                                                                    \
+  end_class                                                                                                                                                    \
+  start_class(LIRKind)                                                                                                                                         \
+    oop_field(LIRKind, platformKind, "Ljdk/internal/jvmci/meta/PlatformKind;")                                                                                   \
+    int_field(LIRKind, referenceMask)                                                                                                                          \
+  end_class                                                                                                                                                    \
+  start_class(Value)                                                                                                                                           \
+    oop_field(Value, lirKind, "Ljdk/internal/jvmci/meta/LIRKind;")                                                                                             \
+    static_oop_field(Value, ILLEGAL, "Ljdk/internal/jvmci/meta/AllocatableValue;");                                                                            \
+  end_class                                                                                                                                                    \
+  start_class(RegisterValue)                                                                                                                                   \
+    oop_field(RegisterValue, reg, "Ljdk/internal/jvmci/code/Register;")                                                                                          \
+  end_class                                                                                                                                                    \
+  start_class(code_Location)                                                                                                                                   \
+    oop_field(code_Location, reg, "Ljdk/internal/jvmci/code/Register;")                                                                                          \
+    int_field(code_Location, offset)                                                                                                                           \
+  end_class                                                                                                                                                    \
+  start_class(code_Register)                                                                                                                                   \
+    int_field(code_Register, number)                                                                                                                           \
+    int_field(code_Register, encoding)                                                                                                                         \
+  end_class                                                                                                                                                    \
+  start_class(StackSlot)                                                                                                                                       \
+    int_field(StackSlot, offset)                                                                                                                               \
+    boolean_field(StackSlot, addFrameSize)                                                                                                                     \
+  end_class                                                                                                                                                    \
+  start_class(VirtualObject)                                                                                                                                   \
+    int_field(VirtualObject, id)                                                                                                                               \
+    oop_field(VirtualObject, type, "Ljdk/internal/jvmci/meta/ResolvedJavaType;")                                                                               \
+    objArrayOop_field(VirtualObject, values, "[Ljdk/internal/jvmci/meta/JavaValue;")                                                                           \
+    objArrayOop_field(VirtualObject, slotKinds, "[Ljdk/internal/jvmci/meta/JavaKind;")                                                                         \
+  end_class                                                                                                                                                    \
+  start_class(StackLockValue)                                                                                                                                  \
+    oop_field(StackLockValue, owner, "Ljdk/internal/jvmci/meta/JavaValue;")                                                                                    \
+    oop_field(StackLockValue, slot, "Ljdk/internal/jvmci/code/StackSlotValue;")                                                                                \
+    boolean_field(StackLockValue, eliminated)                                                                                                                  \
+  end_class                                                                                                                                                    \
+  start_class(SpeculationLog)                                                                                                                                  \
+    oop_field(SpeculationLog, lastFailed, "Ljava/lang/Object;")                                                                                                \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotStackFrameReference)                                                                                                                      \
+    oop_field(HotSpotStackFrameReference, compilerToVM, "Ljdk/internal/jvmci/hotspot/CompilerToVM;")                                                             \
+    long_field(HotSpotStackFrameReference, stackPointer)                                                                                                       \
+    int_field(HotSpotStackFrameReference, frameNumber)                                                                                                         \
+    int_field(HotSpotStackFrameReference, bci)                                                                                                                 \
+    oop_field(HotSpotStackFrameReference, method, "Ljdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethod;")                                                    \
+    objArrayOop_field(HotSpotStackFrameReference, locals, "[Ljava/lang/Object;")                                                                               \
+    typeArrayOop_field(HotSpotStackFrameReference, localIsVirtual, "[Z")                                                                                       \
+  end_class                                                                                                                                                    \
+  start_class(HotSpotConstantPool)                                                                                                                             \
+    long_field(HotSpotConstantPool, metaspaceConstantPool)                                                                                                     \
+  end_class                                                                                                                                                    \
+  /* end*/
+
+#define START_CLASS(name)                                                                                                                                      \
+class name : AllStatic {                                                                                                                                       \
+  private:                                                                                                                                                     \
+    friend class JVMCICompiler;                                                                                                                                \
+    static void check(oop obj, const char* field_name, int offset) {                                                                                           \
+        assert(obj != NULL, err_msg("NULL field access of %s.%s", #name, field_name));                                                                         \
+        assert(obj->is_a(SystemDictionary::name##_klass()), err_msg("wrong class, " #name " expected, found %s", obj->klass()->external_name())); \
+        assert(offset != 0, "must be valid offset");                                                                                                           \
+    }                                                                                                                                                          \
+    static void compute_offsets();                                                                                                                             \
+  public:                                                                                                                                                      \
+    static InstanceKlass* klass() { return SystemDictionary::name##_klass() == NULL ? NULL : InstanceKlass::cast(SystemDictionary::name##_klass()); }
+
+#define END_CLASS };
+
+#define FIELD(name, type, accessor, cast)                                                                                                                         \
+    static int _##name##_offset;                                                                                                                                  \
+    static type name(oop obj)                   { check(obj, #name, _##name##_offset); return cast obj->accessor(_##name##_offset); }                                               \
+    static type name(Handle& obj)                { check(obj(), #name, _##name##_offset); return cast obj->accessor(_##name##_offset); }                                            \
+    static type name(jobject obj)               { check(JNIHandles::resolve(obj), #name, _##name##_offset); return cast JNIHandles::resolve(obj)->accessor(_##name##_offset); }     \
+    static void set_##name(oop obj, type x)     { check(obj, #name, _##name##_offset); obj->accessor##_put(_##name##_offset, x); }                                                  \
+    static void set_##name(Handle& obj, type x)  { check(obj(), #name, _##name##_offset); obj->accessor##_put(_##name##_offset, x); }                                               \
+    static void set_##name(jobject obj, type x) { check(JNIHandles::resolve(obj), #name, _##name##_offset); JNIHandles::resolve(obj)->accessor##_put(_##name##_offset, x); }
+
+#define EMPTY_CAST 
+#define CHAR_FIELD(klass, name) FIELD(name, jchar, char_field, EMPTY_CAST)
+#define INT_FIELD(klass, name) FIELD(name, jint, int_field, EMPTY_CAST)
+#define BOOLEAN_FIELD(klass, name) FIELD(name, jboolean, bool_field, EMPTY_CAST)
+#define LONG_FIELD(klass, name) FIELD(name, jlong, long_field, EMPTY_CAST)
+#define FLOAT_FIELD(klass, name) FIELD(name, jfloat, float_field, EMPTY_CAST)
+#define OOP_FIELD(klass, name, signature) FIELD(name, oop, obj_field, EMPTY_CAST)
+#define OBJARRAYOOP_FIELD(klass, name, signature) FIELD(name, objArrayOop, obj_field, (objArrayOop))
+#define TYPEARRAYOOP_FIELD(klass, name, signature) FIELD(name, typeArrayOop, obj_field, (typeArrayOop))
+#define STATIC_OOP_FIELD(klassName, name, signature) STATIC_OOPISH_FIELD(klassName, name, oop, signature)
+#define STATIC_OBJARRAYOOP_FIELD(klassName, name, signature) STATIC_OOPISH_FIELD(klassName, name, objArrayOop, signature)
+#define STATIC_OOPISH_FIELD(klassName, name, type, signature)                                                  \
+    static int _##name##_offset;                                                                               \
+    static type name() {                                                                                       \
+      assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \
+      InstanceKlass* ik = klassName::klass();                                                                  \
+      address addr = ik->static_field_addr(_##name##_offset - InstanceMirrorKlass::offset_of_static_fields()); \
+      if (UseCompressedOops) {                                                                                 \
+        return (type) oopDesc::load_decode_heap_oop((narrowOop *)addr);                                        \
+      } else {                                                                                                 \
+        return (type) oopDesc::load_decode_heap_oop((oop*)addr);                                               \
+      }                                                                                                        \
+    }                                                                                                          \
+    static void set_##name(type x) {                                                                           \
+      assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \
+      assert(klassName::klass() != NULL, "Class not yet loaded: " #klassName);                                 \
+      InstanceKlass* ik = klassName::klass();                                                                  \
+      address addr = ik->static_field_addr(_##name##_offset - InstanceMirrorKlass::offset_of_static_fields()); \
+      if (UseCompressedOops) {                                                                                 \
+        oop_store((narrowOop *)addr, x);                                                                       \
+      } else {                                                                                                 \
+        oop_store((oop*)addr, x);                                                                              \
+      }                                                                                                        \
+    }
+#define STATIC_PRIMITIVE_FIELD(klassName, name, jtypename)                                                     \
+    static int _##name##_offset;                                                                               \
+    static jtypename name() {                                                                                  \
+      assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \
+      InstanceKlass* ik = klassName::klass();                                                                  \
+      address addr = ik->static_field_addr(_##name##_offset - InstanceMirrorKlass::offset_of_static_fields()); \
+      return *((jtypename *)addr);                                                                             \
+    }                                                                                                          \
+    static void set_##name(jtypename x) {                                                                      \
+      assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \
+      InstanceKlass* ik = klassName::klass();                                                                  \
+      address addr = ik->static_field_addr(_##name##_offset - InstanceMirrorKlass::offset_of_static_fields()); \
+      *((jtypename *)addr) = x;                                                                                \
+    }
+
+#define STATIC_INT_FIELD(klassName, name) STATIC_PRIMITIVE_FIELD(klassName, name, jint)
+#define STATIC_BOOLEAN_FIELD(klassName, name) STATIC_PRIMITIVE_FIELD(klassName, name, jboolean)
+
+COMPILER_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, FLOAT_FIELD, OOP_FIELD, TYPEARRAYOOP_FIELD, OBJARRAYOOP_FIELD, STATIC_OOP_FIELD, STATIC_OBJARRAYOOP_FIELD, STATIC_INT_FIELD, STATIC_BOOLEAN_FIELD)
+#undef START_CLASS
+#undef END_CLASS
+#undef FIELD
+#undef CHAR_FIELD
+#undef INT_FIELD
+#undef BOOLEAN_FIELD
+#undef LONG_FIELD
+#undef FLOAT_FIELD
+#undef OOP_FIELD
+#undef TYPEARRAYOOP_FIELD
+#undef OBJARRAYOOP_FIELD
+#undef STATIC_OOPISH_FIELD
+#undef STATIC_OOP_FIELD
+#undef STATIC_OBJARRAYOOP_FIELD
+#undef STATIC_INT_FIELD
+#undef STATIC_BOOLEAN_FIELD
+#undef EMPTY_CAST
+
+void compute_offset(int &dest_offset, Klass* klass, const char* name, const char* signature, bool static_field);
+
+#endif // SHARE_VM_JVMCI_JVMCIJAVACLASSES_HPP
--- a/src/share/vm/jvmci/jvmciRuntime.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/jvmci/jvmciRuntime.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -23,18 +23,21 @@
 
 #include "precompiled.hpp"
 #include "asm/codeBuffer.hpp"
+#include "code/codeCache.hpp"
 #include "compiler/compileBroker.hpp"
 #include "compiler/disassembler.hpp"
 #include "jvmci/jvmciRuntime.hpp"
 #include "jvmci/jvmciCompilerToVM.hpp"
 #include "jvmci/jvmciCompiler.hpp"
-#include "jvmci/jvmciJavaAccess.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
 #include "jvmci/jvmciEnv.hpp"
 #include "memory/oopFactory.hpp"
+#include "oops/oop.inline.hpp"
 #include "prims/jvm.h"
 #include "runtime/biasedLocking.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/reflection.hpp"
+#include "runtime/sharedRuntime.hpp"
 #include "utilities/debug.hpp"
 #include "utilities/defaultStream.hpp"
 
@@ -49,10 +52,15 @@
 bool JVMCIRuntime::_shutdown_called = false;
 
 void JVMCIRuntime::initialize_natives(JNIEnv *env, jclass c2vmClass) {
+#ifdef _LP64
+#ifndef TARGET_ARCH_sparc
   uintptr_t heap_end = (uintptr_t) Universe::heap()->reserved_region().end();
   uintptr_t allocation_end = heap_end + ((uintptr_t)16) * 1024 * 1024 * 1024;
-  AMD64_ONLY(guarantee(heap_end < allocation_end, "heap end too close to end of address space (might lead to erroneous TLAB allocations)"));
-  NOT_LP64(error("check TLAB allocation code for address space conflicts"));
+  guarantee(heap_end < allocation_end, "heap end too close to end of address space (might lead to erroneous TLAB allocations)");
+#endif // TARGET_ARCH_sparc
+#else
+  fatal("check TLAB allocation code for address space conflicts");
+#endif
 
   ensure_jvmci_class_loader_is_initialized();
 
@@ -75,18 +83,6 @@
   }
 }
 
-BufferBlob* JVMCIRuntime::initialize_buffer_blob() {
-  JavaThread* THREAD = JavaThread::current();
-  BufferBlob* buffer_blob = THREAD->get_buffer_blob();
-  if (buffer_blob == NULL) {
-    buffer_blob = BufferBlob::create("JVMCI thread-local CodeBuffer", JVMCINMethodSizeLimit);
-    if (buffer_blob != NULL) {
-      THREAD->set_buffer_blob(buffer_blob);
-    }
-  }
-  return buffer_blob;
-}
-
 BasicType JVMCIRuntime::kindToBasicType(jchar ch) {
   switch(ch) {
     case 'z': return T_BOOLEAN;
@@ -252,7 +248,7 @@
 
   Handle exception(thread, ex);
   nm = CodeCache::find_nmethod(pc);
-  assert(nm != NULL, "this is not an nmethod");
+  assert(nm != NULL, "this is not a compiled method");
   // Adjust the pc as needed/
   if (nm->is_deopt_pc(pc)) {
     RegisterMap map(thread, false);
@@ -378,7 +374,7 @@
   }
   // Back in JAVA, use no oops DON'T safepoint
 
-  // Now check to see if the nmethod we were called from is now deoptimized.
+  // Now check to see if the compiled method we were called from is now deoptimized.
   // If so we must return to the deopt blob and deoptimize the nmethod
   if (nm != NULL && caller_is_deopted()) {
     continuation = SharedRuntime::deopt_blob()->unpack_with_exception_in_tls();
@@ -403,11 +399,11 @@
 JRT_END
 
 JRT_ENTRY_NO_ASYNC(void, JVMCIRuntime::monitorenter(JavaThread* thread, oopDesc* obj, BasicLock* lock))
-  if (TraceJVMCI >= 3) {
+  IF_TRACE_jvmci_3 {
     char type[O_BUFLEN];
     obj->klass()->name()->as_C_string(type, O_BUFLEN);
     markOop mark = obj->mark();
-    tty->print_cr("%s: entered locking slow case with obj=" INTPTR_FORMAT ", type=%s, mark=" INTPTR_FORMAT ", lock=" INTPTR_FORMAT, thread->name(), p2i(obj), type, p2i(mark), p2i(lock));
+    TRACE_jvmci_3("%s: entered locking slow case with obj=" INTPTR_FORMAT ", type=%s, mark=" INTPTR_FORMAT ", lock=" INTPTR_FORMAT, thread->name(), p2i(obj), type, p2i(mark), p2i(lock));
     tty->flush();
   }
 #ifdef ASSERT
@@ -428,9 +424,7 @@
       ObjectSynchronizer::fast_enter(h_obj, lock, false, THREAD);
     }
   }
-  if (TraceJVMCI >= 3) {
-    tty->print_cr("%s: exiting locking slow with obj=" INTPTR_FORMAT, thread->name(), p2i(obj));
-  }
+  TRACE_jvmci_3("%s: exiting locking slow with obj=" INTPTR_FORMAT, thread->name(), p2i(obj));
 JRT_END
 
 JRT_LEAF(void, JVMCIRuntime::monitorexit(JavaThread* thread, oopDesc* obj, BasicLock* lock))
@@ -457,10 +451,10 @@
   } else {
     ObjectSynchronizer::fast_exit(obj, lock, THREAD);
   }
-  if (TraceJVMCI >= 3) {
+  IF_TRACE_jvmci_3 {
     char type[O_BUFLEN];
     obj->klass()->name()->as_C_string(type, O_BUFLEN);
-    tty->print_cr("%s: exited locking slow case with obj=" INTPTR_FORMAT ", type=%s, mark=" INTPTR_FORMAT ", lock=" INTPTR_FORMAT, thread->name(), p2i(obj), type, p2i(obj->mark()), p2i(lock));
+    TRACE_jvmci_3("%s: exited locking slow case with obj=" INTPTR_FORMAT ", type=%s, mark=" INTPTR_FORMAT ", lock=" INTPTR_FORMAT, thread->name(), p2i(obj), type, p2i(obj->mark()), p2i(lock));
     tty->flush();
   }
 JRT_END
@@ -498,12 +492,12 @@
 JRT_LEAF(jboolean, JVMCIRuntime::validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child))
   bool ret = true;
   if(!Universe::heap()->is_in_closed_subset(parent)) {
-    tty->print_cr("Parent Object "INTPTR_FORMAT" not in heap", p2i(parent));
+    tty->print_cr("Parent Object " INTPTR_FORMAT " not in heap", p2i(parent));
     parent->print();
     ret=false;
   }
   if(!Universe::heap()->is_in_closed_subset(child)) {
-    tty->print_cr("Child Object "INTPTR_FORMAT" not in heap", p2i(child));
+    tty->print_cr("Child Object " INTPTR_FORMAT " not in heap", p2i(child));
     child->print();
     ret=false;
   }
@@ -531,12 +525,15 @@
   return exception;
 JRT_END
 
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED
 JRT_LEAF(void, JVMCIRuntime::log_printf(JavaThread* thread, oopDesc* format, jlong v1, jlong v2, jlong v3))
   ResourceMark rm;
   assert(format != NULL && java_lang_String::is_instance(format), "must be");
   char *buf = java_lang_String::as_utf8_string(format);
-  tty->print(buf, v1, v2, v3);
+  tty->print((const char*)buf, v1, v2, v3);
 JRT_END
+PRAGMA_DIAG_POP
 
 static void decipher(jlong v, bool ignoreZero) {
   if (v != 0 || !ignoreZero) {
@@ -560,9 +557,11 @@
   }
 }
 
+PRAGMA_DIAG_PUSH
+PRAGMA_FORMAT_NONLITERAL_IGNORED
 JRT_LEAF(void, JVMCIRuntime::vm_message(jboolean vmError, jlong format, jlong v1, jlong v2, jlong v3))
   ResourceMark rm;
-  char *buf = (char*) (address) format;
+  const char *buf = (const char*) (address) format;
   if (vmError) {
     if (buf != NULL) {
       fatal(err_msg(buf, v1, v2, v3));
@@ -577,6 +576,7 @@
     decipher(v1, false);
   }
 JRT_END
+PRAGMA_DIAG_POP
 
 JRT_LEAF(void, JVMCIRuntime::log_primitive(JavaThread* thread, jchar typeChar, jlong value, jboolean newline))
   union {
@@ -663,6 +663,16 @@
   return Handle((oop)result.get_jobject());
 }
 
+static bool jvmci_options_file_exists() {
+  const char* home = Arguments::get_java_home();
+  size_t path_len = strlen(home) + strlen("/lib/jvmci/options") + 1;
+  char path[JVM_MAXPATHLEN];
+  char sep = os::file_separator()[0];
+  jio_snprintf(path, JVM_MAXPATHLEN, "%s%clib%cjvmci%coptions", home, sep, sep, sep);
+  struct stat st;
+  return os::stat(path, &st) == 0;
+}
+
 void JVMCIRuntime::initialize_HotSpotJVMCIRuntime() {
   if (JNIHandles::resolve(_HotSpotJVMCIRuntime_instance) == NULL) {
     Thread* THREAD = Thread::current();
@@ -674,13 +684,15 @@
            "HotSpotJVMCIRuntime initialization should only be triggered through JVMCI initialization");
 #endif
 
-    if (_options != NULL) {
+    bool parseOptionsFile = jvmci_options_file_exists();
+    if (_options != NULL || parseOptionsFile) {
       JavaCallArguments args;
       oop options = java_lang_String::create_oop_from_str(_options, CHECK_ABORT);
       args.push_oop(options);
+      args.push_int(parseOptionsFile);
       callStatic("jdk/internal/jvmci/options/OptionsParser",
                  "parseOptionsFromVM",
-                 "(Ljava/lang/String;)Ljava/lang/Boolean;", &args);
+                 "(Ljava/lang/String;Z)Ljava/lang/Boolean;", &args);
     }
 
     if (_compiler != NULL) {
@@ -710,14 +722,34 @@
 }
 
 void JVMCIRuntime::metadata_do(void f(Metadata*)) {
-  if (HotSpotJVMCIMetaAccessContext::klass() == NULL) {
+  // For simplicity, the existence of HotSpotJVMCIMetaAccessContext in
+  // the SystemDictionary well known classes should ensure the other
+  // classes have already been loaded, so make sure their order in the
+  // table enforces that.
+  assert(SystemDictionary::WK_KLASS_ENUM_NAME(jdk_internal_jvmci_hotspot_HotSpotResolvedJavaMethodImpl) <
+         SystemDictionary::WK_KLASS_ENUM_NAME(jdk_internal_jvmci_hotspot_HotSpotJVMCIMetaAccessContext), "must be loaded earlier");
+  assert(SystemDictionary::WK_KLASS_ENUM_NAME(jdk_internal_jvmci_hotspot_HotSpotConstantPool) <
+         SystemDictionary::WK_KLASS_ENUM_NAME(jdk_internal_jvmci_hotspot_HotSpotJVMCIMetaAccessContext), "must be loaded earlier");
+  assert(SystemDictionary::WK_KLASS_ENUM_NAME(jdk_internal_jvmci_hotspot_HotSpotResolvedObjectTypeImpl) <
+         SystemDictionary::WK_KLASS_ENUM_NAME(jdk_internal_jvmci_hotspot_HotSpotJVMCIMetaAccessContext), "must be loaded earlier");
+
+  if (HotSpotJVMCIMetaAccessContext::klass() == NULL ||
+      !HotSpotJVMCIMetaAccessContext::klass()->is_linked()) {
+    // Nothing could be registered yet
     return;
   }
+
   // WeakReference<HotSpotJVMCIMetaAccessContext>[]
   objArrayOop allContexts = HotSpotJVMCIMetaAccessContext::allContexts();
   if (allContexts == NULL) {
     return;
   }
+
+  // These must be loaded at this point but the linking state doesn't matter.
+  assert(SystemDictionary::HotSpotResolvedJavaMethodImpl_klass() != NULL, "must be loaded");
+  assert(SystemDictionary::HotSpotConstantPool_klass() != NULL, "must be loaded");
+  assert(SystemDictionary::HotSpotResolvedObjectTypeImpl_klass() != NULL, "must be loaded");
+  
   for (int i = 0; i < allContexts->length(); i++) {
     oop ref = allContexts->obj_at(i);
     if (ref != NULL) {
@@ -757,7 +789,7 @@
   }
 }
 
-// private static void CompilerToVMImpl.init()
+// private static void CompilerToVM.init()
 JVM_ENTRY(void, JVM_InitializeJVMCINatives(JNIEnv *env, jclass c2vmClass))
   JVMCIRuntime::initialize_natives(env, c2vmClass);
 JVM_END
@@ -786,7 +818,7 @@
       }
     }
 
-    // We cannot use jvmciJavaAccess for this because we are currently in the
+    // We cannot use jvmciJavaClasses for this because we are currently in the
     // process of initializing that mechanism.
     TempNewSymbol field_name = SymbolTable::new_symbol("useJVMCIClassLoader", CHECK_ABORT);
     fieldDescriptor field_desc;
@@ -811,7 +843,8 @@
  * Everything before the '=' is the property name and everything after '=' is the value.
  * Lines that start with '#' are treated as comments and ignored.
  * No special processing of whitespace or any escape characters is performed.
- * Also, no check is made whether an existing property is overridden.
+ * The last definition of a property "wins" (i.e., it overrides all earlier
+ * definitions of the property).
  */
 class JVMCIPropertiesFileClosure : public ParseClosure {
   SystemProperty** _plist;
@@ -835,7 +868,7 @@
     *sep = '\0';
     const char* name = line;
     char* value = sep + 1;
-    Arguments::PropertyList_add(_plist, name, value);
+    Arguments::PropertyList_unique_add(_plist, name, value);
   }
 };
 
@@ -955,22 +988,18 @@
 
 void JVMCIRuntime::parse_lines(char* path, ParseClosure* closure, bool warnStatFailure) {
   struct stat st;
-  if (os::stat(path, &st) == 0 && (st.st_mode & S_IFREG) == S_IFREG) { // exists & is regular file
-    int file_handle = os::open(path, 0, 0);
+  if (::stat(path, &st) == 0 && (st.st_mode & S_IFREG) == S_IFREG) { // exists & is regular file
+    int file_handle = ::open(path, 0, 0);
     if (file_handle != -1) {
       char* buffer = NEW_C_HEAP_ARRAY(char, st.st_size + 1, mtInternal);
       int num_read;
-      if(ThreadLocalStorage::thread() == NULL) { // Solaris needs a JavaThread for os::read, if no thread started yet, fallback.
-        num_read = (int) ::read(file_handle, (char*) buffer, st.st_size);
-      } else {
-        num_read = (int) os::read(file_handle, (char*) buffer, st.st_size);
-      }
+      num_read = (int) ::read(file_handle, (char*) buffer, st.st_size);
       if (num_read == -1) {
         warning("Error reading file %s due to %s", path, strerror(errno));
       } else if (num_read != st.st_size) {
         warning("Only read %d of " SIZE_FORMAT " bytes from %s", num_read, (size_t) st.st_size, path);
       }
-      os::close(file_handle);
+      ::close(file_handle);
       closure->set_filename(path);
       if (num_read == st.st_size) {
         buffer[num_read] = '\0';
--- a/src/share/vm/jvmci/jvmciRuntime.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/jvmci/jvmciRuntime.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -184,8 +184,6 @@
    */
   static Klass* load_required_class(Symbol* name);
 
-  static BufferBlob* initialize_buffer_blob();
-
   static BasicType kindToBasicType(jchar ch);
 
   // The following routines are all called from compiled JVMCI code
@@ -223,20 +221,18 @@
   static int test_deoptimize_call_int(JavaThread* thread, int value);
 };
 
-// Tracing macros
-
-#define IF_TRACE_jvmci_1 if (!(TraceJVMCI >= 1)) ; else
-#define IF_TRACE_jvmci_2 if (!(TraceJVMCI >= 2)) ; else
-#define IF_TRACE_jvmci_3 if (!(TraceJVMCI >= 3)) ; else
-#define IF_TRACE_jvmci_4 if (!(TraceJVMCI >= 4)) ; else
-#define IF_TRACE_jvmci_5 if (!(TraceJVMCI >= 5)) ; else
+// Tracing macros.
 
-// using commas and else to keep one-instruction semantics
+#define IF_TRACE_jvmci_1 if (!(JVMCITraceLevel >= 1)) ; else
+#define IF_TRACE_jvmci_2 if (!(JVMCITraceLevel >= 2)) ; else
+#define IF_TRACE_jvmci_3 if (!(JVMCITraceLevel >= 3)) ; else
+#define IF_TRACE_jvmci_4 if (!(JVMCITraceLevel >= 4)) ; else
+#define IF_TRACE_jvmci_5 if (!(JVMCITraceLevel >= 5)) ; else
 
-#define TRACE_jvmci_1 if (!(TraceJVMCI >= 1 && (tty->print("TraceJVMCI-1: "), true))) ; else tty->print_cr
-#define TRACE_jvmci_2 if (!(TraceJVMCI >= 2 && (tty->print("   TraceJVMCI-2: "), true))) ; else tty->print_cr
-#define TRACE_jvmci_3 if (!(TraceJVMCI >= 3 && (tty->print("      TraceJVMCI-3: "), true))) ; else tty->print_cr
-#define TRACE_jvmci_4 if (!(TraceJVMCI >= 4 && (tty->print("         TraceJVMCI-4: "), true))) ; else tty->print_cr
-#define TRACE_jvmci_5 if (!(TraceJVMCI >= 5 && (tty->print("            TraceJVMCI-5: "), true))) ; else tty->print_cr
+#define TRACE_jvmci_1 if (!(JVMCITraceLevel >= 1 && (tty->print("JVMCITrace-1: "), true))) ; else tty->print_cr
+#define TRACE_jvmci_2 if (!(JVMCITraceLevel >= 2 && (tty->print("   JVMCITrace-2: "), true))) ; else tty->print_cr
+#define TRACE_jvmci_3 if (!(JVMCITraceLevel >= 3 && (tty->print("      JVMCITrace-3: "), true))) ; else tty->print_cr
+#define TRACE_jvmci_4 if (!(JVMCITraceLevel >= 4 && (tty->print("         JVMCITrace-4: "), true))) ; else tty->print_cr
+#define TRACE_jvmci_5 if (!(JVMCITraceLevel >= 5 && (tty->print("            JVMCITrace-5: "), true))) ; else tty->print_cr
 
 #endif // SHARE_VM_JVMCI_JVMCI_RUNTIME_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/jvmci/jvmci_globals.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2000, 2010, 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.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "jvmci/jvmci_globals.hpp"
+
+JVMCI_FLAGS(MATERIALIZE_DEVELOPER_FLAG, MATERIALIZE_PD_DEVELOPER_FLAG, MATERIALIZE_PRODUCT_FLAG, MATERIALIZE_PD_PRODUCT_FLAG, MATERIALIZE_NOTPRODUCT_FLAG)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/jvmci/jvmci_globals.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2000, 2012, 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.
+ *
+ */
+
+#ifndef SHARE_VM_JVMCI_JVMCI_GLOBALS_HPP
+#define SHARE_VM_JVMCI_JVMCI_GLOBALS_HPP
+
+#include "runtime/globals.hpp"
+#ifdef TARGET_ARCH_x86
+# include "jvmci_globals_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "jvmci_globals_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_arm
+# include "jvmci_globals_arm.hpp"
+#endif
+#ifdef TARGET_ARCH_ppc
+# include "jvmci_globals_ppc.hpp"
+#endif
+
+//
+// Defines all global flags used by the JVMCI compiler. Only flags that need
+// to be accessible to the JVMCI C++ code should be defined here. All other
+// JVMCI flags should be defined in JVMCIOptions.java.
+//
+#define JVMCI_FLAGS(develop, develop_pd, product, product_pd, notproduct)   \
+                                                                            \
+  product(bool, UseJVMCIClassLoader, true,                                  \
+          "Load JVMCI classes with separate class loader")                  \
+                                                                            \
+  product(ccstr, JVMCIServicesDir, NULL,                                    \
+          "Alternate directory to use for JVMCI services")                  \
+                                                                            \
+  COMPILERJVMCI_PRESENT(product(bool, BootstrapJVMCI, false,                \
+          "Bootstrap JVMCI before running Java main method"))               \
+                                                                            \
+  COMPILERJVMCI_PRESENT(product(bool, PrintBootstrap, true,                 \
+          "Print JVMCI bootstrap progress and summary"))                    \
+                                                                            \
+  COMPILERJVMCI_PRESENT(product(intx, JVMCIThreads, 1,                      \
+          "Force number of JVMCI compiler threads to use"))                 \
+                                                                            \
+  COMPILERJVMCI_PRESENT(product(intx, JVMCIHostThreads, 1,                  \
+          "Force number of compiler threads for JVMCI host compiler"))      \
+                                                                            \
+  JVMCI_ONLY(product(bool, CodeInstallSafepointChecks, true,                \
+          "Perform explicit safepoint checks while installing code"))       \
+                                                                            \
+  NOT_COMPILER2(product_pd(intx, MaxVectorSize,                             \
+          "Max vector size in bytes, "                                      \
+          "actual size could be less depending on elements type"))          \
+                                                                            \
+  NOT_COMPILER2(product(bool, ReduceInitialCardMarks, true,                 \
+          "Defer write barriers of young objects"))                         \
+                                                                            \
+  product(intx, JVMCITraceLevel, 0,                                         \
+          "Trace level for JVMCI: "                                         \
+          "1 means emit a message for each CompilerToVM call,"              \
+          "levels greater than 1 provide progressively greater detail")     \
+                                                                            \
+  product(intx, JVMCICounterSize, 0,                                        \
+          "Reserved size for benchmark counters")                           \
+                                                                            \
+  product(bool, JVMCICountersExcludeCompiler, true,                         \
+          "Exclude JVMCI compiler threads from benchmark counters")         \
+                                                                            \
+  product(bool, JVMCICompileWithC1Only, true,                               \
+          "Only compile JVMCI classes with C1")                             \
+                                                                            \
+  product(bool, JVMCICompileAppFirst, false,                                \
+          "Prioritize application compilations over JVMCI compilations")    \
+                                                                            \
+  develop(bool, JVMCIUseFastLocking, true,                                  \
+          "Use fast inlined locking code")                                  \
+                                                                            \
+  product(intx, JVMCINMethodSizeLimit, (80*K)*wordSize,                     \
+          "Maximum size of a compiled method.")                             \
+                                                                            \
+  develop(bool, TraceUncollectedSpeculations, false,                        \
+          "Print message when a failed speculation was not collected")      \
+
+
+// Read default values for JVMCI globals
+
+JVMCI_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_NOTPRODUCT_FLAG)
+
+#endif // SHARE_VM_JVMCI_JVMCI_GLOBALS_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/jvmci/systemDictionary_jvmci.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2012, 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
+ * 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.
+ */
+
+#ifndef SHARE_VM_JVMCI_SYSTEMDICTIONARY_JVMCI_HPP
+#define SHARE_VM_JVMCI_SYSTEMDICTIONARY_JVMCI_HPP
+
+#if !INCLUDE_JVMCI
+#define JVMCI_WK_KLASSES_DO(do_klass)
+#else
+#define JVMCI_WK_KLASSES_DO(do_klass)                                                                                           \
+  /* JVMCI classes. These are loaded on-demand. */                                                                              \
+  do_klass(HotSpotCompiledCode_klass,                    jdk_internal_jvmci_hotspot_HotSpotCompiledCode,                 Jvmci) \
+  do_klass(HotSpotCompiledCode_Comment_klass,            jdk_internal_jvmci_hotspot_HotSpotCompiledCode_Comment,         Jvmci) \
+  do_klass(HotSpotCompiledNmethod_klass,                 jdk_internal_jvmci_hotspot_HotSpotCompiledNmethod,              Jvmci) \
+  do_klass(HotSpotForeignCallTarget_klass,               jdk_internal_jvmci_hotspot_HotSpotForeignCallTarget,            Jvmci) \
+  do_klass(HotSpotReferenceMap_klass,                    jdk_internal_jvmci_hotspot_HotSpotReferenceMap,                 Jvmci) \
+  do_klass(HotSpotInstalledCode_klass,                   jdk_internal_jvmci_hotspot_HotSpotInstalledCode,                Jvmci) \
+  do_klass(HotSpotNmethod_klass,                         jdk_internal_jvmci_hotspot_HotSpotNmethod,                      Jvmci) \
+  do_klass(HotSpotResolvedJavaMethodImpl_klass,          jdk_internal_jvmci_hotspot_HotSpotResolvedJavaMethodImpl,       Jvmci) \
+  do_klass(HotSpotResolvedObjectTypeImpl_klass,          jdk_internal_jvmci_hotspot_HotSpotResolvedObjectTypeImpl,       Jvmci) \
+  do_klass(HotSpotCompressedNullConstant_klass,          jdk_internal_jvmci_hotspot_HotSpotCompressedNullConstant,       Jvmci) \
+  do_klass(HotSpotObjectConstantImpl_klass,              jdk_internal_jvmci_hotspot_HotSpotObjectConstantImpl,           Jvmci) \
+  do_klass(HotSpotMetaspaceConstantImpl_klass,           jdk_internal_jvmci_hotspot_HotSpotMetaspaceConstantImpl,        Jvmci) \
+  do_klass(HotSpotStackFrameReference_klass,             jdk_internal_jvmci_hotspot_HotSpotStackFrameReference,          Jvmci) \
+  do_klass(HotSpotConstantPool_klass,                    jdk_internal_jvmci_hotspot_HotSpotConstantPool,                 Jvmci) \
+  do_klass(HotSpotJVMCIMetaAccessContext_klass,          jdk_internal_jvmci_hotspot_HotSpotJVMCIMetaAccessContext,       Jvmci) \
+  do_klass(Assumptions_ConcreteMethod_klass,             jdk_internal_jvmci_meta_Assumptions_ConcreteMethod,             Jvmci) \
+  do_klass(Assumptions_NoFinalizableSubclass_klass,      jdk_internal_jvmci_meta_Assumptions_NoFinalizableSubclass,      Jvmci) \
+  do_klass(Assumptions_ConcreteSubtype_klass,            jdk_internal_jvmci_meta_Assumptions_ConcreteSubtype,            Jvmci) \
+  do_klass(Assumptions_LeafType_klass,                   jdk_internal_jvmci_meta_Assumptions_LeafType,                   Jvmci) \
+  do_klass(Assumptions_CallSiteTargetValue_klass,        jdk_internal_jvmci_meta_Assumptions_CallSiteTargetValue,        Jvmci) \
+  do_klass(Architecture_klass,                           jdk_internal_jvmci_code_Architecture,                           Jvmci) \
+  do_klass(TargetDescription_klass,                      jdk_internal_jvmci_code_TargetDescription,                      Jvmci) \
+  do_klass(BytecodePosition_klass,                       jdk_internal_jvmci_code_BytecodePosition,                       Jvmci) \
+  do_klass(DebugInfo_klass,                              jdk_internal_jvmci_code_DebugInfo,                              Jvmci) \
+  do_klass(RegisterSaveLayout_klass,                     jdk_internal_jvmci_code_RegisterSaveLayout,                     Jvmci) \
+  do_klass(BytecodeFrame_klass,                          jdk_internal_jvmci_code_BytecodeFrame,                          Jvmci) \
+  do_klass(CompilationResult_Call_klass,                 jdk_internal_jvmci_code_CompilationResult_Call,                 Jvmci) \
+  do_klass(CompilationResult_ConstantReference_klass,    jdk_internal_jvmci_code_CompilationResult_ConstantReference,    Jvmci) \
+  do_klass(CompilationResult_DataPatch_klass,            jdk_internal_jvmci_code_CompilationResult_DataPatch,            Jvmci) \
+  do_klass(CompilationResult_DataSectionReference_klass, jdk_internal_jvmci_code_CompilationResult_DataSectionReference, Jvmci) \
+  do_klass(CompilationResult_ExceptionHandler_klass,     jdk_internal_jvmci_code_CompilationResult_ExceptionHandler,     Jvmci) \
+  do_klass(CompilationResult_Mark_klass,                 jdk_internal_jvmci_code_CompilationResult_Mark,                 Jvmci) \
+  do_klass(CompilationResult_Infopoint_klass,            jdk_internal_jvmci_code_CompilationResult_Infopoint,            Jvmci) \
+  do_klass(CompilationResult_Site_klass,                 jdk_internal_jvmci_code_CompilationResult_Site,                 Jvmci) \
+  do_klass(InfopointReason_klass,                        jdk_internal_jvmci_code_InfopointReason,                        Jvmci) \
+  do_klass(InstalledCode_klass,                          jdk_internal_jvmci_code_InstalledCode,                          Jvmci) \
+  do_klass(code_Location_klass,                          jdk_internal_jvmci_code_Location,                               Jvmci) \
+  do_klass(code_Register_klass,                          jdk_internal_jvmci_code_Register,                               Jvmci) \
+  do_klass(RegisterValue_klass,                          jdk_internal_jvmci_code_RegisterValue,                          Jvmci) \
+  do_klass(StackSlot_klass,                              jdk_internal_jvmci_code_StackSlot,                              Jvmci) \
+  do_klass(StackLockValue_klass,                         jdk_internal_jvmci_code_StackLockValue,                         Jvmci) \
+  do_klass(VirtualObject_klass,                          jdk_internal_jvmci_code_VirtualObject,                          Jvmci) \
+  do_klass(SpeculationLog_klass,                         jdk_internal_jvmci_meta_SpeculationLog,                         Jvmci) \
+  do_klass(JavaConstant_klass,                           jdk_internal_jvmci_meta_JavaConstant,                           Jvmci) \
+  do_klass(PrimitiveConstant_klass,                      jdk_internal_jvmci_meta_PrimitiveConstant,                      Jvmci) \
+  do_klass(RawConstant_klass,                            jdk_internal_jvmci_meta_RawConstant,                            Jvmci) \
+  do_klass(NullConstant_klass,                           jdk_internal_jvmci_meta_NullConstant,                           Jvmci) \
+  do_klass(ExceptionHandler_klass,                       jdk_internal_jvmci_meta_ExceptionHandler,                       Jvmci) \
+  do_klass(JavaKind_klass,                               jdk_internal_jvmci_meta_JavaKind,                               Jvmci) \
+  do_klass(LIRKind_klass,                                jdk_internal_jvmci_meta_LIRKind,                                Jvmci) \
+  do_klass(Value_klass,                                  jdk_internal_jvmci_meta_Value,                                  Jvmci)
+#endif
+
+#endif // SHARE_VM_JVMCI_SYSTEMDICTIONARY_JVMCI_HPP
+  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/vm/jvmci/vmSymbols_jvmci.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2012, 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
+ * 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.
+ */
+
+#ifndef SHARE_VM_JVMCI_VMSYMBOLS_JVMCI_HPP
+#define SHARE_VM_JVMCI_VMSYMBOLS_JVMCI_HPP
+
+
+#if !INCLUDE_JVMCI
+#define JVMCI_VM_SYMBOLS_DO(template, do_alias)
+#else
+#define JVMCI_VM_SYMBOLS_DO(template, do_alias)                                                                                           \
+  template(jdk_internal_jvmci_hotspot_HotSpotCompiledCode,             "jdk/internal/jvmci/hotspot/HotSpotCompiledCode")                  \
+  template(jdk_internal_jvmci_hotspot_HotSpotCompiledCode_Comment,     "jdk/internal/jvmci/hotspot/HotSpotCompiledCode$Comment")          \
+  template(jdk_internal_jvmci_hotspot_HotSpotCompiledNmethod,          "jdk/internal/jvmci/hotspot/HotSpotCompiledNmethod")               \
+  template(jdk_internal_jvmci_hotspot_HotSpotForeignCallTarget,        "jdk/internal/jvmci/hotspot/HotSpotForeignCallTarget")             \
+  template(jdk_internal_jvmci_hotspot_HotSpotReferenceMap,             "jdk/internal/jvmci/hotspot/HotSpotReferenceMap")                  \
+  template(jdk_internal_jvmci_hotspot_CompilerToVM,                    "jdk/internal/jvmci/hotspot/CompilerToVM")                         \
+  template(jdk_internal_jvmci_hotspot_HotSpotInstalledCode,            "jdk/internal/jvmci/hotspot/HotSpotInstalledCode")                 \
+  template(jdk_internal_jvmci_hotspot_HotSpotNmethod,                  "jdk/internal/jvmci/hotspot/HotSpotNmethod")                       \
+  template(jdk_internal_jvmci_hotspot_HotSpotResolvedJavaMethodImpl,   "jdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethodImpl")        \
+  template(jdk_internal_jvmci_hotspot_HotSpotResolvedObjectTypeImpl,   "jdk/internal/jvmci/hotspot/HotSpotResolvedObjectTypeImpl")        \
+  template(jdk_internal_jvmci_hotspot_HotSpotCompressedNullConstant,   "jdk/internal/jvmci/hotspot/HotSpotCompressedNullConstant")        \
+  template(jdk_internal_jvmci_hotspot_HotSpotObjectConstantImpl,       "jdk/internal/jvmci/hotspot/HotSpotObjectConstantImpl")            \
+  template(jdk_internal_jvmci_hotspot_HotSpotMetaspaceConstantImpl,    "jdk/internal/jvmci/hotspot/HotSpotMetaspaceConstantImpl")         \
+  template(jdk_internal_jvmci_hotspot_HotSpotStackFrameReference,      "jdk/internal/jvmci/hotspot/HotSpotStackFrameReference")           \
+  template(jdk_internal_jvmci_hotspot_HotSpotConstantPool,             "jdk/internal/jvmci/hotspot/HotSpotConstantPool")                  \
+  template(jdk_internal_jvmci_hotspot_HotSpotJVMCIMetaAccessContext,   "jdk/internal/jvmci/hotspot/HotSpotJVMCIMetaAccessContext")        \
+  template(jdk_internal_jvmci_meta_JavaConstant,                       "jdk/internal/jvmci/meta/JavaConstant")                            \
+  template(jdk_internal_jvmci_meta_PrimitiveConstant,                  "jdk/internal/jvmci/meta/PrimitiveConstant")                       \
+  template(jdk_internal_jvmci_meta_RawConstant,                        "jdk/internal/jvmci/meta/RawConstant")                             \
+  template(jdk_internal_jvmci_meta_NullConstant,                       "jdk/internal/jvmci/meta/NullConstant")                            \
+  template(jdk_internal_jvmci_meta_ExceptionHandler,                   "jdk/internal/jvmci/meta/ExceptionHandler")                        \
+  template(jdk_internal_jvmci_meta_JavaKind,                           "jdk/internal/jvmci/meta/JavaKind")                                \
+  template(jdk_internal_jvmci_meta_LIRKind,                            "jdk/internal/jvmci/meta/LIRKind")                                 \
+  template(jdk_internal_jvmci_meta_Value,                              "jdk/internal/jvmci/meta/Value")                                   \
+  template(jdk_internal_jvmci_meta_Assumptions_ConcreteSubtype,        "jdk/internal/jvmci/meta/Assumptions$ConcreteSubtype")             \
+  template(jdk_internal_jvmci_meta_Assumptions_LeafType,               "jdk/internal/jvmci/meta/Assumptions$LeafType")                    \
+  template(jdk_internal_jvmci_meta_Assumptions_NoFinalizableSubclass,  "jdk/internal/jvmci/meta/Assumptions$NoFinalizableSubclass")       \
+  template(jdk_internal_jvmci_meta_Assumptions_ConcreteMethod,         "jdk/internal/jvmci/meta/Assumptions$ConcreteMethod")              \
+  template(jdk_internal_jvmci_meta_Assumptions_CallSiteTargetValue,    "jdk/internal/jvmci/meta/Assumptions$CallSiteTargetValue")         \
+  template(jdk_internal_jvmci_meta_SpeculationLog,                     "jdk/internal/jvmci/meta/SpeculationLog")                          \
+  template(jdk_internal_jvmci_code_Architecture,                       "jdk/internal/jvmci/code/Architecture")                            \
+  template(jdk_internal_jvmci_code_TargetDescription,                  "jdk/internal/jvmci/code/TargetDescription")                       \
+  template(jdk_internal_jvmci_code_CompilationResult_Call,             "jdk/internal/jvmci/code/CompilationResult$Call")                  \
+  template(jdk_internal_jvmci_code_CompilationResult_ConstantReference, "jdk/internal/jvmci/code/CompilationResult$ConstantReference")    \
+  template(jdk_internal_jvmci_code_CompilationResult_DataPatch,        "jdk/internal/jvmci/code/CompilationResult$DataPatch")             \
+  template(jdk_internal_jvmci_code_CompilationResult_DataSectionReference, "jdk/internal/jvmci/code/CompilationResult$DataSectionReference") \
+  template(jdk_internal_jvmci_code_CompilationResult_ExceptionHandler, "jdk/internal/jvmci/code/CompilationResult$ExceptionHandler")      \
+  template(jdk_internal_jvmci_code_CompilationResult_Mark,             "jdk/internal/jvmci/code/CompilationResult$Mark")                  \
+  template(jdk_internal_jvmci_code_CompilationResult_Infopoint,        "jdk/internal/jvmci/code/CompilationResult$Infopoint")             \
+  template(jdk_internal_jvmci_code_CompilationResult_Site,             "jdk/internal/jvmci/code/CompilationResult$Site")                  \
+  template(jdk_internal_jvmci_code_InfopointReason,                    "jdk/internal/jvmci/code/InfopointReason")                         \
+  template(jdk_internal_jvmci_code_InstalledCode,                      "jdk/internal/jvmci/code/InstalledCode")                           \
+  template(jdk_internal_jvmci_code_BytecodeFrame,                      "jdk/internal/jvmci/code/BytecodeFrame")                           \
+  template(jdk_internal_jvmci_code_BytecodePosition,                   "jdk/internal/jvmci/code/BytecodePosition")                        \
+  template(jdk_internal_jvmci_code_DebugInfo,                          "jdk/internal/jvmci/code/DebugInfo")                               \
+  template(jdk_internal_jvmci_code_Location,                           "jdk/internal/jvmci/code/Location")                                \
+  template(jdk_internal_jvmci_code_Register,                           "jdk/internal/jvmci/code/Register")                                \
+  template(jdk_internal_jvmci_code_RegisterValue,                      "jdk/internal/jvmci/code/RegisterValue")                           \
+  template(jdk_internal_jvmci_code_StackSlot,                          "jdk/internal/jvmci/code/StackSlot")                               \
+  template(jdk_internal_jvmci_code_StackLockValue,                     "jdk/internal/jvmci/code/StackLockValue")                          \
+  template(jdk_internal_jvmci_code_VirtualObject,                      "jdk/internal/jvmci/code/VirtualObject")                           \
+  template(jdk_internal_jvmci_code_RegisterSaveLayout,                 "jdk/internal/jvmci/code/RegisterSaveLayout")                      \
+  template(jdk_internal_jvmci_code_InvalidInstalledCodeException,      "jdk/internal/jvmci/code/InvalidInstalledCodeException")           \
+  template(compileMethod_name,                                         "compileMethod")                                                   \
+  template(compileMethod_signature,                                    "(Ljdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethod;IJI)V")    \
+  template(fromMetaspace_name,                                         "fromMetaspace")                                                   \
+  template(method_fromMetaspace_signature,                             "(J)Ljdk/internal/jvmci/hotspot/HotSpotResolvedJavaMethod;")       \
+  template(constantPool_fromMetaspace_signature,                       "(J)Ljdk/internal/jvmci/hotspot/HotSpotConstantPool;")             \
+  template(klass_fromMetaspace_signature,                              "(Ljava/lang/Class;)Ljdk/internal/jvmci/hotspot/HotSpotResolvedObjectTypeImpl;")   \
+  template(jdk_internal_jvmci_hotspot_Stable_signature,                "Ljdk/internal/jvmci/hotspot/Stable;")
+#endif
+
+#endif // SHARE_VM_JVMCI_VMSYMBOLS_JVMCI_HPP
--- a/src/share/vm/memory/threadLocalAllocBuffer.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/memory/threadLocalAllocBuffer.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -102,9 +102,8 @@
     global_stats()->update_fast_refill_waste(_fast_refill_waste);
 
   } else {
-    // (ds) _gc_waste can be non-zero (see above) even if _number_of_refills is 0
     assert(_number_of_refills == 0 && _fast_refill_waste == 0 &&
-           _slow_refill_waste == 0/* && _gc_waste          == 0*/,
+           _slow_refill_waste == 0 && _gc_waste          == 0,
            "tlab stats == 0");
   }
   global_stats()->update_slow_allocations(_slow_allocations);
--- a/src/share/vm/precompiled/precompiled.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/precompiled/precompiled.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -296,7 +296,7 @@
 # include "c1/c1_globals.hpp"
 #endif // COMPILER1
 #if INCLUDE_JVMCI
-# include "jvmci/jvmciGlobals.hpp"
+# include "jvmci/jvmci_globals.hpp"
 #endif // INCLUDE_JVMCI
 #if INCLUDE_ALL_GCS
 # include "gc_implementation/concurrentMarkSweep/cmsOopClosures.hpp"
--- a/src/share/vm/prims/nativeLookup.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/prims/nativeLookup.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -130,7 +130,6 @@
   void     JNICALL JVM_InitJVMCIClassLoader(JNIEnv *env, jclass c, jobject loader);
   void     JNICALL JVM_InitializeJVMCINatives(JNIEnv *env, jclass compilerToVMClass);
   jobject  JNICALL JVM_GetJVMCIRuntime(JNIEnv *env, jclass c);
-  jobject  JNICALL JVM_GetJVMCIRuntime(JNIEnv *env, jclass c);
   jobject  JNICALL JVM_GetJVMCIServiceImpls(JNIEnv *env, jclass c, jclass serviceClass);
 #endif
 }
@@ -147,7 +146,7 @@
   { CC"Java_jdk_internal_jvmci_service_JVMCIClassLoaderFactory_init", NULL, FN_PTR(JVM_InitJVMCIClassLoader)     },
   { CC"Java_jdk_internal_jvmci_runtime_JVMCI_initializeRuntime",      NULL, FN_PTR(JVM_GetJVMCIRuntime)          },
   { CC"Java_jdk_internal_jvmci_service_Services_getServiceImpls",     NULL, FN_PTR(JVM_GetJVMCIServiceImpls)     },
-  { CC"Java_jdk_internal_jvmci_hotspot_CompilerToVMImpl_init",        NULL, FN_PTR(JVM_InitializeJVMCINatives)   },
+  { CC"Java_jdk_internal_jvmci_hotspot_CompilerToVM_init",            NULL, FN_PTR(JVM_InitializeJVMCINatives)   },
 #endif
 };
 
--- a/src/share/vm/runtime/arguments.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/runtime/arguments.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -2763,11 +2763,6 @@
           return JNI_ERR;
         }
 #endif // !INCLUDE_JVMTI
-#if INCLUDE_JVMCI
-        if (strcmp(name, "hprof") == 0) {
-          FLAG_SET_CMDLINE(bool, JVMCIHProfEnabled, true);
-        }
-#endif
         add_init_library(name, options);
       }
     // -agentlib and -agentpath
@@ -2790,12 +2785,6 @@
           return JNI_ERR;
         }
 #endif // !INCLUDE_JVMTI
-#if INCLUDE_JVMCI
-        if (valid_hprof_or_jdwp_agent(name, is_absolute_path)) {
-          FLAG_SET_CMDLINE(bool, JVMCIHProfEnabled, true);
-        }
-#endif
-
         add_init_agent(name, options, is_absolute_path);
       }
     // -javaagent
--- a/src/share/vm/runtime/deoptimization.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/runtime/deoptimization.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -94,7 +94,7 @@
 
 #if INCLUDE_JVMCI
 #include "jvmci/jvmciRuntime.hpp"
-#include "jvmci/jvmciJavaAccess.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
 #endif
 
 
@@ -1425,7 +1425,7 @@
 
   // We need to update the map if we have biased locking.
 #if INCLUDE_JVMCI
-  // (lstadler) JVMCI might need to get an exception from the stack, which in turn requires the register map to be valid
+  // JVMCI might need to get an exception from the stack, which in turn requires the register map to be valid
   RegisterMap reg_map(thread, true);
 #else
   RegisterMap reg_map(thread, UseBiasedLocking);
--- a/src/share/vm/runtime/globals.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/runtime/globals.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -39,7 +39,7 @@
 #include "c1/c1_globals.hpp"
 #endif
 #if INCLUDE_JVMCI
-#include "jvmci/jvmciGlobals.hpp"
+#include "jvmci/jvmci_globals.hpp"
 #endif
 #ifdef COMPILER2
 #include "opto/c2_globals.hpp"
--- a/src/share/vm/runtime/globals.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/runtime/globals.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -131,16 +131,16 @@
 #endif
 #ifdef COMPILERJVMCI 
 #ifdef TARGET_ARCH_x86
-# include "jvmciGlobals_x86.hpp"
+# include "jvmci_globals_x86.hpp"
 #endif
 #ifdef TARGET_ARCH_sparc
-# include "jvmciGlobals_sparc.hpp"
+# include "jvmci_globals_sparc.hpp"
 #endif
 #ifdef TARGET_ARCH_arm
-# include "jvmciGlobals_arm.hpp"
+# include "jvmci_globals_arm.hpp"
 #endif
 #ifdef TARGET_ARCH_ppc
-# include "jvmciGlobals_ppc.hpp"
+# include "jvmci_globals_ppc.hpp"
 #endif
 #endif // COMPILERJVMCI
 #ifdef COMPILER2
--- a/src/share/vm/runtime/handles.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/runtime/handles.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -62,7 +62,6 @@
 // used operators for ease of use.
 
 class Handle VALUE_OBJ_CLASS_SPEC {
-  friend class VMStructs;
  private:
   oop* _handle;
 
--- a/src/share/vm/runtime/javaCalls.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/runtime/javaCalls.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -41,7 +41,7 @@
 #include "runtime/stubRoutines.hpp"
 #include "runtime/thread.inline.hpp"
 #if INCLUDE_JVMCI
-#include "jvmci/jvmciJavaAccess.hpp"
+#include "jvmci/jvmciJavaClasses.hpp"
 #include "jvmci/jvmciRuntime.hpp"
 #endif
 
--- a/src/share/vm/runtime/os.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/runtime/os.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -584,9 +584,6 @@
   static void *find_agent_function(AgentLibrary *agent_lib, bool check_lib,
                                    const char *syms[], size_t syms_len);
 
-
-  static address get_pc(void* context);
-
   // Print out system information; they are called by fatal error handler.
   // Output format may be different on different platforms.
   static void print_os_info(outputStream* st);
--- a/src/share/vm/runtime/sharedRuntime.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/runtime/sharedRuntime.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -1013,6 +1013,7 @@
 
 
 JRT_ENTRY_NO_ASYNC(void, SharedRuntime::register_finalizer(JavaThread* thread, oopDesc* obj))
+  assert(obj->is_oop(), "must be a valid oop");
 #if INCLUDE_JVMCI
   // This removes the requirement for JVMCI compilers to emit code
   // performing a dynamic check that obj has a finalizer before
@@ -1023,7 +1024,6 @@
     return;
   }
 #endif
-  assert(obj->is_oop(), "must be a valid oop");
   assert(obj->klass()->has_finalizer(), "shouldn't be here otherwise");
   InstanceKlass::register_finalizer(instanceOop(obj), CHECK);
 JRT_END
@@ -1216,6 +1216,7 @@
     assert(fr.is_entry_frame(), "must be");
     // fr is now pointing to the entry frame.
     callee_method = methodHandle(THREAD, fr.entry_frame_call_wrapper()->callee_method());
+    assert(fr.entry_frame_call_wrapper()->receiver() == NULL || !callee_method->is_static(), "non-null receiver for static call??");
   } else {
     Bytecodes::Code bc;
     CallInfo callinfo;
--- a/src/share/vm/runtime/thread.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/runtime/thread.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -1458,7 +1458,6 @@
   // Set the claimed par_id to UINT_MAX (ie not claiming any par_ids)
   set_claimed_par_id(UINT_MAX);
 
-  _buffer_blob = NULL;
   set_saved_exception_pc(NULL);
   set_threadObj(NULL);
   _anchor.clear();
@@ -1489,9 +1488,7 @@
   _pending_failed_speculation = NULL;
   _pending_transfer_to_interpreter = false;
   _jvmci._alternate_call_target = NULL;
-  // TODO: If _jvmci becomes a union, then this assignment
-  // should be converted to an assertion or guarantee
-  _jvmci._implicit_exception_pc = NULL;
+  assert(_jvmci._implicit_exception_pc == NULL, "must be");
   if (JVMCICounterSize > 0) {
     _jvmci_counters = NEW_C_HEAP_ARRAY(jlong, JVMCICounterSize, mtInternal);
     memset(_jvmci_counters, 0, sizeof(jlong) * JVMCICounterSize);
--- a/src/share/vm/runtime/thread.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/runtime/thread.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -785,10 +785,6 @@
   JavaThread*    _next;                          // The next thread in the Threads list
   oop            _threadObj;                     // The Java level thread object
 
-  // (thomaswue) Necessary for holding a compilation buffer.
-  // Moved up from CompilerThread to JavaThread in order to enable code
-  // installation from Java application code.
-  BufferBlob*   _buffer_blob;
 #ifdef ASSERT
  private:
   int _java_call_counter;
@@ -934,15 +930,14 @@
   // Specifies if the DeoptReason for the last uncommon trap was Reason_transfer_to_interpreter
   bool      _pending_transfer_to_interpreter;
 
-  // These fields are mutually exclusive in terms of live ranges
-  // so this could be a union instead of a struct.
-  struct {
+  // These fields are mutually exclusive in terms of live ranges.
+  union {
     // Communicates the pc at which the most recent implicit exception occurred
     // from the signal handler to a deoptimization stub.
     address   _implicit_exception_pc;
 
-    // Communicates an alternative call target to an i2c stub from a JavaCall.
-    address   _alternate_call_target;    //
+    // Communicates an alternative call target to an i2c stub from a JavaCall .
+    address   _alternate_call_target;
   } _jvmci;
 
   // Support for high precision, thread sensitive counters in JVMCI compiled code.
@@ -1037,10 +1032,6 @@
     return (struct JNINativeInterface_ *)_jni_environment.functions;
   }
 
-
-  BufferBlob*   get_buffer_blob()                { return _buffer_blob; }
-  void          set_buffer_blob(BufferBlob* b)   { _buffer_blob = b; };
-
   // This function is called at thread creation to allow
   // platform specific thread variables to be initialized.
   void cache_global_variables();
--- a/src/share/vm/runtime/vmStructs.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/runtime/vmStructs.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -1010,9 +1010,6 @@
   /*********************************/                                                                                                \
   /* JNIHandles and JNIHandleBlock */                                                                                                \
   /*********************************/                                                                                                \
-                                                                                                                                     \
-  nonstatic_field(Handle,                      _handle,                                       oop*)                                  \
-                                                                                                                                     \
      static_field(JNIHandles,                  _global_handles,                               JNIHandleBlock*)                       \
      static_field(JNIHandles,                  _weak_global_handles,                          JNIHandleBlock*)                       \
      static_field(JNIHandles,                  _deleted_handle,                               oop)                                   \
@@ -1745,8 +1742,6 @@
   /* JNIHandles and JNIHandleBlock */                                     \
   /*********************************/                                     \
                                                                           \
-  declare_toplevel_type(Handle)                                           \
-                                                                          \
   declare_toplevel_type(JNIHandles)                                       \
   declare_toplevel_type(JNIHandleBlock)                                   \
   declare_toplevel_type(jobject)                                          \
@@ -2543,22 +2538,9 @@
   declare_constant(ConstantPoolCacheEntry::is_final_shift)                \
   declare_constant(ConstantPoolCacheEntry::is_forced_virtual_shift)       \
   declare_constant(ConstantPoolCacheEntry::is_vfinal_shift)               \
-  declare_constant(ConstantPoolCacheEntry::has_appendix_shift)            \
-  declare_constant(ConstantPoolCacheEntry::has_method_type_shift)         \
   declare_constant(ConstantPoolCacheEntry::is_field_entry_shift)          \
   declare_constant(ConstantPoolCacheEntry::tos_state_shift)               \
                                                                           \
-  declare_constant(ConstantPoolCacheEntry::cp_index_bits)                 \
-  declare_constant(ConstantPoolCacheEntry::cp_index_mask)                 \
-  declare_constant(ConstantPoolCacheEntry::bytecode_1_shift)              \
-  declare_constant(ConstantPoolCacheEntry::bytecode_1_mask)               \
-  declare_constant(ConstantPoolCacheEntry::bytecode_2_shift)              \
-  declare_constant(ConstantPoolCacheEntry::bytecode_2_mask)               \
-                                                                          \
-  declare_constant(ConstantPoolCacheEntry::_indy_resolved_references_appendix_offset) \
-  declare_constant(ConstantPoolCacheEntry::_indy_resolved_references_method_type_offset) \
-  declare_constant(ConstantPoolCacheEntry::_indy_resolved_references_entries) \
-                                                                          \
   /***************************************/                               \
   /* java_lang_Thread::ThreadStatus enum */                               \
   /***************************************/                               \
--- a/src/share/vm/utilities/exceptions.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/utilities/exceptions.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -90,8 +90,7 @@
   void clear_pending_exception();
 
   ThreadShadow() : _pending_exception(NULL),
-                   _exception_file(NULL), _exception_line(0)
-  {}
+                   _exception_file(NULL), _exception_line(0) {}
 };
 
 
--- a/src/share/vm/utilities/growableArray.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/utilities/growableArray.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -377,17 +377,17 @@
   // matching key according to the static compare function.  Insert
   // that element is not already in the list.  Assumes the list is
   // already sorted according to compare function.
-  template <int compare(E, E)> E find_insert_binary(E key) {
+  template <int compare(E&, E&)> E insert_sorted(E& key) {
     bool found;
-    int location = find_binary<E, compare>(key, found);
+    int location = find_sorted<E, compare>(key, found);
     if (!found) {
       assert(location <= length(), "out of range");
-      insert_binary(location, key);
+      insert_before(location, key);
     }
     return at(location);
   }
 
-  template <typename K, int compare(K, E)> int find_binary(K key, bool& found) {
+  template <typename K, int compare(K&, E&)> int find_sorted(K& key, bool& found) {
     found = false;
     int min = 0;
     int max = length() - 1;
@@ -407,21 +407,6 @@
     }
     return min;
   }
-
-  // Insert a new element at location, moving values as needed.
-  void insert_binary(int location, E element) {
-    int len = length();
-    if (len == location) {
-      append(element);
-    } else {
-      append(at(len-1));
-      int pos;
-      for (pos = len-2; pos >= location; pos--) {
-        at_put(pos+1, at(pos));
-      }
-      at_put(location, element);
-    }
-  }
 };
 
 // Global GrowableArray methods (one instance in the library per each 'E' type).
--- a/src/share/vm/utilities/top.hpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/utilities/top.hpp	Tue Sep 15 18:13:11 2015 -0700
@@ -43,7 +43,7 @@
 #include "opto/c2_globals.hpp"
 #endif
 #if INCLUDE_JVMCI
-#include "jvmci/jvmciGlobals.hpp"
+#include "jvmci/jvmci_globals.hpp"
 #endif
 
 // THIS FILE IS INTESIONALLY LEFT EMPTY
--- a/src/share/vm/utilities/vmError.cpp	Tue Sep 15 18:12:33 2015 -0700
+++ b/src/share/vm/utilities/vmError.cpp	Tue Sep 15 18:13:11 2015 -0700
@@ -539,18 +539,17 @@
   STEP(102, "(printing code blob if possible)")
 
      if (_verbose && _context) {
-       address pc = os::get_pc(_context);
-       CodeBlob* cb = CodeCache::find_blob(pc);
+       CodeBlob* cb = CodeCache::find_blob(_pc);
        if (cb != NULL) {
-         if (Interpreter::contains(pc)) {
+         if (Interpreter::contains(_pc)) {
            // The interpreter CodeBlob is very large so try to print the codelet instead.
-           InterpreterCodelet* codelet = Interpreter::codelet_containing(pc);
+           InterpreterCodelet* codelet = Interpreter::codelet_containing(_pc);
            if (codelet != NULL) {
              codelet->print_on(st);
              Disassembler::decode(codelet->code_begin(), codelet->code_end(), st);
            }
          } else {
-           StubCodeDesc* desc = StubCodeDesc::desc_for(pc);
+           StubCodeDesc* desc = StubCodeDesc::desc_for(_pc);
            if (desc != NULL) {
              desc->print_on(st);
              Disassembler::decode(desc->begin(), desc->end(), st);