# HG changeset patch # User Doug Simon # Date 1432679776 -7200 # Node ID 48c1ebd2412012b65dcd76d99ed7a5016d1376fd # Parent d12eaef9af720fd00b6bd2586aa9383681c8191a renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53) diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.amd64/src/com/oracle/graal/amd64/AMD64.java --- a/graal/com.oracle.graal.amd64/src/com/oracle/graal/amd64/AMD64.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.amd64/src/com/oracle/graal/amd64/AMD64.java Wed May 27 00:36:16 2015 +0200 @@ -22,15 +22,17 @@ */ package com.oracle.graal.amd64; -import static com.oracle.graal.api.code.MemoryBarriers.*; -import static com.oracle.graal.api.code.Register.*; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.PlatformKind; +import static com.oracle.jvmci.code.MemoryBarriers.*; +import static com.oracle.jvmci.code.Register.*; import java.nio.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.Register.RegisterCategory; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.Register.RegisterCategory; /** * Represents the AMD64 architecture. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/overview.html --- a/graal/com.oracle.graal.api.code/overview.html Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ - - - - - - - - -The com.oracle.graal.api.code project provides an API to the runtime's native code cache. -It allows installation and execution of native code. - - - diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/AbstractAddress.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/AbstractAddress.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2013, 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 com.oracle.graal.api.code; - -/** - * Abstract base class that represents a platform specific address. - */ -public abstract class AbstractAddress { -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Architecture.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Architecture.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,249 +0,0 @@ -/* - * Copyright (c) 2009, 2011, 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 com.oracle.graal.api.code; - -import java.nio.*; -import java.util.*; - -import com.oracle.graal.api.code.Register.RegisterCategory; -import com.oracle.graal.api.meta.*; - -/** - * Represents a CPU architecture, including information such as its endianness, CPU registers, word - * width, etc. - */ -public abstract class Architecture { - - /** - * The number of entries required in a {@link ReferenceMap} covering all the registers that may - * store references. The index of a register in the reference map is given by - * {@link Register#getReferenceMapIndex()}. - */ - private final int registerReferenceMapSize; - - /** - * Represents the natural size of words (typically registers and pointers) of this architecture, - * in bytes. - */ - private final int wordSize; - - /** - * The name of this architecture (e.g. "AMD64", "SPARCv9"). - */ - private final String name; - - /** - * Array of all available registers on this architecture. The index of each register in this - * array is equal to its {@linkplain Register#number number}. - */ - private final Register[] registers; - - /** - * The byte ordering can be either little or big endian. - */ - private final ByteOrder byteOrder; - - /** - * Whether the architecture supports unaligned memory accesses. - */ - private final boolean unalignedMemoryAccess; - - /** - * Mask of the barrier constants denoting the barriers that are not required to be explicitly - * inserted under this architecture. - */ - private final int implicitMemoryBarriers; - - /** - * Offset in bytes from the beginning of a call instruction to the displacement. - */ - private final int machineCodeCallDisplacementOffset; - - /** - * The size of the return address pushed to the stack by a call instruction. A value of 0 - * denotes that call linkage uses registers instead (e.g. SPARC). - */ - private final int returnAddressSize; - - protected Architecture(String name, int wordSize, ByteOrder byteOrder, boolean unalignedMemoryAccess, Register[] registers, int implicitMemoryBarriers, int nativeCallDisplacementOffset, - int registerReferenceMapSize, int returnAddressSize) { - this.name = name; - this.registers = registers; - this.wordSize = wordSize; - this.byteOrder = byteOrder; - this.unalignedMemoryAccess = unalignedMemoryAccess; - this.implicitMemoryBarriers = implicitMemoryBarriers; - this.machineCodeCallDisplacementOffset = nativeCallDisplacementOffset; - this.registerReferenceMapSize = registerReferenceMapSize; - this.returnAddressSize = returnAddressSize; - } - - /** - * Converts this architecture to a string. - * - * @return the string representation of this architecture - */ - @Override - public final String toString() { - return getName().toLowerCase(); - } - - public int getRegisterReferenceMapSize() { - return registerReferenceMapSize; - } - - /** - * Gets the natural size of words (typically registers and pointers) of this architecture, in - * bytes. - */ - public int getWordSize() { - return wordSize; - } - - /** - * Gets the name of this architecture. - */ - public String getName() { - return name; - } - - /** - * Gets an array of all available registers on this architecture. The index of each register in - * this array is equal to its {@linkplain Register#number number}. - */ - public Register[] getRegisters() { - return registers.clone(); - } - - public ByteOrder getByteOrder() { - return byteOrder; - } - - /** - * @return true if the architecture supports unaligned memory accesses. - */ - public boolean supportsUnalignedMemoryAccess() { - return unalignedMemoryAccess; - } - - /** - * Gets the size of the return address pushed to the stack by a call instruction. A value of 0 - * denotes that call linkage uses registers instead. - */ - public int getReturnAddressSize() { - return returnAddressSize; - } - - /** - * Gets the offset in bytes from the beginning of a call instruction to the displacement. - */ - public int getMachineCodeCallDisplacementOffset() { - return machineCodeCallDisplacementOffset; - } - - /** - * Determines the barriers in a given barrier mask that are explicitly required on this - * architecture. - * - * @param barriers a mask of the barrier constants - * @return the value of {@code barriers} minus the barriers unnecessary on this architecture - */ - public final int requiredBarriers(int barriers) { - return barriers & ~implicitMemoryBarriers; - } - - /** - * 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 - * @param kind the kind that should be stored in the register - */ - public abstract boolean canStoreValue(RegisterCategory category, PlatformKind kind); - - /** - * Return the largest kind that can be stored in a register of a given category. - * - * @param category the category of the register - * @return the largest kind that can be stored in a register {@code category} - */ - public abstract PlatformKind getLargestStorableKind(RegisterCategory category); - - @Override - public final boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (obj instanceof Architecture) { - Architecture that = (Architecture) obj; - if (this.name.equals(that.name)) { - assert this.byteOrder.equals(that.byteOrder); - assert this.implicitMemoryBarriers == that.implicitMemoryBarriers; - assert this.machineCodeCallDisplacementOffset == that.machineCodeCallDisplacementOffset; - assert this.registerReferenceMapSize == that.registerReferenceMapSize; - assert Arrays.equals(this.registers, that.registers); - assert this.returnAddressSize == that.returnAddressSize; - assert this.unalignedMemoryAccess == that.unalignedMemoryAccess; - assert this.wordSize == that.wordSize; - return true; - } - } - return false; - } - - @Override - public final int hashCode() { - return name.hashCode(); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ArithmeticOperation.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ArithmeticOperation.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2013, 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 com.oracle.graal.api.code; - -/** - * An {@code ArithmeticOperation} is an operation that does primitive value arithmetic without side - * effect. - */ -public interface ArithmeticOperation { -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BailoutException.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BailoutException.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2009, 2011, 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 com.oracle.graal.api.code; - -import java.util.*; - -/** - * Exception thrown when the compiler refuses to compile a method because of problems with the - * method. e.g. bytecode wouldn't verify, too big, JSR/ret too complicated, etc. This exception is - * not meant to indicate problems with the compiler itself. - */ -public class BailoutException extends RuntimeException { - - public static final long serialVersionUID = 8974598793458772L; - private final boolean permanent; - - /** - * Creates a new {@link BailoutException}. - * - * - * @param args parameters to the formatter - */ - public BailoutException(String format, Object... args) { - super(String.format(Locale.ENGLISH, format, args)); - this.permanent = true; - } - - /** - * Creates a new {@link BailoutException}. - * - * - * @param args parameters to the formatter - */ - public BailoutException(Throwable cause, String format, Object... args) { - super(String.format(Locale.ENGLISH, format, args), cause); - this.permanent = true; - } - - /** - * Creates a new {@link BailoutException}. - * - * @param permanent specifies whether this exception will occur again if compilation is retried - * @param args parameters to the formatter - */ - public BailoutException(boolean permanent, String format, Object... args) { - super(String.format(Locale.ENGLISH, format, args)); - this.permanent = permanent; - } - - /** - * @return whether this exception will occur again if compilation is retried - */ - public boolean isPermanent() { - return permanent; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodeFrame.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodeFrame.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,271 +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 com.oracle.graal.api.code; - -import java.util.*; - -import com.oracle.graal.api.meta.*; - -/** - * Represents the Java bytecode frame state(s) at a given position including {@link Value locations} - * where to find the local variables, operand stack values and locked objects of the bytecode - * frame(s). - */ -public class BytecodeFrame extends BytecodePosition { - - /** - * An array of values representing how to reconstruct the state of the Java frame. This is array - * is partitioned as follows: - *

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Start index (inclusive)End index (exclusive)Description
0numLocalsLocal variables
numLocalsnumLocals + numStackOperand stack
numLocals + numStackvalues.lengthLocked objects
- *

- * 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; - - /** - * The number of locals in the values array. - */ - public final int numLocals; - - /** - * The number of stack slots in the values array. - */ - public final int numStack; - - /** - * The number of locks in the values array. - */ - public final int numLocks; - - /** - * True if this is a position inside an exception handler before the exception object has been - * consumed. In this case, {@link #numStack} {@code == 1} and {@link #getStackValue(int) - * getStackValue(0)} is the location of the exception object. If deoptimization happens at this - * position, the interpreter will rethrow the exception instead of executing the bytecode - * instruction at this position. - */ - public final boolean rethrowException; - - public final boolean duringCall; - - /** - * This BCI should be used for frame states that are built for code with no meaningful BCI. - */ - public static final int UNKNOWN_BCI = -5; - - /** - * The BCI for exception unwind. This is synthetic code and has no representation in bytecode. - * In contrast with {@link #AFTER_EXCEPTION_BCI}, at this point, if the method is synchronized, - * the monitor is still held. - */ - public static final int UNWIND_BCI = -1; - - /** - * The BCI for the state before starting to execute a method. Note that if the method is - * synchronized, the monitor is not yet held. - */ - public static final int BEFORE_BCI = -2; - - /** - * The BCI for the state after finishing the execution of a method and returning normally. Note - * that if the method was synchronized the monitor is already released. - */ - public static final int AFTER_BCI = -3; - - /** - * The BCI for exception unwind. This is synthetic code and has no representation in bytecode. - * In contrast with {@link #UNWIND_BCI}, at this point, if the method is synchronized, the - * monitor is already released. - */ - public static final int AFTER_EXCEPTION_BCI = -4; - - /** - * This BCI should be used for states that cannot be the target of a deoptimization, like - * snippet frame states. - */ - public static final int INVALID_FRAMESTATE_BCI = -6; - - /** - * Determines if a given BCI matches one of the placeholder BCI constants defined in this class. - */ - public static boolean isPlaceholderBci(int bci) { - return bci < 0; - } - - /** - * Gets the name of a given placeholder BCI. - */ - public static String getPlaceholderBciName(int bci) { - assert isPlaceholderBci(bci); - if (bci == BytecodeFrame.AFTER_BCI) { - return "AFTER_BCI"; - } else if (bci == BytecodeFrame.AFTER_EXCEPTION_BCI) { - return "AFTER_EXCEPTION_BCI"; - } else if (bci == BytecodeFrame.INVALID_FRAMESTATE_BCI) { - return "INVALID_FRAMESTATE_BCI"; - } else if (bci == BytecodeFrame.BEFORE_BCI) { - return "BEFORE_BCI"; - } else if (bci == BytecodeFrame.UNKNOWN_BCI) { - return "UNKNOWN_BCI"; - } else { - assert bci == BytecodeFrame.UNWIND_BCI; - return "UNWIND_BCI"; - } - } - - /** - * Creates a new frame object. - * - * @param caller the caller frame (which may be {@code null}) - * @param method the method - * @param bci a BCI within the method - * @param rethrowException specifies if the VM should re-throw the pending exception when - * deopt'ing using this frame - * @param values the frame state {@link #values} - * @param numLocals the number of local variables - * @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) { - super(caller, method, bci); - assert values != null; - this.rethrowException = rethrowException; - this.duringCall = duringCall; - this.values = values; - this.numLocals = numLocals; - this.numStack = numStack; - this.numLocks = numLocks; - assert !rethrowException || numStack == 1 : "must have exception on top of the stack"; - } - - /** - * Ensure that the frame state is formatted as expected by the JVM, with null or Illegal in the - * 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) { - if (caller() != null) { - caller().validateFormat(derivedOk); - } - for (int i = 0; i < numLocals + numStack; i++) { - if (values[i] != null) { - Kind kind = values[i].getKind(); - 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 derivedOk || ValueUtil.isIllegal(values[i]) || !values[i].getLIRKind().isDerivedReference() : "Unexpected derived value: " + values[i]; - } - } - return true; - } - - /** - * Gets the value representing the specified local variable. - * - * @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) { - return values[i]; - } - - /** - * Gets the value representing the specified stack slot. - * - * @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) { - return values[i + numLocals]; - } - - /** - * Gets the value representing the specified lock. - * - * @param i the lock index - * @return the value that can be used to reconstruct the lock's current value - */ - public Value getLockValue(int i) { - return values[i + numLocals + numStack]; - } - - /** - * Gets the caller of this frame. - * - * @return {@code null} if this frame has no caller - */ - public BytecodeFrame caller() { - return (BytecodeFrame) getCaller(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof BytecodeFrame && super.equals(obj)) { - BytecodeFrame that = (BytecodeFrame) obj; - // @formatter:off - if (this.duringCall == that.duringCall && - this.rethrowException == that.rethrowException && - this.numLocals == that.numLocals && - this.numLocks == that.numLocks && - this.numStack == that.numStack && - Arrays.equals(this.values, that.values)) { - return true; - } - // @formatter:off - return true; - } - return false; - } - - @Override - public String toString() { - return CodeUtil.append(new StringBuilder(100), this).toString(); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodePosition.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/BytecodePosition.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2009, 2011, 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 com.oracle.graal.api.code; - -import java.util.*; - -import com.oracle.graal.api.meta.*; - -/** - * Represents a code position, that is, a chain of inlined methods with bytecode locations, that is - * communicated from the compiler to the runtime system. A code position can be used by the runtime - * system to reconstruct a source-level stack trace for exceptions and to create - * {@linkplain BytecodeFrame frames} for deoptimization. - */ -public class BytecodePosition { - - private final BytecodePosition caller; - private final ResolvedJavaMethod method; - private final int bci; - - /** - * Constructs a new object representing a given parent/caller, a given method, and a given BCI. - * - * @param caller the parent position - * @param method the method - * @param bci a BCI within the method - */ - public BytecodePosition(BytecodePosition caller, ResolvedJavaMethod method, int bci) { - assert method != null; - this.caller = caller; - this.method = method; - this.bci = bci; - } - - /** - * Converts this code position to a string representation. - * - * @return a string representation of this code position - */ - @Override - public String toString() { - return CodeUtil.append(new StringBuilder(100), this).toString(); - } - - /** - * Deep equality test. - */ - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (obj != null && getClass() == obj.getClass()) { - BytecodePosition that = (BytecodePosition) obj; - if (this.bci == that.bci && Objects.equals(this.getMethod(), that.getMethod()) && Objects.equals(this.caller, that.caller)) { - return true; - } - } - return false; - } - - @Override - public int hashCode() { - return getBCI(); - } - - /** - * @return The location within the method, as a bytecode index. The constant {@code -1} may be - * used to indicate the location is unknown, for example within code synthesized by the - * compiler. - */ - public int getBCI() { - return bci; - } - - /** - * @return The runtime interface method for this position. - */ - public ResolvedJavaMethod getMethod() { - return method; - } - - /** - * The position where this position has been called, {@code null} if none. - */ - public BytecodePosition getCaller() { - return caller; - } - - /** - * Adds a caller to the current position returning the new position. - */ - public BytecodePosition addCaller(BytecodePosition link) { - if (getCaller() == null) { - return new BytecodePosition(link, getMethod(), getBCI()); - } else { - return new BytecodePosition(getCaller().addCaller(link), getMethod(), getBCI()); - } - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CalleeSaveLayout.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CalleeSaveLayout.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2010, 2011, 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 com.oracle.graal.api.code; - -import java.util.*; - -import com.oracle.graal.api.meta.*; - -/** - * The callee save area (CSA) is a contiguous space in a stack frame used to save (and restore) the - * values of the caller's registers. This class describes the layout of a CSA in terms of its - * {@linkplain #size size}, {@linkplain #slotSize slot size} and the {@linkplain #registers callee - * save registers} covered by the CSA. - */ -public class CalleeSaveLayout { - - /** - * The size (in bytes) of the CSA. - */ - public final int size; - - /** - * The size (in bytes) of an {@linkplain #registerAt(int) indexable} slot in the CSA. - */ - public final int slotSize; - - /** - * Map from {@linkplain Register#number register numbers} to slot indexes in the CSA. - */ - private final int[] regNumToIndex; - - private final Register[] indexToReg; - - /** - * The list of registers {@linkplain #contains(int) contained} by this CSA. - */ - public final Register[] registers; - - /** - * The offset from the frame pointer to the CSA. If this is not known, then this field will have - * the value {@link Integer#MAX_VALUE}. - */ - public final int frameOffsetToCSA; - - /** - * Creates a CSA layout. - * - * @param size size (in bytes) of the CSA. If this is {@code -1}, then the CSA size will be - * computed from {@code registers}. - * @param slotSize the size (in bytes) of an {@linkplain #registerAt(int) indexable} slot in the - * CSA - * @param registers the registers that can be saved in the CSA - */ - public CalleeSaveLayout(TargetDescription target, int frameOffsetToCSA, int size, int slotSize, Register... registers) { - this.frameOffsetToCSA = frameOffsetToCSA; - assert slotSize == 0 || CodeUtil.isPowerOf2(slotSize); - this.slotSize = slotSize; - int maxRegNum = -1; - int maxOffset = 0; - this.registers = registers; - int offset = 0; - for (Register reg : registers) { - assert offset % slotSize == 0; - assert reg.number >= 0; - if (reg.number > maxRegNum) { - maxRegNum = reg.number; - } - if (offset > maxOffset) { - maxOffset = offset; - } - PlatformKind kind = target.arch.getLargestStorableKind(reg.getRegisterCategory()); - offset += target.getSizeInBytes(kind); - } - if (size == -1) { - this.size = offset; - } else { - assert offset <= size; - this.size = size; - } - - this.regNumToIndex = new int[maxRegNum + 1]; - this.indexToReg = offset == 0 ? new Register[0] : new Register[offset / slotSize]; - Arrays.fill(regNumToIndex, -1); - offset = 0; - for (Register reg : registers) { - int index = offset / slotSize; - regNumToIndex[reg.number] = index; - indexToReg[index] = reg; - PlatformKind kind = target.arch.getLargestStorableKind(reg.getRegisterCategory()); - offset += target.getSizeInBytes(kind); - } - } - - /** - * Gets the offset of a given register in the CSA. - * - * @return the offset (in bytes) of {@code reg} in the CSA - * @throws IllegalArgumentException if {@code reg} does not have a slot in the CSA - */ - public int offsetOf(int reg) { - return indexOf(reg) * slotSize; - } - - /** - * Gets the index of a given register in the CSA. - * - * @return the index of {@code reg} in the CSA - * @throws IllegalArgumentException if {@code reg} does not have a slot in the CSA - */ - public int indexOf(int reg) { - if (!contains(reg)) { - throw new IllegalArgumentException(String.valueOf(reg)); - } - return regNumToIndex[reg]; - } - - /** - * Gets the offset of a given register in the CSA. - * - * @return the offset (in bytes) of {@code reg} in the CSA - * @throws IllegalArgumentException if {@code reg} does not have a slot in the CSA - */ - public int offsetOf(Register reg) { - return offsetOf(reg.number); - } - - /** - * Determines if the CSA includes a slot for a given register. - * - * @param reg the register to test - * @return true if the CSA contains a slot for {@code reg} - */ - public boolean contains(int reg) { - return reg >= 0 && reg < regNumToIndex.length && regNumToIndex[reg] != -1; - } - - /** - * Gets the register whose slot in the CSA is at a given index. - * - * @param index an index of a slot in the CSA - * @return the register whose slot in the CSA is at {@code index} or {@code null} if - * {@code index} does not denote a slot in the CSA aligned with a register - */ - public Register registerAt(int index) { - if (index < 0 || index >= indexToReg.length) { - return null; - } - return indexToReg[index]; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("["); - for (Register reg : registers) { - if (sb.length() != 1) { - sb.append(", "); - } - sb.append(reg).append("{+").append(offsetOf(reg)).append('}'); - } - return sb.append("] size=").append(size).toString(); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CallingConvention.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CallingConvention.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2009, 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 com.oracle.graal.api.code; - -import static com.oracle.graal.api.code.ValueUtil.*; - -import com.oracle.graal.api.meta.*; - -/** - * A calling convention describes the locations in which the arguments for a call are placed and the - * location in which the return value is placed if the call is not void. - */ -public class CallingConvention { - - /** - * Constants denoting the type of a call for which a calling convention is requested. - */ - public enum Type { - /** - * A request for the outgoing argument locations at a call site to Java code. - */ - JavaCall(true), - - /** - * A request for the incoming argument locations. - */ - JavaCallee(false), - - /** - * A request for the outgoing argument locations at a call site to external native code that - * complies with the platform ABI. - */ - NativeCall(true); - - /** - * Determines if this is a request for the outgoing argument locations at a call site. - */ - public final boolean out; - - public static final Type[] VALUES = values(); - - private Type(boolean out) { - this.out = out; - } - } - - /** - * The amount of stack space (in bytes) required for the stack-based arguments of the call. - */ - private final int stackSize; - - private final AllocatableValue returnLocation; - - /** - * The ordered locations in which the arguments are placed. - */ - private final AllocatableValue[] argumentLocations; - - /** - * Creates a description of the registers and stack locations used by a call. - * - * @param stackSize amount of stack space (in bytes) required for the stack-based arguments of - * the call - * @param returnLocation the location for the return value or {@link Value#ILLEGAL} if a void - * call - * @param argumentLocations the ordered locations in which the arguments are placed - */ - public CallingConvention(int stackSize, AllocatableValue returnLocation, AllocatableValue... argumentLocations) { - assert argumentLocations != null; - assert returnLocation != null; - this.argumentLocations = argumentLocations; - this.stackSize = stackSize; - this.returnLocation = returnLocation; - assert verify(); - } - - /** - * Gets the location for the return value or {@link Value#ILLEGAL} if a void call. - */ - public AllocatableValue getReturn() { - return returnLocation; - } - - /** - * Gets the location for the {@code index}'th argument. - */ - public AllocatableValue getArgument(int index) { - return argumentLocations[index]; - } - - /** - * Gets the amount of stack space (in bytes) required for the stack-based arguments of the call. - */ - public int getStackSize() { - return stackSize; - } - - /** - * Gets the number of locations required for the arguments. - */ - public int getArgumentCount() { - return argumentLocations.length; - } - - /** - * Gets the locations required for the arguments. - */ - public AllocatableValue[] getArguments() { - if (argumentLocations.length == 0) { - return argumentLocations; - } - return argumentLocations.clone(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("CallingConvention["); - String sep = ""; - for (Value op : argumentLocations) { - sb.append(sep).append(op); - sep = ", "; - } - if (!returnLocation.equals(Value.ILLEGAL)) { - sb.append(" -> ").append(returnLocation); - } - sb.append("]"); - return sb.toString(); - } - - private boolean verify() { - for (int i = 0; i < argumentLocations.length; i++) { - Value location = argumentLocations[i]; - assert isStackSlot(location) || isAllocatableValue(location); - } - return true; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +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 com.oracle.graal.api.code; - -import com.oracle.graal.api.code.CompilationResult.DataPatch; -import com.oracle.graal.api.code.DataSection.Data; -import com.oracle.graal.api.meta.*; - -/** - * Access to code cache related details and requirements. - */ -public interface CodeCacheProvider { - - /** - * Adds the given compilation result as an implementation of the given method without making it - * the default implementation. - * - * @param method a method to which the executable code is begin added - * @param compResult the compilation result to be added - * @param speculationLog the speculation log to be used - * @return a reference to the compiled and ready-to-run code or throws a - * {@link BailoutException} if the code installation failed - */ - InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, SpeculationLog speculationLog, InstalledCode predefinedInstalledCode); - - /** - * Sets the given compilation result as the default implementation of the given method. - * - * @param method a method to which the executable code is begin added - * @param compResult the compilation result to be added - * @return a reference to the compiled and ready-to-run code or null if the code installation - * failed - */ - InstalledCode setDefaultMethod(ResolvedJavaMethod method, CompilationResult compResult); - - /** - * Returns a disassembly of some compiled code. - * - * @param compResult some compiled code - * @param installedCode the result of installing the code in {@code compResult} or null if the - * code has not yet been installed - * - * @return a disassembly. This will be of length 0 if the runtime does not support - * disassembling. - */ - String disassemble(CompilationResult compResult, InstalledCode installedCode); - - /** - * Gets the register configuration to use when compiling a given method. - */ - RegisterConfig getRegisterConfig(); - - /** - * Minimum size of the stack area reserved for outgoing parameters. This area is reserved in all - * cases, even when the compiled method has no regular call instructions. - * - * @return the minimum size of the outgoing parameter area in bytes - */ - int getMinimumOutgoingSize(); - - /** - * Determines if a {@link DataPatch} should be created for a given primitive constant that is - * part of a {@link CompilationResult}. A data patch is always created for an object constant. - */ - boolean needsDataPatch(JavaConstant constant); - - /** - * Create a {@link Data} item for a {@link Constant}, that can be used in a {@link DataPatch}. - */ - Data createDataItem(Constant constant); - - /** - * Gets a description of the target architecture. - */ - TargetDescription getTarget(); - - /** - * Create a new speculation log for the target runtime. - */ - SpeculationLog createSpeculationLog(); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeUtil.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeUtil.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,479 +0,0 @@ -/* - * Copyright (c) 2010, 2013, 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 com.oracle.graal.api.code; - -import java.util.*; - -import com.oracle.graal.api.meta.*; - -/** - * Miscellaneous collection of utility methods used by {@code com.oracle.graal.api.code} and its - * clients. - */ -public class CodeUtil { - - public static final String NEW_LINE = String.format("%n"); - - public static final int K = 1024; - public static final int M = 1024 * 1024; - - public static boolean isOdd(int n) { - return (n & 1) == 1; - } - - public static boolean isEven(int n) { - return (n & 1) == 0; - } - - /** - * Checks whether the specified integer is a power of two. - * - * @param val the value to check - * @return {@code true} if the value is a power of two; {@code false} otherwise - */ - public static boolean isPowerOf2(int val) { - return val > 0 && (val & val - 1) == 0; - } - - /** - * Checks whether the specified long is a power of two. - * - * @param val the value to check - * @return {@code true} if the value is a power of two; {@code false} otherwise - */ - public static boolean isPowerOf2(long val) { - return val > 0 && (val & val - 1) == 0; - } - - /** - * Computes the log (base 2) of the specified integer, rounding down. (E.g {@code log2(8) = 3}, - * {@code log2(21) = 4} ) - * - * @param val the value - * @return the log base 2 of the value - */ - public static int log2(int val) { - assert val > 0; - return (Integer.SIZE - 1) - Integer.numberOfLeadingZeros(val); - } - - /** - * Computes the log (base 2) of the specified long, rounding down. (E.g {@code log2(8) = 3}, - * {@code log2(21) = 4}) - * - * @param val the value - * @return the log base 2 of the value - */ - public static int log2(long val) { - assert val > 0; - return (Long.SIZE - 1) - Long.numberOfLeadingZeros(val); - } - - /** - * Narrow an integer value to a given bit width, and return the result as a signed long. - * - * @param value the value - * @param resultBits the result bit width - * @return {@code value} interpreted as {@code resultBits} bit number, encoded as signed long - */ - public static long narrow(long value, int resultBits) { - long ret = value & mask(resultBits); - return signExtend(ret, resultBits); - } - - /** - * Sign extend an integer. - * - * @param value the input value - * @param inputBits the bit width of the input value - * @return a signed long with the same value as the signed {@code inputBits}-bit number - * {@code value} - */ - public static long signExtend(long value, int inputBits) { - if (inputBits < 64) { - if ((value >>> (inputBits - 1) & 1) == 1) { - return value | (-1L << inputBits); - } else { - return value & ~(-1L << inputBits); - } - } else { - return value; - } - } - - /** - * Zero extend an integer. - * - * @param value the input value - * @param inputBits the bit width of the input value - * @return an unsigned long with the same value as the unsigned {@code inputBits}-bit number - * {@code value} - */ - public static long zeroExtend(long value, int inputBits) { - if (inputBits < 64) { - return value & ~(-1L << inputBits); - } else { - return value; - } - } - - /** - * Convert an integer to long. - * - * @param value the input value - * @param inputBits the bit width of the input value - * @param unsigned whether the values should be interpreted as signed or unsigned - * @return a long with the same value as the {@code inputBits}-bit number {@code value} - */ - public static long convert(long value, int inputBits, boolean unsigned) { - if (unsigned) { - return zeroExtend(value, inputBits); - } else { - return signExtend(value, inputBits); - } - } - - /** - * Get a bitmask with the low {@code bits} bit set and the high {@code 64 - bits} bit clear. - */ - public static long mask(int bits) { - assert 0 <= bits && bits <= 64; - if (bits == 64) { - return 0xffffffffffffffffL; - } else { - return (1L << bits) - 1; - } - } - - /** - * Get the minimum value representable in a {@code bits} bit signed integer. - */ - public static long minValue(int bits) { - assert 0 < bits && bits <= 64; - return -1L << (bits - 1); - } - - /** - * Get the maximum value representable in a {@code bits} bit signed integer. - */ - public static long maxValue(int bits) { - assert 0 < bits && bits <= 64; - return mask(bits - 1); - } - - /** - * Formats the values in a frame as a tabulated string. - * - * @param frame - * @return the values in {@code frame} as a tabulated string - */ - public static String tabulateValues(BytecodeFrame frame) { - int cols = Math.max(frame.numLocals, Math.max(frame.numStack, frame.numLocks)); - assert cols > 0; - ArrayList cells = new ArrayList<>(); - cells.add(""); - for (int i = 0; i < cols; i++) { - cells.add(i); - } - cols++; - if (frame.numLocals != 0) { - cells.add("locals:"); - cells.addAll(Arrays.asList(frame.values).subList(0, frame.numLocals)); - cells.addAll(Collections.nCopies(cols - frame.numLocals - 1, "")); - } - if (frame.numStack != 0) { - cells.add("stack:"); - cells.addAll(Arrays.asList(frame.values).subList(frame.numLocals, frame.numLocals + frame.numStack)); - cells.addAll(Collections.nCopies(cols - frame.numStack - 1, "")); - } - if (frame.numLocks != 0) { - cells.add("locks:"); - cells.addAll(Arrays.asList(frame.values).subList(frame.numLocals + frame.numStack, frame.values.length)); - cells.addAll(Collections.nCopies(cols - frame.numLocks - 1, "")); - } - Object[] cellArray = cells.toArray(); - for (int i = 0; i < cellArray.length; i++) { - if ((i % cols) != 0) { - cellArray[i] = "|" + cellArray[i]; - } - } - return CodeUtil.tabulate(cellArray, cols, 1, 1); - } - - /** - * Formats a given table as a string. The value of each cell is produced by - * {@link String#valueOf(Object)}. - * - * @param cells the cells of the table in row-major order - * @param cols the number of columns per row - * @param lpad the number of space padding inserted before each formatted cell value - * @param rpad the number of space padding inserted after each formatted cell value - * @return a string with one line per row and each column left-aligned - */ - public static String tabulate(Object[] cells, int cols, int lpad, int rpad) { - int rows = (cells.length + (cols - 1)) / cols; - int[] colWidths = new int[cols]; - for (int col = 0; col < cols; col++) { - for (int row = 0; row < rows; row++) { - int index = col + (row * cols); - if (index < cells.length) { - Object cell = cells[index]; - colWidths[col] = Math.max(colWidths[col], String.valueOf(cell).length()); - } - } - } - StringBuilder sb = new StringBuilder(); - String nl = NEW_LINE; - for (int row = 0; row < rows; row++) { - for (int col = 0; col < cols; col++) { - int index = col + (row * cols); - if (index < cells.length) { - for (int i = 0; i < lpad; i++) { - sb.append(' '); - } - Object cell = cells[index]; - String s = String.valueOf(cell); - int w = s.length(); - sb.append(s); - while (w < colWidths[col]) { - sb.append(' '); - w++; - } - for (int i = 0; i < rpad; i++) { - sb.append(' '); - } - } - } - sb.append(nl); - } - return sb.toString(); - } - - /** - * Appends a formatted code position to a {@link StringBuilder}. - * - * @param sb the {@link StringBuilder} to append to - * @param pos the code position to format and append to {@code sb} - * @return the value of {@code sb} - */ - public static StringBuilder append(StringBuilder sb, BytecodePosition pos) { - MetaUtil.appendLocation(sb.append("at "), pos.getMethod(), pos.getBCI()); - if (pos.getCaller() != null) { - sb.append(NEW_LINE); - append(sb, pos.getCaller()); - } - return sb; - } - - /** - * Appends a formatted frame to a {@link StringBuilder}. - * - * @param sb the {@link StringBuilder} to append to - * @param frame the frame to format and append to {@code sb} - * @return the value of {@code sb} - */ - public static StringBuilder append(StringBuilder sb, BytecodeFrame frame) { - MetaUtil.appendLocation(sb.append("at "), frame.getMethod(), frame.getBCI()); - assert sb.charAt(sb.length() - 1) == ']'; - sb.deleteCharAt(sb.length() - 1); - sb.append(", duringCall: ").append(frame.duringCall).append(", rethrow: ").append(frame.rethrowException).append(']'); - if (frame.values != null && frame.values.length > 0) { - sb.append(NEW_LINE); - String table = tabulateValues(frame); - String[] rows = table.split(NEW_LINE); - for (int i = 0; i < rows.length; i++) { - String row = rows[i]; - if (!row.trim().isEmpty()) { - sb.append(" ").append(row); - if (i != rows.length - 1) { - sb.append(NEW_LINE); - } - } - } - } - if (frame.caller() != null) { - sb.append(NEW_LINE); - append(sb, frame.caller()); - } else if (frame.getCaller() != null) { - sb.append(NEW_LINE); - append(sb, frame.getCaller()); - } - return sb; - } - - public interface RefMapFormatter { - - String formatStackSlot(int frameRefMapIndex); - - String formatRegister(int regRefMapIndex); - } - - /** - * Formats a location in a register reference map. - */ - public static class DefaultRegFormatter implements RefMapFormatter { - - private final Register[] registers; - - public DefaultRegFormatter(Architecture arch) { - registers = new Register[arch.getRegisterReferenceMapSize()]; - for (Register r : arch.getRegisters()) { - if (r.getReferenceMapIndex() >= 0) { - registers[r.getReferenceMapIndex()] = r; - } - } - } - - public String formatStackSlot(int frameRefMapIndex) { - return null; - } - - public String formatRegister(int regRefMapIndex) { - int i = regRefMapIndex; - int idx = 0; - while (registers[i] == null) { - i--; - idx++; - } - if (idx == 0) { - return registers[i].toString(); - } else { - return String.format("%s+%d", registers[i].toString(), idx); - } - } - } - - /** - * Formats a location present in a register or frame reference map. - */ - public static class DefaultRefMapFormatter extends DefaultRegFormatter { - - /** - * The size of a stack slot. - */ - public final int slotSize; - - /** - * The register used as the frame pointer. - */ - public final Register fp; - - /** - * The offset (in bytes) from the slot pointed to by {@link #fp} to the slot corresponding - * to bit 0 in the frame reference map. - */ - public final int refMapToFPOffset; - - public DefaultRefMapFormatter(Architecture arch, int slotSize, Register fp, int refMapToFPOffset) { - super(arch); - this.slotSize = slotSize; - this.fp = fp; - this.refMapToFPOffset = refMapToFPOffset; - } - - @Override - public String formatStackSlot(int frameRefMapIndex) { - int refMapOffset = frameRefMapIndex * slotSize; - int fpOffset = refMapOffset + refMapToFPOffset; - if (fpOffset >= 0) { - return fp + "+" + fpOffset; - } - return fp.name + fpOffset; - } - } - - public static class NumberedRefMapFormatter implements RefMapFormatter { - - public String formatStackSlot(int frameRefMapIndex) { - return "s" + frameRefMapIndex; - } - - public String formatRegister(int regRefMapIndex) { - return "r" + regRefMapIndex; - } - } - - /** - * Appends a formatted debug info to a {@link StringBuilder}. - * - * @param sb the {@link StringBuilder} to append to - * @param info the debug info to format and append to {@code sb} - * @return the value of {@code sb} - */ - public static StringBuilder append(StringBuilder sb, DebugInfo info, RefMapFormatter formatterArg) { - RefMapFormatter formatter = formatterArg; - if (formatter == null) { - formatter = new NumberedRefMapFormatter(); - } - String nl = NEW_LINE; - ReferenceMap refMap = info.getReferenceMap(); - if (refMap != null && refMap.hasRegisterRefMap()) { - sb.append(" reg-ref-map:"); - refMap.appendRegisterMap(sb, formatter); - sb.append(nl); - } - if (refMap != null && refMap.hasFrameRefMap()) { - sb.append("frame-ref-map:"); - refMap.appendFrameMap(sb, formatter); - sb.append(nl); - } - RegisterSaveLayout calleeSaveInfo = info.getCalleeSaveInfo(); - if (calleeSaveInfo != null) { - sb.append("callee-save-info:").append(nl); - Map map = calleeSaveInfo.slotsToRegisters(true); - for (Map.Entry e : map.entrySet()) { - sb.append(" ").append(e.getValue()).append(" -> ").append(formatter.formatStackSlot(e.getKey())).append(nl); - } - } - BytecodeFrame frame = info.frame(); - if (frame != null) { - append(sb, frame); - } else if (info.getBytecodePosition() != null) { - append(sb, info.getBytecodePosition()); - } - return sb; - } - - /** - * Create a calling convention from a {@link ResolvedJavaMethod}. - */ - public static CallingConvention getCallingConvention(CodeCacheProvider codeCache, CallingConvention.Type type, ResolvedJavaMethod method, boolean stackOnly) { - Signature sig = method.getSignature(); - JavaType retType = sig.getReturnType(null); - int sigCount = sig.getParameterCount(false); - JavaType[] argTypes; - int argIndex = 0; - if (!method.isStatic()) { - argTypes = new JavaType[sigCount + 1]; - argTypes[argIndex++] = method.getDeclaringClass(); - } else { - argTypes = new JavaType[sigCount]; - } - for (int i = 0; i < sigCount; i++) { - argTypes[argIndex++] = sig.getParameterType(i, null); - } - - RegisterConfig registerConfig = codeCache.getRegisterConfig(); - return registerConfig.getCallingConvention(type, retType, argTypes, codeCache.getTarget(), stackOnly); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,951 +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 com.oracle.graal.api.code; - -import static com.oracle.graal.api.meta.MetaUtil.*; -import static java.util.Collections.*; - -import java.util.*; - -import com.oracle.graal.api.code.CodeUtil.RefMapFormatter; -import com.oracle.graal.api.meta.Assumptions.Assumption; -import com.oracle.graal.api.meta.*; - -/** - * Represents the output from compiling a method, including the compiled machine code, associated - * data and references, relocation information, deoptimization information, etc. - */ -public class CompilationResult { - - /** - * Represents a code position with associated additional information. - */ - public abstract static class Site { - - /** - * The position (or offset) of this site with respect to the start of the target method. - */ - public final int pcOffset; - - public Site(int pos) { - this.pcOffset = pos; - } - - @Override - public final int hashCode() { - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - return identityHashCodeString(this); - } - - @Override - public abstract boolean equals(Object obj); - } - - /** - * Represents an infopoint with associated debug info. Note that safepoints are also infopoints. - */ - public static class Infopoint extends Site implements Comparable { - - public final DebugInfo debugInfo; - - public final InfopointReason reason; - - public Infopoint(int pcOffset, DebugInfo debugInfo, InfopointReason reason) { - super(pcOffset); - this.debugInfo = debugInfo; - this.reason = reason; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(pcOffset); - sb.append("[]"); - appendDebugInfo(sb, debugInfo); - return sb.toString(); - } - - @Override - public int compareTo(Infopoint o) { - if (pcOffset < o.pcOffset) { - return -1; - } else if (pcOffset > o.pcOffset) { - return 1; - } - return this.reason.compareTo(o.reason); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj != null && obj.getClass() == getClass()) { - Infopoint that = (Infopoint) obj; - if (this.pcOffset == that.pcOffset && Objects.equals(this.debugInfo, that.debugInfo) && Objects.equals(this.reason, that.reason)) { - return true; - } - } - return false; - } - } - - /** - * Represents a call in the code. - */ - public static final class Call extends Infopoint { - - /** - * The target of the call. - */ - public final InvokeTarget target; - - /** - * The size of the call instruction. - */ - public final int size; - - /** - * Specifies if this call is direct or indirect. A direct call has an immediate operand - * encoding the absolute or relative (to the call itself) address of the target. An indirect - * call has a register or memory operand specifying the target address of the call. - */ - public final boolean direct; - - public Call(InvokeTarget target, int pcOffset, int size, boolean direct, DebugInfo debugInfo) { - super(pcOffset, debugInfo, InfopointReason.CALL); - this.size = size; - this.target = target; - this.direct = direct; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof Call && super.equals(obj)) { - Call that = (Call) obj; - if (this.size == that.size && this.direct == that.direct && Objects.equals(this.target, that.target)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(pcOffset); - sb.append('['); - sb.append(target); - sb.append(']'); - - if (debugInfo != null) { - appendDebugInfo(sb, debugInfo); - } - - return sb.toString(); - } - } - - /** - * Represents some external data that is referenced by the code. - */ - public abstract static class Reference { - - @Override - public abstract int hashCode(); - - @Override - public abstract boolean equals(Object obj); - } - - public static final class ConstantReference extends Reference { - - private final VMConstant constant; - - public ConstantReference(VMConstant constant) { - this.constant = constant; - } - - public VMConstant getConstant() { - return constant; - } - - @Override - public String toString() { - return constant.toString(); - } - - @Override - public int hashCode() { - return constant.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof ConstantReference) { - ConstantReference that = (ConstantReference) obj; - return Objects.equals(this.constant, that.constant); - } - return false; - } - } - - public static final class DataSectionReference extends Reference { - - private boolean initialized; - private int offset; - - public DataSectionReference() { - // will be set after the data section layout is fixed - offset = 0xDEADDEAD; - } - - public int getOffset() { - assert initialized; - - return offset; - } - - public void setOffset(int offset) { - assert !initialized; - initialized = true; - - this.offset = offset; - } - - @Override - public int hashCode() { - return offset; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof DataSectionReference) { - DataSectionReference that = (DataSectionReference) obj; - return this.offset == that.offset; - } - return false; - } - } - - /** - * Represents a code site that references some data. The associated data can be either a - * {@link DataSectionReference reference} to the data section, or it may be an inlined - * {@link JavaConstant} that needs to be patched. - */ - public static final class DataPatch extends Site { - - public Reference reference; - - public DataPatch(int pcOffset, Reference reference) { - super(pcOffset); - this.reference = reference; - } - - @Override - public String toString() { - return String.format("%d[]", pcOffset, reference.toString()); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof DataPatch) { - DataPatch that = (DataPatch) obj; - if (this.pcOffset == that.pcOffset && Objects.equals(this.reference, that.reference)) { - return true; - } - } - return false; - } - } - - /** - * Provides extra information about instructions or data at specific positions in - * {@link CompilationResult#getTargetCode()}. This is optional information that can be used to - * enhance a disassembly of the code. - */ - public abstract static class CodeAnnotation { - - public final int position; - - public CodeAnnotation(int position) { - this.position = position; - } - - @Override - public final int hashCode() { - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - return identityHashCodeString(this); - } - - @Override - public abstract boolean equals(Object obj); - } - - /** - * A string comment about one or more instructions at a specific position in the code. - */ - public static final class CodeComment extends CodeAnnotation { - - public final String value; - - public CodeComment(int position, String comment) { - super(position); - this.value = comment; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof CodeComment) { - CodeComment that = (CodeComment) obj; - if (this.position == that.position && this.value.equals(that.value)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - return getClass().getSimpleName() + "@" + position + ": " + value; - } - } - - /** - * Describes a table of signed offsets embedded in the code. The offsets are relative to the - * starting address of the table. This type of table maybe generated when translating a - * multi-way branch based on a key value from a dense value set (e.g. the {@code tableswitch} - * JVM instruction). - * - * The table is indexed by the contiguous range of integers from {@link #low} to {@link #high} - * inclusive. - */ - public static final class JumpTable extends CodeAnnotation { - - /** - * The low value in the key range (inclusive). - */ - public final int low; - - /** - * The high value in the key range (inclusive). - */ - public final int high; - - /** - * The size (in bytes) of each table entry. - */ - public final int entrySize; - - public JumpTable(int position, int low, int high, int entrySize) { - super(position); - this.low = low; - this.high = high; - this.entrySize = entrySize; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof JumpTable) { - JumpTable that = (JumpTable) obj; - if (this.position == that.position && this.entrySize == that.entrySize && this.low == that.low && this.high == that.high) { - return true; - } - } - return false; - } - - @Override - public String toString() { - return getClass().getSimpleName() + "@" + position + ": [" + low + " .. " + high + "]"; - } - } - - /** - * Represents exception handler information for a specific code position. It includes the catch - * code position as well as the caught exception type. - */ - public static final class ExceptionHandler extends Site { - - public final int handlerPos; - - ExceptionHandler(int pcOffset, int handlerPos) { - super(pcOffset); - this.handlerPos = handlerPos; - } - - @Override - public String toString() { - return String.format("%d[]", pcOffset, handlerPos); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof ExceptionHandler) { - ExceptionHandler that = (ExceptionHandler) obj; - if (this.pcOffset == that.pcOffset && this.handlerPos == that.handlerPos) { - return true; - } - } - return false; - } - } - - /** - * Represents a mark in the machine code that can be used by the runtime for its own purposes. A - * mark can reference other marks. - */ - public static final class Mark extends Site { - - public final Object id; - - public Mark(int pcOffset, Object id) { - super(pcOffset); - this.id = id; - } - - @Override - public String toString() { - if (id == null) { - return String.format("%d[]", pcOffset); - } else if (id instanceof Integer) { - return String.format("%d[]", pcOffset, Integer.toHexString((Integer) id)); - } else { - return String.format("%d[]", pcOffset, id.toString()); - } - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof Mark) { - Mark that = (Mark) obj; - if (this.pcOffset == that.pcOffset && Objects.equals(this.id, that.id)) { - return true; - } - } - return false; - } - } - - private int id = -1; - private int entryBCI = -1; - - private final DataSection dataSection = new DataSection(); - - private final List infopoints = new ArrayList<>(); - private final List dataPatches = new ArrayList<>(); - private final List exceptionHandlers = new ArrayList<>(); - private final List marks = new ArrayList<>(); - - private int totalFrameSize = -1; - private int customStackAreaOffset = -1; - - private final String name; - - /** - * The buffer containing the emitted machine code. - */ - private byte[] targetCode; - - /** - * The leading number of bytes in {@link #targetCode} containing the emitted machine code. - */ - private int targetCodeSize; - - private ArrayList annotations; - - private Assumption[] assumptions; - - /** - * The list of the methods whose bytecodes were used as input to the compilation. If - * {@code null}, then the compilation did not record method dependencies. Otherwise, the first - * element of this array is the root method of the compilation. - */ - private ResolvedJavaMethod[] methods; - - public CompilationResult() { - this(null); - } - - public CompilationResult(String name) { - this.name = name; - } - - @Override - public int hashCode() { - // CompilationResult instances should not be used as hash map keys - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - if (methods != null) { - return getClass().getName() + "[" + methods[0].format("%H.%n(%p)%r") + "]"; - } - return identityHashCodeString(this); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj != null && obj.getClass() == getClass()) { - CompilationResult that = (CompilationResult) obj; - // @formatter:off - if (this.entryBCI == that.entryBCI && - this.id == that.id && - this.customStackAreaOffset == that.customStackAreaOffset && - this.totalFrameSize == that.totalFrameSize && - this.targetCodeSize == that.targetCodeSize && - Objects.equals(this.name, that.name) && - Objects.equals(this.annotations, that.annotations) && - Objects.equals(this.dataSection, that.dataSection) && - Objects.equals(this.exceptionHandlers, that.exceptionHandlers) && - Objects.equals(this.dataPatches, that.dataPatches) && - Objects.equals(this.infopoints, that.infopoints) && - Objects.equals(this.marks, that.marks) && - Arrays.equals(this.assumptions, that.assumptions) && - Arrays.equals(targetCode, that.targetCode)) { - return true; - } - // @formatter:on - } - return false; - } - - /** - * @return the compile id - */ - public int getId() { - return id; - } - - /** - * @param id the compile id to set - */ - public void setId(int id) { - this.id = id; - } - - /** - * @return the entryBCI - */ - public int getEntryBCI() { - return entryBCI; - } - - /** - * @param entryBCI the entryBCI to set - */ - public void setEntryBCI(int entryBCI) { - this.entryBCI = entryBCI; - } - - /** - * Sets the assumptions made during compilation. - */ - public void setAssumptions(Assumption[] assumptions) { - this.assumptions = assumptions; - } - - /** - * Gets a fixed-size {@linkplain Arrays#asList(Object...) view} of the assumptions made during - * compilation. - */ - public Collection getAssumptions() { - return assumptions == null ? Collections.emptyList() : Arrays.asList(assumptions); - } - - /** - * Sets the methods whose bytecodes were used as input to the compilation. - * - * @param rootMethod the root method of the compilation - * @param inlinedMethods the methods inlined during compilation - */ - public void setMethods(ResolvedJavaMethod rootMethod, Collection inlinedMethods) { - assert rootMethod != null; - assert inlinedMethods != null; - if (inlinedMethods.contains(rootMethod)) { - methods = inlinedMethods.toArray(new ResolvedJavaMethod[inlinedMethods.size()]); - for (int i = 0; i < methods.length; i++) { - if (methods[i].equals(rootMethod)) { - if (i != 0) { - ResolvedJavaMethod tmp = methods[0]; - methods[0] = methods[i]; - methods[i] = tmp; - } - break; - } - } - } else { - methods = new ResolvedJavaMethod[1 + inlinedMethods.size()]; - methods[0] = rootMethod; - int i = 1; - for (ResolvedJavaMethod m : inlinedMethods) { - methods[i++] = m; - } - } - } - - /** - * Gets a fixed-size {@linkplain Arrays#asList(Object...) view} of the methods whose bytecodes - * were used as input to the compilation. - * - * @return {@code null} if the compilation did not record method dependencies otherwise the - * methods whose bytecodes were used as input to the compilation with the first element - * being the root method of the compilation - */ - public Collection getMethods() { - return methods == null ? null : Arrays.asList(methods); - } - - public DataSection getDataSection() { - return dataSection; - } - - /** - * The total frame size of the method in bytes. This includes the return address pushed onto the - * stack, if any. - * - * @return the frame size - */ - public int getTotalFrameSize() { - assert totalFrameSize != -1 : "frame size not yet initialized!"; - return totalFrameSize; - } - - /** - * Sets the total frame size in bytes. This includes the return address pushed onto the stack, - * if any. - * - * @param size the size of the frame in bytes - */ - public void setTotalFrameSize(int size) { - totalFrameSize = size; - } - - /** - * Sets the machine that has been generated by the compiler. - * - * @param code the machine code generated - * @param size the size of the machine code - */ - public void setTargetCode(byte[] code, int size) { - targetCode = code; - targetCodeSize = size; - } - - /** - * Records a data patch in the code section. The data patch can refer to something in the - * {@link DataSectionReference data section} or directly to an {@link ConstantReference inlined - * constant}. - * - * @param codePos The position in the code that needs to be patched. - * @param ref The reference that should be inserted in the code. - */ - public void recordDataPatch(int codePos, Reference ref) { - assert codePos >= 0 && ref != null; - dataPatches.add(new DataPatch(codePos, ref)); - } - - /** - * Records a call in the code array. - * - * @param codePos the position of the call in the code array - * @param size the size of the call instruction - * @param target the being called - * @param debugInfo the debug info for the call - * @param direct specifies if this is a {@linkplain Call#direct direct} call - */ - public void recordCall(int codePos, int size, InvokeTarget target, DebugInfo debugInfo, boolean direct) { - final Call call = new Call(target, codePos, size, direct, debugInfo); - addInfopoint(call); - } - - /** - * Records an exception handler for this method. - * - * @param codePos the position in the code that is covered by the handler - * @param handlerPos the position of the handler - */ - public void recordExceptionHandler(int codePos, int handlerPos) { - assert validateExceptionHandlerAdd(codePos, handlerPos) : String.format("Duplicate exception handler for pc 0x%x handlerPos 0x%x", codePos, handlerPos); - exceptionHandlers.add(new ExceptionHandler(codePos, handlerPos)); - } - - /** - * Validate if the exception handler for codePos already exists and handlerPos is different. - * - * @param codePos - * @param handlerPos - * @return true if the validation is successful - */ - private boolean validateExceptionHandlerAdd(int codePos, int handlerPos) { - ExceptionHandler exHandler = getExceptionHandlerForCodePos(codePos); - return exHandler == null || exHandler.handlerPos == handlerPos; - } - - /** - * Returns the first ExceptionHandler which matches codePos. - * - * @param codePos position to search for - * @return first matching ExceptionHandler - */ - private ExceptionHandler getExceptionHandlerForCodePos(int codePos) { - for (ExceptionHandler h : exceptionHandlers) { - if (h.pcOffset == codePos) { - return h; - } - } - return null; - } - - /** - * Records an infopoint in the code array. - * - * @param codePos the position of the infopoint in the code array - * @param debugInfo the debug info for the infopoint - */ - public void recordInfopoint(int codePos, DebugInfo debugInfo, InfopointReason reason) { - addInfopoint(new Infopoint(codePos, debugInfo, reason)); - } - - /** - * Records a custom infopoint in the code section. - * - * Compiler implementations can use this method to record non-standard infopoints, which are not - * handled by the dedicated methods like {@link #recordCall}. - * - * @param infopoint the infopoint to record, usually a derived class from {@link Infopoint} - */ - public void addInfopoint(Infopoint infopoint) { - // The infopoints list must always be sorted - if (!infopoints.isEmpty()) { - Infopoint previousInfopoint = infopoints.get(infopoints.size() - 1); - if (previousInfopoint.pcOffset > infopoint.pcOffset) { - // This re-sorting should be very rare - Collections.sort(infopoints); - previousInfopoint = infopoints.get(infopoints.size() - 1); - } - if (previousInfopoint.pcOffset == infopoint.pcOffset) { - if (infopoint.reason.canBeOmitted()) { - return; - } - if (previousInfopoint.reason.canBeOmitted()) { - Infopoint removed = infopoints.remove(infopoints.size() - 1); - assert removed == previousInfopoint; - } else { - throw new RuntimeException("Infopoints that can not be omited should have distinct PCs"); - } - } - } - infopoints.add(infopoint); - } - - /** - * Records an instruction mark within this method. - * - * @param codePos the position in the code that is covered by the handler - * @param markId the identifier for this mark - */ - public Mark recordMark(int codePos, Object markId) { - Mark mark = new Mark(codePos, markId); - marks.add(mark); - return mark; - } - - /** - * Offset in bytes for the custom stack area (relative to sp). - * - * @return the offset in bytes - */ - public int getCustomStackAreaOffset() { - return customStackAreaOffset; - } - - /** - * @see #getCustomStackAreaOffset() - * @param offset - */ - public void setCustomStackAreaOffset(int offset) { - customStackAreaOffset = offset; - } - - /** - * @return the machine code generated for this method - */ - public byte[] getTargetCode() { - return targetCode; - } - - /** - * @return the size of the machine code generated for this method - */ - public int getTargetCodeSize() { - return targetCodeSize; - } - - /** - * @return the code annotations or {@code null} if there are none - */ - public List getAnnotations() { - if (annotations == null) { - return Collections.emptyList(); - } - return annotations; - } - - public void addAnnotation(CodeAnnotation annotation) { - assert annotation != null; - if (annotations == null) { - annotations = new ArrayList<>(); - } - annotations.add(annotation); - } - - private static void appendDebugInfo(StringBuilder sb, DebugInfo info) { - if (info != null) { - ReferenceMap refMap = info.getReferenceMap(); - if (refMap != null) { - RefMapFormatter formatter = new CodeUtil.NumberedRefMapFormatter(); - if (refMap.hasFrameRefMap()) { - sb.append(" stackMap["); - refMap.appendFrameMap(sb, formatter); - sb.append(']'); - } - if (refMap.hasRegisterRefMap()) { - sb.append(" registerMap["); - refMap.appendRegisterMap(sb, formatter); - sb.append(']'); - } - } - RegisterSaveLayout calleeSaveInfo = info.getCalleeSaveInfo(); - if (calleeSaveInfo != null) { - sb.append(" callee-save-info["); - String sep = ""; - for (Map.Entry e : calleeSaveInfo.registersToSlots(true).entrySet()) { - sb.append(sep).append(e.getKey()).append("->").append(e.getValue()); - sep = ", "; - } - sb.append(']'); - } - BytecodePosition codePos = info.getBytecodePosition(); - if (codePos != null) { - MetaUtil.appendLocation(sb.append(" "), codePos.getMethod(), codePos.getBCI()); - if (info.hasFrame()) { - sb.append(" #locals=").append(info.frame().numLocals).append(" #expr=").append(info.frame().numStack); - if (info.frame().numLocks > 0) { - sb.append(" #locks=").append(info.frame().numLocks); - } - } - } - } - } - - /** - * @return the list of infopoints, sorted by {@link Site#pcOffset} - */ - public List getInfopoints() { - if (infopoints.isEmpty()) { - return emptyList(); - } - return unmodifiableList(infopoints); - } - - /** - * @return the list of data references - */ - public List getDataPatches() { - if (dataPatches.isEmpty()) { - return emptyList(); - } - return unmodifiableList(dataPatches); - } - - /** - * @return the list of exception handlers - */ - public List getExceptionHandlers() { - if (exceptionHandlers.isEmpty()) { - return emptyList(); - } - return unmodifiableList(exceptionHandlers); - } - - /** - * @return the list of marks - */ - public List getMarks() { - if (marks.isEmpty()) { - return emptyList(); - } - return unmodifiableList(marks); - } - - public String getName() { - return name; - } - - public void reset() { - infopoints.clear(); - dataPatches.clear(); - exceptionHandlers.clear(); - marks.clear(); - if (annotations != null) { - annotations.clear(); - } - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DataSection.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DataSection.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,278 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.api.code; - -import static com.oracle.graal.api.meta.MetaUtil.*; - -import java.nio.*; -import java.util.*; -import java.util.function.*; - -import com.oracle.graal.api.code.CompilationResult.DataPatch; -import com.oracle.graal.api.code.CompilationResult.DataSectionReference; -import com.oracle.graal.api.code.DataSection.Data; -import com.oracle.graal.api.meta.*; - -public final class DataSection implements Iterable { - - @FunctionalInterface - public interface DataBuilder { - - void emit(ByteBuffer buffer, Consumer patch); - - static DataBuilder raw(byte[] data) { - return (buffer, patch) -> buffer.put(data); - } - - static DataBuilder serializable(SerializableConstant c) { - return (buffer, patch) -> c.serialize(buffer); - } - - static DataBuilder zero(int size) { - switch (size) { - case 1: - return (buffer, patch) -> buffer.put((byte) 0); - case 2: - return (buffer, patch) -> buffer.putShort((short) 0); - case 4: - return (buffer, patch) -> buffer.putInt(0); - case 8: - return (buffer, patch) -> buffer.putLong(0L); - default: - return (buffer, patch) -> { - int rest = size; - while (rest > 8) { - buffer.putLong(0L); - rest -= 8; - } - while (rest > 0) { - buffer.put((byte) 0); - rest--; - } - }; - } - } - } - - public static final class Data { - - private int alignment; - private final int size; - private final DataBuilder builder; - - private DataSectionReference ref; - - public Data(int alignment, int size, DataBuilder builder) { - this.alignment = alignment; - this.size = size; - this.builder = builder; - - // initialized in DataSection.insertData(Data) - ref = null; - } - - public void updateAlignment(int newAlignment) { - if (newAlignment == alignment) { - return; - } - alignment = lcm(alignment, newAlignment); - } - - public int getAlignment() { - return alignment; - } - - public int getSize() { - return size; - } - - public DataBuilder getBuilder() { - return builder; - } - - @Override - public int hashCode() { - // Data instances should not be used as hash map keys - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - return identityHashCodeString(this); - } - - @Override - public boolean equals(Object obj) { - assert ref != null; - if (obj == this) { - return true; - } - if (obj instanceof Data) { - Data that = (Data) obj; - if (this.alignment == that.alignment && this.size == that.size && this.ref.equals(that.ref)) { - return true; - } - } - return false; - } - } - - private final ArrayList dataItems = new ArrayList<>(); - - private boolean finalLayout; - private int sectionAlignment; - private int sectionSize; - - @Override - public int hashCode() { - // DataSection instances should not be used as hash map keys - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public String toString() { - return identityHashCodeString(this); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof DataSection) { - DataSection that = (DataSection) obj; - if (this.finalLayout == that.finalLayout && this.sectionAlignment == that.sectionAlignment && this.sectionSize == that.sectionSize && Objects.equals(this.dataItems, that.dataItems)) { - return true; - } - } - return false; - } - - /** - * Insert a {@link Data} item into the data section. If the item is already in the data section, - * the same {@link DataSectionReference} is returned. - * - * @param data the {@link Data} item to be inserted - * @return a unique {@link DataSectionReference} identifying the {@link Data} item - */ - public DataSectionReference insertData(Data data) { - assert !finalLayout; - if (data.ref == null) { - data.ref = new DataSectionReference(); - dataItems.add(data); - } - return data.ref; - } - - /** - * Compute the layout of the data section. This can be called only once, and after it has been - * called, the data section can no longer be modified. - */ - public void finalizeLayout() { - assert !finalLayout; - finalLayout = true; - - // simple heuristic: put items with larger alignment requirement first - dataItems.sort((a, b) -> a.alignment - b.alignment); - - int position = 0; - for (Data d : dataItems) { - sectionAlignment = lcm(sectionAlignment, d.alignment); - position = align(position, d.alignment); - - d.ref.setOffset(position); - position += d.size; - } - - sectionSize = position; - } - - /** - * Get the size of the data section. Can only be called after {@link #finalizeLayout}. - */ - public int getSectionSize() { - assert finalLayout; - return sectionSize; - } - - /** - * Get the minimum alignment requirement of the data section. Can only be called after - * {@link #finalizeLayout}. - */ - public int getSectionAlignment() { - assert finalLayout; - return sectionAlignment; - } - - /** - * Build the data section. Can only be called after {@link #finalizeLayout}. - * - * @param buffer The {@link ByteBuffer} where the data section should be built. The buffer must - * hold at least {@link #getSectionSize()} bytes. - * @param patch A {@link Consumer} to receive {@link DataPatch data patches} for relocations in - * the data section. - */ - public void buildDataSection(ByteBuffer buffer, Consumer patch) { - assert finalLayout; - for (Data d : dataItems) { - buffer.position(d.ref.getOffset()); - d.builder.emit(buffer, patch); - } - } - - public Data findData(DataSectionReference ref) { - for (Data d : dataItems) { - if (d.ref == ref) { - return d; - } - } - return null; - } - - public Iterator iterator() { - return dataItems.iterator(); - } - - private static int lcm(int x, int y) { - if (x == 0) { - return y; - } else if (y == 0) { - return x; - } - - int a = Math.max(x, y); - int b = Math.min(x, y); - while (b > 0) { - int tmp = a % b; - a = b; - b = tmp; - } - - int gcd = a; - return x * y / gcd; - } - - private static int align(int position, int alignment) { - return ((position + alignment - 1) / alignment) * alignment; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DebugInfo.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DebugInfo.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2009, 2011, 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 com.oracle.graal.api.code; - -import java.util.*; - -import com.oracle.graal.api.meta.*; - -/** - * Represents the debugging information for a particular point of execution. This information - * includes: - *
    - *
  • a {@linkplain #getBytecodePosition() bytecode position}
  • - *
  • a reference map for registers and stack slots in the current frame
  • - *
  • a map from bytecode locals and operand stack slots to their values or locations from which - * their values can be read
  • - *
  • a map from the registers (in the caller's frame) to the slots where they are saved in the - * current frame
  • - *
- */ -public final class DebugInfo { - - private final BytecodePosition bytecodePosition; - private final ReferenceMap referenceMap; - @SuppressWarnings("unused") private final Value[] virtualObjectMapping; - private RegisterSaveLayout calleeSaveInfo; - - /** - * Creates a new {@link DebugInfo} from the given values. - * - * @param codePos the {@linkplain BytecodePosition code position} or {@linkplain BytecodeFrame - * frame} info - * @param referenceMap the reference map - * @param virtualObjectMapping the mapping of {@link VirtualObject}s to their real values - */ - public DebugInfo(BytecodePosition codePos, ReferenceMap referenceMap, Value[] virtualObjectMapping) { - this.bytecodePosition = codePos; - this.referenceMap = referenceMap; - this.virtualObjectMapping = virtualObjectMapping; - } - - public DebugInfo(BytecodePosition codePos) { - this(codePos, null, null); - } - - /** - * @return {@code true} if this debug information has a frame - */ - public boolean hasFrame() { - return getBytecodePosition() instanceof BytecodeFrame; - } - - /** - * Gets the deoptimization information for each inlined frame (if available). - * - * @return {@code null} if no frame de-opt info is {@linkplain #hasFrame() available} - */ - public BytecodeFrame frame() { - if (hasFrame()) { - return (BytecodeFrame) getBytecodePosition(); - } - return null; - } - - @Override - public String toString() { - return CodeUtil.append(new StringBuilder(100), this, null).toString(); - } - - /** - * @return The code position (including all inlined methods) of this debug info. If this is a - * {@link BytecodeFrame} instance, then it is also the deoptimization information for - * each inlined frame. - */ - public BytecodePosition getBytecodePosition() { - return bytecodePosition; - } - - public ReferenceMap getReferenceMap() { - return referenceMap; - } - - /** - * Sets the map from the registers (in the caller's frame) to the slots where they are saved in - * the current frame. - */ - public void setCalleeSaveInfo(RegisterSaveLayout calleeSaveInfo) { - this.calleeSaveInfo = calleeSaveInfo; - } - - /** - * Gets the map from the registers (in the caller's frame) to the slots where they are saved in - * the current frame. If no such information is available, {@code null} is returned. - */ - public RegisterSaveLayout getCalleeSaveInfo() { - return calleeSaveInfo; - } - - @Override - public int hashCode() { - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof DebugInfo) { - DebugInfo that = (DebugInfo) obj; - if (Objects.equals(this.bytecodePosition, that.bytecodePosition) && Objects.equals(this.calleeSaveInfo, that.calleeSaveInfo) && Objects.equals(this.referenceMap, that.referenceMap)) { - return true; - } - } - return false; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DisassemblerProvider.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DisassemblerProvider.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2013, 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 com.oracle.graal.api.code; - -/** - * Interface providing capability for disassembling machine code. - */ -public interface DisassemblerProvider { - - /** - * Gets a textual disassembly of some given installed code. - * - * @return a non-zero length string containing a disassembly of {@code code} or null if - * {@code code} is {@link InstalledCode#isValid() invalid} or it could not be - * disassembled for some other reason - */ - String disassemble(InstalledCode code); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ForeignCallLinkage.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ForeignCallLinkage.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2009, 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 com.oracle.graal.api.code; - -import com.oracle.graal.api.meta.*; - -/** - * The runtime specific details of a {@linkplain ForeignCallDescriptor foreign} call. - */ -public interface ForeignCallLinkage extends InvokeTarget { - - /** - * Gets the details of where parameters are passed and value(s) are returned from the caller's - * perspective. - */ - CallingConvention getOutgoingCallingConvention(); - - /** - * Gets the details of where parameters are passed and value(s) are returned from the callee's - * perspective. - */ - CallingConvention getIncomingCallingConvention(); - - /** - * Returns the maximum absolute offset of PC relative call to this stub from any position in the - * code cache or -1 when not applicable. Intended for determining the required size of - * address/offset fields. - */ - long getMaxCallTargetOffset(); - - ForeignCallDescriptor getDescriptor(); - - /** - * Gets the values used/killed by this foreign call. - */ - Value[] getTemporaries(); - - /** - * Determines if the foreign call target destroys all registers. - * - * @return {@code true} if the register allocator must save all live registers around a call to - * this target - */ - boolean destroysRegisters(); - - /** - * Determines if this is call to a function that does not deoptimize, and therefore also does - * not lock, GC or throw exceptions. That is, the thread's execution state during the call is - * never inspected by another thread. - */ - boolean canDeoptimize(); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ForeignCallsProvider.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ForeignCallsProvider.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2013, 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 com.oracle.graal.api.code; - -import com.oracle.graal.api.meta.*; - -/** - * Details about a set of supported {@link ForeignCallDescriptor foreign calls}. - */ -public interface ForeignCallsProvider { - - /** - * Determines if a given foreign call is side-effect free. Deoptimization cannot return - * execution to a point before a foreign call that has a side effect. - */ - boolean isReexecutable(ForeignCallDescriptor descriptor); - - /** - * Gets the set of memory locations killed by a given foreign call. Returning the special value - * {@link LocationIdentity#any()} denotes that the call kills all memory locations. Returning - * any empty array denotes that the call does not kill any memory locations. - */ - LocationIdentity[] getKilledLocations(ForeignCallDescriptor descriptor); - - /** - * Determines if deoptimization can occur during a given foreign call. - */ - boolean canDeoptimize(ForeignCallDescriptor descriptor); - - /** - * Gets the linkage for a foreign call. - */ - ForeignCallLinkage lookupForeignCall(ForeignCallDescriptor descriptor); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InfopointReason.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InfopointReason.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2013, 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 com.oracle.graal.api.code; - -/** - * A reason for infopoint insertion. - */ -public enum InfopointReason { - UNKNOWN(false), - SAFEPOINT(false), - CALL(false), - IMPLICIT_EXCEPTION(false), - METHOD_START(true), - METHOD_END(true), - LINE_NUMBER(true); - - private InfopointReason(boolean canBeOmitted) { - this.canBeOmitted = canBeOmitted; - } - - private final boolean canBeOmitted; - - public boolean canBeOmitted() { - return canBeOmitted; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InstalledCode.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InstalledCode.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2011, 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 com.oracle.graal.api.code; - -/** - * Represents a compiled instance of a method. It may have been invalidated or removed in the - * meantime. - */ -public class InstalledCode { - - /** - * Raw address of this code blob. - */ - private long address; - - /** - * Counts how often the address field was reassigned. - */ - private long version; - - protected final String name; - - public InstalledCode(String name) { - this.name = name; - } - - public final void setAddress(long address) { - this.address = address; - version++; - } - - /** - * @return the address of this code blob - */ - public final long getAddress() { - return address; - } - - /** - * @return the address of this code blob - */ - public final long getVersion() { - return version; - } - - /** - * Returns the name of this code blob. - */ - public String getName() { - return name; - } - - /** - * Returns the start address of this installed code if it is {@linkplain #isValid() valid}, 0 - * otherwise. - */ - public long getStart() { - return 0; - } - - /** - * Returns the number of instruction bytes for this code. - */ - public long getCodeSize() { - return 0; - } - - /** - * Returns a copy of this installed code if it is {@linkplain #isValid() valid}, null otherwise. - */ - public byte[] getCode() { - return null; - } - - /** - * @return true if the code represented by this object is still valid, false otherwise (may - * happen due to deopt, etc.) - */ - public boolean isValid() { - return address != 0; - } - - /** - * Invalidates this installed code such that any subsequent invocation will throw an - * {@link InvalidInstalledCodeException}. - */ - public void invalidate() { - throw new UnsupportedOperationException(); - } - - /** - * Executes the installed code with a variable number of arguments. - * - * @param args the array of object arguments - * @return the value returned by the executed code - */ - @SuppressWarnings("unused") - public Object executeVarargs(Object... args) throws InvalidInstalledCodeException { - throw new UnsupportedOperationException(); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InvalidInstalledCodeException.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/InvalidInstalledCodeException.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2013, 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 com.oracle.graal.api.code; - -/** - * Exception thrown by the runtime in case an invalidated machine code is called. - */ -public final class InvalidInstalledCodeException extends Exception { - - private static final long serialVersionUID = -3540232440794244844L; -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/MemoryBarriers.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/MemoryBarriers.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2011, 2011, 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 com.oracle.graal.api.code; - -/** - * Constants and intrinsic definition for memory barriers. - * - * The documentation for each constant is taken from Doug Lea's The JSR-133 Cookbook for Compiler - * Writers. - *

- * The {@code JMM_*} constants capture the memory barriers necessary to implement the Java Memory - * Model with respect to volatile field accesses. Their values are explained by this comment from - * templateTable_i486.cpp in the HotSpot source code: - * - *

- * Volatile variables demand their effects be made known to all CPU's in
- * order.  Store buffers on most chips allow reads & writes to reorder; the
- * JMM's ReadAfterWrite.java test fails in -Xint mode without some kind of
- * memory barrier (i.e., it's not sufficient that the interpreter does not
- * reorder volatile references, the hardware also must not reorder them).
- *
- * According to the new Java Memory Model (JMM):
- * (1) All volatiles are serialized wrt to each other.
- * ALSO reads & writes act as acquire & release, so:
- * (2) A read cannot let unrelated NON-volatile memory refs that happen after
- * the read float up to before the read.  It's OK for non-volatile memory refs
- * that happen before the volatile read to float down below it.
- * (3) Similarly, a volatile write cannot let unrelated NON-volatile memory refs
- * that happen BEFORE the write float down to after the write.  It's OK for
- * non-volatile memory refs that happen after the volatile write to float up
- * before it.
- *
- * We only put in barriers around volatile refs (they are expensive), not
- * _between_ memory refs (which would require us to track the flavor of the
- * previous memory refs).  Requirements (2) and (3) require some barriers
- * before volatile stores and after volatile loads.  These nearly cover
- * requirement (1) but miss the volatile-store-volatile-load case.  This final
- * case is placed after volatile-stores although it could just as well go
- * before volatile-loads.
- * 
- */ -public class MemoryBarriers { - - /** - * The sequence {@code Load1; LoadLoad; Load2} ensures that {@code Load1}'s data are loaded - * before data accessed by {@code Load2} and all subsequent load instructions are loaded. In - * general, explicit {@code LoadLoad} barriers are needed on processors that perform speculative - * loads and/or out-of-order processing in which waiting load instructions can bypass waiting - * stores. On processors that guarantee to always preserve load ordering, these barriers amount - * to no-ops. - */ - public static final int LOAD_LOAD = 0x0001; - - /** - * The sequence {@code Load1; LoadStore; Store2} ensures that {@code Load1}'s data are loaded - * before all data associated with {@code Store2} and subsequent store instructions are flushed. - * {@code LoadStore} barriers are needed only on those out-of-order processors in which waiting - * store instructions can bypass loads. - */ - public static final int LOAD_STORE = 0x0002; - - /** - * The sequence {@code Store1; StoreLoad; Load2} ensures that {@code Store1}'s data are made - * visible to other processors (i.e., flushed to main memory) before data accessed by - * {@code Load2} and all subsequent load instructions are loaded. {@code StoreLoad} barriers - * protect against a subsequent load incorrectly using {@code Store1}'s data value rather than - * that from a more recent store to the same location performed by a different processor. - * Because of this, on the processors discussed below, a {@code StoreLoad} is strictly necessary - * only for separating stores from subsequent loads of the same location(s) as were stored - * before the barrier. {@code StoreLoad} barriers are needed on nearly all recent - * multiprocessors, and are usually the most expensive kind. Part of the reason they are - * expensive is that they must disable mechanisms that ordinarily bypass cache to satisfy loads - * from write-buffers. This might be implemented by letting the buffer fully flush, among other - * possible stalls. - */ - public static final int STORE_LOAD = 0x0004; - - /** - * The sequence {@code Store1; StoreStore; Store2} ensures that {@code Store1}'s data are - * visible to other processors (i.e., flushed to memory) before the data associated with - * {@code Store2} and all subsequent store instructions. In general, {@code StoreStore} barriers - * are needed on processors that do not otherwise guarantee strict ordering of flushes from - * write buffers and/or caches to other processors or main memory. - */ - public static final int STORE_STORE = 0x0008; - - public static final int JMM_PRE_VOLATILE_WRITE = LOAD_STORE | STORE_STORE; - public static final int JMM_POST_VOLATILE_WRITE = STORE_LOAD | STORE_STORE; - public static final int JMM_PRE_VOLATILE_READ = 0; - public static final int JMM_POST_VOLATILE_READ = LOAD_LOAD | LOAD_STORE; - - public static String barriersString(int barriers) { - StringBuilder sb = new StringBuilder(); - sb.append((barriers & LOAD_LOAD) != 0 ? "LOAD_LOAD " : ""); - sb.append((barriers & LOAD_STORE) != 0 ? "LOAD_STORE " : ""); - sb.append((barriers & STORE_LOAD) != 0 ? "STORE_LOAD " : ""); - sb.append((barriers & STORE_STORE) != 0 ? "STORE_STORE " : ""); - return sb.toString().trim(); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ReferenceMap.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ReferenceMap.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* - * 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 com.oracle.graal.api.code; - -import com.oracle.graal.api.code.CodeUtil.RefMapFormatter; -import com.oracle.graal.api.meta.*; - -public abstract class ReferenceMap implements Cloneable { - - public abstract void setRegister(int idx, LIRKind kind); - - public abstract void setStackSlot(int offset, LIRKind kind); - - public abstract boolean hasRegisterRefMap(); - - public abstract boolean hasFrameRefMap(); - - public abstract void appendRegisterMap(StringBuilder sb, RefMapFormatter formatterArg); - - public abstract void appendFrameMap(StringBuilder sb, RefMapFormatter formatterArg); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Register.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Register.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,241 +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 com.oracle.graal.api.code; - -import com.oracle.graal.api.meta.*; - -/** - * Represents a target machine register. - */ -public final class Register implements Comparable { - - public static final RegisterCategory SPECIAL = new RegisterCategory("SPECIAL"); - - /** - * Invalid register. - */ - public static final Register None = new Register(-1, -1, "noreg", SPECIAL); - - /** - * Frame pointer of the current method. All spill slots and outgoing stack-based arguments are - * addressed relative to this register. - */ - public static final Register Frame = new Register(-2, -2, "framereg", SPECIAL); - - public static final Register CallerFrame = new Register(-3, -3, "callerframereg", SPECIAL); - - /** - * The identifier for this register that is unique across all the registers in a - * {@link Architecture}. A valid register has {@code number > 0}. - */ - public final int number; - - /** - * The mnemonic of this register. - */ - public final String name; - - /** - * The actual encoding in a target machine instruction for this register, which may or may not - * be the same as {@link #number}. - */ - public final int encoding; - - /** - * The assembler calls this method to get the register's encoding. - */ - public int encoding() { - return encoding; - } - - /** - * A platform specific register category that describes which values can be stored in a - * register. - */ - private final RegisterCategory registerCategory; - - /** - * A platform specific register type that describes which values can be stored in a register. - */ - public static class RegisterCategory { - - private final String name; - - private final int referenceMapOffset; - private final int referenceMapShift; - - public RegisterCategory(String name) { - this(name, 0, 0); - } - - public RegisterCategory(String name, int referenceMapOffset) { - this(name, referenceMapOffset, 0); - } - - public RegisterCategory(String name, int referenceMapOffset, int referenceMapShift) { - this.name = name; - this.referenceMapOffset = referenceMapOffset; - this.referenceMapShift = referenceMapShift; - } - - @Override - public String toString() { - return name; - } - - @Override - public int hashCode() { - return 23 + name.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof RegisterCategory) { - RegisterCategory that = (RegisterCategory) obj; - return this.referenceMapOffset == that.referenceMapOffset && this.referenceMapShift == that.referenceMapShift && this.name.equals(that.name); - } - return false; - } - } - - /** - * Creates a {@link Register} instance. - * - * @param number unique identifier for the register - * @param encoding the target machine encoding for the register - * @param name the mnemonic name for the register - * @param registerCategory the register category - */ - public Register(int number, int encoding, String name, RegisterCategory registerCategory) { - this.number = number; - this.name = name; - this.registerCategory = registerCategory; - this.encoding = encoding; - } - - public RegisterCategory getRegisterCategory() { - return registerCategory; - } - - /** - * Get the start index of this register in the {@link ReferenceMap}. - */ - public int getReferenceMapIndex() { - return (encoding << registerCategory.referenceMapShift) + registerCategory.referenceMapOffset; - } - - /** - * Gets this register as a {@linkplain RegisterValue value} with a specified kind. - * - * @param kind the specified kind - * @return the {@link RegisterValue} - */ - public RegisterValue asValue(LIRKind kind) { - return new RegisterValue(kind, this); - } - - /** - * Gets this register as a {@linkplain RegisterValue value} with no particular kind. - * - * @return a {@link RegisterValue} with {@link Kind#Illegal} kind. - */ - public RegisterValue asValue() { - return asValue(LIRKind.Illegal); - } - - /** - * Determines if this is a valid register. - * - * @return {@code true} iff this register is valid - */ - public boolean isValid() { - return number >= 0; - } - - /** - * Gets the maximum register {@linkplain #number number} in a given set of registers. - * - * @param registers the set of registers to process - * @return the maximum register number for any register in {@code registers} - */ - public static int maxRegisterNumber(Register[] registers) { - int max = Integer.MIN_VALUE; - for (Register r : registers) { - if (r.number > max) { - max = r.number; - } - } - return max; - } - - /** - * Gets the maximum register {@linkplain #encoding encoding} in a given set of registers. - * - * @param registers the set of registers to process - * @return the maximum register encoding for any register in {@code registers} - */ - public static int maxRegisterEncoding(Register[] registers) { - int max = Integer.MIN_VALUE; - for (Register r : registers) { - if (r.encoding > max) { - max = r.encoding; - } - } - return max; - } - - @Override - public String toString() { - return name; - } - - @Override - public int compareTo(Register o) { - if (number < o.number) { - return -1; - } - if (number > o.number) { - return 1; - } - return 0; - } - - @Override - public int hashCode() { - return 17 + name.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof Register) { - Register other = (Register) obj; - if (number == other.number) { - assert name.equals(other.name); - assert encoding == other.encoding; - assert registerCategory.equals(other.registerCategory); - return true; - } - } - return false; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterAttributes.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterAttributes.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2010, 2011, 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 com.oracle.graal.api.code; - -import java.util.*; - -/** - * A collection of register attributes. The specific attribute values for a register may be local to - * a compilation context. For example, a {@link RegisterConfig} in use during a compilation will - * determine which registers are callee saved. - */ -public class RegisterAttributes { - - private final boolean callerSave; - private final boolean calleeSave; - private final boolean allocatable; - - public RegisterAttributes(boolean isCallerSave, boolean isCalleeSave, boolean isAllocatable) { - this.callerSave = isCallerSave; - this.calleeSave = isCalleeSave; - this.allocatable = isAllocatable; - } - - public static final RegisterAttributes NONE = new RegisterAttributes(false, false, false); - - /** - * Creates a map from register {@linkplain Register#number numbers} to register - * {@linkplain RegisterAttributes attributes} for a given register configuration and set of - * registers. - * - * @param registerConfig a register configuration - * @param registers a set of registers - * @return an array whose length is the max register number in {@code registers} plus 1. An - * element at index i holds the attributes of the register whose number is i. - */ - public static RegisterAttributes[] createMap(RegisterConfig registerConfig, Register[] registers) { - RegisterAttributes[] map = new RegisterAttributes[registers.length]; - for (Register reg : registers) { - if (reg != null) { - CalleeSaveLayout csl = registerConfig.getCalleeSaveLayout(); - RegisterAttributes attr = new RegisterAttributes(Arrays.asList(registerConfig.getCallerSaveRegisters()).contains(reg), - csl == null ? false : Arrays.asList(csl.registers).contains(reg), Arrays.asList(registerConfig.getAllocatableRegisters()).contains(reg)); - if (map.length <= reg.number) { - map = Arrays.copyOf(map, reg.number + 1); - } - map[reg.number] = attr; - } - } - for (int i = 0; i < map.length; i++) { - if (map[i] == null) { - map[i] = NONE; - } - } - return map; - } - - /** - * @return Denotes a register that is available for use by a register allocator. - */ - public boolean isAllocatable() { - return allocatable; - } - - /** - * @return Denotes a register whose value preservation (if required) across a call is the - * responsibility of the callee. - */ - public boolean isCalleeSave() { - return calleeSave; - } - - /** - * @return Denotes a register whose value preservation (if required) across a call is the - * responsibility of the caller. - */ - public boolean isCallerSave() { - return callerSave; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterConfig.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterConfig.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2009, 2011, 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 com.oracle.graal.api.code; - -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.meta.*; - -/** - * A register configuration binds roles and {@linkplain RegisterAttributes attributes} to physical - * registers. - */ -public interface RegisterConfig { - - /** - * Gets the register to be used for returning a value of a given kind. - */ - Register getReturnRegister(Kind kind); - - /** - * Gets the maximum allowed size of the frame. - */ - default int getMaximumFrameSize() { - return Integer.MAX_VALUE; - } - - /** - * Gets the register to which {@link Register#Frame} and {@link Register#CallerFrame} are bound. - */ - Register getFrameRegister(); - - /** - * Gets the calling convention describing how arguments are passed. - * - * @param type the type of calling convention being requested - * @param returnType the return type (can be null for methods returning {@code void}) - * @param parameterTypes the types of the arguments of the call - * @param target the target platform - * @param stackOnly ignore registers - */ - CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly); - - /** - * Gets the ordered set of registers that are can be used to pass parameters according to a - * given calling convention. - * - * @param type the type of calling convention - * @param kind specifies what kind of registers is being requested - * @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); - - /** - * Gets the set of all registers that might be used by the register allocator. - * - * To get the set of registers the register allocator is allowed to use see - * {@link RegisterAllocationConfig#getAllocatableRegisters()} - */ - @SuppressWarnings("javadoc") - Register[] getAllocatableRegisters(); - - /** - * Filters a set of registers and returns only those that can be used by the register allocator - * for a value of a particular kind. - */ - Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers); - - /** - * Gets the registers whose values must be preserved by a method across any call it makes. - */ - Register[] getCallerSaveRegisters(); - - /** - * Gets the layout of the callee save area of this register configuration. - * - * @return {@code null} if there is no callee save area - */ - CalleeSaveLayout getCalleeSaveLayout(); - - /** - * Gets a map from register {@linkplain Register#number numbers} to register - * {@linkplain RegisterAttributes attributes} for this register configuration. - * - * @return an array where an element at index i holds the attributes of the register whose - * number is i - */ - RegisterAttributes[] getAttributesMap(); - - /** - * Gets the register corresponding to a runtime-defined role. - * - * @param id the identifier of a runtime-defined register role - * @return the register playing the role specified by {@code id} - */ - Register getRegisterForRole(int id); - - /** - * Determines if all {@link #getAllocatableRegisters() allocatable} registers are - * {@link #getCallerSaveRegisters() caller saved}. - */ - boolean areAllAllocatableRegistersCallerSaved(); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterSaveLayout.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterSaveLayout.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2013, 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 com.oracle.graal.api.code; - -import java.util.*; - -/** - * A map from registers to frame slots. This can be used to describe where callee saved registers - * are saved in a callee's frame. - */ -public final class RegisterSaveLayout { - - /** - * Keys. - */ - private final Register[] registers; - - /** - * Slot indexes relative to stack pointer. - */ - private final int[] slots; - - /** - * Creates a map from registers to frame slots. - * - * @param registers the keys in the map - * @param slots frame slot index for each register in {@code registers} - */ - public RegisterSaveLayout(Register[] registers, int[] slots) { - assert registers.length == slots.length; - this.registers = registers; - this.slots = slots; - assert registersToSlots(false).size() == registers.length : "non-unique registers"; - assert new HashSet<>(registersToSlots(false).values()).size() == slots.length : "non-unqiue slots"; - } - - /** - * Gets the frame slot index for a given register. - * - * @param register register to get the frame slot index for - * @return frame slot index - */ - public int registerToSlot(Register register) { - for (int i = 0; i < registers.length; i++) { - if (register.equals(registers[i])) { - return slots[i]; - } - } - throw new IllegalArgumentException(register + " not saved by this layout: " + this); - } - - /** - * Gets this layout information as a {@link Map} from registers to slots. - */ - public Map registersToSlots(boolean sorted) { - Map result; - if (sorted) { - result = new TreeMap<>(); - } else { - result = new HashMap<>(); - } - for (int i = 0; i < registers.length; i++) { - result.put(registers[i], slots[i]); - } - return result; - } - - /** - * Gets this layout information as a {@link Map} from slots to registers. - */ - public Map slotsToRegisters(boolean sorted) { - Map result; - if (sorted) { - result = new TreeMap<>(); - } else { - result = new HashMap<>(); - } - for (int i = 0; i < registers.length; i++) { - result.put(slots[i], registers[i]); - } - return result; - } - - @Override - public int hashCode() { - throw new UnsupportedOperationException(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof RegisterSaveLayout) { - RegisterSaveLayout that = (RegisterSaveLayout) obj; - if (Arrays.equals(registers, that.registers) && Arrays.equals(slots, that.slots)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - return registersToSlots(true).toString(); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterValue.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterValue.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +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 com.oracle.graal.api.code; - -import com.oracle.graal.api.meta.*; - -/** - * 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 - * {@link Register#asValue(LIRKind)} to retrieve the canonical {@link RegisterValue} instance for a - * given (register,kind) pair. - */ -public final class RegisterValue extends AllocatableValue { - - private final Register reg; - - /** - * Should only be called from {@link Register#Register} to ensure canonicalization. - */ - protected RegisterValue(LIRKind kind, Register register) { - super(kind); - this.reg = register; - } - - @Override - public String toString() { - return getRegister().name + getKindSuffix(); - } - - /** - * @return the register that contains the value - */ - public Register getRegister() { - return reg; - } - - @Override - public int hashCode() { - return 29 * super.hashCode() + reg.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof RegisterValue) { - RegisterValue other = (RegisterValue) obj; - return super.equals(obj) && reg.equals(other.reg); - } - return false; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/SourceStackTrace.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/SourceStackTrace.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2015, 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 com.oracle.graal.api.code; - -/** - * Class representing a exception with a stack trace of the currently processed position in the - * compiled Java program instead of the stack trace of the compiler. The exception of the compiler - * is saved as the cause of this exception. - */ -public abstract class SourceStackTrace extends BailoutException { - private static final long serialVersionUID = 2144811793442316776L; - - public static SourceStackTrace create(Throwable cause, String format, StackTraceElement[] elements) { - return new SourceStackTrace(cause, format) { - - private static final long serialVersionUID = 6279381376051787907L; - - @Override - public final synchronized Throwable fillInStackTrace() { - assert elements != null; - setStackTrace(elements); - return this; - } - }; - } - - private SourceStackTrace(Throwable cause, String format) { - super(cause, format); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/SpeculationLog.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/SpeculationLog.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2012, 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 com.oracle.graal.api.code; - -import java.util.*; -import java.util.concurrent.*; - -import com.oracle.graal.api.meta.*; - -/** - * Manages a list of unique deoptimization reasons. - * - */ -public abstract class SpeculationLog { - private volatile Object lastFailed; - private volatile Collection speculations; - private Set failedSpeculations; - - public synchronized void collectFailedSpeculations() { - if (lastFailed != null) { - if (failedSpeculations == null) { - failedSpeculations = new HashSet<>(2); - } - failedSpeculations.add(lastFailed); - lastFailed = null; - speculations = null; - } - } - - public boolean maySpeculate(Object reason) { - if (failedSpeculations != null && failedSpeculations.contains(reason)) { - return false; - } - return true; - } - - protected void addSpeculation(Object reason) { - assert maySpeculate(reason); - if (speculations == null) { - synchronized (this) { - if (speculations == null) { - speculations = new ConcurrentLinkedQueue<>(); - } - } - } - speculations.add(reason); - } - - public abstract JavaConstant speculate(Object reason); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/StackLockValue.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/StackLockValue.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +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 com.oracle.graal.api.code; - -import static com.oracle.graal.api.code.ValueUtil.*; - -import com.oracle.graal.api.meta.*; - -/** - * Represents lock information in the debug information. - */ -public final class StackLockValue extends AbstractValue implements JavaValue { - - private Value owner; - private StackSlotValue slot; - private final boolean eliminated; - - public StackLockValue(Value object, StackSlotValue slot, boolean eliminated) { - super(LIRKind.Illegal); - this.owner = object; - this.slot = slot; - this.eliminated = eliminated; - } - - public Value getOwner() { - return owner; - } - - public void setOwner(Value newOwner) { - this.owner = newOwner; - } - - public Value getSlot() { - return slot; - } - - public boolean isEliminated() { - return eliminated; - } - - @Override - public String toString() { - return "monitor[" + owner + (slot != null ? ", " + slot : "") + (eliminated ? ", eliminated" : "") + "]"; - } - - @Override - public int hashCode() { - final int prime = 43; - int result = super.hashCode(); - result = prime * result + (eliminated ? 1231 : 1237); - result = prime * result + owner.hashCode(); - result = prime * result + slot.hashCode(); - return result; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof StackLockValue) { - StackLockValue other = (StackLockValue) obj; - return super.equals(obj) && eliminated == other.eliminated && owner.equals(other.owner) && slot.equals(other.slot); - } - return false; - } - - public void setSlot(StackSlotValue stackSlot) { - assert slot == null || (isVirtualStackSlot(slot) && (slot.equals(stackSlot) || isStackSlot(stackSlot))) : String.format("Can not set slot for %s to %s", this, stackSlot); - slot = stackSlot; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/StackSlot.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/StackSlot.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2010, 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 com.oracle.graal.api.code; - -import com.oracle.graal.api.meta.*; - -/** - * Represents a compiler spill slot or an outgoing stack-based argument in a method's frame or an - * incoming stack-based argument in a method's {@linkplain #isInCallerFrame() caller's frame}. - */ -public final class StackSlot extends StackSlotValue { - - private final int offset; - private final boolean addFrameSize; - - /** - * Gets a {@link StackSlot} instance representing a stack slot at a given index holding a value - * of a given kind. - * - * @param kind The kind of the value stored in the stack slot. - * @param offset The offset of the stack slot (in bytes) - * @param addFrameSize Specifies if the offset is relative to the stack pointer, or the - * beginning of the frame (stack pointer + total frame size). - */ - public static StackSlot get(LIRKind kind, int offset, boolean addFrameSize) { - assert addFrameSize || offset >= 0; - return new StackSlot(kind, offset, addFrameSize); - } - - /** - * Private constructor to enforce use of {@link #get(LIRKind, int, boolean)} so that a cache can - * be used. - */ - private StackSlot(LIRKind kind, int offset, boolean addFrameSize) { - super(kind); - this.offset = offset; - this.addFrameSize = addFrameSize; - } - - /** - * Gets the offset of this stack slot, relative to the stack pointer. - * - * @return The offset of this slot (in bytes). - */ - public int getOffset(int totalFrameSize) { - assert totalFrameSize > 0 || !addFrameSize; - int result = offset + (addFrameSize ? totalFrameSize : 0); - assert result >= 0; - return result; - } - - public boolean isInCallerFrame() { - return addFrameSize && offset >= 0; - } - - public int getRawOffset() { - return offset; - } - - public boolean getRawAddFrameSize() { - return addFrameSize; - } - - @Override - public String toString() { - if (!addFrameSize) { - return "out:" + offset + getKindSuffix(); - } else if (offset >= 0) { - return "in:" + offset + getKindSuffix(); - } else { - return "stack:" + (-offset) + getKindSuffix(); - } - } - - /** - * Gets this stack slot used to pass an argument from the perspective of a caller. - */ - public StackSlot asOutArg() { - assert offset >= 0; - if (addFrameSize) { - return get(getLIRKind(), offset, false); - } - return this; - } - - /** - * Gets this stack slot used to pass an argument from the perspective of a callee. - */ - public StackSlot asInArg() { - assert offset >= 0; - if (!addFrameSize) { - return get(getLIRKind(), offset, true); - } - return this; - } - - @Override - public int hashCode() { - final int prime = 37; - int result = super.hashCode(); - result = prime * result + (addFrameSize ? 1231 : 1237); - result = prime * result + offset; - return result; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof StackSlot) { - StackSlot other = (StackSlot) obj; - return super.equals(obj) && addFrameSize == other.addFrameSize && offset == other.offset; - } - return false; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/StackSlotValue.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/StackSlotValue.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.api.code; - -import com.oracle.graal.api.meta.*; - -/** - * Common base class for {@linkplain StackSlot real} and {@linkplain VirtualStackSlot virtual} stack - * slots. - */ -public abstract class StackSlotValue extends AllocatableValue { - - public StackSlotValue(LIRKind lirKind) { - super(lirKind); - } - -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TargetDescription.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TargetDescription.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +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 com.oracle.graal.api.code; - -import static com.oracle.graal.api.meta.MetaUtil.*; - -import com.oracle.graal.api.meta.*; - -/** - * Represents the target machine for a compiler, including the CPU architecture, the size of - * pointers and references, alignment of stacks, caches, etc. - */ -public abstract class TargetDescription { - - public final Architecture arch; - - /** - * Specifies if this is a multi-processor system. - */ - public final boolean isMP; - - /** - * Specifies if this target supports encoding objects inline in the machine code. - */ - public final boolean inlineObjects; - - /** - * The machine word size on this target. - */ - public final int wordSize; - - /** - * The kind to be used for representing raw pointers and CPU registers. - */ - public final Kind wordKind; - - /** - * The stack alignment requirement of the platform. For example, from Appendix D of Intel 64 and IA-32 Architectures - * Optimization Reference Manual: - * - *
-     *     "It is important to ensure that the stack frame is aligned to a
-     *      16-byte boundary upon function entry to keep local __m128 data,
-     *      parameters, and XMM register spill locations aligned throughout
-     *      a function invocation."
-     * 
- */ - public final int stackAlignment; - - /** - * Maximum constant displacement at which a memory access can no longer be an implicit null - * check. - */ - public final int implicitNullCheckLimit; - - public TargetDescription(Architecture arch, boolean isMP, int stackAlignment, int implicitNullCheckLimit, boolean inlineObjects) { - this.arch = arch; - this.isMP = isMP; - this.wordSize = arch.getWordSize(); - this.wordKind = Kind.fromWordSize(wordSize); - this.stackAlignment = stackAlignment; - this.implicitNullCheckLimit = implicitNullCheckLimit; - this.inlineObjects = inlineObjects; - } - - @Override - public final int hashCode() { - throw new UnsupportedOperationException(); - } - - @Override - public final boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof TargetDescription) { - TargetDescription that = (TargetDescription) obj; - // @formatter:off - if (this.implicitNullCheckLimit == that.implicitNullCheckLimit && - this.inlineObjects == that.inlineObjects && - this.isMP == that.isMP && - this.stackAlignment == that.stackAlignment && - this.wordKind.equals(that.wordKind) && - this.wordSize == that.wordSize && - this.arch.equals(that.arch)) { - return true; - } - // @formatter:on - } - return false; - } - - @Override - public String toString() { - return identityHashCodeString(this); - } - - public int getSizeInBytes(PlatformKind kind) { - return arch.getSizeInBytes(kind); - } - - 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 abstract ReferenceMap createReferenceMap(boolean hasRegisters, int stackSlotCount); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TypeCheckHints.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TypeCheckHints.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* - * Copyright (c) 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 com.oracle.graal.api.code; - -import java.util.*; - -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; -import com.oracle.graal.api.meta.JavaTypeProfile.ProfiledType; - -/** - * Utility for deriving hint types for a type check instruction (e.g. checkcast or instanceof) based - * on the target type of the check and any profiling information available for the instruction. - */ -public class TypeCheckHints { - - /** - * A receiver type profiled in a type check instruction. - */ - public static class Hint { - - /** - * A type seen while profiling a type check instruction. - */ - public final ResolvedJavaType type; - - /** - * Specifies if {@link #type} is a sub-type of the checked type. - */ - public final boolean positive; - - Hint(ResolvedJavaType type, boolean positive) { - this.type = type; - this.positive = positive; - } - } - - private static final Hint[] NO_HINTS = {}; - - /** - * If non-null, then this is the only type that could pass the type check because the target of - * the type check is a final class or has been speculated to be a final class and this value is - * the only concrete subclass of the target type. - */ - public final ResolvedJavaType exact; - - /** - * The most likely types that the type check instruction will see. - */ - public final Hint[] hints; - - /** - * The profile from which this information was derived. - */ - public final JavaTypeProfile profile; - - /** - * The total probability that the type check will hit one of the types in {@link #hints}. - */ - public final double hintHitProbability; - - /** - * Derives hint information for use when generating the code for a type check instruction. - * - * @param targetType the target type of the type check - * @param profile the profiling information available for the instruction (if any) - * @param assumptions the object in which speculations are recorded. This is null if - * speculations are not supported. - * @param minHintHitProbability if the probability that the type check will hit one of the - * profiled types (up to {@code maxHints}) is below this value, then {@link #hints} - * will be null - * @param maxHints the maximum length of {@link #hints} - */ - public TypeCheckHints(ResolvedJavaType targetType, JavaTypeProfile profile, Assumptions assumptions, double minHintHitProbability, int maxHints) { - this.profile = profile; - if (targetType != null && !canHaveSubtype(targetType)) { - exact = targetType; - } else { - if (assumptions != null) { - AssumptionResult leafConcreteSubtype = targetType == null ? null : targetType.findLeafConcreteSubtype(); - if (leafConcreteSubtype != null) { - assumptions.record(leafConcreteSubtype); - exact = leafConcreteSubtype.getResult(); - } else { - exact = null; - } - } else { - exact = null; - } - } - Double[] hitProbability = {null}; - this.hints = makeHints(targetType, profile, minHintHitProbability, maxHints, hitProbability); - this.hintHitProbability = hitProbability[0]; - } - - private static Hint[] makeHints(ResolvedJavaType targetType, JavaTypeProfile profile, double minHintHitProbability, int maxHints, Double[] hitProbability) { - double hitProb = 0.0d; - Hint[] hintsBuf = NO_HINTS; - if (profile != null) { - double notRecordedTypes = profile.getNotRecordedProbability(); - ProfiledType[] ptypes = profile.getTypes(); - if (notRecordedTypes < (1D - minHintHitProbability) && ptypes != null && ptypes.length > 0) { - hintsBuf = new Hint[ptypes.length]; - int hintCount = 0; - for (ProfiledType ptype : ptypes) { - if (targetType != null) { - ResolvedJavaType hintType = ptype.getType(); - hintsBuf[hintCount++] = new Hint(hintType, targetType.isAssignableFrom(hintType)); - hitProb += ptype.getProbability(); - } - if (hintCount == maxHints) { - break; - } - } - if (hitProb >= minHintHitProbability) { - if (hintsBuf.length != hintCount || hintCount > maxHints) { - hintsBuf = Arrays.copyOf(hintsBuf, Math.min(maxHints, hintCount)); - } - } else { - hintsBuf = NO_HINTS; - hitProb = 0.0d; - } - } - } - hitProbability[0] = hitProb; - return hintsBuf; - } - - /** - * Determines if a given type can have subtypes other than itself. This analysis is purely - * static; no assumptions are made. - * - * @return true if {@code type} can have subtypes - */ - public static boolean canHaveSubtype(ResolvedJavaType type) { - return !type.getElementalType().isFinal(); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/UnsignedMath.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/UnsignedMath.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2011, 2011, 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 com.oracle.graal.api.code; - -import java.math.*; - -//JaCoCo Exclude - -/** - * Utilities for unsigned comparisons. All methods have correct, but slow, standard Java - * implementations so that they can be used with compilers not supporting the intrinsics. - */ -public class UnsignedMath { - - private static final long MASK = 0xffffffffL; - - /** - * Unsigned comparison aboveThan for two numbers. - */ - public static boolean aboveThan(int a, int b) { - return (a & MASK) > (b & MASK); - } - - /** - * Unsigned comparison aboveOrEqual for two numbers. - */ - public static boolean aboveOrEqual(int a, int b) { - return (a & MASK) >= (b & MASK); - } - - /** - * Unsigned comparison belowThan for two numbers. - */ - public static boolean belowThan(int a, int b) { - return (a & MASK) < (b & MASK); - } - - /** - * Unsigned comparison belowOrEqual for two numbers. - */ - public static boolean belowOrEqual(int a, int b) { - return (a & MASK) <= (b & MASK); - } - - /** - * Unsigned comparison aboveThan for two numbers. - */ - public static boolean aboveThan(long a, long b) { - return (a > b) ^ ((a < 0) != (b < 0)); - } - - /** - * Unsigned comparison aboveOrEqual for two numbers. - */ - public static boolean aboveOrEqual(long a, long b) { - return (a >= b) ^ ((a < 0) != (b < 0)); - } - - /** - * Unsigned comparison belowThan for two numbers. - */ - public static boolean belowThan(long a, long b) { - return (a < b) ^ ((a < 0) != (b < 0)); - } - - /** - * Unsigned comparison belowOrEqual for two numbers. - */ - public static boolean belowOrEqual(long a, long b) { - return (a <= b) ^ ((a < 0) != (b < 0)); - } - - /** - * Unsigned division for two numbers. - */ - public static int divide(int a, int b) { - return (int) ((a & MASK) / (b & MASK)); - } - - /** - * Unsigned remainder for two numbers. - */ - public static int remainder(int a, int b) { - return (int) ((a & MASK) % (b & MASK)); - } - - /** - * Unsigned division for two numbers. - */ - public static long divide(long a, long b) { - return bi(a).divide(bi(b)).longValue(); - } - - /** - * Unsigned remainder for two numbers. - */ - public static long remainder(long a, long b) { - return bi(a).remainder(bi(b)).longValue(); - } - - private static BigInteger bi(long unsigned) { - return unsigned >= 0 ? BigInteger.valueOf(unsigned) : BigInteger.valueOf(unsigned & 0x7fffffffffffffffL).setBit(63); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2012, 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 com.oracle.graal.api.code; - -import java.util.*; - -import com.oracle.graal.api.meta.*; - -/** - * Utility class for working with the {@link Value} class and its subclasses. - */ -public final class ValueUtil { - - public static boolean isIllegal(Value value) { - assert value != null; - return Value.ILLEGAL.equals(value); - } - - public static boolean isLegal(Value value) { - return !isIllegal(value); - } - - public static boolean isVirtualObject(Value value) { - assert value != null; - return value instanceof VirtualObject; - } - - public static VirtualObject asVirtualObject(Value value) { - assert value != null; - return (VirtualObject) value; - } - - public static boolean isConstant(Value 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; - } - - public static AllocatableValue asAllocatableValue(Value value) { - assert value != null; - return (AllocatableValue) value; - } - - public static boolean isStackSlot(Value value) { - assert value != null; - return value instanceof StackSlot; - } - - public static StackSlot asStackSlot(Value value) { - assert value != null; - return (StackSlot) value; - } - - public static boolean isStackSlotValue(Value value) { - assert value != null; - return value instanceof StackSlotValue; - } - - public static StackSlotValue asStackSlotValue(Value value) { - assert value != null; - return (StackSlotValue) value; - } - - public static boolean isVirtualStackSlot(Value value) { - assert value != null; - return value instanceof VirtualStackSlot; - } - - public static VirtualStackSlot asVirtualStackSlot(Value value) { - assert value != null; - return (VirtualStackSlot) value; - } - - public static boolean isRegister(Value value) { - assert value != null; - return value instanceof RegisterValue; - } - - public static Register asRegister(Value value) { - assert value != null; - return ((RegisterValue) value).getRegister(); - } - - public static Register asIntReg(Value value) { - if (value.getKind().getStackKind() != Kind.Int) { - throw new InternalError("needed Int got: " + value.getKind()); - } 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)); - } - - public static boolean sameRegister(Value v1, Value v2, Value v3) { - return sameRegister(v1, v2) && sameRegister(v1, v3); - } - - /** - * Checks if all the provided values are different physical registers. The parameters can be - * either {@link Register registers}, {@link Value values} or arrays of them. All values that - * are not {@link RegisterValue registers} are ignored. - */ - public static boolean differentRegisters(Object... values) { - List registers = collectRegisters(values, new ArrayList()); - for (int i = 1; i < registers.size(); i++) { - Register r1 = registers.get(i); - for (int j = 0; j < i; j++) { - Register r2 = registers.get(j); - if (r1.equals(r2)) { - return false; - } - } - } - return true; - } - - private static List collectRegisters(Object[] values, List registers) { - for (Object o : values) { - if (o instanceof Register) { - registers.add((Register) o); - } else if (o instanceof Value) { - if (isRegister((Value) o)) { - registers.add(asRegister((Value) o)); - } - } else if (o instanceof Object[]) { - collectRegisters((Object[]) o, registers); - } else { - throw new IllegalArgumentException("Not a Register or Value: " + o); - } - } - return registers; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/VirtualObject.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/VirtualObject.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,213 +0,0 @@ -/* - * Copyright (c) 2010, 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 com.oracle.graal.api.code; - -import java.util.*; - -import com.oracle.graal.api.meta.*; - -/** - * An instance of this class represents an object whose allocation was removed by escape analysis. - * The information stored in the {@link VirtualObject} is used during deoptimization to recreate the - * object. - */ -public final class VirtualObject extends AbstractValue implements JavaValue { - - private final ResolvedJavaType type; - private Value[] values; - private final int id; - - /** - * Creates a new {@link VirtualObject} for the given type, with the given fields. If - * {@code type} is an instance class then {@code values} provides the values for the fields - * returned by {@link ResolvedJavaType#getInstanceFields(boolean) getInstanceFields(true)}. If - * {@code type} is an array then the length of the values array determines the reallocated array - * length. - * - * @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); - } - - private VirtualObject(ResolvedJavaType type, Value[] values, int id) { - super(LIRKind.reference(Kind.Object)); - this.type = type; - this.values = values; - this.id = id; - } - - private static StringBuilder appendValue(StringBuilder buf, Value value, Set visited) { - if (value instanceof VirtualObject) { - VirtualObject vo = (VirtualObject) value; - buf.append("vobject:").append(vo.type.toJavaName(false)).append(':').append(vo.id); - if (!visited.contains(vo)) { - visited.add(vo); - buf.append('{'); - if (vo.values == null) { - buf.append(""); - } else { - if (vo.type.isArray()) { - for (int i = 0; i < vo.values.length; i++) { - if (i != 0) { - buf.append(','); - } - buf.append(i).append('='); - appendValue(buf, vo.values[i], visited); - } - } else { - ResolvedJavaField[] fields = vo.type.getInstanceFields(true); - assert fields.length == vo.values.length : vo.type + ", fields=" + Arrays.toString(fields) + ", values=" + Arrays.toString(vo.values); - for (int i = 0; i < vo.values.length; i++) { - if (i != 0) { - buf.append(','); - } - buf.append(fields[i].getName()).append('='); - appendValue(buf, vo.values[i], visited); - } - } - } - buf.append('}'); - } - } else { - buf.append(value); - } - return buf; - } - - @Override - public String toString() { - Set visited = Collections.newSetFromMap(new IdentityHashMap()); - return appendValue(new StringBuilder(), this, visited).toString(); - } - - /** - * Returns the type of the object whose allocation was removed during compilation. This can be - * either an instance of an array type. - */ - public ResolvedJavaType getType() { - return type; - } - - /** - * Returns an array containing all the values to be stored into the object when it is recreated. - */ - public Value[] getValues() { - return values; - } - - /** - * Returns the unique id that identifies the object within the debug information for one - * position in the compiled code. - */ - public int getId() { - return id; - } - - private static boolean checkValues(ResolvedJavaType type, Value[] values) { - if (values != null) { - 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(); - } else { - if ((valKind == Kind.Double || valKind == Kind.Long) && field.getKind() == Kind.Int) { - assert fields[fieldIndex].getKind() == Kind.Int; - fieldIndex++; - } else { - assert valKind == field.getKind().getStackKind() : field + ": " + valKind + " != " + field.getKind(); - } - } - } - 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) { - for (int i = 0; i < values.length; i++) { - assert values[i].getLIRKind().isReference(0) : values[i].getKind() + " != " + 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; - } - } - } - } - return true; - } - - /** - * Overwrites the current set of values with a new one. - * - * @param values an array containing all the values to be stored into the object when it is - * recreated. - */ - public void setValues(Value[] values) { - assert checkValues(type, values); - this.values = values; - } - - @Override - public int hashCode() { - return getLIRKind().hashCode() + type.hashCode(); - } - - @Override - public boolean equals(Object o) { - if (o == this) { - return true; - } - if (o instanceof VirtualObject) { - VirtualObject l = (VirtualObject) o; - if (!l.type.equals(type) || l.values.length != values.length) { - return false; - } - for (int i = 0; i < values.length; i++) { - /* - * Virtual objects can form cycles. Calling equals() could therefore lead to - * infinite recursion. - */ - if (!same(values[i], l.values[i])) { - return false; - } - } - return true; - } - return false; - } - - private static boolean same(Object o1, Object o2) { - return o1 == o2; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/VirtualStackSlot.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/VirtualStackSlot.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.api.code; - -import com.oracle.graal.api.meta.*; - -/** - * {@link VirtualStackSlot}s are stack slots that are not yet fixed to specific frame offset. They - * are replaced by real {@link StackSlot}s with a fixed position in the frame before code emission. - */ -public abstract class VirtualStackSlot extends StackSlotValue { - - private final int id; - - public VirtualStackSlot(int id, LIRKind lirKind) { - super(lirKind); - this.id = id; - } - - public int getId() { - return id; - } - - @Override - public String toString() { - return "vstack:" + id + getKindSuffix(); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + id; - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - VirtualStackSlot other = (VirtualStackSlot) obj; - if (id != other.id) { - return false; - } - return true; - } - -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2010, 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 that defines the interface between a Java application that wants to install code and the runtime. - * The runtime provides in implementation of the {@link com.oracle.graal.api.code.CodeCacheProvider} interface. - * The method {@link com.oracle.graal.api.code.CodeCacheProvider#addMethod(com.oracle.graal.api.meta.ResolvedJavaMethod, CompilationResult, SpeculationLog, InstalledCode)} - * can be used to install code for a given method. - */ -package com.oracle.graal.api.code; - diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/stack/InspectedFrame.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/stack/InspectedFrame.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +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 com.oracle.graal.api.code.stack; - -import com.oracle.graal.api.meta.*; - -public interface InspectedFrame { - - /** - * Returns the value of the local at the given index. Currently only works for object values. - * This value is a copy iff {@link #isVirtual(int)} is true. - */ - Object getLocal(int index); - - /** - * Returns whether the local at the given index is a virtual object, and therefore the object - * returned by {@link #getLocal(int)} is a copy. - */ - boolean isVirtual(int index); - - /** - * Returns true if the stack frame is a compiled stack frame and there are virtual objects - * anywhere in the current state of the compiled method. This can return true even if - * {@link #isVirtual(int)} return false for all locals. - */ - boolean hasVirtualObjects(); - - /** - * This method will materialize all virtual objects, deoptimize the stack frame and make sure - * that subsequent execution of the deoptimized frame uses the materialized values. - */ - void materializeVirtualObjects(boolean invalidateCode); - - /** - * @return the current bytecode index - */ - int getBytecodeIndex(); - - /** - * @return the current method - */ - ResolvedJavaMethod getMethod(); - - /** - * Checks if the current method is equal to the given method. This is semantically equivalent to - * {@code method.equals(getMethod())}, but can be implemented more efficiently. - */ - boolean isMethod(ResolvedJavaMethod method); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/stack/InspectedFrameVisitor.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/stack/InspectedFrameVisitor.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +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 com.oracle.graal.api.code.stack; - -/** - * Callback interface for {@link StackIntrospection#iterateFrames}. Implementations of - * {@link #visitFrame} return null to indicate that frame iteration should continue and the next - * caller frame should be visited; and return any non-null value to indicate that frame iteration - * should stop. - */ -public interface InspectedFrameVisitor { - - T visitFrame(InspectedFrame frame); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/stack/StackIntrospection.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/stack/StackIntrospection.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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 com.oracle.graal.api.code.stack; - -import com.oracle.graal.api.meta.*; - -public interface StackIntrospection { - - /** - * Accesses the current stack, providing {@link InspectedFrame}s to the visitor that can be used - * to inspect the stack frames' contents. Iteration continues as long as - * {@link InspectedFrameVisitor#visitFrame}, which is invoked for every {@link InspectedFrame}, - * returns null. Any non-null result of the visitor indicates that frame iteration should stop. - * - * @param initialMethods if this is non-{@code null}, then the stack trace will start at these - * methods - * @param matchingMethods if this is non-{@code null}, then only matching stack frames are - * returned - * @param initialSkip the number of matching methods to skip (including the initial method) - * @param visitor the visitor that is called for every matching method - * @return the last result returned by the visitor (which is non-null to indicate that iteration - * should stop), or null if the whole stack was iterated. - */ - T iterateFrames(ResolvedJavaMethod[] initialMethods, ResolvedJavaMethod[] matchingMethods, int initialSkip, InspectedFrameVisitor visitor); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.directives.test/src/com/oracle/graal/api/directives/test/ControlFlowAnchorDirectiveTest.java --- a/graal/com.oracle.graal.api.directives.test/src/com/oracle/graal/api/directives/test/ControlFlowAnchorDirectiveTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.api.directives.test/src/com/oracle/graal/api/directives/test/ControlFlowAnchorDirectiveTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.api.directives.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.lang.annotation.*; import java.util.*; import org.junit.*; import com.oracle.graal.api.directives.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.directives.test/src/com/oracle/graal/api/directives/test/DeoptimizeDirectiveTest.java --- a/graal/com.oracle.graal.api.directives.test/src/com/oracle/graal/api/directives/test/DeoptimizeDirectiveTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.api.directives.test/src/com/oracle/graal/api/directives/test/DeoptimizeDirectiveTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.api.directives.test; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.api.directives.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; public class DeoptimizeDirectiveTest extends GraalCompilerTest { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/overview.html --- a/graal/com.oracle.graal.api.meta/overview.html Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ - - - - - - - - -The com.oracle.graal.api.meta project provides an API to the runtime data structures -for various Java elements. Unlike standard Java reflection, it can model elements that are not yet loaded. -It can also expose profiling information collected by the runtime system. - - - diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractJavaProfile.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractJavaProfile.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2013, 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 com.oracle.graal.api.meta; - -/** - * This object holds probability information for a set of items that were profiled at a specific - * BCI. The precision of the supplied values may vary, but a runtime that provides this information - * should be aware that it will be used to guide performance-critical decisions like speculative - * inlining, etc. - * - * @param a subclass of AbstractProfiledItem - * @param the class of the items that are profiled at the specific BCI and for which - * probabilities are stored. E.g., a ResolvedJavaType or a ResolvedJavaMethod. - */ -public abstract class AbstractJavaProfile, U> { - - private final double notRecordedProbability; - private final T[] pitems; - - public AbstractJavaProfile(double notRecordedProbability, T[] pitems) { - this.pitems = pitems; - assert !Double.isNaN(notRecordedProbability); - this.notRecordedProbability = notRecordedProbability; - assert isSorted(); - assert totalProbablility() >= 0 && totalProbablility() <= 1.0001 : totalProbablility() + " " + this; - } - - private double totalProbablility() { - double total = notRecordedProbability; - for (T item : pitems) { - total += item.probability; - } - return total; - } - - /** - * Determines if an array of profiled items are sorted in descending order of their - * probabilities. - */ - private boolean isSorted() { - for (int i = 1; i < pitems.length; i++) { - if (pitems[i - 1].getProbability() < pitems[i].getProbability()) { - return false; - } - } - return true; - } - - /** - * Returns the estimated probability of all types that could not be recorded due to profiling - * limitations. - * - * @return double value ≥ 0.0 and ≤ 1.0 - */ - public double getNotRecordedProbability() { - return notRecordedProbability; - } - - protected T[] getItems() { - return pitems; - } - - /** - * Searches for an entry of a given resolved Java type. - * - * @param type the type for which an entry should be searched - * @return the entry or null if no entry for this type can be found - */ - public T findEntry(ResolvedJavaType type) { - if (pitems != null) { - for (T pt : pitems) { - if (pt.getItem().equals(type)) { - return pt; - } - } - } - return null; - } - - @Override - public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append(this.getClass().getName()); - builder.append("["); - if (pitems != null) { - for (T pt : pitems) { - builder.append(pt.toString()); - builder.append(", "); - } - } - builder.append(this.notRecordedProbability); - builder.append("]"); - return builder.toString(); - } - - public boolean isIncluded(U item) { - if (this.getNotRecordedProbability() > 0.0) { - return true; - } else { - for (int i = 0; i < getItems().length; i++) { - T pitem = getItems()[i]; - U curType = pitem.getItem(); - if (curType == item) { - return true; - } - } - } - return false; - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (!(obj instanceof AbstractJavaProfile)) { - return false; - } - AbstractJavaProfile that = (AbstractJavaProfile) obj; - if (that.notRecordedProbability != notRecordedProbability) { - return false; - } - if (that.pitems.length != pitems.length) { - return false; - } - for (int i = 0; i < pitems.length; ++i) { - if (!pitems[i].equals(that.pitems[i])) { - return false; - } - } - return true; - } - - @Override - public int hashCode() { - return (int) Double.doubleToLongBits(notRecordedProbability) + pitems.length * 13; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractProfiledItem.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractProfiledItem.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2013, 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 com.oracle.graal.api.meta; - -/** - * A profiled type that has a probability. Profiled types are naturally sorted in descending order - * of their probabilities. - */ -public abstract class AbstractProfiledItem implements Comparable> { - - protected final T item; - protected final double probability; - - public AbstractProfiledItem(T item, double probability) { - assert item != null; - assert probability >= 0.0D && probability <= 1.0D; - this.item = item; - this.probability = probability; - } - - protected T getItem() { - return item; - } - - /** - * Returns the estimated probability of {@link #getItem()}. - * - * @return double value ≥ 0.0 and ≤ 1.0 - */ - public double getProbability() { - return probability; - } - - @Override - public int compareTo(AbstractProfiledItem o) { - if (getProbability() > o.getProbability()) { - return -1; - } else if (getProbability() < o.getProbability()) { - return 1; - } - return 0; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - long temp; - temp = Double.doubleToLongBits(probability); - result = prime * result + (int) (temp ^ (temp >>> 32)); - result = prime * result + item.hashCode(); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - AbstractProfiledItem other = (AbstractProfiledItem) obj; - if (Double.doubleToLongBits(probability) != Double.doubleToLongBits(other.probability)) { - return false; - } - return item.equals(other.item); - } - - @Override - public abstract String toString(); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractValue.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractValue.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +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 com.oracle.graal.api.meta; - -/** - * Abstract base class for values. - */ -public abstract class AbstractValue implements Value, KindProvider { - - 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. - */ - @ExcludeFromIdentityComparisonVerification - public final boolean identityEquals(AbstractValue other) { - return this == other; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AllocatableValue.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AllocatableValue.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2013, 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 com.oracle.graal.api.meta; - -/** - * 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, KindProvider { - - public static final AllocatableValue[] NONE = {}; - - public AllocatableValue(LIRKind lirKind) { - super(lirKind); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Assumptions.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Assumptions.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,380 +0,0 @@ -/* - * Copyright (c) 2011, 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 com.oracle.graal.api.meta; - -import java.lang.invoke.*; -import java.util.*; - -/** - * Class for recording assumptions made during compilation. - */ -public final class Assumptions implements Iterable { - - /** - * Abstract base class for assumptions. An assumption assumes a property of the runtime that may - * be invalidated by subsequent execution (e.g., that a class has no subclasses implementing - * {@link NoFinalizableSubclass Object.finalize()}). - */ - public abstract static class Assumption { - } - - /** - * A class for providing information that is only valid in association with a set of - * {@link Assumption}s. - * - * @param - */ - public static class AssumptionResult { - Assumption[] assumptions; - final T result; - - private static final Assumption[] EMPTY = new Assumption[0]; - - public AssumptionResult(T result, Assumption... assumptions) { - this.result = result; - this.assumptions = assumptions; - } - - public AssumptionResult(T result) { - this(result, EMPTY); - } - - public T getResult() { - return result; - } - - public boolean isAssumptionFree() { - return assumptions.length == 0; - } - - public void add(AssumptionResult other) { - Assumption[] newAssumptions = Arrays.copyOf(this.assumptions, this.assumptions.length + other.assumptions.length); - System.arraycopy(other.assumptions, 0, newAssumptions, this.assumptions.length, other.assumptions.length); - this.assumptions = newAssumptions; - } - } - - /** - * An assumption that a given class has no subclasses implementing {@link Object#finalize()}). - */ - public static final class NoFinalizableSubclass extends Assumption { - - private ResolvedJavaType receiverType; - - public NoFinalizableSubclass(ResolvedJavaType receiverType) { - this.receiverType = receiverType; - } - - @Override - public int hashCode() { - return 31 + receiverType.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof NoFinalizableSubclass) { - NoFinalizableSubclass other = (NoFinalizableSubclass) obj; - return other.receiverType.equals(receiverType); - } - return false; - } - - @Override - public String toString() { - return "NoFinalizableSubclass[receiverType=" + receiverType.toJavaName() + "]"; - } - - } - - /** - * An assumption that a given abstract or interface type has one direct concrete subtype. There - * is no requirement that the subtype is a leaf type. - */ - public static final class ConcreteSubtype extends Assumption { - - /** - * Type the assumption is made about. - */ - public final ResolvedJavaType context; - - /** - * Assumed concrete sub-type of the context type. - */ - public final ResolvedJavaType subtype; - - public ConcreteSubtype(ResolvedJavaType context, ResolvedJavaType subtype) { - this.context = context; - this.subtype = subtype; - assert context.isAbstract(); - assert subtype.isConcrete() || context.isInterface() : subtype.toString() + " : " + context.toString(); - assert !subtype.isArray() || subtype.getElementalType().isFinal() : subtype.toString() + " : " + context.toString(); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + context.hashCode(); - result = prime * result + subtype.hashCode(); - return result; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof ConcreteSubtype) { - ConcreteSubtype other = (ConcreteSubtype) obj; - return other.context.equals(context) && other.subtype.equals(subtype); - } - return false; - } - - @Override - public String toString() { - return "ConcreteSubtype[context=" + context.toJavaName() + ", subtype=" + subtype.toJavaName() + "]"; - } - } - - /** - * An assumption that a given type has no subtypes. - */ - public static final class LeafType extends Assumption { - - /** - * Type the assumption is made about. - */ - public final ResolvedJavaType context; - - public LeafType(ResolvedJavaType context) { - this.context = context; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + context.hashCode(); - return result; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof LeafType) { - LeafType other = (LeafType) obj; - return other.context.equals(context); - } - return false; - } - - @Override - public String toString() { - return "LeafSubtype[context=" + context.toJavaName() + "]"; - } - } - - /** - * An assumption that a given virtual method has a given unique implementation. - */ - public static final class ConcreteMethod extends Assumption { - - /** - * A virtual (or interface) method whose unique implementation for the receiver type in - * {@link #context} is {@link #impl}. - */ - public final ResolvedJavaMethod method; - - /** - * A receiver type. - */ - public final ResolvedJavaType context; - - /** - * The unique implementation of {@link #method} for {@link #context}. - */ - public final ResolvedJavaMethod impl; - - public ConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl) { - this.method = method; - this.context = context; - this.impl = impl; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + method.hashCode(); - result = prime * result + context.hashCode(); - result = prime * result + impl.hashCode(); - return result; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof ConcreteMethod) { - ConcreteMethod other = (ConcreteMethod) obj; - return other.method.equals(method) && other.context.equals(context) && other.impl.equals(impl); - } - return false; - } - - @Override - public String toString() { - return "ConcreteMethod[method=" + method.format("%H.%n(%p)%r") + ", context=" + context.toJavaName() + ", impl=" + impl.format("%H.%n(%p)%r") + "]"; - } - } - - /** - * An assumption that a given call site's method handle did not change. - */ - public static final class CallSiteTargetValue extends Assumption { - - public final CallSite callSite; - public final MethodHandle methodHandle; - - public CallSiteTargetValue(CallSite callSite, MethodHandle methodHandle) { - this.callSite = callSite; - this.methodHandle = methodHandle; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + callSite.hashCode(); - result = prime * result + methodHandle.hashCode(); - return result; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof CallSiteTargetValue) { - CallSiteTargetValue other = (CallSiteTargetValue) obj; - return callSite.equals(other.callSite) && methodHandle.equals(other.methodHandle); - } - return false; - } - - @Override - public String toString() { - return "CallSiteTargetValue[callSite=" + callSite + ", methodHandle=" + methodHandle + "]"; - } - } - - private final Set assumptions = new HashSet<>(); - - /** - * Returns whether any assumptions have been registered. - * - * @return {@code true} if at least one assumption has been registered, {@code false} otherwise. - */ - public boolean isEmpty() { - return assumptions.isEmpty(); - } - - @Override - public int hashCode() { - throw new UnsupportedOperationException("hashCode"); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj instanceof Assumptions) { - Assumptions that = (Assumptions) obj; - if (!this.assumptions.equals(that.assumptions)) { - return false; - } - return true; - } - return false; - } - - @Override - public Iterator iterator() { - return assumptions.iterator(); - } - - /** - * Records an assumption that the specified type has no finalizable subclasses. - * - * @param receiverType the type that is assumed to have no finalizable subclasses - */ - public void recordNoFinalizableSubclassAssumption(ResolvedJavaType receiverType) { - record(new NoFinalizableSubclass(receiverType)); - } - - /** - * Records that {@code subtype} is the only concrete subtype in the class hierarchy below - * {@code context}. - * - * @param context the root of the subtree of the class hierarchy that this assumptions is about - * @param subtype the one concrete subtype - */ - public void recordConcreteSubtype(ResolvedJavaType context, ResolvedJavaType subtype) { - record(new ConcreteSubtype(context, subtype)); - } - - /** - * Records that {@code impl} is the only possible concrete target for a virtual call to - * {@code method} with a receiver of type {@code context}. - * - * @param method a method that is the target of a virtual call - * @param context the receiver type of a call to {@code method} - * @param impl the concrete method that is the only possible target for the virtual call - */ - public void recordConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl) { - record(new ConcreteMethod(method, context, impl)); - } - - public void record(AssumptionResult result) { - for (Assumption assumption : result.assumptions) { - record(assumption); - } - } - - public void record(Assumption assumption) { - assumptions.add(assumption); - } - - /** - * Gets a copy of the assumptions recorded in this object as an array. - */ - public Assumption[] toArray() { - return assumptions.toArray(new Assumption[assumptions.size()]); - } - - /** - * Copies assumptions recorded by another {@link Assumptions} object into this object. - */ - public void record(Assumptions other) { - assert other != this; - assumptions.addAll(other.assumptions); - } - - @Override - public String toString() { - return "Assumptions[" + assumptions + "]"; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/BytecodeDisassemblerProvider.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/BytecodeDisassemblerProvider.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2013, 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 com.oracle.graal.api.meta; - -/** - * Interface for disassembling bytecode. - */ -public interface BytecodeDisassemblerProvider { - - /** - * Gets a textual disassembly of the bytecode for a given method. In the absence of bytecode - * rewriting, disassembling a method will produce the same result. - * - * @return a non-zero length string containing a disassembly of {@code method}'s bytecode or - * null if {@code method} has no bytecode (i.e., {@code method.getCodeSize() == 0}) - */ - String disassemble(ResolvedJavaMethod method); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Constant.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Constant.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.api.meta; - -/** - * Represents a compile-time constant (boxed) value within the compiler. - */ -public interface Constant { - - boolean isDefaultForKind(); - - String toValueString(); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantPool.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantPool.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +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 com.oracle.graal.api.meta; - -/** - * Represents the runtime representation of the constant pool that is used by the compiler when - * parsing bytecode. Provides methods to look up a constant pool entry without performing - * resolution. They are used during compilation. - */ -public interface ConstantPool { - - /** - * Returns the number of entries the constant pool. - * - * @return number of entries in the constant pool - */ - int length(); - - /** - * Ensures that the type referenced by the specified constant pool entry is loaded and - * initialized. This can be used to compile time resolve a type. It works for field, method, or - * type constant pool entries. - * - * @param cpi the index of the constant pool entry that references the type - * @param opcode the opcode of the instruction that references the type - */ - void loadReferencedType(int cpi, int opcode); - - /** - * Looks up a reference to a field. If {@code opcode} is non-negative, then resolution checks - * specific to the bytecode it denotes are performed if the field is already resolved. Should - * any of these checks fail, an unresolved field reference is returned. - * - * @param cpi the constant pool index - * @param opcode the opcode of the instruction for which the lookup is being performed or - * {@code -1} - * @return a reference to the field at {@code cpi} in this pool - * @throws ClassFormatError if the entry at {@code cpi} is not a field - */ - JavaField lookupField(int cpi, int opcode); - - /** - * Looks up a reference to a method. If {@code opcode} is non-negative, then resolution checks - * specific to the bytecode it denotes are performed if the method is already resolved. Should - * any of these checks fail, an unresolved method reference is returned. - * - * @param cpi the constant pool index - * @param opcode the opcode of the instruction for which the lookup is being performed or - * {@code -1} - * @return a reference to the method at {@code cpi} in this pool - * @throws ClassFormatError if the entry at {@code cpi} is not a method - */ - JavaMethod lookupMethod(int cpi, int opcode); - - /** - * Looks up a reference to a type. If {@code opcode} is non-negative, then resolution checks - * specific to the bytecode it denotes are performed if the type is already resolved. Should any - * of these checks fail, an unresolved type reference is returned. - * - * @param cpi the constant pool index - * @param opcode the opcode of the instruction for which the lookup is being performed or - * {@code -1} - * @return a reference to the compiler interface type - */ - JavaType lookupType(int cpi, int opcode); - - /** - * Looks up an Utf8 string. - * - * @param cpi the constant pool index - * @return the Utf8 string at index {@code cpi} in this constant pool - */ - String lookupUtf8(int cpi); - - /** - * Looks up a method signature. - * - * @param cpi the constant pool index - * @return the method signature at index {@code cpi} in this constant pool - */ - Signature lookupSignature(int cpi); - - /** - * Looks up a constant at the specified index. - * - * @param cpi the constant pool index - * @return the {@code Constant} or {@code JavaType} instance representing the constant pool - * entry - */ - Object lookupConstant(int cpi); - - /** - * Looks up the appendix at the specified index. - * - * @param cpi the constant pool index - * @param opcode the opcode of the instruction for which the lookup is being performed or - * {@code -1} - * @return the appendix if it exists and is resolved or {@code null} - */ - JavaConstant lookupAppendix(int cpi, int opcode); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantReflectionProvider.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantReflectionProvider.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2012, 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 com.oracle.graal.api.meta; - -import java.lang.invoke.*; - -/** - * 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. - */ -public interface ConstantReflectionProvider { - - /** - * Compares two constants for equality. The equality relationship is symmetric. Returns - * {@link Boolean#TRUE true} if the two constants represent the same run time value, - * {@link Boolean#FALSE false} if they are different. Returns {@code null} if the constants - * cannot be compared at this point. - */ - Boolean constantEquals(Constant x, Constant y); - - /** - * Returns the length of the array constant. Returns {@code null} if the constant is not an - * array, or if the array length is not available at this point. - */ - Integer readArrayLength(JavaConstant array); - - /** - * Reads a value from the given array at the given index. Returns {@code null} if the constant - * is not an array, if the index is out of bounds, or if the value is not available at this - * point. - */ - JavaConstant readArrayElement(JavaConstant array, int index); - - /** - * Reads a value from the given array at the given index if it is a stable array. Returns - * {@code null} if the constant is not a stable array, if it is a default value, if the index is - * out of bounds, or if the value is not available at this point. - */ - JavaConstant readConstantArrayElement(JavaConstant array, int index); - - /** - * Reads a value from the given array at the given offset if it is a stable array. The offset - * will decoded relative to the platform addressing into an index into the array. Returns - * {@code null} if the constant is not a stable array, if it is a default value, if the offset - * is out of bounds, or if the value is not available at this point. - */ - JavaConstant readConstantArrayElementForOffset(JavaConstant array, long offset); - - /** - * Gets the constant value of this field. Note that a {@code static final} field may not be - * considered constant if its declaring class is not yet initialized or if it is a well known - * field that can be updated via other means (e.g., {@link System#setOut(java.io.PrintStream)}). - * - * @param receiver object from which this field's value is to be read. This value is ignored if - * this field is static. - * @return the constant value of this field or {@code null} if this field is not considered - * constant by the runtime - */ - JavaConstant readConstantFieldValue(JavaField field, JavaConstant receiver); - - /** - * Gets the current value of this field for a given object, if available. - * - * There is no guarantee that the same value will be returned by this method for a field unless - * the field is considered to be {@linkplain #readConstantFieldValue(JavaField, JavaConstant) - * constant} by the runtime. - * - * @param receiver object from which this field's value is to be read. This value is ignored if - * this field is static. - * @return the value of this field or {@code null} if the value is not available (e.g., because - * the field holder is not yet initialized). - */ - JavaConstant readFieldValue(JavaField field, JavaConstant receiver); - - /** - * Gets the current value of this field for a given object, if available. Like - * {@link #readFieldValue(JavaField, JavaConstant)} but treats array fields as stable. - * - * There is no guarantee that the same value will be returned by this method for a field unless - * the field is considered to be {@linkplain #readConstantFieldValue(JavaField, JavaConstant) - * constant} by the runtime. - * - * @param receiver object from which this field's value is to be read. This value is ignored if - * this field is static. - * @param isDefaultStable if {@code true}, default values are considered stable - * @return the value of this field or {@code null} if the value is not available (e.g., because - * the field holder is not yet initialized). - */ - 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. - */ - 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. - */ - JavaConstant unboxPrimitive(JavaConstant source); - - /** - * Gets a string as a {@link JavaConstant}. - */ - JavaConstant forString(String value); - - /** - * Returns the {@link ResolvedJavaType} for a {@link Class} object (or any other object regarded - * as a class by the VM) encapsulated in the given constant. Returns {@code null} if the - * constant does not encapsulate a class, or if the type is not available at this point. - */ - ResolvedJavaType asJavaType(Constant constant); - - /** - * Gets access to the internals of {@link MethodHandle}. - */ - MethodHandleAccessProvider getMethodHandleAccess(); - - /** - * Gets raw memory access. - */ - MemoryAccessProvider getMemoryAccessProvider(); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DefaultProfilingInfo.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DefaultProfilingInfo.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* - * Copyright (c) 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 com.oracle.graal.api.meta; - -/** - * An implementation of {@link ProfilingInfo} that can used in the absence of real profile - * information. - */ -public final class DefaultProfilingInfo implements ProfilingInfo { - - private static final ProfilingInfo[] NO_PROFILING_INFO = new ProfilingInfo[]{new DefaultProfilingInfo(TriState.TRUE), new DefaultProfilingInfo(TriState.FALSE), - new DefaultProfilingInfo(TriState.UNKNOWN)}; - - private final TriState exceptionSeen; - - DefaultProfilingInfo(TriState exceptionSeen) { - this.exceptionSeen = exceptionSeen; - } - - @Override - public int getCodeSize() { - return 0; - } - - @Override - public JavaTypeProfile getTypeProfile(int bci) { - return null; - } - - @Override - public JavaMethodProfile getMethodProfile(int bci) { - return null; - } - - @Override - public double getBranchTakenProbability(int bci) { - return -1; - } - - @Override - public double[] getSwitchProbabilities(int bci) { - return null; - } - - @Override - public TriState getExceptionSeen(int bci) { - return exceptionSeen; - } - - @Override - public TriState getNullSeen(int bci) { - return TriState.UNKNOWN; - } - - @Override - public int getExecutionCount(int bci) { - return -1; - } - - public static ProfilingInfo get(TriState exceptionSeen) { - return NO_PROFILING_INFO[exceptionSeen.ordinal()]; - } - - @Override - public int getDeoptimizationCount(DeoptimizationReason reason) { - return 0; - } - - @Override - public boolean isMature() { - return false; - } - - @Override - public String toString() { - return "BaseProfilingInfo<" + this.toString(null, "; ") + ">"; - } - - public void setMature() { - // Do nothing - } - - public boolean setCompilerIRSize(Class irType, int nodeCount) { - return false; - } - - public int getCompilerIRSize(Class irType) { - return -1; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DeoptimizationAction.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DeoptimizationAction.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* - * Copyright (c) 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 com.oracle.graal.api.meta; - -/** - * Specifies the action that should be taken by the runtime in case a certain deoptimization is - * triggered. - */ -public enum DeoptimizationAction { - /** - * Do not invalidate the machine code. This is typically used when deoptimizing at a point where - * it's highly likely nothing will change the likelihood of the deoptimization happening again. - * For example, a compiled array allocation where the size is negative. - */ - None(false), - - /** - * Do not invalidate the machine code, but schedule a recompilation if this deoptimization is - * triggered too often. - */ - RecompileIfTooManyDeopts(true), - - /** - * Invalidate the machine code and reset the profiling information. - */ - InvalidateReprofile(true), - - /** - * Invalidate the machine code and immediately schedule a recompilation. This is typically used - * when deoptimizing to resolve an unresolved symbol in which case extra profiling is not - * required to determine that the deoptimization will not re-occur. - */ - InvalidateRecompile(true), - - /** - * Invalidate the machine code and stop compiling the outermost method of this compilation. - */ - InvalidateStopCompiling(true); - - private final boolean invalidatesCompilation; - - private DeoptimizationAction(boolean invalidatesCompilation) { - this.invalidatesCompilation = invalidatesCompilation; - } - - public boolean doesInvalidateCompilation() { - return invalidatesCompilation; - } - -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DeoptimizationReason.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DeoptimizationReason.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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 com.oracle.graal.api.meta; - -/** - * Enumeration of reasons for why a deoptimization is happening. - */ -public enum DeoptimizationReason { - None, - NullCheckException, - BoundsCheckException, - ClassCastException, - ArrayStoreException, - UnreachedCode, - TypeCheckedInliningViolated, - OptimizedTypeCheckViolated, - NotCompiledExceptionHandler, - Unresolved, - JavaSubroutineMismatch, - ArithmeticException, - RuntimeConstraint, - LoopLimitCheck, - Aliasing, - TransferToInterpreter, -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ExceptionHandler.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ExceptionHandler.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2009, 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 com.oracle.graal.api.meta; - -import java.util.*; - -/** - * Represents an exception handler within the bytecodes. - */ -public final class ExceptionHandler { - - private final int startBCI; - private final int endBCI; - private final int handlerBCI; - private final int catchTypeCPI; - private final JavaType catchType; - - /** - * Creates a new exception handler with the specified ranges. - * - * @param startBCI the start index of the protected range - * @param endBCI the end index of the protected range - * @param catchBCI the index of the handler - * @param catchTypeCPI the index of the throwable class in the constant pool - * @param catchType the type caught by this exception handler - */ - public ExceptionHandler(int startBCI, int endBCI, int catchBCI, int catchTypeCPI, JavaType catchType) { - this.startBCI = startBCI; - this.endBCI = endBCI; - this.handlerBCI = catchBCI; - this.catchTypeCPI = catchTypeCPI; - this.catchType = catchType; - } - - /** - * Returns the start bytecode index of the protected range of this handler. - */ - public int getStartBCI() { - return startBCI; - } - - /** - * Returns the end bytecode index of the protected range of this handler. - */ - public int getEndBCI() { - return endBCI; - } - - /** - * Returns the bytecode index of the handler block of this handler. - */ - public int getHandlerBCI() { - return handlerBCI; - } - - /** - * Returns the index into the constant pool representing the type of exception caught by this - * handler. - */ - public int catchTypeCPI() { - return catchTypeCPI; - } - - /** - * Checks whether this handler catches all exceptions. - * - * @return {@code true} if this handler catches all exceptions - */ - public boolean isCatchAll() { - return catchTypeCPI == 0; - } - - /** - * Returns the type of exception caught by this exception handler. - */ - public JavaType getCatchType() { - return catchType; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof ExceptionHandler)) { - return false; - } - ExceptionHandler that = (ExceptionHandler) obj; - if (this.startBCI != that.startBCI || this.endBCI != that.endBCI || this.handlerBCI != that.handlerBCI || this.catchTypeCPI != that.catchTypeCPI) { - return false; - } - return Objects.equals(this.catchType, that.catchType); - } - - @Override - public String toString() { - return "ExceptionHandler"; - } - - @Override - public int hashCode() { - return catchTypeCPI ^ endBCI ^ handlerBCI; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ExcludeFromIdentityComparisonVerification.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ExcludeFromIdentityComparisonVerification.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.api.meta; - -import java.lang.annotation.*; - -/** - * This annotation denotes methods which are allowed to use identity checks (==/!=) on restricted - * types. - * - * @see CheckGraalInvariants - */ -@SuppressWarnings("javadoc") -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.METHOD) -public @interface ExcludeFromIdentityComparisonVerification { - -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ForeignCallDescriptor.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ForeignCallDescriptor.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2009, 2013, 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 com.oracle.graal.api.meta; - -import java.util.*; - -/** - * The name and signature of a foreign call. A foreign call differs from a normal compiled Java call - * in at least one of these aspects: - *
    - *
  • The call is to C/C++/assembler code.
  • - *
  • The call uses different conventions for passing parameters or returning values.
  • - *
  • The callee has different register saving semantics. For example, the callee may save all - * registers (apart from some specified temporaries) in which case the register allocator doesn't - * not need to spill all live registers around the call site.
  • - *
  • The call does not occur at an INVOKE* bytecode. Such a call could be transformed into a - * standard Java call if the foreign routine is a normal Java method and the runtime supports - * linking Java calls at arbitrary bytecodes.
  • - *
- */ -public class ForeignCallDescriptor { - - private final String name; - private final Class resultType; - private final Class[] argumentTypes; - - public ForeignCallDescriptor(String name, Class resultType, Class... argumentTypes) { - this.name = name; - this.resultType = resultType; - this.argumentTypes = argumentTypes; - } - - /** - * Gets the name of this foreign call. - */ - public String getName() { - return name; - } - - /** - * Gets the return type of this foreign call. - */ - public Class getResultType() { - return resultType; - } - - /** - * Gets the argument types of this foreign call. - */ - public Class[] getArgumentTypes() { - return argumentTypes.clone(); - } - - @Override - public int hashCode() { - return name.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof ForeignCallDescriptor) { - ForeignCallDescriptor other = (ForeignCallDescriptor) obj; - return other.name.equals(name) && other.resultType.equals(resultType) && Arrays.equals(other.argumentTypes, argumentTypes); - } - return false; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(name).append('('); - String sep = ""; - for (Class arg : argumentTypes) { - sb.append(sep).append(arg.getSimpleName()); - sep = ","; - } - return sb.append(')').append(resultType.getSimpleName()).toString(); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/InvokeTarget.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/InvokeTarget.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2013, 2013, 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 com.oracle.graal.api.meta; - -/** - * Represents the resolved target of an invocation. - */ -public interface InvokeTarget { -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaConstant.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaConstant.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,458 +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 com.oracle.graal.api.meta; - -/** - * Represents a constant (boxed) value, such as an integer, floating point number, or object - * reference, within the compiler and across the compiler/runtime interface. Exports a set of - * {@code JavaConstant} instances that represent frequently used constant values, such as - * {@link #NULL_POINTER}. - */ -public interface JavaConstant extends Constant, JavaValue, Value { - - /* - * 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); - - /** - * Checks whether this constant is null. - * - * @return {@code true} if this constant is the null constant - */ - boolean isNull(); - - static boolean isNull(Constant c) { - if (c instanceof JavaConstant) { - return ((JavaConstant) c).isNull(); - } else { - return false; - } - } - - /** - * Checks whether this constant is non-null. - * - * @return {@code true} if this constant is a primitive, or an object constant that is not null - */ - default boolean isNonNull() { - return !isNull(); - } - - /** - * Checks whether this constant is the default value for its kind (null, 0, 0.0, false). - * - * @return {@code true} if this constant is the default value for its kind - */ - boolean isDefaultForKind(); - - /** - * Returns the value of this constant as a boxed Java value. - * - * @return the value of this constant - */ - Object asBoxedPrimitive(); - - /** - * Returns the primitive int value this constant represents. The constant must have a - * {@link Kind#getStackKind()} of {@link Kind#Int}. - * - * @return the constant value - */ - int asInt(); - - /** - * Returns the primitive boolean value this constant represents. The constant must have kind - * {@link Kind#Boolean}. - * - * @return the constant value - */ - boolean asBoolean(); - - /** - * Returns the primitive long value this constant represents. The constant must have kind - * {@link Kind#Long}, a {@link Kind#getStackKind()} of {@link Kind#Int}. - * - * @return the constant value - */ - long asLong(); - - /** - * Returns the primitive float value this constant represents. The constant must have kind - * {@link Kind#Float}. - * - * @return the constant value - */ - float asFloat(); - - /** - * Returns the primitive double value this constant represents. The constant must have kind - * {@link Kind#Double}. - * - * @return the constant value - */ - double asDouble(); - - default String toValueString() { - if (getKind() == Kind.Illegal) { - return "illegal"; - } else { - return getKind().format(asBoxedPrimitive()); - } - } - - static String toString(JavaConstant constant) { - if (constant.getKind() == Kind.Illegal) { - return "illegal"; - } else { - return constant.getKind().getJavaName() + "[" + constant.toValueString() + "]"; - } - } - - /** - * Creates a boxed double constant. - * - * @param d the double value to box - * @return a boxed copy of {@code value} - */ - static PrimitiveConstant forDouble(double d) { - if (Double.compare(0.0D, d) == 0) { - return DOUBLE_0; - } - if (Double.compare(d, 1.0D) == 0) { - return DOUBLE_1; - } - return new PrimitiveConstant(Kind.Double, Double.doubleToRawLongBits(d)); - } - - /** - * Creates a boxed float constant. - * - * @param f the float value to box - * @return a boxed copy of {@code value} - */ - static PrimitiveConstant forFloat(float f) { - if (Float.compare(f, 0.0F) == 0) { - return FLOAT_0; - } - if (Float.compare(f, 1.0F) == 0) { - return FLOAT_1; - } - return new PrimitiveConstant(Kind.Float, Float.floatToRawIntBits(f)); - } - - /** - * Creates a boxed long constant. - * - * @param i the long value to box - * @return a boxed copy of {@code value} - */ - static PrimitiveConstant forLong(long i) { - if (i == 0) { - return LONG_0; - } else if (i == 1) { - return LONG_1; - } else { - return new PrimitiveConstant(Kind.Long, i); - } - } - - /** - * Creates a boxed integer constant. - * - * @param i the integer value to box - * @return a boxed copy of {@code value} - */ - static PrimitiveConstant forInt(int i) { - switch (i) { - case -1: - return INT_MINUS_1; - case 0: - return INT_0; - case 1: - return INT_1; - case 2: - return INT_2; - default: - return new PrimitiveConstant(Kind.Int, i); - } - } - - /** - * Creates a boxed byte constant. - * - * @param i the byte value to box - * @return a boxed copy of {@code value} - */ - static PrimitiveConstant forByte(byte i) { - return new PrimitiveConstant(Kind.Byte, i); - } - - /** - * Creates a boxed boolean constant. - * - * @param i the boolean value to box - * @return a boxed copy of {@code value} - */ - static PrimitiveConstant forBoolean(boolean i) { - return i ? TRUE : FALSE; - } - - /** - * Creates a boxed char constant. - * - * @param i the char value to box - * @return a boxed copy of {@code value} - */ - static PrimitiveConstant forChar(char i) { - return new PrimitiveConstant(Kind.Char, i); - } - - /** - * Creates a boxed short constant. - * - * @param i the short value to box - * @return a boxed copy of {@code value} - */ - static PrimitiveConstant forShort(short i) { - return new PrimitiveConstant(Kind.Short, i); - } - - /** - * Creates a {@link JavaConstant} from a primitive integer of a certain kind. - */ - static PrimitiveConstant forIntegerKind(Kind kind, long i) { - switch (kind) { - case Boolean: - return forBoolean(i != 0); - case Byte: - return forByte((byte) i); - case Short: - return forShort((short) i); - case Char: - return forChar((char) i); - case Int: - return forInt((int) i); - case Long: - return forLong(i); - default: - throw new IllegalArgumentException("not an integer kind: " + kind); - } - } - - /** - * Creates a {@link JavaConstant} from a primitive integer of a certain width. - */ - static PrimitiveConstant forPrimitiveInt(int bits, long i) { - assert bits <= 64; - switch (bits) { - case 1: - return forBoolean(i != 0); - case 8: - return forByte((byte) i); - case 16: - return forShort((short) i); - case 32: - return forInt((int) i); - case 64: - return forLong(i); - default: - throw new IllegalArgumentException("unsupported integer width: " + bits); - } - } - - /** - * Creates a boxed constant for the given boxed primitive value. - * - * @param value the Java boxed value - * @return the primitive constant holding the {@code value} - */ - static PrimitiveConstant forBoxedPrimitive(Object value) { - if (value instanceof Boolean) { - return forBoolean((Boolean) value); - } else if (value instanceof Byte) { - return forByte((Byte) value); - } else if (value instanceof Character) { - return forChar((Character) value); - } else if (value instanceof Short) { - return forShort((Short) value); - } else if (value instanceof Integer) { - return forInt((Integer) value); - } else if (value instanceof Long) { - return forLong((Long) value); - } else if (value instanceof Float) { - return forFloat((Float) value); - } else if (value instanceof Double) { - return forDouble((Double) value); - } else { - return null; - } - } - - static PrimitiveConstant forIllegal() { - return new PrimitiveConstant(Kind.Illegal, 0); - } - - /** - * Returns a constant with the default value for the given kind. - */ - static JavaConstant defaultForKind(Kind kind) { - switch (kind) { - case Boolean: - return FALSE; - case Byte: - return forByte((byte) 0); - case Char: - return forChar((char) 0); - case Short: - return forShort((short) 0); - case Int: - return INT_0; - case Double: - return DOUBLE_0; - case Float: - return FLOAT_0; - case Long: - return LONG_0; - case Object: - return NULL_POINTER; - default: - throw new IllegalArgumentException(kind.toString()); - } - } - - /** - * Returns the zero value for a given numeric kind. - */ - static JavaConstant zero(Kind kind) { - switch (kind) { - case Boolean: - return FALSE; - case Byte: - return forByte((byte) 0); - case Char: - return forChar((char) 0); - case Double: - return DOUBLE_0; - case Float: - return FLOAT_0; - case Int: - return INT_0; - case Long: - return LONG_0; - case Short: - return forShort((short) 0); - default: - throw new IllegalArgumentException(kind.toString()); - } - } - - /** - * Returns the one value for a given numeric kind. - */ - static JavaConstant one(Kind kind) { - switch (kind) { - case Boolean: - return TRUE; - case Byte: - return forByte((byte) 1); - case Char: - return forChar((char) 1); - case Double: - return DOUBLE_1; - case Float: - return FLOAT_1; - case Int: - return INT_1; - case Long: - return LONG_1; - case Short: - return forShort((short) 1); - default: - throw new IllegalArgumentException(kind.toString()); - } - } - - /** - * Adds two numeric constants. - */ - static JavaConstant add(JavaConstant x, JavaConstant y) { - assert x.getKind() == y.getKind(); - switch (x.getKind()) { - case Byte: - return forByte((byte) (x.asInt() + y.asInt())); - case Char: - return forChar((char) (x.asInt() + y.asInt())); - case Double: - return forDouble(x.asDouble() + y.asDouble()); - case Float: - return forFloat(x.asFloat() + y.asFloat()); - case Int: - return forInt(x.asInt() + y.asInt()); - case Long: - return forLong(x.asLong() + y.asLong()); - case Short: - return forShort((short) (x.asInt() + y.asInt())); - default: - throw new IllegalArgumentException(x.getKind().toString()); - } - } - - /** - * Multiplies two numeric constants. - */ - static PrimitiveConstant mul(JavaConstant x, JavaConstant y) { - assert x.getKind() == y.getKind(); - switch (x.getKind()) { - case Byte: - return forByte((byte) (x.asInt() * y.asInt())); - case Char: - return forChar((char) (x.asInt() * y.asInt())); - case Double: - return forDouble(x.asDouble() * y.asDouble()); - case Float: - return forFloat(x.asFloat() * y.asFloat()); - case Int: - return forInt(x.asInt() * y.asInt()); - case Long: - return forLong(x.asLong() * y.asLong()); - case Short: - return forShort((short) (x.asInt() * y.asInt())); - default: - throw new IllegalArgumentException(x.getKind().toString()); - } - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaField.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaField.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2009, 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 com.oracle.graal.api.meta; - -import java.util.*; - -/** - * Represents a reference to a Java field, either resolved or unresolved fields. Fields, like - * methods and types, are resolved through {@link ConstantPool constant pools}. - */ -public interface JavaField extends TrustedInterface { - - /** - * Returns the name of this field. - */ - String getName(); - - /** - * Returns a {@link JavaType} object that identifies the declared type for this field. - */ - JavaType getType(); - - /** - * Returns the kind of this field. This is the same as calling {@link #getType}. - * {@link JavaType#getKind getKind}. - */ - default Kind getKind() { - return getType().getKind(); - } - - /** - * Returns the {@link JavaType} object representing the class or interface that declares this - * field. - */ - JavaType getDeclaringClass(); - - /** - * Gets a string for this field formatted according to a given format specification. A format - * specification is composed of characters that are to be copied verbatim to the result and - * specifiers that denote an attribute of this field that is to be copied to the result. A - * specifier is a single character preceded by a '%' character. The accepted specifiers and the - * field attributes they denote are described below: - * - *
-     *     Specifier | Description                                          | Example(s)
-     *     ----------+------------------------------------------------------------------------------------------
-     *     'T'       | Qualified type                                       | "int" "java.lang.String"
-     *     't'       | Unqualified type                                     | "int" "String"
-     *     'H'       | Qualified holder                                     | "java.util.Map.Entry"
-     *     'h'       | Unqualified holder                                   | "Entry"
-     *     'n'       | Field name                                           | "age"
-     *     'f'       | Indicator if field is unresolved, static or instance | "unresolved" "static" "instance"
-     *     '%'       | A '%' character                                      | "%"
-     * 
- * - * @param format a format specification - * @return the result of formatting this field according to {@code format} - * @throws IllegalFormatException if an illegal specifier is encountered in {@code format} - */ - default String format(String format) throws IllegalFormatException { - StringBuilder sb = new StringBuilder(); - int index = 0; - JavaType type = getType(); - while (index < format.length()) { - char ch = format.charAt(index++); - if (ch == '%') { - if (index >= format.length()) { - 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)); - break; - } - case 'H': - qualified = true; - // fall through - case 'h': { - sb.append(getDeclaringClass().toJavaName(qualified)); - break; - } - case 'n': { - sb.append(getName()); - break; - } - case 'f': { - sb.append(!(this instanceof ResolvedJavaField) ? "unresolved" : ((ResolvedJavaField) this).isStatic() ? "static" : "instance"); - break; - } - case '%': { - sb.append('%'); - break; - } - default: { - throw new UnknownFormatConversionException(String.valueOf(specifier)); - } - } - } else { - sb.append(ch); - } - } - return sb.toString(); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaMethod.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaMethod.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* - * Copyright (c) 2009, 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 com.oracle.graal.api.meta; - -import java.util.*; - -/** - * Represents a reference to a Java method, either resolved or unresolved. Methods, like fields and - * types, are resolved through {@link ConstantPool constant pools}. - */ -public interface JavaMethod extends TrustedInterface { - - /** - * Returns the name of this method. - */ - String getName(); - - /** - * Returns the {@link JavaType} object representing the class or interface that declares this - * method. - */ - JavaType getDeclaringClass(); - - /** - * Returns the signature of this method. - */ - Signature getSignature(); - - /** - * Gets a string for this method formatted according to a given format specification. A format - * specification is composed of characters that are to be copied verbatim to the result and - * specifiers that denote an attribute of this method that is to be copied to the result. A - * specifier is a single character preceded by a '%' character. The accepted specifiers and the - * method attributes they denote are described below: - * - *
-     *     Specifier | Description                                          | Example(s)
-     *     ----------+------------------------------------------------------------------------------------------
-     *     'R'       | Qualified return type                                | "int" "java.lang.String"
-     *     'r'       | Unqualified return type                              | "int" "String"
-     *     'H'       | Qualified holder                                     | "java.util.Map.Entry"
-     *     'h'       | Unqualified holder                                   | "Entry"
-     *     'n'       | Method name                                          | "add"
-     *     'P'       | Qualified parameter types, separated by ', '         | "int, java.lang.String"
-     *     'p'       | Unqualified parameter types, separated by ', '       | "int, String"
-     *     'f'       | Indicator if method is unresolved, static or virtual | "unresolved" "static" "virtual"
-     *     '%'       | A '%' character                                      | "%"
-     * 
- * - * @param format a format specification - * @return the result of formatting this method according to {@code format} - * @throws IllegalFormatException if an illegal specifier is encountered in {@code format} - */ - default String format(String format) throws IllegalFormatException { - StringBuilder sb = new StringBuilder(); - int index = 0; - Signature sig = null; - while (index < format.length()) { - char ch = format.charAt(index++); - if (ch == '%') { - if (index >= format.length()) { - 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)); - break; - } - case 'H': - qualified = true; - // fall through - case 'h': { - sb.append(getDeclaringClass().toJavaName(qualified)); - break; - } - case 'n': { - sb.append(getName()); - break; - } - case 'P': - qualified = true; - // fall through - case 'p': { - if (sig == null) { - sig = getSignature(); - } - for (int i = 0; i < sig.getParameterCount(false); i++) { - if (i != 0) { - sb.append(", "); - } - sb.append(sig.getParameterType(i, null).toJavaName(qualified)); - } - break; - } - case 'f': { - sb.append(!(this instanceof ResolvedJavaMethod) ? "unresolved" : ((ResolvedJavaMethod) this).isStatic() ? "static" : "virtual"); - break; - } - case '%': { - sb.append('%'); - break; - } - default: { - throw new UnknownFormatConversionException(String.valueOf(specifier)); - } - } - } else { - sb.append(ch); - } - } - return sb.toString(); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaMethodProfile.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaMethodProfile.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2013, 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 com.oracle.graal.api.meta; - -import com.oracle.graal.api.meta.JavaMethodProfile.ProfiledMethod; - -/** - * This profile object represents the method profile at a specific BCI. The precision of the - * supplied values may vary, but a runtime that provides this information should be aware that it - * will be used to guide performance-critical decisions like speculative inlining, etc. - */ -public final class JavaMethodProfile extends AbstractJavaProfile { - - public JavaMethodProfile(double notRecordedProbability, ProfiledMethod[] pitems) { - super(notRecordedProbability, pitems); - } - - public ProfiledMethod[] getMethods() { - return super.getItems(); - } - - public static class ProfiledMethod extends AbstractProfiledItem { - - public ProfiledMethod(ResolvedJavaMethod method, double probability) { - super(method, probability); - } - - /** - * Returns the type for this profile entry. - */ - public ResolvedJavaMethod getMethod() { - return getItem(); - } - - @Override - public String toString() { - return "{" + item.getName() + ", " + probability + "}"; - } - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaType.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaType.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2009, 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 com.oracle.graal.api.meta; - -import static com.oracle.graal.api.meta.MetaUtil.*; - -/** - * Represents a resolved or unresolved type. Types include primitives, objects, {@code void}, and - * arrays thereof. - */ -public interface JavaType extends TrustedInterface { - - /** - * Returns the name of this type in internal form. The following are examples of strings - * returned by this method: - * - *
-     *     "Ljava/lang/Object;"
-     *     "I"
-     *     "[[B"
-     * 
- */ - String getName(); - - /** - * Returns an unqualified name of this type. - * - *
-     *     "Object"
-     *     "Integer"
-     * 
- */ - default String getUnqualifiedName() { - String name = getName(); - if (name.indexOf('/') != -1) { - name = name.substring(name.lastIndexOf('/') + 1); - } - if (name.endsWith(";")) { - name = name.substring(0, name.length() - 1); - } - return name; - } - - /** - * For array types, gets the type of the components, or {@code null} if this is not an array - * type. This method is analogous to {@link Class#getComponentType()}. - */ - JavaType getComponentType(); - - /** - * Gets the elemental type for this given type. The elemental type is the corresponding zero - * dimensional type of an array type. For example, the elemental type of {@code int[][][]} is - * {@code int}. A non-array type is its own elemental type. - */ - default JavaType getElementalType() { - JavaType t = this; - while (t.getComponentType() != null) { - t = t.getComponentType(); - } - return t; - } - - /** - * Gets the array class type representing an array with elements of this type. - */ - JavaType getArrayClass(); - - /** - * Gets the kind of this type. - */ - Kind getKind(); - - /** - * Resolves this type to a {@link ResolvedJavaType}. - * - * @param accessingClass the context of resolution (must not be null) - * @return the resolved Java type - * @throws LinkageError if the resolution failed - * @throws NullPointerException if {@code accessingClass} is {@code null} - */ - ResolvedJavaType resolve(ResolvedJavaType accessingClass); - - /** - * Gets the Java programming language name for this type. The following are examples of strings - * returned by this method: - * - *
-     *      java.lang.Object
-     *      int
-     *      boolean[][]
-     * 
- * - * @return the Java name corresponding to this type - */ - default String toJavaName() { - return internalNameToJava(getName(), true, false); - } - - /** - * Gets the Java programming language name for this type. The following are examples of strings - * returned by this method: - * - *
-     *     qualified == true:
-     *         java.lang.Object
-     *         int
-     *         boolean[][]
-     *     qualified == false:
-     *         Object
-     *         int
-     *         boolean[][]
-     * 
- * - * @param qualified specifies if the package prefix of this type should be included in the - * returned name - * @return the Java name corresponding to this type - */ - default String toJavaName(boolean qualified) { - Kind kind = getKind(); - if (kind == Kind.Object) { - return internalNameToJava(getName(), qualified, false); - } - return getKind().getJavaName(); - } - - /** - * Returns this type's name in the same format as {@link Class#getName()}. - */ - default String toClassName() { - return internalNameToJava(getName(), true, true); - } - -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaTypeProfile.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaTypeProfile.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +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. - */ -package com.oracle.graal.api.meta; - -import java.util.*; - -import com.oracle.graal.api.meta.JavaTypeProfile.ProfiledType; - -/** - * This profile object represents the type profile at a specific BCI. The precision of the supplied - * values may vary, but a runtime that provides this information should be aware that it will be - * used to guide performance-critical decisions like speculative inlining, etc. - */ -public final class JavaTypeProfile extends AbstractJavaProfile { - - private static final ProfiledType[] EMPTY_ARRAY = new ProfiledType[0]; - - private final TriState nullSeen; - - public JavaTypeProfile(TriState nullSeen, double notRecordedProbability, ProfiledType[] pitems) { - super(notRecordedProbability, pitems); - this.nullSeen = nullSeen; - } - - /** - * Returns whether a null value was at the type check. - */ - public TriState getNullSeen() { - return nullSeen; - } - - /** - * A list of types for which the runtime has recorded probability information. Note that this - * includes both positive and negative types where a positive type is a subtype of the checked - * type and a negative type is not. - */ - public ProfiledType[] getTypes() { - return getItems(); - } - - public JavaTypeProfile restrict(JavaTypeProfile otherProfile) { - if (otherProfile.getNotRecordedProbability() > 0.0) { - // Not useful for restricting since there is an unknown set of types occurring. - return this; - } - - if (this.getNotRecordedProbability() > 0.0) { - // We are unrestricted, so the other profile is always a better estimate. - return otherProfile; - } - - ArrayList result = new ArrayList<>(); - for (int i = 0; i < getItems().length; i++) { - ProfiledType ptype = getItems()[i]; - ResolvedJavaType type = ptype.getItem(); - if (otherProfile.isIncluded(type)) { - result.add(ptype); - } - } - - TriState newNullSeen = (otherProfile.getNullSeen() == TriState.FALSE) ? TriState.FALSE : getNullSeen(); - double newNotRecorded = getNotRecordedProbability(); - return createAdjustedProfile(result, newNullSeen, newNotRecorded); - } - - public JavaTypeProfile restrict(ResolvedJavaType declaredType, boolean nonNull) { - ArrayList result = new ArrayList<>(); - for (int i = 0; i < getItems().length; i++) { - ProfiledType ptype = getItems()[i]; - ResolvedJavaType type = ptype.getItem(); - if (declaredType.isAssignableFrom(type)) { - result.add(ptype); - } - } - - TriState newNullSeen = (nonNull) ? TriState.FALSE : getNullSeen(); - double newNotRecorded = this.getNotRecordedProbability(); - // Assume for the types not recorded, the incompatibility rate is the same. - if (getItems().length != 0) { - newNotRecorded *= ((double) result.size() / (double) getItems().length); - } - return createAdjustedProfile(result, newNullSeen, newNotRecorded); - } - - private JavaTypeProfile createAdjustedProfile(ArrayList result, TriState newNullSeen, double newNotRecorded) { - if (result.size() != this.getItems().length || newNotRecorded != getNotRecordedProbability() || newNullSeen != getNullSeen()) { - if (result.size() == 0) { - return new JavaTypeProfile(newNullSeen, 1.0, EMPTY_ARRAY); - } - double factor; - if (result.size() == this.getItems().length) { - /* List of types did not change, no need to recompute probabilities. */ - factor = 1.0; - } else { - double probabilitySum = 0.0; - for (int i = 0; i < result.size(); i++) { - probabilitySum += result.get(i).getProbability(); - } - probabilitySum += newNotRecorded; - - factor = 1.0 / probabilitySum; // Normalize to 1.0 - assert factor >= 1.0; - } - ProfiledType[] newResult = new ProfiledType[result.size()]; - for (int i = 0; i < newResult.length; ++i) { - ProfiledType curType = result.get(i); - newResult[i] = new ProfiledType(curType.getItem(), Math.min(1.0, curType.getProbability() * factor)); - } - double newNotRecordedTypeProbability = Math.min(1.0, newNotRecorded * factor); - return new JavaTypeProfile(newNullSeen, newNotRecordedTypeProbability, newResult); - } - return this; - } - - @Override - public boolean equals(Object other) { - return super.equals(other) && nullSeen.equals(((JavaTypeProfile) other).nullSeen); - } - - @Override - public int hashCode() { - return nullSeen.hashCode() + super.hashCode(); - } - - public static class ProfiledType extends AbstractProfiledItem { - - public ProfiledType(ResolvedJavaType type, double probability) { - super(type, probability); - assert type.isArray() || type.isConcrete() : type; - } - - /** - * Returns the type for this profile entry. - */ - public ResolvedJavaType getType() { - return getItem(); - } - - @Override - public String toString() { - return String.format("%.6f#%s", probability, item); - } - } - - @Override - public String toString() { - StringBuilder buf = new StringBuilder("JavaTypeProfile", getNotRecordedProbability())).toString(); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaValue.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaValue.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.api.meta; - -/** - * Interface for things that represent a Java value. - */ -public interface JavaValue { - - /** - * Returns the kind of this value. - */ - Kind getKind(); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java Tue May 26 23:45:05 2015 +0200 +++ /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 com.oracle.graal.api.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); - } - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/KindProvider.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/KindProvider.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package com.oracle.graal.api.meta; - -/** - * Interface for classes which can be associated with a Kind. - */ -public interface KindProvider { - - Kind getKind(); - -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LIRKind.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LIRKind.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,349 +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 com.oracle.graal.api.meta; - -import java.util.*; - -/** - * Represents the type of values in the LIR. It is composed of a {@link PlatformKind} that gives the - * low level representation of the value, and a {@link #referenceMask} that describes the location - * of object references in the value. - * - *

Constructing {@link LIRKind} instances

- * - * During LIR generation, every new {@link Value} should get a {@link LIRKind} of the correct - * {@link PlatformKind} that also contains the correct reference information. {@linkplain LIRKind - * LIRKinds} should be created as follows: - * - *

- * If the result value is created from one or more input values, the {@link LIRKind} should be - * created with {@link LIRKind#derive}(inputs). If the result has a different {@link PlatformKind} - * than the inputs, {@link LIRKind#derive}(inputs).{@link #changeType}(resultKind) should be used. - *

- * If the result is an exact copy of one of the inputs, {@link Value#getLIRKind()} can be used. Note - * that this is only correct for move-like operations, like conditional move or compare-and-swap. - * For convert operations, {@link LIRKind#derive} should be used. - *

- * If it is known that the result will be a reference (e.g. pointer arithmetic where the end result - * is a valid oop), {@link LIRKind#reference} should be used. - *

- * If it is known that the result will neither be a reference nor be derived from a reference, - * {@link LIRKind#value} can be used. If the operation producing this value has inputs, this is very - * likely wrong, and {@link LIRKind#derive} should be used instead. - *

- * If it is known that the result is derived from a reference, {@link LIRKind#derivedReference} can - * be used. In most cases, {@link LIRKind#derive} should be used instead, since it is able to detect - * this automatically. - */ -public final class LIRKind { - - /** - * The non-type. This uses {@link #derivedReference}, so it can never be part of an oop map. - */ - public static final LIRKind Illegal = derivedReference(Kind.Illegal); - - private final PlatformKind platformKind; - private final int referenceMask; - - private static final int DERIVED_REFERENCE = -1; - - private LIRKind(PlatformKind platformKind, int referenceMask) { - this.platformKind = platformKind; - this.referenceMask = referenceMask; - } - - /** - * Create a {@link LIRKind} of type {@code platformKind} that contains a primitive value. Should - * be only used when it's guaranteed that the value is not even indirectly derived from a - * reference. Otherwise, {@link #derive(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); - } - - /** - * Create a {@link LIRKind} of type {@code platformKind} that contains a single tracked oop - * reference. - */ - public static LIRKind reference(PlatformKind platformKind) { - int length = platformKind.getVectorLength(); - assert 0 < length && length < 32 : "vector of " + length + " references not supported"; - return new LIRKind(platformKind, (1 << length) - 1); - } - - /** - * Create a {@link LIRKind} of type {@code platformKind} that contains a value that is derived - * from a reference. Values of this {@link LIRKind} can not be live at safepoints. In most - * cases, this should not be called directly. {@link #derive} should be used instead to - * automatically propagate this information. - */ - public static LIRKind derivedReference(PlatformKind platformKind) { - return new LIRKind(platformKind, DERIVED_REFERENCE); - } - - /** - * Derive a new type from inputs. The result will have the {@link PlatformKind} of one of the - * inputs. If all inputs are values, the result is a value. Otherwise, the result is a derived - * reference. - * - * This method should be used to construct the result {@link LIRKind} of any operation that - * modifies values (e.g. arithmetics). - */ - public static LIRKind derive(Value... inputs) { - assert inputs.length > 0; - for (Value input : inputs) { - LIRKind kind = input.getLIRKind(); - if (kind.isDerivedReference()) { - return kind; - } else if (!kind.isValue()) { - return kind.makeDerivedReference(); - } - } - - // all inputs are values, just return one of them - return inputs[0].getLIRKind(); - } - - /** - * Merge the types of the inputs. The result will have the {@link PlatformKind} of one of the - * inputs. If all inputs are values (references), the result is a value (reference). Otherwise, - * the result is a derived reference. - * - * This method should be used to construct the result {@link LIRKind} of merge operation that do - * not modify values (e.g. phis). - */ - public static LIRKind merge(Value... inputs) { - assert inputs.length > 0; - ArrayList kinds = new ArrayList<>(inputs.length); - for (int i = 0; i < inputs.length; i++) { - kinds.add(inputs[i].getLIRKind()); - } - return merge(kinds); - } - - /** - * @see #merge(Value...) - */ - public static LIRKind merge(Iterable kinds) { - LIRKind mergeKind = null; - - for (LIRKind kind : kinds) { - - assert mergeKind == null || verifyMoveKinds(mergeKind, kind) : String.format("Input kinds do not match %s vs. %s", mergeKind, kind); - - if (kind.isDerivedReference()) { - /** - * Kind is a derived reference therefore the result can only be also a derived - * reference. - */ - return kind; - } - if (mergeKind == null) { - mergeKind = kind; - continue; - } - - if (kind.isValue()) { - /* Kind is a value. */ - if (mergeKind.referenceMask != 0) { - /* - * Inputs consists of values and references. Make the result a derived - * reference. - */ - return mergeKind.makeDerivedReference(); - } - /* Check that other inputs are also values. */ - } else { - /* Kind is a reference. */ - if (mergeKind.referenceMask != kind.referenceMask) { - /* - * Reference maps do not match so the result can only be a derived reference. - */ - return mergeKind.makeDerivedReference(); - } - } - - } - assert mergeKind != null; - - // all inputs are values or references, just return one of them - return mergeKind; - } - - /** - * Create a new {@link LIRKind} with the same reference information and a new - * {@linkplain #getPlatformKind platform kind}. If the new kind is a longer vector than this, - * the new elements are marked as untracked values. - */ - public LIRKind changeType(PlatformKind newPlatformKind) { - if (newPlatformKind == platformKind) { - return this; - } else if (isDerivedReference()) { - return derivedReference(newPlatformKind); - } else if (referenceMask == 0) { - // value type - return new LIRKind(newPlatformKind, 0); - } else { - // reference type - int newLength = Math.min(32, newPlatformKind.getVectorLength()); - int newReferenceMask = referenceMask & (0xFFFFFFFF >>> (32 - newLength)); - assert newReferenceMask != DERIVED_REFERENCE; - return new LIRKind(newPlatformKind, newReferenceMask); - } - } - - /** - * Create a new {@link LIRKind} with a new {@linkplain #getPlatformKind platform kind}. If the - * new kind is longer than this, the reference positions are repeated to fill the vector. - */ - public LIRKind repeat(PlatformKind newPlatformKind) { - if (isDerivedReference()) { - return derivedReference(newPlatformKind); - } else if (referenceMask == 0) { - // value type - return new LIRKind(newPlatformKind, 0); - } else { - // reference type - int oldLength = platformKind.getVectorLength(); - int newLength = newPlatformKind.getVectorLength(); - assert oldLength <= newLength && newLength < 32 && (newLength % oldLength) == 0; - - // repeat reference mask to fill new kind - int newReferenceMask = 0; - for (int i = 0; i < newLength; i += platformKind.getVectorLength()) { - newReferenceMask |= referenceMask << i; - } - - assert newReferenceMask != DERIVED_REFERENCE; - return new LIRKind(newPlatformKind, newReferenceMask); - } - } - - /** - * Create a new {@link LIRKind} with the same type, but marked as containing a derivedReference. - */ - public LIRKind makeDerivedReference() { - return new LIRKind(platformKind, DERIVED_REFERENCE); - } - - /** - * Get the low level type that is used in code generation. - */ - public PlatformKind getPlatformKind() { - return platformKind; - } - - /** - * Check whether this value is derived from a reference. If this returns {@code true}, this - * value must not be live at safepoints. - */ - public boolean isDerivedReference() { - return referenceMask == DERIVED_REFERENCE; - } - - /** - * Check whether the {@code idx}th part of this value is a reference that must be tracked at - * safepoints. - * - * @param idx The index into the vector if this is a vector kind. Must be 0 if this is a scalar - * kind. - */ - public boolean isReference(int idx) { - assert 0 <= idx && idx < platformKind.getVectorLength() : "invalid index " + idx + " in " + this; - return !isDerivedReference() && (referenceMask & 1 << idx) != 0; - } - - /** - * Check whether this kind is a value type that doesn't need to be tracked at safepoints. - */ - public boolean isValue() { - return referenceMask == 0; - } - - @Override - public String toString() { - if (isValue()) { - return platformKind.name(); - } else if (isDerivedReference()) { - return platformKind.name() + "[*]"; - } else { - StringBuilder ret = new StringBuilder(); - ret.append(platformKind.name()); - ret.append('['); - for (int i = 0; i < platformKind.getVectorLength(); i++) { - if (isReference(i)) { - ret.append('.'); - } else { - ret.append(' '); - } - } - ret.append(']'); - return ret.toString(); - } - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((platformKind == null) ? 0 : platformKind.hashCode()); - result = prime * result + referenceMask; - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!(obj instanceof LIRKind)) { - return false; - } - - LIRKind other = (LIRKind) obj; - return platformKind == other.platformKind && referenceMask == other.referenceMask; - } - - public static boolean verifyMoveKinds(LIRKind dst, LIRKind src) { - if (src.equals(dst)) { - return true; - } - /* - * TODO(je,rs) What we actually want is toStackKind(src.getPlatformKind()).equals( - * dst.getPlatformKind()) but due to the handling of sub-integer at the current point - * (phi-)moves from e.g. integer to short can happen. Therefore we compare stack kinds. - */ - if (toStackKind(src.getPlatformKind()).equals(toStackKind(dst.getPlatformKind()))) { - return !src.isDerivedReference() || dst.isDerivedReference(); - } - return false; - } - - private static PlatformKind toStackKind(PlatformKind platformKind) { - if (platformKind instanceof Kind) { - return ((Kind) platformKind).getStackKind(); - } - return platformKind; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LineNumberTable.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LineNumberTable.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2011, 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 com.oracle.graal.api.meta; - -public interface LineNumberTable { - - int[] getLineNumberEntries(); - - int[] getBciEntries(); - - int getLineNumber(int bci); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LineNumberTableImpl.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LineNumberTableImpl.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2011, 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 com.oracle.graal.api.meta; - -public class LineNumberTableImpl implements LineNumberTable { - - private final int[] lineNumbers; - private final int[] bci; - - public LineNumberTableImpl(int[] lineNumbers, int[] bci) { - this.lineNumbers = lineNumbers; - this.bci = bci; - } - - @Override - public int[] getLineNumberEntries() { - return lineNumbers; - } - - @Override - public int[] getBciEntries() { - return bci; - } - - @Override - public int getLineNumber(@SuppressWarnings("hiding") int bci) { - for (int i = 0; i < this.bci.length - 1; i++) { - if (this.bci[i] <= bci && bci < this.bci[i + 1]) { - return lineNumbers[i]; - } - } - return lineNumbers[lineNumbers.length - 1]; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Local.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Local.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2011, 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 com.oracle.graal.api.meta; - -public interface Local { - - int getStartBCI(); - - int getEndBCI(); - - int getSlot(); - - String getName(); - - JavaType getType(); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocalImpl.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocalImpl.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2011, 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 com.oracle.graal.api.meta; - -public class LocalImpl implements Local { - - private final String name; - private final int startBci; - private final int endBci; - private final int slot; - private final JavaType type; - - public LocalImpl(String name, JavaType type, int startBci, int endBci, int slot) { - this.name = name; - this.startBci = startBci; - this.endBci = endBci; - this.slot = slot; - this.type = type; - } - - @Override - public int getStartBCI() { - return startBci; - } - - @Override - public int getEndBCI() { - return endBci; - } - - @Override - public String getName() { - return name; - } - - @Override - public JavaType getType() { - return type; - } - - @Override - public int getSlot() { - return slot; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof LocalImpl)) { - return false; - } - LocalImpl that = (LocalImpl) obj; - return this.name.equals(that.name) && this.startBci == that.startBci && this.endBci == that.endBci && this.slot == that.slot && this.type.equals(that.type); - } - - @Override - public int hashCode() { - return super.hashCode(); - } - - @Override - public String toString() { - return "LocalImpl"; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocalVariableTable.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocalVariableTable.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2011, 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 com.oracle.graal.api.meta; - -public interface LocalVariableTable { - - Local[] getLocals(); - - Local[] getLocalsAt(int bci); - - Local getLocal(int slot, int bci); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocalVariableTableImpl.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocalVariableTableImpl.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2011, 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 com.oracle.graal.api.meta; - -import java.util.*; - -public class LocalVariableTableImpl implements LocalVariableTable { - - private final Local[] locals; - - public LocalVariableTableImpl(Local[] locals) { - this.locals = locals; - } - - @Override - public Local getLocal(int slot, int bci) { - Local result = null; - for (Local local : locals) { - if (local.getSlot() == slot && local.getStartBCI() <= bci && local.getEndBCI() >= bci) { - if (result == null) { - result = local; - } else { - throw new IllegalStateException("Locals overlap!"); - } - } - } - return result; - } - - @Override - public Local[] getLocals() { - return locals; - } - - @Override - public Local[] getLocalsAt(int bci) { - List result = new ArrayList<>(); - for (Local l : locals) { - if (l.getStartBCI() <= bci && bci <= l.getEndBCI()) { - result.add(l); - } - } - return result.toArray(new Local[result.size()]); - } - -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +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. - */ -package com.oracle.graal.api.meta; - -import java.util.*; - -// JaCoCo Exclude - -/** - * Marker interface for location identities. Apart from the special values {@link #ANY_LOCATION} and - * {@link #FINAL_LOCATION}, a different location identity of two memory accesses guarantees that the - * two accesses do not interfere. - * - * Clients of {@link LocationIdentity} must use {@link #equals(Object)}, not {@code ==}, when - * comparing two {@link LocationIdentity} values for equality. Likewise, they must not use - * {@link IdentityHashMap}s with {@link LocationIdentity} values as keys. - */ -public abstract class LocationIdentity { - - /** - * Denotes any location. A write to such a location kills all values in a memory map during an - * analysis of memory accesses. A read from this location cannot be moved or coalesced with - * other reads because its interaction with other reads is not known. - */ - private static final LocationIdentity ANY_LOCATION = NamedLocationIdentity.mutable("ANY_LOCATION"); - - /** - * Denotes the location of a value that is guaranteed to be unchanging. - */ - public static final LocationIdentity FINAL_LOCATION = NamedLocationIdentity.immutable("FINAL_LOCATION"); - - /** - * Denotes the location of the length field of a Java array. - */ - public static final LocationIdentity ARRAY_LENGTH_LOCATION = NamedLocationIdentity.immutable("[].length"); - - public static LocationIdentity any() { - return ANY_LOCATION; - } - - /** - * Denotes a location is unchanging in all cases. Not that this is different than the Java - * notion of final which only requires definite assignment. - */ - public abstract boolean isImmutable(); - - public final boolean isMutable() { - return !isImmutable(); - } - - public final boolean isAny() { - return this == ANY_LOCATION; - } - - public final boolean isSingle() { - return this != ANY_LOCATION; - } - - public final boolean overlaps(LocationIdentity other) { - return isAny() || other.isAny() || this.equals(other); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MemoryAccessProvider.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MemoryAccessProvider.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2012, 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 com.oracle.graal.api.meta; - -/** - * Provides memory access operations for the target VM. - */ -public interface MemoryAccessProvider { - - /** - * Reads a value of this kind using a base address and a displacement. No bounds checking or - * type checking is performed. Returns {@code null} if the value is not available at this point. - * - * @param base the base address from which the value is read. - * @param displacement the displacement within the object in bytes - * @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); - - /** - * Reads a primitive value using a base address and a displacement. - * - * @param kind the {@link Kind} 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 - */ - JavaConstant readPrimitiveConstant(Kind kind, Constant base, long displacement, int bits); - - /** - * Reads a Java {@link Object} value using a base address and a displacement. - * - * @param base the base address from which the value is read - * @param displacement the displacement within the object in bytes - * @return the read value encapsulated in a {@link Constant} object - */ - JavaConstant readObjectConstant(Constant base, long displacement); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2012, 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 com.oracle.graal.api.meta; - -import java.lang.reflect.*; - -/** - * Provides access to the metadata of a class typically provided in a class file. - */ -public interface MetaAccessProvider { - - /** - * Returns the resolved Java type representing a given Java class. - * - * @param clazz the Java class object - * @return the resolved Java type object - */ - ResolvedJavaType lookupJavaType(Class clazz); - - /** - * Returns the resolved Java types representing some given Java classes. - * - * @param classes the Java class objects - * @return the resolved Java type objects - */ - default ResolvedJavaType[] lookupJavaTypes(Class[] classes) { - ResolvedJavaType[] result = new ResolvedJavaType[classes.length]; - for (int i = 0; i < result.length; i++) { - result[i] = lookupJavaType(classes[i]); - } - return result; - } - - /** - * Provides the {@link ResolvedJavaMethod} for a {@link Method} or {@link Constructor} obtained - * via reflection. - */ - ResolvedJavaMethod lookupJavaMethod(Executable reflectionMethod); - - /** - * Provides the {@link ResolvedJavaField} for a {@link Field} obtained via reflection. - */ - ResolvedJavaField lookupJavaField(Field reflectionField); - - /** - * Returns the resolved Java type of the given {@link JavaConstant} object. - * - * @return {@code null} if {@code constant.isNull() || !constant.kind.isObject()} - */ - ResolvedJavaType lookupJavaType(JavaConstant constant); - - /** - * Returns the number of bytes occupied by this constant value or constant object. - * - * @param constant the constant whose bytes should be measured - * @return the number of bytes occupied by this constant - */ - long getMemorySize(JavaConstant constant); - - /** - * Parses a method - * descriptor into a {@link Signature}. The behavior of this method is undefined if the - * method descriptor is not well formed. - */ - Signature parseMethodDescriptor(String methodDescriptor); - - /** - * Encodes a deoptimization action and a deoptimization reason in an integer value. - * - * @param debugId an integer that can be used to track the origin of a deoptimization at - * runtime. There is no guarantee that the runtime will use this value. The runtime - * may even keep fewer than 32 bits. - * - * @return the encoded value as an integer - */ - JavaConstant encodeDeoptActionAndReason(DeoptimizationAction action, DeoptimizationReason reason, int debugId); - - DeoptimizationReason decodeDeoptReason(JavaConstant constant); - - DeoptimizationAction decodeDeoptAction(JavaConstant constant); - - int decodeDebugId(JavaConstant constant); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,341 +0,0 @@ -/* - * Copyright (c) 2012, 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 com.oracle.graal.api.meta; - -import java.io.*; -import java.util.*; - -/** - * Miscellaneous collection of utility methods used by {@code com.oracle.graal.api.meta} and its - * clients. - */ -public class MetaUtil { - - private static class ClassInfo { - public long totalSize; - public long instanceCount; - - @Override - public String toString() { - return "totalSize=" + totalSize + ", instanceCount=" + instanceCount; - } - } - - /** - * Returns the number of bytes occupied by this constant value or constant object and - * recursively all values reachable from this value. - * - * @param constant the constant whose bytes should be measured - * @param printTopN print total size and instance count of the top n classes is desired - * @return the number of bytes occupied by this constant - */ - public static long getMemorySizeRecursive(MetaAccessProvider access, ConstantReflectionProvider constantReflection, JavaConstant constant, PrintStream out, int printTopN) { - Set marked = new HashSet<>(); - Deque stack = new ArrayDeque<>(); - if (constant.getKind() == Kind.Object && constant.isNonNull()) { - marked.add(constant); - } - final HashMap histogram = new HashMap<>(); - stack.push(constant); - long sum = 0; - while (!stack.isEmpty()) { - JavaConstant c = stack.pop(); - long memorySize = access.getMemorySize(constant); - sum += memorySize; - if (c.getKind() == Kind.Object && c.isNonNull()) { - ResolvedJavaType clazz = access.lookupJavaType(c); - if (!histogram.containsKey(clazz)) { - histogram.put(clazz, new ClassInfo()); - } - ClassInfo info = histogram.get(clazz); - info.instanceCount++; - info.totalSize += memorySize; - ResolvedJavaType type = access.lookupJavaType(c); - if (type.isArray()) { - if (!type.getComponentType().isPrimitive()) { - int length = constantReflection.readArrayLength(c); - for (int i = 0; i < length; i++) { - JavaConstant value = constantReflection.readArrayElement(c, i); - pushConstant(marked, stack, value); - } - } - } else { - ResolvedJavaField[] instanceFields = type.getInstanceFields(true); - for (ResolvedJavaField f : instanceFields) { - if (f.getKind() == Kind.Object) { - JavaConstant value = constantReflection.readFieldValue(f, c); - pushConstant(marked, stack, value); - } - } - } - } - } - ArrayList clazzes = new ArrayList<>(); - clazzes.addAll(histogram.keySet()); - Collections.sort(clazzes, new Comparator() { - - @Override - public int compare(ResolvedJavaType o1, ResolvedJavaType o2) { - long l1 = histogram.get(o1).totalSize; - long l2 = histogram.get(o2).totalSize; - if (l1 > l2) { - return -1; - } else if (l1 == l2) { - return 0; - } else { - return 1; - } - } - }); - - int z = 0; - for (ResolvedJavaType c : clazzes) { - if (z > printTopN) { - break; - } - out.println("Class " + c + ", " + histogram.get(c)); - ++z; - } - - return sum; - } - - private static void pushConstant(Set marked, Deque stack, JavaConstant value) { - if (value.isNonNull()) { - if (!marked.contains(value)) { - marked.add(value); - stack.push(value); - } - } - } - - /** - * Calls {@link JavaType#resolve(ResolvedJavaType)} on an array of types. - */ - public static ResolvedJavaType[] resolveJavaTypes(JavaType[] types, ResolvedJavaType accessingClass) { - ResolvedJavaType[] result = new ResolvedJavaType[types.length]; - for (int i = 0; i < result.length; i++) { - result[i] = types[i].resolve(accessingClass); - } - return result; - } - - /** - * Extends the functionality of {@link Class#getSimpleName()} to include a non-empty string for - * anonymous and local classes. - * - * @param clazz the class for which the simple name is being requested - * @param withEnclosingClass specifies if the returned name should be qualified with the name(s) - * of the enclosing class/classes of {@code clazz} (if any). This option is ignored - * if {@code clazz} denotes an anonymous or local class. - * @return the simple name - */ - public static String getSimpleName(Class clazz, boolean withEnclosingClass) { - final String simpleName = clazz.getSimpleName(); - if (simpleName.length() != 0) { - if (withEnclosingClass) { - String prefix = ""; - Class enclosingClass = clazz; - while ((enclosingClass = enclosingClass.getEnclosingClass()) != null) { - prefix = enclosingClass.getSimpleName() + "." + prefix; - } - return prefix + simpleName; - } - return simpleName; - } - // Must be an anonymous or local class - final String name = clazz.getName(); - int index = name.indexOf('$'); - if (index == -1) { - return name; - } - index = name.lastIndexOf('.', index); - if (index == -1) { - return name; - } - return name.substring(index + 1); - } - - static String internalNameToJava(String name, boolean qualified, boolean classForNameCompatible) { - switch (name.charAt(0)) { - case 'L': { - String result = name.substring(1, name.length() - 1).replace('/', '.'); - if (!qualified) { - final int lastDot = result.lastIndexOf('.'); - if (lastDot != -1) { - result = result.substring(lastDot + 1); - } - } - return result; - } - case '[': - return classForNameCompatible ? name.replace('/', '.') : internalNameToJava(name.substring(1), qualified, classForNameCompatible) + "[]"; - default: - if (name.length() != 1) { - throw new IllegalArgumentException("Illegal internal name: " + name); - } - return Kind.fromPrimitiveOrVoidTypeChar(name.charAt(0)).getJavaName(); - } - } - - /** - * 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); - try { - String n = internalNameToJava(internal, true, true); - return metaAccess.lookupJavaType(k.isPrimitive() ? k.toJavaClass() : Class.forName(n, true, cl)); - } catch (ClassNotFoundException cnfe) { - throw new IllegalArgumentException("could not instantiate class described by " + internal, cnfe); - } - } - - /** - * Convenient shortcut for calling - * {@link #appendLocation(StringBuilder, ResolvedJavaMethod, int)} without having to supply a - * {@link StringBuilder} instance and convert the result to a string. - */ - public static String toLocation(ResolvedJavaMethod method, int bci) { - return appendLocation(new StringBuilder(), method, bci).toString(); - } - - /** - * Appends a string representation of a location specified by a given method and bci to a given - * {@link StringBuilder}. If a stack trace element with a non-null file name and non-negative - * line number is {@linkplain ResolvedJavaMethod#asStackTraceElement(int) available} for the - * given method, then the string returned is the {@link StackTraceElement#toString()} value of - * the stack trace element, suffixed by the bci location. For example: - * - *

-     *     java.lang.String.valueOf(String.java:2930) [bci: 12]
-     * 
- * - * Otherwise, the string returned is the value of applying {@link JavaMethod#format(String)} - * with the format string {@code "%H.%n(%p)"}, suffixed by the bci location. For example: - * - *
-     *     java.lang.String.valueOf(int) [bci: 12]
-     * 
- * - * @param sb - * @param method - * @param bci - */ - public static StringBuilder appendLocation(StringBuilder sb, ResolvedJavaMethod method, int bci) { - if (method != null) { - StackTraceElement ste = method.asStackTraceElement(bci); - if (ste.getFileName() != null && ste.getLineNumber() > 0) { - sb.append(ste); - } else { - sb.append(method.format("%H.%n(%p)")); - } - } else { - sb.append("Null method"); - } - return sb.append(" [bci: ").append(bci).append(']'); - } - - static void appendProfile(StringBuilder buf, AbstractJavaProfile profile, int bci, String type, String sep) { - if (profile != null) { - AbstractProfiledItem[] pitems = profile.getItems(); - if (pitems != null) { - buf.append(String.format("%s@%d:", type, bci)); - for (int j = 0; j < pitems.length; j++) { - AbstractProfiledItem pitem = pitems[j]; - buf.append(String.format(" %.6f (%s)%s", pitem.getProbability(), pitem.getItem(), sep)); - } - if (profile.getNotRecordedProbability() != 0) { - buf.append(String.format(" %.6f %s", profile.getNotRecordedProbability(), type, sep)); - } else { - buf.append(String.format(" %s", type, sep)); - } - } - } - } - - /** - * Converts a Java source-language class name into the internal form. - * - * @param className the class name - * @return the internal name form of the class name - */ - public static String toInternalName(String className) { - String prefix = ""; - String base = className; - while (base.endsWith("[]")) { - prefix += "["; - base = base.substring(base.length() - 2); - } - - switch (className) { - case "boolean": - return prefix + "Z"; - case "byte": - return prefix + "B"; - case "short": - return prefix + "S"; - case "char": - return prefix + "C"; - case "int": - return prefix + "I"; - case "float": - return prefix + "F"; - case "long": - return prefix + "J"; - case "double": - return prefix + "D"; - case "void": - return prefix + "V"; - default: - return prefix + "L" + className.replace('.', '/') + ";"; - } - } - - /** - * Prepends the String {@code indentation} to every line in String {@code lines}, including a - * possibly non-empty line following the final newline. - */ - public static String indent(String lines, String indentation) { - if (lines.length() == 0) { - return lines; - } - final String newLine = "\n"; - if (lines.endsWith(newLine)) { - return indentation + (lines.substring(0, lines.length() - 1)).replace(newLine, newLine + indentation) + newLine; - } - return indentation + lines.replace(newLine, newLine + indentation); - } - - /** - * Gets a string representation of an object based soley on its class and its - * {@linkplain System#identityHashCode(Object) identity hash code}. This avoids and calls to - * virtual methods on the object such as {@link Object#hashCode()}. - */ - public static String identityHashCodeString(Object obj) { - if (obj == null) { - return "null"; - } - return obj.getClass().getName() + "@" + System.identityHashCode(obj); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MethodHandleAccessProvider.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MethodHandleAccessProvider.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.api.meta; - -import java.lang.invoke.*; - -/** - * Interface to access the internals of the {@link MethodHandle} implementation of the VM. An - * implementation of this interface is usually required to access non-public classes, methods, and - * fields of {@link MethodHandle}, i.e., data that is not standardized by the Java specification. - */ -public interface MethodHandleAccessProvider { - - /** - * Identification for methods defined on the class {@link MethodHandle} that are processed by - * the {@link MethodHandleAccessProvider}. - */ - public enum IntrinsicMethod { - /** The method {@code MethodHandle.invokeBasic}. */ - INVOKE_BASIC, - /** The method {@code MethodHandle.linkToStatic}. */ - LINK_TO_STATIC, - /** The method {@code MethodHandle.linkToSpecial}. */ - LINK_TO_SPECIAL, - /** The method {@code MethodHandle.linkToVirtual}. */ - LINK_TO_VIRTUAL, - /** The method {@code MethodHandle.linkToInterface}. */ - LINK_TO_INTERFACE - } - - /** - * Returns the method handle method intrinsic identifier for the provided method, or - * {@code null} if the method is not an intrinsic processed by this interface. - */ - IntrinsicMethod lookupMethodHandleIntrinsic(ResolvedJavaMethod method); - - /** - * Resolves the invocation target for an invocation of {@link IntrinsicMethod#INVOKE_BASIC - * MethodHandle.invokeBasic} with the given constant receiver {@link MethodHandle}. Returns - * {@code null} if the invocation target is not available at this time. - *

- * The first invocations of a method handle can use an interpreter to lookup the actual invoked - * method; frequently executed method handles can use Java bytecode generation to avoid the - * interpreter overhead. If the parameter forceBytecodeGeneration is set to true, the VM should - * try to generate bytecodes before this method returns. - */ - ResolvedJavaMethod resolveInvokeBasicTarget(JavaConstant methodHandle, boolean forceBytecodeGeneration); - - /** - * Resolves the invocation target for an invocation of a {@code MethodHandle.linkTo*} method - * with the given constant member name. The member name is the last parameter of the - * {@code linkTo*} method. Returns {@code null} if the invocation target is not available at - * this time. - */ - ResolvedJavaMethod resolveLinkToTarget(JavaConstant memberName); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MethodIdHolder.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MethodIdHolder.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +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 com.oracle.graal.api.meta; - -import java.util.*; -import java.util.function.*; - -/** - * An object that can be assigned a globally unique identifier for use as a key in a - * {@link MethodIdMap}. - */ -public interface MethodIdHolder { - /** - * Sets the unique, positive, non-zero identifier for this method. - */ - void setMethodId(int id); - - /** - * Gets the identifier set by {@link #setMethodId(int)} or 0 if no identifier was assigned to - * this method. - */ - int getMethodId(); - - /** - * A singleton class for allocating globally unique method identifiers. - */ - static final class MethodIdAllocator { - - /** - * Ensures a given method has a unique identifier. - */ - public int assignId(MethodIdHolder holder) { - assert Thread.holdsLock(instance) : "must only be called from within MethodIdHolder.allocateIds"; - int id = holder.getMethodId(); - if (id == 0) { - id = nextId++; - holder.setMethodId(id); - if (idVerifierMap != null) { - idVerifierMap.put(holder, id); - } - } else { - assert !idVerifierMap.containsKey(holder) || idVerifierMap.get(holder) == id; - } - return id; - } - - private int nextId = 1; - private final Map idVerifierMap; - - @SuppressWarnings("all") - private MethodIdAllocator() { - boolean assertionsEnabled = false; - assert assertionsEnabled = true; - idVerifierMap = assertionsEnabled ? new HashMap<>() : null; - } - - /** - * Singleton instance. - */ - private static final MethodIdAllocator instance = new MethodIdAllocator(); - } - - /** - * Executes some given code that ensures some set of {@link ResolvedJavaMethod}s have unique ids - * {@linkplain MethodIdHolder#setMethodId(int) assigned} to them. The - * {@link Consumer#accept(Object)} method of the given object is called under a global lock. - */ - static void assignIds(Consumer methodIdConsumer) { - synchronized (MethodIdAllocator.instance) { - methodIdConsumer.accept(MethodIdAllocator.instance); - } - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MethodIdMap.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MethodIdMap.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,236 +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 com.oracle.graal.api.meta; - -import java.lang.reflect.*; -import java.util.*; -import java.util.function.*; -import java.util.stream.*; - -import com.oracle.graal.api.meta.MethodIdHolder.MethodIdAllocator; - -/** - * A map whose keys are {@link MethodIdHolder}s. This data structure can be used for mapping - * identifiers to methods without requiring eager resolution of the latter (e.g., to - * {@link ResolvedJavaMethod}s) and has retrieval as fast as array indexing. The constraints on - * using such a map are: - *

    - *
  • at most one value can be added for any key
  • - *
  • no more entries can be added after the first {@linkplain #get(MethodIdHolder) retrieval}
  • - *
- * - * @param the type of the values in the map - */ -public class MethodIdMap { - - /** - * Key for a method. - */ - public static class MethodKey { - final boolean isStatic; - final Class declaringClass; - final String name; - final Class[] argumentTypes; - final T value; - int id; - - MethodKey(T data, boolean isStatic, Class declaringClass, String name, Class... argumentTypes) { - assert isStatic || argumentTypes[0] == declaringClass; - this.value = data; - this.isStatic = isStatic; - this.declaringClass = declaringClass; - this.name = name; - this.argumentTypes = argumentTypes; - assert resolveJava() != null; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof MethodKey) { - MethodKey that = (MethodKey) obj; - boolean res = this.name.equals(that.name) && this.declaringClass.equals(that.declaringClass) && Arrays.equals(this.argumentTypes, that.argumentTypes); - assert !res || this.isStatic == that.isStatic; - return res; - } - return false; - } - - public int getDeclaredParameterCount() { - return isStatic ? argumentTypes.length : argumentTypes.length - 1; - } - - @Override - public int hashCode() { - // Replay compilation mandates use of stable hash codes - return declaringClass.getName().hashCode() ^ name.hashCode(); - } - - private MethodIdHolder resolve(MetaAccessProvider metaAccess) { - return (MethodIdHolder) metaAccess.lookupJavaMethod(resolveJava()); - } - - private Executable resolveJava() { - try { - Executable res; - Class[] parameterTypes = isStatic ? argumentTypes : Arrays.copyOfRange(argumentTypes, 1, argumentTypes.length); - if (name.equals("")) { - res = declaringClass.getDeclaredConstructor(parameterTypes); - } else { - res = declaringClass.getDeclaredMethod(name, parameterTypes); - } - assert Modifier.isStatic(res.getModifiers()) == isStatic; - return res; - } catch (NoSuchMethodException | SecurityException e) { - throw new InternalError(e); - } - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(declaringClass.getName()).append('.').append(name).append('('); - for (Class p : argumentTypes) { - if (sb.charAt(sb.length() - 1) != '(') { - sb.append(", "); - } - sb.append(p.getSimpleName()); - } - return sb.append(')').toString(); - } - } - - private final MetaAccessProvider metaAccess; - - /** - * Initial list of entries. - */ - private final List> registrations; - - /** - * Entry array that is initialized upon first call to {@link #get(MethodIdHolder)}. - * - * Note: this must be volatile since double-checked locking is used to initialize it - */ - private volatile V[] entries; - - /** - * The minimum {@linkplain MethodIdHolder#getMethodId() id} for a key in this map. - */ - private int minId = Integer.MAX_VALUE; - - public MethodIdMap(MetaAccessProvider metaAccess) { - this.metaAccess = metaAccess; - this.registrations = new ArrayList<>(INITIAL_CAPACITY); - } - - private static final int INITIAL_CAPACITY = 64; - - /** - * Adds an entry to this map for a specified method. - * - * @param value value to be associated with the specified method - * @param isStatic specifies if the method is static - * @param declaringClass the class declaring the method - * @param name the name of the method - * @param argumentTypes the argument types of the method. Element 0 of this array must be - * {@code declaringClass} iff the method is non-static. - * @return an object representing the method - */ - public MethodKey put(V value, boolean isStatic, Class declaringClass, String name, Class... argumentTypes) { - assert isStatic || argumentTypes[0] == declaringClass; - MethodKey methodKey = new MethodKey<>(value, isStatic, declaringClass, name, argumentTypes); - assert entries == null : "registration is closed"; - assert !registrations.contains(methodKey) : "a value is already registered for " + methodKey; - registrations.add(methodKey); - return methodKey; - } - - @SuppressWarnings("unchecked") - protected V[] allocateEntries(int length) { - return (V[]) new Object[length]; - } - - /** - * Determines if a method denoted by a given {@link MethodKey} is in this map. - */ - public boolean containsKey(MethodKey key) { - return registrations.contains(key); - } - - public V get(MethodIdHolder method) { - if (entries == null) { - createEntries(); - } - - int id = method.getMethodId(); - int index = id - minId; - return index >= 0 && index < entries.length ? entries[index] : null; - } - - public void createEntries() { - // 'assignIds' synchronizes on a global lock which ensures thread safe - // allocation of identifiers across all MethodIdHolder objects - MethodIdHolder.assignIds(new Consumer() { - - public void accept(MethodIdAllocator idAllocator) { - if (entries == null) { - if (registrations.isEmpty()) { - entries = allocateEntries(0); - } else { - int max = Integer.MIN_VALUE; - for (MethodKey methodKey : registrations) { - MethodIdHolder m = methodKey.resolve(metaAccess); - int id = idAllocator.assignId(m); - if (id < minId) { - minId = id; - } - if (id > max) { - max = id; - } - methodKey.id = id; - } - - int length = (max - minId) + 1; - entries = allocateEntries(length); - for (MethodKey m : registrations) { - int index = m.id - minId; - entries[index] = m.value; - } - } - } - } - }); - } - - @Override - public String toString() { - return registrations.stream().map(MethodKey::toString).collect(Collectors.joining(", ")); - } - - public MetaAccessProvider getMetaAccess() { - return metaAccess; - } - - public int size() { - return registrations.size(); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ModifiersProvider.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ModifiersProvider.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +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 com.oracle.graal.api.meta; - -import static java.lang.reflect.Modifier.*; - -import java.lang.reflect.*; - -/** - * A Java element (i.e., a class, interface, field or method) that is described by a set of Java - * language {@linkplain #getModifiers() modifiers}. - */ -public interface ModifiersProvider { - - /** - * Returns the Java language modifiers for this element. - */ - int getModifiers(); - - /** - * @see Modifier#isInterface(int) - */ - default boolean isInterface() { - return Modifier.isInterface(getModifiers()); - } - - /** - * @see Modifier#isSynchronized(int) - */ - default boolean isSynchronized() { - return Modifier.isSynchronized(getModifiers()); - } - - /** - * @see Modifier#isStatic(int) - */ - default boolean isStatic() { - return Modifier.isStatic(getModifiers()); - } - - /** - * @see Modifier#isFinal(int) - */ - default boolean isFinal() { - return Modifier.isFinal(getModifiers()); - } - - /** - * @see Modifier#isPublic(int) - */ - default boolean isPublic() { - return Modifier.isPublic(getModifiers()); - } - - /** - * Determines if this element is neither {@linkplain #isPublic() public}, - * {@linkplain #isProtected() protected} nor {@linkplain #isPrivate() private}. - */ - default boolean isPackagePrivate() { - return ((PUBLIC | PROTECTED | PRIVATE) & getModifiers()) == 0; - } - - /** - * @see Modifier#isPrivate(int) - */ - default boolean isPrivate() { - return Modifier.isPrivate(getModifiers()); - } - - /** - * @see Modifier#isProtected(int) - */ - default boolean isProtected() { - return Modifier.isProtected(getModifiers()); - } - - /** - * @see Modifier#isTransient(int) - */ - default boolean isTransient() { - return Modifier.isTransient(getModifiers()); - } - - /** - * @see Modifier#isStrict(int) - */ - default boolean isStrict() { - return Modifier.isStrict(getModifiers()); - } - - /** - * @see Modifier#isVolatile(int) - */ - default boolean isVolatile() { - return Modifier.isVolatile(getModifiers()); - } - - /** - * @see Modifier#isNative(int) - */ - default boolean isNative() { - return Modifier.isNative(getModifiers()); - } - - /** - * @see Modifier#isAbstract(int) - */ - default boolean isAbstract() { - return Modifier.isAbstract(getModifiers()); - } - - /** - * Checks that the method is concrete and not abstract. - * - * @return whether the method is a concrete method - */ - default boolean isConcrete() { - return !isAbstract(); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NamedLocationIdentity.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NamedLocationIdentity.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +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. - */ -package com.oracle.graal.api.meta; - -import java.util.*; - -import com.oracle.graal.api.meta.Kind.FormatWithToString; - -/** - * A {@link LocationIdentity} with a name. - */ -public final class NamedLocationIdentity extends LocationIdentity implements FormatWithToString { - - /** - * Map for asserting all {@link NamedLocationIdentity} instances have a unique name. - */ - static class DB { - private static final HashMap map = new HashMap<>(); - - static boolean checkUnique(NamedLocationIdentity identity) { - NamedLocationIdentity oldValue = map.put(identity.name, identity); - if (oldValue != null) { - throw new AssertionError("identity " + identity + " already exists"); - } - return true; - } - } - - private final String name; - private final boolean immutable; - - private NamedLocationIdentity(String name, boolean immutable) { - this.name = name; - this.immutable = immutable; - } - - /** - * Creates a named unique location identity for read and write operations against mutable - * memory. - * - * @param name the name of the new location identity - */ - public static NamedLocationIdentity mutable(String name) { - return create(name, false); - } - - /** - * Creates a named unique location identity for read operations against immutable memory. - * Immutable memory will never have a visible write in the graph, which is more restictive than - * Java final. - * - * @param name the name of the new location identity - */ - public static NamedLocationIdentity immutable(String name) { - return create(name, true); - } - - /** - * Creates a named unique location identity for read and write operations. - * - * @param name the name of the new location identity - * @param immutable true if the location is immutable - */ - private static NamedLocationIdentity create(String name, boolean immutable) { - NamedLocationIdentity id = new NamedLocationIdentity(name, immutable); - assert DB.checkUnique(id); - return id; - } - - @Override - public boolean isImmutable() { - return immutable; - } - - @Override - public String toString() { - return name + (isImmutable() ? ":final" : ""); - } - - /** - * Returns the named location identity for an array of the given element kind. Array accesses of - * the same kind must have the same location identity unless an alias analysis guarantees that - * two distinct arrays are accessed. - */ - public static LocationIdentity getArrayLocation(Kind elementKind) { - return ARRAY_LOCATIONS.get(elementKind); - } - - private static final EnumMap ARRAY_LOCATIONS = initArrayLocations(); - - private static EnumMap initArrayLocations() { - EnumMap result = new EnumMap<>(Kind.class); - for (Kind kind : Kind.values()) { - result.put(kind, NamedLocationIdentity.mutable("Array: " + kind.getJavaName())); - } - return result; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NullConstant.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NullConstant.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.api.meta; - -/** - * The implementation type of the {@link JavaConstant#NULL_POINTER null constant}. - */ -final class NullConstant extends AbstractValue implements JavaConstant { - - protected NullConstant() { - super(LIRKind.reference(Kind.Object)); - } - - @Override - public boolean isNull() { - return true; - } - - @Override - public boolean isDefaultForKind() { - return true; - } - - @Override - public Object asBoxedPrimitive() { - throw new IllegalArgumentException(); - } - - @Override - public int asInt() { - throw new IllegalArgumentException(); - } - - @Override - public boolean asBoolean() { - throw new IllegalArgumentException(); - } - - @Override - public long asLong() { - throw new IllegalArgumentException(); - } - - @Override - public float asFloat() { - throw new IllegalArgumentException(); - } - - @Override - public double asDouble() { - throw new IllegalArgumentException(); - } - - @Override - public String toString() { - return JavaConstant.toString(this); - } - - @Override - public String toValueString() { - return "null"; - } - - @Override - public int hashCode() { - return 13; - } - - @Override - public boolean equals(Object o) { - return o instanceof NullConstant; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/PlatformKind.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/PlatformKind.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2013, 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 com.oracle.graal.api.meta; - -/** - * Represents a platform-specific low-level type for values. - */ -public interface PlatformKind { - - String name(); - - JavaConstant getDefaultValue(); - - public interface Key { - - } - - public class EnumKey implements Key { - @SuppressWarnings("rawtypes") private final Enum e; - - @SuppressWarnings("rawtypes") - public EnumKey(Enum e) { - this.e = e; - } - - @Override - public int hashCode() { - return e.ordinal() ^ e.name().hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (obj instanceof EnumKey) { - EnumKey that = (EnumKey) obj; - return this.e == that.e; - } - return false; - } - } - - /** - * Gets a value associated with this object that can be used as a stable key in a map. The - * {@link Object#hashCode()} implementation of the returned value should be stable between VM - * executions. - */ - Key getKey(); - - default int getVectorLength() { - return 1; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/PrimitiveConstant.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/PrimitiveConstant.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -/* - * 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 com.oracle.graal.api.meta; - -import java.nio.*; - -/** - * 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 { - - /** - * The boxed primitive value as a {@code long}. For {@code float} and {@code double} values, - * this value is the result of {@link Float#floatToRawIntBits(float)} and - * {@link Double#doubleToRawLongBits(double)} respectively. - */ - private final long primitive; - - protected PrimitiveConstant(Kind kind, long primitive) { - super(LIRKind.value(kind)); - this.primitive = primitive; - - assert kind.isPrimitive() || kind == Kind.Illegal; - } - - @Override - public boolean isNull() { - return false; - } - - @Override - public boolean isDefaultForKind() { - return primitive == 0; - } - - @Override - public boolean asBoolean() { - assert getKind() == Kind.Boolean; - return primitive != 0L; - } - - @Override - public int asInt() { - assert getKind().getStackKind() == Kind.Int : getKind().getStackKind(); - return (int) primitive; - } - - @Override - public long asLong() { - assert getKind().isNumericInteger(); - return primitive; - } - - @Override - public float asFloat() { - assert getKind() == Kind.Float; - return Float.intBitsToFloat((int) primitive); - } - - @Override - public double asDouble() { - assert getKind() == Kind.Double; - return Double.longBitsToDouble(primitive); - } - - @Override - public Object asBoxedPrimitive() { - switch (getKind()) { - case Byte: - return Byte.valueOf((byte) primitive); - case Boolean: - return Boolean.valueOf(asBoolean()); - case Short: - return Short.valueOf((short) primitive); - case Char: - return Character.valueOf((char) primitive); - case Int: - return Integer.valueOf(asInt()); - case Long: - return Long.valueOf(asLong()); - case Float: - return Float.valueOf(asFloat()); - case Double: - return Double.valueOf(asDouble()); - default: - throw new IllegalArgumentException("unexpected kind " + getKind()); - } - } - - @Override - public int getSerializedSize() { - return getKind().getByteCount(); - } - - @Override - public void serialize(ByteBuffer buffer) { - switch (getKind()) { - case Byte: - case Boolean: - buffer.put((byte) primitive); - break; - case Short: - buffer.putShort((short) primitive); - break; - case Char: - buffer.putChar((char) primitive); - break; - case Int: - buffer.putInt(asInt()); - break; - case Long: - buffer.putLong(asLong()); - break; - case Float: - buffer.putFloat(asFloat()); - break; - case Double: - buffer.putDouble(asDouble()); - break; - default: - throw new IllegalArgumentException("unexpected kind " + getKind()); - } - } - - @Override - public int hashCode() { - return (int) (primitive ^ (primitive >>> 32)) * (getKind().ordinal() + 31); - } - - @Override - public boolean equals(Object o) { - return o == this || (o instanceof PrimitiveConstant && super.equals(o) && primitive == ((PrimitiveConstant) o).primitive); - } - - @Override - public String toString() { - if (getKind() == Kind.Illegal) { - return "illegal"; - } else { - return getKind().getJavaName() + "[" + asBoxedPrimitive() + "|0x" + Long.toHexString(primitive) + "]"; - } - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ProfilingInfo.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ProfilingInfo.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +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 com.oracle.graal.api.meta; - -/** - * Provides access to the profiling information of one specific method. Every accessor method - * returns the information that is available at the time of invocation. If a method is invoked - * multiple times, it may return significantly different results for every invocation as the - * profiling information may be changed by other Java threads at any time. - */ -public interface ProfilingInfo { - - /** - * Returns the length of the bytecodes associated with this profile. - */ - int getCodeSize(); - - /** - * Returns an estimate of how often the branch at the given byte code was taken. - * - * @return The estimated probability, with 0.0 meaning never and 1.0 meaning always, or -1 if - * this information is not available. - */ - double getBranchTakenProbability(int bci); - - /** - * Returns an estimate of how often the switch cases are taken at the given BCI. The default - * case is stored as the last entry. - * - * @return A double value that contains the estimated probabilities, with 0.0 meaning never and - * 1.0 meaning always, or -1 if this information is not available. - */ - double[] getSwitchProbabilities(int bci); - - /** - * Returns the TypeProfile for the given BCI. - * - * @return Returns a JavaTypeProfile object, or null if not available. - */ - JavaTypeProfile getTypeProfile(int bci); - - /** - * Returns the MethodProfile for the given BCI. - * - * @return Returns a JavaMethodProfile object, or null if not available. - */ - JavaMethodProfile getMethodProfile(int bci); - - /** - * Returns information if the given BCI did ever throw an exception. - * - * @return {@link TriState#TRUE} if the instruction has thrown an exception at least once, - * {@link TriState#FALSE} if it never threw an exception, and {@link TriState#UNKNOWN} - * if this information was not recorded. - */ - TriState getExceptionSeen(int bci); - - /** - * Returns information if null was ever seen for the given BCI. This information is collected - * for the aastore, checkcast and instanceof bytecodes. - * - * @return {@link TriState#TRUE} if null was seen for the instruction, {@link TriState#FALSE} if - * null was NOT seen, and {@link TriState#UNKNOWN} if this information was not recorded. - */ - TriState getNullSeen(int bci); - - /** - * Returns an estimate how often the current BCI was executed. Avoid comparing execution counts - * to each other, as the returned value highly depends on the time of invocation. - * - * @return the estimated execution count or -1 if not available. - */ - int getExecutionCount(int bci); - - /** - * Returns how frequently a method was deoptimized for the given deoptimization reason. This - * only indicates how often the method did fall back to the interpreter for the execution and - * does not indicate how often it was recompiled. - * - * @param reason the reason for which the number of deoptimizations should be queried - * @return the number of times the compiled method deoptimized for the given reason. - */ - int getDeoptimizationCount(DeoptimizationReason reason); - - /** - * Records the size of the compiler intermediate representation (IR) associated with this - * method. - * - * @param irType the IR type for which the size is being recorded - * @param irSize the IR size to be recorded. The unit depends on the IR. - * @return whether recording this information for {@code irType} is supported - */ - boolean setCompilerIRSize(Class irType, int irSize); - - /** - * Gets the size of the compiler intermediate representation (IR) associated with this method - * last recorded by {@link #setCompilerIRSize(Class, int)}. - * - * @param irType the IR type for which the size is being requested - * @return the requested IR size or -1 if it is unavailable for {@code irType} - */ - int getCompilerIRSize(Class irType); - - /** - * Returns true if the profiling information can be assumed as sufficiently accurate. - * - * @return true if the profiling information was recorded often enough mature enough, false - * otherwise. - */ - boolean isMature(); - - /** - * Force data to be treated as mature if possible. - */ - void setMature(); - - /** - * Formats this profiling information to a string. - * - * @param method an optional method that augments the profile string returned - * @param sep the separator to use for each separate profile record - */ - default String toString(ResolvedJavaMethod method, String sep) { - StringBuilder buf = new StringBuilder(100); - if (method != null) { - buf.append(String.format("canBeStaticallyBound: %b%s", method.canBeStaticallyBound(), sep)); - } - for (int i = 0; i < getCodeSize(); i++) { - if (getExecutionCount(i) != -1) { - buf.append(String.format("executionCount@%d: %d%s", i, getExecutionCount(i), sep)); - } - - if (getBranchTakenProbability(i) != -1) { - buf.append(String.format("branchProbability@%d: %.6f%s", i, getBranchTakenProbability(i), sep)); - } - - double[] switchProbabilities = getSwitchProbabilities(i); - if (switchProbabilities != null) { - buf.append(String.format("switchProbabilities@%d:", i)); - for (int j = 0; j < switchProbabilities.length; j++) { - buf.append(String.format(" %.6f", switchProbabilities[j])); - } - buf.append(sep); - } - - if (getExceptionSeen(i) != TriState.UNKNOWN) { - buf.append(String.format("exceptionSeen@%d: %s%s", i, getExceptionSeen(i).name(), sep)); - } - - if (getNullSeen(i) != TriState.UNKNOWN) { - buf.append(String.format("nullSeen@%d: %s%s", i, getNullSeen(i).name(), sep)); - } - - JavaTypeProfile typeProfile = getTypeProfile(i); - MetaUtil.appendProfile(buf, typeProfile, i, "types", sep); - - JavaMethodProfile methodProfile = getMethodProfile(i); - MetaUtil.appendProfile(buf, methodProfile, i, "methods", sep); - } - - boolean firstDeoptReason = true; - for (DeoptimizationReason reason : DeoptimizationReason.values()) { - int count = getDeoptimizationCount(reason); - if (count > 0) { - if (firstDeoptReason) { - buf.append("deoptimization history").append(sep); - firstDeoptReason = false; - } - buf.append(String.format(" %s: %d%s", reason.name(), count, sep)); - } - } - if (buf.length() == 0) { - return ""; - } - String s = buf.toString(); - return s.substring(0, s.length() - sep.length()); - } - -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RawConstant.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RawConstant.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +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 com.oracle.graal.api.meta; - -public class RawConstant extends PrimitiveConstant { - - public RawConstant(long rawValue) { - super(Kind.Int, rawValue); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaField.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaField.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +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 com.oracle.graal.api.meta; - -import java.lang.annotation.*; -import java.lang.reflect.*; - -/** - * Represents a reference to a resolved Java field. Fields, like methods and types, are resolved - * through {@link ConstantPool constant pools}. - */ -public interface ResolvedJavaField extends JavaField, ModifiersProvider { - - /** - * {@inheritDoc} - *

- * Only the {@linkplain Modifier#fieldModifiers() field flags} specified in the JVM - * specification will be included in the returned mask. - */ - int getModifiers(); - - /** - * Determines if this field was injected by the VM. Such a field, for example, is not derived - * from a class file. - */ - boolean isInternal(); - - /** - * Determines if this field is a synthetic field as defined by the Java Language Specification. - */ - boolean isSynthetic(); - - /** - * Returns the {@link ResolvedJavaType} object representing the class or interface that declares - * this field. - */ - ResolvedJavaType getDeclaringClass(); - - /** - * Returns the annotation for the specified type of this field, if such an annotation is - * present. - * - * @param annotationClass the Class object corresponding to the annotation type - * @return this element's annotation for the specified annotation type if present on this field, - * else {@code null} - */ - T getAnnotation(Class annotationClass); - - /** - * Returns an object representing the unique location identity of this resolved Java field. - * - * @return the location identity of the field - */ - LocationIdentity getLocationIdentity(); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,298 +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 com.oracle.graal.api.meta; - -import java.lang.annotation.*; -import java.lang.reflect.*; - -/** - * Represents a resolved Java method. Methods, like fields and types, are resolved through - * {@link ConstantPool constant pools}. - */ -public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget, ModifiersProvider { - - /** - * Returns the bytecode of this method, if the method has code. The returned byte array does not - * contain breakpoints or non-Java bytecodes. This may return null if the - * {@link #getDeclaringClass() holder} is not {@link ResolvedJavaType#isLinked() linked}. - * - * The contained constant pool indices may not be the ones found in the original class file but - * they can be used with the Graal API (e.g. methods in {@link ConstantPool}). - * - * @return the bytecode of the method, or {@code null} if {@code getCodeSize() == 0} or if the - * code is not ready. - */ - byte[] getCode(); - - /** - * Returns the size of the bytecode of this method, if the method has code. This is equivalent - * to {@link #getCode()}. {@code length} if the method has code. - * - * @return the size of the bytecode in bytes, or 0 if no bytecode is available - */ - int getCodeSize(); - - /** - * Returns the {@link ResolvedJavaType} object representing the class or interface that declares - * this method. - */ - ResolvedJavaType getDeclaringClass(); - - /** - * Returns the maximum number of locals used in this method's bytecodes. - */ - int getMaxLocals(); - - /** - * Returns the maximum number of stack slots used in this method's bytecodes. - */ - int getMaxStackSize(); - - /** - * {@inheritDoc} - *

- * Only the {@linkplain Modifier#methodModifiers() method flags} specified in the JVM - * specification will be included in the returned mask. - */ - int getModifiers(); - - /** - * Determines if this method is a synthetic method as defined by the Java Language - * Specification. - */ - boolean isSynthetic(); - - /** - * Returns {@code true} if this method is a default method; returns {@code false} otherwise. - * - * A default method is a public non-abstract instance method, that is, a non-static method with - * a body, declared in an interface type. - * - * @return true if and only if this method is a default method as defined by the Java Language - * Specification. - */ - boolean isDefault(); - - /** - * Checks whether this method is a class initializer. - * - * @return {@code true} if the method is a class initializer - */ - boolean isClassInitializer(); - - /** - * Checks whether this method is a constructor. - * - * @return {@code true} if the method is a constructor - */ - boolean isConstructor(); - - /** - * Checks whether this method can be statically bound (usually, that means it is final or - * private or static, but not abstract, or the declaring class is final). - * - * @return {@code true} if this method can be statically bound - */ - boolean canBeStaticallyBound(); - - /** - * Returns the list of exception handlers for this method. - */ - ExceptionHandler[] getExceptionHandlers(); - - /** - * Returns a stack trace element for this method and a given bytecode index. - */ - StackTraceElement asStackTraceElement(int bci); - - /** - * Returns an object that provides access to the profiling information recorded for this method. - */ - ProfilingInfo getProfilingInfo(); - - /** - * Invalidates the profiling information and restarts profiling upon the next invocation. - */ - void reprofile(); - - /** - * Returns the constant pool of this method. - */ - ConstantPool getConstantPool(); - - /** - * Returns all annotations of this method. If no annotations are present, an array of length 0 - * is returned. - */ - Annotation[] getAnnotations(); - - /** - * Returns the annotation for the specified type of this method, if such an annotation is - * present. - * - * @param annotationClass the Class object corresponding to the annotation type - * @return this element's annotation for the specified annotation type if present on this - * method, else {@code null} - */ - T getAnnotation(Class annotationClass); - - /** - * Returns an array of arrays that represent the annotations on the formal parameters, in - * declaration order, of this method. - * - * @see Method#getParameterAnnotations() - */ - Annotation[][] getParameterAnnotations(); - - /** - * Returns an array of {@link Type} objects that represent the formal parameter types, in - * declaration order, of this method. - * - * @see Method#getGenericParameterTypes() - */ - Type[] getGenericParameterTypes(); - - /** - * Returns {@code true} if this method is not excluded from inlining and has associated Java - * bytecodes (@see {@link ResolvedJavaMethod#hasBytecodes()}). - */ - boolean canBeInlined(); - - /** - * Returns {@code true} if the inlining of this method should be forced. - */ - boolean shouldBeInlined(); - - /** - * Returns the LineNumberTable of this method or null if this method does not have a line - * numbers table. - */ - LineNumberTable getLineNumberTable(); - - /** - * Returns the local variable table of this method or null if this method does not have a local - * variable table. - */ - LocalVariableTable getLocalVariableTable(); - - /** - * Invokes the underlying method represented by this object, on the specified object with the - * specified parameters. This method is similar to a reflective method invocation by - * {@link Method#invoke}. - * - * @param receiver The receiver for the invocation, or {@code null} if it is a static method. - * @param arguments The arguments for the invocation. - * @return The value returned by the method invocation, or {@code null} if the return type is - * {@code void}. - */ - JavaConstant invoke(JavaConstant receiver, JavaConstant[] arguments); - - /** - * Gets the encoding of (that is, a constant representing the value of) this method. - * - * @return a constant representing a reference to this method - */ - Constant getEncoding(); - - /** - * Checks if this method is present in the virtual table for subtypes of the specified - * {@linkplain ResolvedJavaType type}. - * - * @return true is this method is present in the virtual table for subtypes of this type. - */ - boolean isInVirtualMethodTable(ResolvedJavaType resolved); - - /** - * Gets the annotation of a particular type for a formal parameter of this method. - * - * @param annotationClass the Class object corresponding to the annotation type - * @param parameterIndex the index of a formal parameter of {@code method} - * @return the annotation of type {@code annotationClass} for the formal parameter present, else - * null - * @throws IndexOutOfBoundsException if {@code parameterIndex} does not denote a formal - * parameter - */ - default T getParameterAnnotation(Class annotationClass, int parameterIndex) { - if (parameterIndex >= 0) { - Annotation[][] parameterAnnotations = getParameterAnnotations(); - for (Annotation a : parameterAnnotations[parameterIndex]) { - if (a.annotationType() == annotationClass) { - return annotationClass.cast(a); - } - } - } - return null; - } - - default JavaType[] toParameterTypes() { - JavaType receiver = isStatic() || isConstructor() ? null : getDeclaringClass(); - return getSignature().toParameterTypes(receiver); - } - - /** - * Gets the annotations of a particular type for the formal parameters of this method. - * - * @param annotationClass the Class object corresponding to the annotation type - * @return the annotation of type {@code annotationClass} (if any) for each formal parameter - * present - */ - @SuppressWarnings("unchecked") - default T[] getParameterAnnotations(Class annotationClass) { - Annotation[][] parameterAnnotations = getParameterAnnotations(); - T[] result = (T[]) Array.newInstance(annotationClass, parameterAnnotations.length); - for (int i = 0; i < parameterAnnotations.length; i++) { - for (Annotation a : parameterAnnotations[i]) { - if (a.annotationType() == annotationClass) { - result[i] = annotationClass.cast(a); - } - } - } - return result; - } - - /** - * Checks whether the method has bytecodes associated with it. Methods without bytecodes are - * either abstract or native methods. - * - * @return whether the definition of this method is Java bytecodes - */ - default boolean hasBytecodes() { - return isConcrete() && !isNative(); - } - - /** - * Checks whether the method has a receiver parameter - i.e., whether it is not static. - * - * @return whether the method has a receiver parameter - */ - default boolean hasReceiver() { - return !isStatic(); - } - - /** - * Determines if this method is {@link java.lang.Object#Object()}. - */ - default boolean isJavaLangObjectInit() { - return getDeclaringClass().isJavaLangObject() && getName().equals(""); - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,354 +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 com.oracle.graal.api.meta; - -import java.lang.annotation.*; -import java.net.*; - -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; - -/** - * Represents a resolved Java type. Types include primitives, objects, {@code void}, and arrays - * thereof. Types, like fields and methods, are resolved through {@link ConstantPool constant pools} - * . - */ -public interface ResolvedJavaType extends JavaType, ModifiersProvider { - - /** - * Gets the runtime representation of the Java class object of this type. - */ - JavaConstant getJavaClass(); - - /** - * Gets the runtime representation of the "hub" of this type--that is, the closest part of the - * type representation which is typically stored in the object header. - */ - Constant getObjectHub(); - - /** - * Checks whether this type has a finalizer method. - * - * @return {@code true} if this class has a finalizer - */ - boolean hasFinalizer(); - - /** - * Checks whether this type has any finalizable subclasses so far. Any decisions based on this - * information require the registration of a dependency, since this information may change. - * - * @return {@code true} if this class has any subclasses with finalizers - */ - AssumptionResult hasFinalizableSubclass(); - - /** - * Checks whether this type is an interface. - * - * @return {@code true} if this type is an interface - */ - boolean isInterface(); - - /** - * Checks whether this type is an instance class. - * - * @return {@code true} if this type is an instance class - */ - boolean isInstanceClass(); - - /** - * Checks whether this type is an array class. - * - * @return {@code true} if this type is an array class - */ - boolean isArray(); - - /** - * Checks whether this type is primitive. - * - * @return {@code true} if this type is primitive - */ - boolean isPrimitive(); - - /** - * {@inheritDoc} - *

- * Only the flags specified in the JVM specification will be included in the returned mask. This - * method is identical to {@link Class#getModifiers()} in terms of the value return for this - * type. - */ - int getModifiers(); - - /** - * Checks whether this type is initialized. If a type is initialized it implies that it was - * {@link #isLinked() linked} and that the static initializer has run. - * - * @return {@code true} if this type is initialized - */ - boolean isInitialized(); - - /** - * Initializes this type. - */ - void initialize(); - - /** - * Checks whether this type is linked and verified. When a type is linked the static initializer - * has not necessarily run. An {@link #isInitialized() initialized} type is always linked. - * - * @return {@code true} if this type is linked - */ - boolean isLinked(); - - /** - * Determines if this type is either the same as, or is a superclass or superinterface of, the - * type represented by the specified parameter. This method is identical to - * {@link Class#isAssignableFrom(Class)} in terms of the value return for this type. - */ - boolean isAssignableFrom(ResolvedJavaType other); - - /** - * Returns true if this type is exactly the type {@link java.lang.Object}. - */ - default boolean isJavaLangObject() { - // Removed assertion due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=434442 - return getSuperclass() == null && !isInterface() && getKind() == Kind.Object; - } - - /** - * Checks whether the specified object is an instance of this type. - * - * @param obj the object to test - * @return {@code true} if the object is an instance of this type - */ - boolean isInstance(JavaConstant obj); - - /** - * Returns this type if it is an exact type otherwise returns null. This type is exact if it is - * void, primitive, final, or an array of a final or primitive type. - * - * @return this type if it is exact; {@code null} otherwise - */ - ResolvedJavaType asExactType(); - - /** - * Gets the super class of this type. If this type represents either the {@code Object} class, - * an interface, a primitive type, or void, then null is returned. If this object represents an - * array class then the type object representing the {@code Object} class is returned. - */ - ResolvedJavaType getSuperclass(); - - /** - * Gets the interfaces implemented or extended by this type. This method is analogous to - * {@link Class#getInterfaces()} and as such, only returns the interfaces directly implemented - * or extended by this type. - */ - ResolvedJavaType[] getInterfaces(); - - /** - * Gets the single implementor of this type. Calling this method on a non-interface type causes - * an exception. - *

- * If the compiler uses the result of this method for its compilation, the usage must be guarded - * because the verifier can not guarantee that the assigned type really implements this - * interface. Additionally, class loading can invalidate the result of this method. - * - * @return {@code null} if there is no implementor, the implementor if there is only one, or - * {@code this} if there are more than one. - */ - ResolvedJavaType getSingleImplementor(); - - /** - * Walks the class hierarchy upwards and returns the least common class that is a superclass of - * both the current and the given type. - * - * @return the least common type that is a super type of both the current and the given type, or - * {@code null} if primitive types are involved. - */ - ResolvedJavaType findLeastCommonAncestor(ResolvedJavaType otherType); - - /** - * Attempts to get a leaf concrete subclass of this type. - *

- * For an {@linkplain #isArray() array} type A, the leaf concrete subclass is A if the - * {@linkplain #getElementalType() elemental} type of A is final (which includes primitive - * types). Otherwise {@code null} is returned for A. - *

- * For a non-array type T, the result is the leaf concrete type in the current hierarchy of T. - *

- * A runtime may decide not to manage or walk a large hierarchy and so the result is - * conservative. That is, a non-null result is guaranteed to be the leaf concrete class in T's - * hierarchy at the current point in time but a null result does not necessarily imply - * that there is no leaf concrete class in T's hierarchy. - *

- * If the compiler uses the result of this method for its compilation, it must register the - * {@link AssumptionResult} in its {@link Assumptions} because dynamic class loading can - * invalidate the result of this method. - * - * @return an {@link AssumptionResult} containing the leaf concrete subclass for this type as - * described above - */ - AssumptionResult findLeafConcreteSubtype(); - - ResolvedJavaType getComponentType(); - - default ResolvedJavaType getElementalType() { - ResolvedJavaType t = this; - while (t.isArray()) { - t = t.getComponentType(); - } - return t; - } - - ResolvedJavaType getArrayClass(); - - /** - * Resolves the method implementation for virtual dispatches on objects of this dynamic type. - * This resolution process only searches "up" the class hierarchy of this type. - * - * @param method the method to select the implementation of - * @param callerType the caller or context type used to perform access checks - * @param includeAbstract whether abstract methods should be returned. If it is {@code false} - * this method behaves like {@link #resolveConcreteMethod}. This is just a temporary - * parameter to highlight the changed semantics of this method. TODO (je) remove this - * flag. - * @return the link-time resolved method (might be abstract) or {@code null} if it can not be - * linked - */ - ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method, ResolvedJavaType callerType, boolean includeAbstract); - - /** - * Resolves the method implementation for virtual dispatches on objects of this dynamic type. - * This resolution process only searches "up" the class hierarchy of this type. A broader search - * that also walks "down" the hierarchy is implemented by - * {@link #findUniqueConcreteMethod(ResolvedJavaMethod)}. - * - * @param method the method to select the implementation of - * @param callerType the caller or context type used to perform access checks - * @return the concrete method that would be selected at runtime, or {@code null} if there is no - * concrete implementation of {@code method} in this type or any of its superclasses - */ - ResolvedJavaMethod resolveConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType callerType); - - /** - * Given a {@link ResolvedJavaMethod} A, returns a concrete {@link ResolvedJavaMethod} B that is - * the only possible unique target for a virtual call on A(). Returns {@code null} if either no - * such concrete method or more than one such method exists. Returns the method A if A is a - * concrete method that is not overridden. - *

- * If the compiler uses the result of this method for its compilation, it must register an - * assumption because dynamic class loading can invalidate the result of this method. - * - * @param method the method A for which a unique concrete target is searched - * @return the unique concrete target or {@code null} if no such target exists or assumptions - * are not supported by this runtime - */ - AssumptionResult findUniqueConcreteMethod(ResolvedJavaMethod method); - - /** - * Returns the instance fields of this class, including - * {@linkplain ResolvedJavaField#isInternal() internal} fields. A zero-length array is returned - * for array and primitive types. The order of fields returned by this method is stable. That - * is, for a single JVM execution the same order is returned each time this method is called. It - * is also the "natural" order, which means that the JVM would expect the fields in this order - * if no specific order is given. - * - * @param includeSuperclasses if true, then instance fields for the complete hierarchy of this - * type are included in the result - * @return an array of instance fields - */ - ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses); - - /** - * Returns the static fields of this class, including - * {@linkplain ResolvedJavaField#isInternal() internal} fields. A zero-length array is returned - * for array and primitive types. The order of fields returned by this method is stable. That - * is, for a single JVM execution the same order is returned each time this method is called. - */ - ResolvedJavaField[] getStaticFields(); - - /** - * Returns the annotation for the specified type of this class, if such an annotation is - * present. - * - * @param annotationClass the Class object corresponding to the annotation type - * @return this element's annotation for the specified annotation type if present on this class, - * else {@code null} - */ - T getAnnotation(Class annotationClass); - - /** - * Returns the instance field of this class (or one of its super classes) at the given offset, - * or {@code null} if there is no such field. - * - * @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); - - /** - * Returns name of source file of this type. - */ - String getSourceFileName(); - - /** - * Returns the class file path - if available - of this type, or {@code null}. - */ - URL getClassFilePath(); - - /** - * Returns {@code true} if the type is a local type. - */ - boolean isLocal(); - - /** - * Returns {@code true} if the type is a member type. - */ - boolean isMember(); - - /** - * Returns the enclosing type of this type, if it exists, or {@code null}. - */ - ResolvedJavaType getEnclosingType(); - - /** - * Returns an array reflecting all the constructors declared by this type. This method is - * similar to {@link Class#getDeclaredConstructors()} in terms of returned constructors. - */ - ResolvedJavaMethod[] getDeclaredConstructors(); - - /** - * Returns an array reflecting all the methods declared by this type. This method is similar to - * {@link Class#getDeclaredMethods()} in terms of returned methods. - */ - ResolvedJavaMethod[] getDeclaredMethods(); - - /** - * Returns the {@code } method for this class if there is one. - */ - ResolvedJavaMethod getClassInitializer(); - - /** - * Returns true if this type represents an interface and it should be trusted even in places - * where the JVM verifier would not give any guarantees other than {@link Object}. - */ - boolean isTrustedInterfaceType(); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/SerializableConstant.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/SerializableConstant.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* - * 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 - * 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 com.oracle.graal.api.meta; - -import java.nio.*; - -/** - * Represents a compile-time constant that can be converted to a byte array. - */ -public interface SerializableConstant extends Constant { - - /** - * Return the size in bytes of the serialized representation of this constant. - */ - int getSerializedSize(); - - /** - * Serialize the constant into the ByteBuffer. There must be at least - * {@link #getSerializedSize()} bytes available capacity in the buffer. - */ - void serialize(ByteBuffer buffer); -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Signature.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Signature.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2009, 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 com.oracle.graal.api.meta; - -/** - * Represents a method signature provided by the runtime. - * - * @see Method - * Descriptors - */ -public interface Signature { - - /** - * Returns the number of parameters in this signature, adding 1 for a receiver if requested. - * - * @param receiver true if 1 is to be added to the result for a receiver - * @return the number of parameters; + 1 iff {@code receiver == true} - */ - int getParameterCount(boolean receiver); - - /** - * Gets the parameter type at the specified position. - * - * @param index the index into the parameters, with {@code 0} indicating the first parameter - * @param accessingClass the context of the type lookup. If non-null, its class loader is used - * for resolving the type. If {@code null}, then the type returned is either - * unresolved or a resolved type whose resolution is context free (e.g., a primitive - * type or a type in a java.* package). - * @return the {@code index}'th parameter type - * @throws LinkageError if {@code accessingClass != null} and resolution fails - * - */ - JavaType getParameterType(int index, ResolvedJavaType accessingClass); - - /** - * Gets the parameter kind at the specified position. This is the same as calling - * {@link #getParameterType}. {@link JavaType#getKind getKind}. - * - * @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(); - } - - /** - * Gets the return type of this signature. - * - * @param accessingClass the context of the type lookup. If non-null, its class loader is used - * for resolving the type. If {@code null}, then the type returned is either - * unresolved or a resolved type whose resolution is context free (e.g., a primitive - * type or a type in a java.* package). - * @return the return type - * @throws LinkageError if {@code accessingClass != null} and resolution fails - */ - JavaType getReturnType(ResolvedJavaType accessingClass); - - /** - * Gets the return kind of this signature. This is the same as calling {@link #getReturnType}. - * {@link JavaType#getKind getKind}. - */ - default Kind getReturnKind() { - return getReturnType(null).getKind(); - } - - /** - * Gets the method - * descriptor corresponding to this signature. For example: - * - *

-     * (ILjava/lang/String;D)V
-     * 
- * - * @return the signature as a string - */ - default String toMethodDescriptor() { - StringBuilder sb = new StringBuilder("("); - for (int i = 0; i < getParameterCount(false); ++i) { - sb.append(getParameterType(i, null).getName()); - } - sb.append(')').append(getReturnType(null).getName()); - return sb.toString(); - } - - default JavaType[] toParameterTypes(JavaType receiverType) { - int args = getParameterCount(false); - JavaType[] result; - int i = 0; - if (receiverType != null) { - result = new JavaType[args + 1]; - result[0] = receiverType; - i = 1; - } else { - result = new JavaType[args]; - } - for (int j = 0; j < args; j++) { - result[i + j] = getParameterType(j, null); - } - return result; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/TriState.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/TriState.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -/* - * 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. - */ -package com.oracle.graal.api.meta; - -/** - * Represents a logic value that can be either {@link #TRUE}, {@link #FALSE}, or {@link #UNKNOWN}. - */ -public enum TriState { - TRUE, - FALSE, - UNKNOWN; - - public static TriState get(boolean value) { - return value ? TRUE : FALSE; - } - - /** - * This is optimistic about {@link #UNKNOWN} (it prefers known values over {@link #UNKNOWN}) and - * pesimistic about known (it perfers {@link #TRUE} over {@link #FALSE}). - */ - public static TriState merge(TriState a, TriState b) { - if (a == TRUE || b == TRUE) { - return TRUE; - } - if (a == FALSE || b == FALSE) { - return FALSE; - } - assert a == UNKNOWN && b == UNKNOWN; - return UNKNOWN; - } - - public boolean isTrue() { - return this == TRUE; - } - - public boolean isFalse() { - return this == FALSE; - } - - public boolean isUnknown() { - return this == UNKNOWN; - } - - public boolean isKnown() { - return this != UNKNOWN; - } - - public boolean toBoolean() { - if (isTrue()) { - return true; - } else if (isFalse()) { - return false; - } else { - throw new IllegalStateException("Cannot convert to boolean, TriState is in an unknown state"); - } - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/TrustedInterface.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/TrustedInterface.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.api.meta; - -/** - * Interfaces extanding this interface should be trusted by the compiler. See - * {@link ResolvedJavaType#isTrustedInterfaceType()}. - * - */ -public interface TrustedInterface { - -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/VMConstant.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/VMConstant.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.graal.api.meta; - -public interface VMConstant extends Constant { -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Value.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Value.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +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 com.oracle.graal.api.meta; - -/** - * Interface for values manipulated by the compiler. All values have a {@linkplain Kind kind} and - * are immutable. - */ -public interface Value extends KindProvider, TrustedInterface { - - AllocatableValue ILLEGAL = new AllocatableValue(LIRKind.Illegal) { - - @Override - public String toString() { - return "-"; - } - - @Override - public boolean equals(Object other) { - // Due to de-serialization this object may exist multiple times. So we compare classes - // instead of the individual objects. (This anonymous class has always the same meaning) - return other != null && this.getClass() == other.getClass(); - } - }; - - LIRKind getLIRKind(); - - /** - * Returns the platform specific kind used to store this value. - */ - PlatformKind getPlatformKind(); - - /** - * Checks if this value is identical to {@code other}. - * - * Warning: Use with caution! Usually equivalence {@link #equals(Object)} is sufficient and - * should be used. - */ - @ExcludeFromIdentityComparisonVerification - default boolean identityEquals(Value other) { - return this == other; - } -} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/package-info.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/package-info.java Tue May 26 23:45:05 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2009, 2011, 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 that defines the interface between a runtime and a Java application that wants to access meta information. The runtime - * provides an implementation of the {@link com.oracle.graal.api.meta.MetaAccessProvider} interface. - */ -package com.oracle.graal.api.meta; - diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/MethodSubstitution.java --- a/graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/MethodSubstitution.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/MethodSubstitution.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,7 @@ import java.lang.annotation.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * Denotes a substitute method. A substitute method can call the original/substituted method by diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/SnippetReflectionProvider.java --- a/graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/SnippetReflectionProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.api.replacements/src/com/oracle/graal/api/replacements/SnippetReflectionProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,15 @@ */ package com.oracle.graal.api.replacements; +import com.oracle.jvmci.meta.JavaField; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.meta.*; /** * Reflection operations on values represented as {@linkplain JavaConstant constants} for the diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/BitOpsTest.java --- a/graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/BitOpsTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/BitOpsTest.java Wed May 27 00:36:16 2015 +0200 @@ -23,7 +23,13 @@ package com.oracle.graal.asm.amd64.test; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64RMOp.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize.*; import static com.oracle.jvmci.common.UnsafeAccess.*; @@ -36,8 +42,6 @@ import com.oracle.graal.amd64.*; import com.oracle.graal.amd64.AMD64.CPUFeature; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.test.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/IncrementDecrementMacroTest.java --- a/graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/IncrementDecrementMacroTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/IncrementDecrementMacroTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,13 @@ */ package com.oracle.graal.asm.amd64.test; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.jvmci.common.UnsafeAccess.*; import static org.junit.Assume.*; @@ -31,8 +37,6 @@ import org.junit.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.test.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/SimpleAssemblerTest.java --- a/graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/SimpleAssemblerTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/SimpleAssemblerTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,13 @@ */ package com.oracle.graal.asm.amd64.test; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Kind; import static org.junit.Assume.*; import java.nio.*; @@ -29,11 +36,9 @@ import org.junit.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CompilationResult.DataSectionReference; -import com.oracle.graal.api.code.DataSection.Data; -import com.oracle.graal.api.code.DataSection.DataBuilder; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CompilationResult.DataSectionReference; +import com.oracle.jvmci.code.DataSection.Data; +import com.oracle.jvmci.code.DataSection.DataBuilder; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.test.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64Address.java --- a/graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64Address.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64Address.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.asm.amd64; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.AbstractAddress; /** * Represents an address in target machine memory, specified via some combination of a base diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64Assembler.java --- a/graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64Assembler.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64Assembler.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,11 @@ */ package com.oracle.graal.asm.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.RegisterConfig; import static com.oracle.graal.amd64.AMD64.*; -import static com.oracle.graal.api.code.MemoryBarriers.*; +import static com.oracle.jvmci.code.MemoryBarriers.*; import static com.oracle.graal.asm.NumUtil.*; import static com.oracle.graal.asm.amd64.AMD64AsmOptions.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic.*; @@ -32,8 +35,7 @@ import com.oracle.graal.amd64.*; import com.oracle.graal.amd64.AMD64.CPUFeature; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.Register.RegisterCategory; +import com.oracle.jvmci.code.Register.RegisterCategory; import com.oracle.graal.asm.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64MacroAssembler.java --- a/graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64MacroAssembler.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64MacroAssembler.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,14 @@ */ package com.oracle.graal.asm.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.CalleeSaveLayout; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.asm.amd64.AMD64AsmOptions.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAddress.java --- a/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAddress.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAddress.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,10 @@ */ package com.oracle.graal.asm.sparc; +import com.oracle.jvmci.code.AbstractAddress; +import com.oracle.jvmci.code.Register; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.sparc.*; import com.oracle.jvmci.common.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java --- a/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,11 @@ */ package com.oracle.graal.asm.sparc; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; import static com.oracle.graal.asm.sparc.SPARCAssembler.CC.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.Op.*; @@ -31,8 +36,6 @@ import static com.oracle.graal.sparc.SPARC.*; import static java.lang.String.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.sparc.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCMacroAssembler.java --- a/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCMacroAssembler.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCMacroAssembler.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,16 @@ */ package com.oracle.graal.asm.sparc; +import com.oracle.jvmci.code.AbstractAddress; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.Register; import static com.oracle.graal.asm.sparc.SPARCAssembler.Annul.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag.*; import static com.oracle.graal.sparc.SPARC.*; import java.util.function.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.asm.*; import com.oracle.jvmci.common.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.asm.test/src/com/oracle/graal/asm/test/AssemblerTest.java --- a/graal/com.oracle.graal.asm.test/src/com/oracle/graal/asm/test/AssemblerTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.asm.test/src/com/oracle/graal/asm/test/AssemblerTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,21 @@ */ package com.oracle.graal.asm.test; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.DisassemblerProvider; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.InvalidInstalledCodeException; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.lang.reflect.*; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.phases.util.*; import com.oracle.graal.runtime.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.asm/src/com/oracle/graal/asm/Assembler.java --- a/graal/com.oracle.graal.asm/src/com/oracle/graal/asm/Assembler.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.asm/src/com/oracle/graal/asm/Assembler.java Wed May 27 00:36:16 2015 +0200 @@ -25,7 +25,7 @@ import java.nio.*; import java.util.*; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.*; /** * The platform-independent base class for the assembler. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/ConstantStackMoveTest.java --- a/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/ConstantStackMoveTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/ConstantStackMoveTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,14 @@ */ package com.oracle.graal.compiler.amd64.test; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.PrimitiveConstant; import static org.junit.Assume.*; import org.junit.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.framemap.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.jtt.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/StackStoreTest.java --- a/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/StackStoreTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/StackStoreTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,16 @@ */ package com.oracle.graal.compiler.amd64.test; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; import static org.junit.Assume.*; import org.junit.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.framemap.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.jtt.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java --- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Wed May 27 00:36:16 2015 +0200 @@ -23,7 +23,22 @@ package com.oracle.graal.compiler.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.code.VirtualStackSlot; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.LIRKind; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MOp.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64RMOp.*; @@ -35,8 +50,6 @@ import java.util.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.AMD64Address.Scale; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -23,13 +23,19 @@ package com.oracle.graal.compiler.amd64; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.LIRKind; import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64RMOp.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MIOp; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64RMOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/alloc/RegisterAllocationConfig.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/alloc/RegisterAllocationConfig.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/alloc/RegisterAllocationConfig.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,13 @@ */ package com.oracle.graal.compiler.common.alloc; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.PlatformKind; import static com.oracle.graal.compiler.common.GraalOptions.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/Condition.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/Condition.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/calc/Condition.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,11 @@ */ package com.oracle.graal.compiler.common.calc; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.UnsignedMath; +import com.oracle.jvmci.meta.PrimitiveConstant; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.Constant; import com.oracle.jvmci.common.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/spi/CodeGenProviders.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/spi/CodeGenProviders.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/spi/CodeGenProviders.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,10 @@ */ package com.oracle.graal.compiler.common.spi; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; /** * A set of providers which are required for LIR and/or code generation. Some may not be present diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/spi/LIRKindTool.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/spi/LIRKindTool.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/spi/LIRKindTool.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.compiler.common.spi; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.LIRKind; /** * This interface can be used to access platform and VM specific kinds. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/AbstractObjectStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/AbstractObjectStamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/AbstractObjectStamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,13 @@ */ package com.oracle.graal.compiler.common.type; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.Constant; import java.util.*; -import com.oracle.graal.api.meta.*; /** * Type describing all pointers to Java objects. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/AbstractPointerStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/AbstractPointerStamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/AbstractPointerStamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.compiler.common.type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Constant; /** * Abstract base class of all pointer types. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,12 @@ */ package com.oracle.graal.compiler.common.type; -import static com.oracle.graal.api.meta.MetaUtil.*; +import static com.oracle.jvmci.meta.MetaUtil.*; import java.util.*; import java.util.function.*; import java.util.stream.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp.Add; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp.And; @@ -48,6 +47,7 @@ import com.oracle.graal.compiler.common.type.ArithmeticOpTable.UnaryOp.Neg; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.UnaryOp.Not; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.UnaryOp.Sqrt; +import com.oracle.jvmci.meta.*; /** * Information about arithmetic operations. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticStamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticStamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.compiler.common.type; +import com.oracle.jvmci.meta.SerializableConstant; import java.nio.*; import java.util.*; -import com.oracle.graal.api.meta.*; /** * Type describing values that support arithmetic operations. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/FloatStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/FloatStamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/FloatStamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,19 @@ */ package com.oracle.graal.compiler.common.type; +import com.oracle.jvmci.meta.PrimitiveConstant; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.SerializableConstant; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.Constant; import static com.oracle.graal.compiler.common.calc.FloatConvert.*; import java.nio.*; import java.util.function.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.spi.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.FloatConvertOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,13 @@ */ package com.oracle.graal.compiler.common.type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.PrimitiveConstant; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.MemoryAccessProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.Constant; import com.oracle.graal.compiler.common.spi.*; import com.oracle.jvmci.common.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IntegerStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IntegerStamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IntegerStamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,20 @@ */ package com.oracle.graal.compiler.common.type; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.meta.PrimitiveConstant; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.SerializableConstant; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.Constant; import static com.oracle.graal.compiler.common.calc.FloatConvert.*; import java.nio.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.spi.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.FloatConvertOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ObjectStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ObjectStamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ObjectStamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,10 @@ */ package com.oracle.graal.compiler.common.type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.MemoryAccessProvider; +import com.oracle.jvmci.meta.Constant; import com.oracle.graal.compiler.common.spi.*; public class ObjectStamp extends AbstractObjectStamp { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/PrimitiveStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/PrimitiveStamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/PrimitiveStamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.compiler.common.type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.MemoryAccessProvider; +import com.oracle.jvmci.meta.Constant; /** * Type describing primitive values. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/Stamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/Stamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/Stamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,12 @@ */ package com.oracle.graal.compiler.common.type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.MemoryAccessProvider; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.MetaAccessProvider; import com.oracle.graal.compiler.common.spi.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampFactory.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampFactory.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampFactory.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,14 @@ */ package com.oracle.graal.compiler.common.type; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.Signature; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.MetaAccessProvider; import com.oracle.jvmci.common.*; public class StampFactory { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,12 @@ */ package com.oracle.graal.compiler.common.type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.MemoryAccessProvider; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.MetaAccessProvider; import com.oracle.graal.compiler.common.spi.*; import com.oracle.jvmci.common.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/util/Util.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/util/Util.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/util/Util.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,10 @@ */ package com.oracle.graal.compiler.common.util; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.code.BailoutException; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.jvmci.debug.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java --- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Wed May 27 00:36:16 2015 +0200 @@ -23,14 +23,22 @@ package com.oracle.graal.compiler.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.LIRKind; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.sparc.SPARCArithmetic.*; import static com.oracle.graal.lir.sparc.SPARCBitManipulationOp.IntrinsicOpcode.*; import static com.oracle.graal.lir.sparc.SPARCCompare.*; import static com.oracle.graal.lir.sparc.SPARCMathIntrinsicOp.IntrinsicOpcode.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCAssembler.CC; import com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCNodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCNodeLIRBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCNodeLIRBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -23,8 +23,11 @@ package com.oracle.graal.compiler.sparc; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.LIRKind; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.match.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CheckGraalInvariants.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CheckGraalInvariants.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CheckGraalInvariants.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,17 @@ */ package com.oracle.graal.compiler.test; +import com.oracle.jvmci.code.BailoutException; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaMethod; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.ExcludeFromIdentityComparisonVerification; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaField; import static com.oracle.jvmci.debug.DelegatingDebugConfig.Feature.*; import java.io.*; @@ -32,9 +43,7 @@ import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.Register.RegisterCategory; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.Register.RegisterCategory; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.*; import com.oracle.graal.compiler.CompilerThreadFactory.DebugConfigAccess; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CommonedConstantsTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CommonedConstantsTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CommonedConstantsTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.compiler.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.lang.reflect.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.phases.common.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConcreteSubtypeTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConcreteSubtypeTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConcreteSubtypeTest.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,8 @@ import org.junit.*; -import com.oracle.graal.api.meta.Assumptions.Assumption; -import com.oracle.graal.api.meta.Assumptions.ConcreteSubtype; +import com.oracle.jvmci.meta.Assumptions.Assumption; +import com.oracle.jvmci.meta.Assumptions.ConcreteSubtype; import com.oracle.graal.nodes.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ConditionTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.compiler.test; +import com.oracle.jvmci.meta.JavaConstant; import static org.junit.Assert.*; import java.util.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; public class ConditionTest { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FinalizableSubclassTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FinalizableSubclassTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FinalizableSubclassTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,15 +22,16 @@ */ package com.oracle.graal.compiler.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Assumptions; import java.io.*; import java.lang.reflect.*; import java.util.*; import org.junit.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.Assumption; -import com.oracle.graal.api.meta.Assumptions.NoFinalizableSubclass; +import com.oracle.jvmci.meta.Assumptions.Assumption; +import com.oracle.jvmci.meta.Assumptions.NoFinalizableSubclass; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.java.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FindUniqueConcreteMethodBugTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FindUniqueConcreteMethodBugTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FindUniqueConcreteMethodBugTest.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,8 @@ import org.junit.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; +import com.oracle.jvmci.meta.*; public class FindUniqueConcreteMethodBugTest extends GraalCompilerTest { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerAssumptionsTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerAssumptionsTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerAssumptionsTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,12 @@ */ package com.oracle.graal.compiler.test; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.Assumptions.Assumption; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Assumptions.Assumption; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,22 @@ */ package com.oracle.graal.compiler.test; -import static com.oracle.graal.api.code.CodeUtil.*; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.SpeculationLog; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ProfilingInfo; +import com.oracle.jvmci.meta.MetaAccessProvider; +import static com.oracle.jvmci.code.CodeUtil.*; import static com.oracle.graal.compiler.GraalCompiler.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.nodes.ConstantNode.*; @@ -35,10 +50,8 @@ import org.junit.*; import org.junit.internal.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.Type; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.api.directives.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraphEncoderTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraphEncoderTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraphEncoderTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.compiler.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.lang.reflect.*; import java.util.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; import com.oracle.graal.phases.common.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/InfopointReasonTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/InfopointReasonTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/InfopointReasonTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,18 +22,20 @@ */ package com.oracle.graal.compiler.test; -import static com.oracle.graal.api.code.CodeUtil.*; +import com.oracle.jvmci.code.InfopointReason; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import static com.oracle.jvmci.code.CodeUtil.*; import static com.oracle.graal.compiler.GraalCompiler.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static org.junit.Assert.*; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.code.CompilationResult.Call; -import com.oracle.graal.api.code.CompilationResult.Infopoint; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention.Type; +import com.oracle.jvmci.code.CompilationResult.Call; +import com.oracle.jvmci.code.CompilationResult.Infopoint; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/LockEliminationTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/LockEliminationTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/LockEliminationTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.compiler.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; import com.oracle.graal.nodes.java.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/LongNodeChainTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/LongNodeChainTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/LongNodeChainTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.compiler.test; +import com.oracle.jvmci.meta.JavaConstant; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; import com.oracle.graal.nodes.calc.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/MemoryArithmeticTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/MemoryArithmeticTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/MemoryArithmeticTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.compiler.test; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; public class MemoryArithmeticTest extends GraalCompilerTest { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ProfilingInfoTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ProfilingInfoTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ProfilingInfoTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,15 @@ */ package com.oracle.graal.compiler.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.TriState; +import com.oracle.jvmci.meta.ProfilingInfo; +import com.oracle.jvmci.meta.JavaTypeProfile; import java.io.*; import org.junit.*; -import com.oracle.graal.api.meta.*; /** * Tests profiling information provided by the runtime. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/PushNodesThroughPiTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/PushNodesThroughPiTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/PushNodesThroughPiTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,10 @@ */ package com.oracle.graal.compiler.test; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ResolvedJavaField; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/backend/AllocatorTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/backend/AllocatorTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/backend/AllocatorTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,13 @@ */ package com.oracle.graal.compiler.test.backend; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Value; import java.util.*; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.MoveOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/backend/BackendTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/backend/BackendTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/backend/BackendTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.compiler.test.backend; -import static com.oracle.graal.api.code.CodeUtil.*; - -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.Type; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.code.CallingConvention; +import static com.oracle.jvmci.code.CodeUtil.*; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.compiler.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.lir.gen.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/deopt/CompiledMethodTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/deopt/CompiledMethodTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/deopt/CompiledMethodTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,12 @@ */ package com.oracle.graal.compiler.test.deopt; +import com.oracle.jvmci.code.InvalidInstalledCodeException; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Kind; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/deopt/MonitorDeoptTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/deopt/MonitorDeoptTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/deopt/MonitorDeoptTest.java Wed May 27 00:36:16 2015 +0200 @@ -24,10 +24,11 @@ */ package com.oracle.graal.compiler.test.deopt; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EATestBase.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EATestBase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EATestBase.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,12 @@ */ package com.oracle.graal.compiler.test.ea; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.JavaConstant; import java.util.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EscapeAnalysisTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EscapeAnalysisTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/EscapeAnalysisTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.compiler.test.ea; +import com.oracle.jvmci.meta.JavaConstant; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.loop.phases.*; import com.oracle.graal.nodes.extended.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/UnsafeEATest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/UnsafeEATest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/ea/UnsafeEATest.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.compiler.test.ea; +import com.oracle.jvmci.meta.JavaConstant; import org.junit.*; import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; import com.oracle.jvmci.common.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/inlining/InliningTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/inlining/InliningTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/inlining/InliningTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.compiler.test.inlining; +import com.oracle.jvmci.code.InfopointReason; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.graph.*; import com.oracle.graal.graphbuilderconf.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/GraalTutorial.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/GraalTutorial.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/GraalTutorial.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,11 @@ */ package com.oracle.graal.compiler.test.tutorial; +import com.oracle.jvmci.code.InvalidInstalledCodeException; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.java.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/InvokeGraal.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/InvokeGraal.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/InvokeGraal.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,20 @@ */ package com.oracle.graal.compiler.test.tutorial; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.SpeculationLog; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ProfilingInfo; +import com.oracle.jvmci.meta.MetaAccessProvider; import java.lang.reflect.*; import java.util.concurrent.atomic.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.*; import com.oracle.graal.compiler.target.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/StaticAnalysis.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/StaticAnalysis.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/StaticAnalysis.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,14 @@ */ package com.oracle.graal.compiler.test.tutorial; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.MetaAccessProvider; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/StaticAnalysisTests.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/StaticAnalysisTests.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/tutorial/StaticAnalysisTests.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,15 @@ */ package com.oracle.graal.compiler.test.tutorial; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.MetaAccessProvider; import java.lang.reflect.*; import java.util.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.target.*; import com.oracle.graal.compiler.test.tutorial.StaticAnalysis.MethodState; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,19 @@ */ package com.oracle.graal.compiler; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.SpeculationLog; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.meta.Assumptions; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ProfilingInfo; +import com.oracle.jvmci.meta.TriState; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.DefaultProfilingInfo; +import com.oracle.jvmci.meta.VMConstant; import static com.oracle.graal.compiler.GraalCompiler.Options.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.compiler.common.alloc.RegisterAllocationConfig.*; @@ -29,10 +42,8 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CompilationResult.ConstantReference; -import com.oracle.graal.api.code.CompilationResult.DataPatch; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CompilationResult.ConstantReference; +import com.oracle.jvmci.code.CompilationResult.DataPatch; import com.oracle.graal.compiler.LIRGenerationPhase.LIRGenerationContext; import com.oracle.graal.compiler.common.alloc.*; import com.oracle.graal.compiler.common.cfg.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,12 @@ */ package com.oracle.graal.compiler; +import com.oracle.jvmci.code.BailoutException; +import com.oracle.jvmci.meta.JavaMethod; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.io.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.lir.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/LIRGenerationPhase.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/LIRGenerationPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/LIRGenerationPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.compiler; +import com.oracle.jvmci.code.TargetDescription; import static com.oracle.graal.compiler.common.GraalOptions.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.graph.*; import com.oracle.graal.lir.gen.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/MethodFilter.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/MethodFilter.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/MethodFilter.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,12 @@ */ package com.oracle.graal.compiler; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.JavaMethod; +import com.oracle.jvmci.meta.Signature; import java.util.*; import java.util.regex.*; -import com.oracle.graal.api.meta.*; /** * This class implements a method filter that can filter based on class name, method name and diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/BytecodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/BytecodeLIRBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/BytecodeLIRBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,15 @@ */ package com.oracle.graal.compiler.gen; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Signature; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import com.oracle.graal.lir.gen.*; public abstract class BytecodeLIRBuilder { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/BytecodeParserTool.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/BytecodeParserTool.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/BytecodeParserTool.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.compiler.gen; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; /** * visible interface of bytecode parsers. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,14 @@ */ package com.oracle.graal.compiler.gen; +import com.oracle.jvmci.code.BytecodeFrame; +import com.oracle.jvmci.code.VirtualObject; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; import java.util.*; import java.util.Map.Entry; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.lir.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,16 @@ */ package com.oracle.graal.compiler.gen; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.JavaConstant; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.compiler.GraalDebugConfig.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.lir.LIR.*; @@ -30,8 +39,6 @@ import java.util.*; import java.util.Map.Entry; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.common.type.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/ComplexMatchResult.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/ComplexMatchResult.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/ComplexMatchResult.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.compiler.match; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; import com.oracle.graal.compiler.gen.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/ComplexMatchValue.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/ComplexMatchValue.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/ComplexMatchValue.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.compiler.match; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AbstractValue; +import com.oracle.jvmci.meta.LIRKind; import com.oracle.graal.compiler.gen.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchStatement.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchStatement.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/MatchStatement.java Wed May 27 00:36:16 2015 +0200 @@ -26,13 +26,13 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.match.MatchPattern.MatchResultCode; import com.oracle.graal.compiler.match.MatchPattern.Result; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; /** * A named {@link MatchPattern} along with a {@link MatchGenerator} that can be evaluated to replace diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,18 @@ */ package com.oracle.graal.compiler.target; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.stack.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.stack.StackIntrospection; +import com.oracle.jvmci.code.DisassemblerProvider; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/spi/Canonicalizable.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/spi/Canonicalizable.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/spi/Canonicalizable.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.graph.spi; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; +import com.oracle.jvmci.meta.*; /** * Nodes can implement {@link Canonicalizable} or one of the two sub-interfaces {@link Unary} and diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graph/src/com/oracle/graal/graph/spi/CanonicalizerTool.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/spi/CanonicalizerTool.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/spi/CanonicalizerTool.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.graph.spi; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; import com.oracle.graal.graph.*; public interface CanonicalizerTool { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/ForeignCallPlugin.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/ForeignCallPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/ForeignCallPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,9 @@ */ package com.oracle.graal.graphbuilderconf; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ForeignCallDescriptor; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GenericInvocationPlugin.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GenericInvocationPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GenericInvocationPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.graphbuilderconf; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import com.oracle.graal.nodes.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderConfiguration.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderConfiguration.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderConfiguration.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.graphbuilderconf; +import com.oracle.jvmci.meta.ResolvedJavaType; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderContext.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderContext.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderContext.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,18 @@ */ package com.oracle.graal.graphbuilderconf; -import static com.oracle.graal.api.meta.DeoptimizationAction.*; -import static com.oracle.graal.api.meta.DeoptimizationReason.*; +import com.oracle.jvmci.code.BailoutException; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Assumptions; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaType; +import static com.oracle.jvmci.meta.DeoptimizationAction.*; +import static com.oracle.jvmci.meta.DeoptimizationReason.*; import static com.oracle.graal.compiler.common.type.StampFactory.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InlineInvokePlugin.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InlineInvokePlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InlineInvokePlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.graphbuilderconf; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.JavaType; import com.oracle.graal.nodes.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/IntrinsicContext.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/IntrinsicContext.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/IntrinsicContext.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.graphbuilderconf; -import static com.oracle.graal.api.code.BytecodeFrame.*; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import static com.oracle.jvmci.code.BytecodeFrame.*; import static com.oracle.graal.graphbuilderconf.IntrinsicContext.CompilationContext.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugin.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -25,10 +25,10 @@ import java.lang.invoke.*; import java.lang.reflect.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.type.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * Plugin for handling a specific method invocation. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/InvocationPlugins.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,16 @@ */ package com.oracle.graal.graphbuilderconf; +import com.oracle.jvmci.meta.MethodIdHolder; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.MethodIdMap; +import com.oracle.jvmci.meta.MetaAccessProvider; import static java.lang.String.*; import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.MethodIdMap.MethodKey; +import com.oracle.jvmci.meta.MethodIdMap.MethodKey; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/LoadFieldPlugin.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/LoadFieldPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/LoadFieldPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,10 @@ */ package com.oracle.graal.graphbuilderconf; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ResolvedJavaField; import com.oracle.graal.nodes.*; public interface LoadFieldPlugin extends GraphBuilderPlugin { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/LoadIndexedPlugin.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/LoadIndexedPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/LoadIndexedPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.graphbuilderconf; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.nodes.*; public interface LoadIndexedPlugin extends GraphBuilderPlugin { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/LoopExplosionPlugin.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/LoopExplosionPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/LoopExplosionPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.graphbuilderconf; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaMethod; public interface LoopExplosionPlugin extends GraphBuilderPlugin { boolean shouldExplodeLoops(ResolvedJavaMethod method); diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/MethodSubstitutionPlugin.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/MethodSubstitutionPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/MethodSubstitutionPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,14 @@ */ package com.oracle.graal.graphbuilderconf; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.MetaAccessProvider; import java.lang.reflect.*; import java.util.*; import java.util.stream.*; import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.jvmci.common.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/TypeCheckPlugin.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/TypeCheckPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/TypeCheckPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.graphbuilderconf; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.JavaTypeProfile; import com.oracle.graal.nodes.*; public interface TypeCheckPlugin extends GraphBuilderPlugin { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java --- a/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,19 @@ */ package com.oracle.graal.hotspot.amd64.test; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.amd64.AMD64.*; import java.util.*; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.compiler.test.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/CompressedNullCheckTest.java --- a/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/CompressedNullCheckTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/CompressedNullCheckTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.amd64.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/DataPatchInConstantsTest.java --- a/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/DataPatchInConstantsTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/DataPatchInConstantsTest.java Wed May 27 00:36:16 2015 +0200 @@ -23,13 +23,14 @@ package com.oracle.graal.hotspot.amd64.test; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Constant; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import org.junit.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.graph.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64DeoptimizationStub.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64DeoptimizationStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64DeoptimizationStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,11 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.TargetDescription; import static com.oracle.graal.amd64.AMD64.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Wed May 27 00:36:16 2015 +0200 @@ -22,17 +22,23 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.CalleeSaveLayout; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.graal.amd64.AMD64.*; -import static com.oracle.graal.api.code.CallingConvention.Type.*; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.CallingConvention.Type.*; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.jvmci.common.UnsafeAccess.*; import java.util.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.ConditionFlag; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,15 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.Value; import static com.oracle.jvmci.hotspot.InitTimer.*; import java.util.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBinaryConsumer.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBinaryConsumer.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBinaryConsumer.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.meta.AllocatableValue; import static com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MIOp; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBytecodeLIRBuilder.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBytecodeLIRBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBytecodeLIRBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,19 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Signature; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.amd64.AMD64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.hotspot.amd64.AMD64HotSpotLIRGenerator.SaveRbp; import com.oracle.graal.lir.StandardOp.NoOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.amd64; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.Register; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.Register; import static com.oracle.graal.amd64.AMD64.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableAddressOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableAddressOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableAddressOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,10 @@ */ package com.oracle.graal.hotspot.amd64; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableShiftOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableShiftOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCardTableShiftOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,10 @@ */ package com.oracle.graal.hotspot.amd64; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCounterOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCounterOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCounterOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,14 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.meta.Value; import static com.oracle.graal.amd64.AMD64.*; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.jvmci.common.JVMCIError.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotEnterUnpackFramesStackFrameOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotEnterUnpackFramesStackFrameOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotEnterUnpackFramesStackFrameOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,15 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.RegisterSaveLayout; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.amd64.AMD64.*; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotEpilogueOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotEpilogueOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotEpilogueOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,14 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.amd64.AMD64.*; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,18 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.amd64.AMD64.*; -import static com.oracle.graal.api.code.CallingConvention.Type.*; -import static com.oracle.graal.api.meta.LocationIdentity.*; -import static com.oracle.graal.api.meta.Value.*; +import static com.oracle.jvmci.code.CallingConvention.Type.*; +import static com.oracle.jvmci.meta.LocationIdentity.*; +import static com.oracle.jvmci.meta.Value.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.hotspot.HotSpotBackend.Options.*; import static com.oracle.graal.hotspot.HotSpotForeignCallLinkage.*; @@ -34,8 +42,6 @@ import static com.oracle.graal.hotspot.HotSpotHostBackend.*; import static com.oracle.graal.hotspot.replacements.CRC32Substitutions.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.jvmci.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.AllocatableValue; import static com.oracle.graal.amd64.AMD64.*; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.ConditionFlag; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerationResult.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerationResult.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerationResult.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.StackSlot; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,23 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.VirtualStackSlot; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.DeoptimizationAction; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.PrimitiveConstant; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.amd64.AMD64.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64RMOp.*; @@ -31,8 +48,6 @@ import java.util.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MIOp; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; import com.oracle.graal.compiler.amd64.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,12 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.RegisterSaveLayout; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.amd64.AMD64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.SaveRegistersOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.AllocatableValue; import static com.oracle.graal.amd64.AMD64.*; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLeaveUnpackFramesStackFrameOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLeaveUnpackFramesStackFrameOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLeaveUnpackFramesStackFrameOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,10 @@ */ package com.oracle.graal.hotspot.amd64; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.RegisterSaveLayout; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLoweringProvider.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLoweringProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLoweringProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,9 @@ */ package com.oracle.graal.hotspot.amd64; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMove.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMove.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMove.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,14 @@ */ package com.oracle.graal.hotspot.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.ConditionFlag; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,24 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.code.BytecodeFrame; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.amd64.AMD64.*; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64RMOp; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.meta.AllocatableValue; import static com.oracle.graal.amd64.AMD64.*; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.AllocatableValue; import static com.oracle.graal.amd64.AMD64.*; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterConfig.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterConfig.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterConfig.java Wed May 27 00:36:16 2015 +0200 @@ -22,15 +22,26 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.RegisterAttributes; +import com.oracle.jvmci.code.CalleeSaveLayout; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.amd64.AMD64.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import java.util.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.compiler.common.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotReturnOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotReturnOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotReturnOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Value; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.BlockEndOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotSafepointOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotSafepointOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotSafepointOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,18 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.InfopointReason; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.amd64.AMD64.*; import static com.oracle.graal.asm.NumUtil.*; import static com.oracle.graal.compiler.common.GraalOptions.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotUnwindOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotUnwindOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotUnwindOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,15 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.code.CallingConvention; import static com.oracle.graal.amd64.AMD64.*; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectStaticCallOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectStaticCallOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectStaticCallOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.hotspot.amd64; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.AMD64Call.DirectCallOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,9 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.AMD64Call.DirectCallOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64IndirectCallOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64IndirectCallOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64IndirectCallOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,13 @@ */ package com.oracle.graal.hotspot.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64RawNativeCallNode.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64RawNativeCallNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64RawNativeCallNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,13 @@ */ package com.oracle.graal.hotspot.amd64; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.compiler.amd64.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64TailcallOp.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64TailcallOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64TailcallOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,14 @@ */ package com.oracle.graal.hotspot.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; import com.oracle.graal.lir.asm.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Performs a hard-coded tail call to the specified target, which normally should be an diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64UncommonTrapStub.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64UncommonTrapStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64UncommonTrapStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,11 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.TargetDescription; import static com.oracle.graal.amd64.AMD64.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/jvmci/AMD64HotSpotJVMCIBackendFactory.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/jvmci/AMD64HotSpotJVMCIBackendFactory.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/jvmci/AMD64HotSpotJVMCIBackendFactory.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,15 @@ */ package com.oracle.graal.hotspot.amd64.jvmci; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.meta.ConstantReflectionProvider; import static com.oracle.jvmci.hotspot.InitTimer.*; import java.util.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.amd64.*; import com.oracle.graal.hotspot.meta.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCDeoptimizationStub.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCDeoptimizationStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCDeoptimizationStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,11 @@ */ package com.oracle.graal.hotspot.sparc; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.Register; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,15 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.api.code.CallingConvention.Type.*; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.JavaType; +import static com.oracle.jvmci.code.CallingConvention.Type.*; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.Annul.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.BranchPredict.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.CC.*; @@ -34,8 +41,6 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.ScratchRegister; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackendFactory.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackendFactory.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackendFactory.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,12 @@ */ package com.oracle.graal.hotspot.sparc; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Value; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,13 @@ */ package com.oracle.graal.hotspot.sparc; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Value; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,13 @@ */ package com.oracle.graal.hotspot.sparc; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Value; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCounterOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCounterOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCounterOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,12 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.ScratchRegister; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.sparc; +import com.oracle.jvmci.code.Register; import static com.oracle.graal.hotspot.HotSpotHostBackend.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.ScratchRegister; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotEnterUnpackFramesStackFrameOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotEnterUnpackFramesStackFrameOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotEnterUnpackFramesStackFrameOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,16 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.api.meta.LocationIdentity.*; -import static com.oracle.graal.api.meta.Value.*; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.meta.LocationIdentity.*; +import static com.oracle.jvmci.meta.Value.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.hotspot.HotSpotBackend.Options.*; import static com.oracle.graal.hotspot.HotSpotForeignCallLinkage.*; @@ -32,8 +40,6 @@ import static com.oracle.graal.hotspot.HotSpotHostBackend.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.jvmci.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCAssembler.CC; import com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerationResult.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerationResult.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerationResult.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.sparc; +import com.oracle.jvmci.code.StackSlot; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.SaveRegistersOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Wed May 27 00:36:16 2015 +0200 @@ -22,15 +22,28 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.code.VirtualStackSlot; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.DeoptimizationAction; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static com.oracle.graal.sparc.SPARC.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.spi.*; import com.oracle.graal.compiler.sparc.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveUnpackFramesStackFrameOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveUnpackFramesStackFrameOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveUnpackFramesStackFrameOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.sparc; +import com.oracle.jvmci.code.Register; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLoweringProvider.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLoweringProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLoweringProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,9 @@ */ package com.oracle.graal.hotspot.sparc; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotMove.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotMove.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotMove.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,15 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCAssembler.Annul; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,20 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.BytecodeFrame; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.sparc.*; import com.oracle.graal.graph.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotRegisterConfig.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotRegisterConfig.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotRegisterConfig.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,24 @@ */ package com.oracle.graal.hotspot.sparc; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.CalleeSaveLayout; +import com.oracle.jvmci.code.RegisterAttributes; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; import static com.oracle.graal.sparc.SPARC.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.asm.*; import com.oracle.graal.lir.framemap.*; import com.oracle.graal.sparc.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotReturnOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotReturnOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotReturnOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.sparc; +import com.oracle.jvmci.meta.Value; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotSafepointOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotSafepointOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotSafepointOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,13 @@ */ package com.oracle.graal.hotspot.sparc; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.InfopointReason; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.AllocatableValue; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Setx; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotUnwindOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotUnwindOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotUnwindOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,15 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.hotspot.sparc; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Value; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,11 @@ */ package com.oracle.graal.hotspot.sparc; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Value; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Setx; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCIndirectCallOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCIndirectCallOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCIndirectCallOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,13 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCUncommonTrapStub.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCUncommonTrapStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCUncommonTrapStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,11 @@ */ package com.oracle.graal.hotspot.sparc; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.Register; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/jvmci/SPARCHotSpotJVMCIBackendFactory.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/jvmci/SPARCHotSpotJVMCIBackendFactory.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/jvmci/SPARCHotSpotJVMCIBackendFactory.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,13 @@ */ package com.oracle.graal.hotspot.sparc.jvmci; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.RegisterConfig; import static com.oracle.jvmci.hotspot.InitTimer.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.sparc.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,16 +22,18 @@ */ package com.oracle.graal.hotspot.test; -import static com.oracle.graal.api.code.CodeUtil.*; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import static com.oracle.jvmci.code.CodeUtil.*; import static com.oracle.graal.compiler.GraalCompiler.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.nodes.ConstantNode.*; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.test.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ArrayCopyIntrinsificationTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ArrayCopyIntrinsificationTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ArrayCopyIntrinsificationTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,14 @@ */ package com.oracle.graal.hotspot.test; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.JavaMethod; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.lang.reflect.*; import java.util.*; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.replacements.arraycopy.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CompressedOopTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CompressedOopTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CompressedOopTest.java Wed May 27 00:36:16 2015 +0200 @@ -23,12 +23,12 @@ package com.oracle.graal.hotspot.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.util.*; import java.util.concurrent.atomic.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.jvmci.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ExplicitExceptionTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ExplicitExceptionTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ExplicitExceptionTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.hotspot.test; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.extended.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ForeignCallDeoptimizeTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ForeignCallDeoptimizeTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/ForeignCallDeoptimizeTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.test; +import com.oracle.jvmci.meta.ForeignCallDescriptor; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.test.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,9 @@ */ package com.oracle.graal.hotspot.test; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.graal.graphbuilderconf.IntrinsicContext.CompilationContext.*; import java.io.*; @@ -32,8 +35,6 @@ import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.hotspot.meta.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotMonitorValueTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotMonitorValueTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotMonitorValueTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,11 @@ */ package com.oracle.graal.hotspot.test; +import com.oracle.jvmci.code.StackLockValue; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.BytecodeFrame; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static org.hamcrest.CoreMatchers.*; import static org.junit.Assert.*; @@ -29,10 +34,8 @@ import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CompilationResult.Call; -import com.oracle.graal.api.code.CompilationResult.Infopoint; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CompilationResult.Call; +import com.oracle.jvmci.code.CompilationResult.Infopoint; import com.oracle.graal.compiler.test.*; import com.oracle.jvmci.common.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotNmethodTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotNmethodTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotNmethodTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.hotspot.test; +import com.oracle.jvmci.code.InvalidInstalledCodeException; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; import com.oracle.jvmci.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotResolvedJavaFieldTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotResolvedJavaFieldTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotResolvedJavaFieldTest.java Wed May 27 00:36:16 2015 +0200 @@ -28,8 +28,8 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.jvmci.hotspot.*; +import com.oracle.jvmci.meta.*; /** * Tests {@link HotSpotResolvedJavaField} functionality. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/InstalledCodeExecuteHelperTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/InstalledCodeExecuteHelperTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/InstalledCodeExecuteHelperTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,14 @@ */ package com.oracle.graal.hotspot.test; +import com.oracle.jvmci.code.InvalidInstalledCodeException; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static java.lang.reflect.Modifier.*; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/LoadJavaMirrorWithKlassTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/LoadJavaMirrorWithKlassTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/LoadJavaMirrorWithKlassTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.hotspot.test; +import com.oracle.jvmci.meta.Kind; import java.util.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierAdditionTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.hotspot.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.jvmci.common.UnsafeAccess.*; import java.lang.ref.*; @@ -30,7 +31,6 @@ import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/WriteBarrierVerificationTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.hotspot.test; +import com.oracle.jvmci.meta.LocationIdentity; import java.util.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,15 @@ */ package com.oracle.graal.hotspot; -import static com.oracle.graal.api.code.CallingConvention.Type.*; -import static com.oracle.graal.api.code.CodeUtil.*; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.BailoutException; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ProfilingInfo; +import static com.oracle.jvmci.code.CallingConvention.Type.*; +import static com.oracle.jvmci.code.CodeUtil.*; import static com.oracle.graal.compiler.GraalCompiler.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; @@ -36,9 +43,7 @@ import java.lang.management.*; import java.util.concurrent.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.api.runtime.*; import com.oracle.graal.hotspot.events.*; import com.oracle.graal.hotspot.events.EventProvider.CompilationEvent; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompileTheWorld.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,11 @@ */ package com.oracle.graal.hotspot; +import com.oracle.jvmci.meta.TriState; +import com.oracle.jvmci.meta.DefaultProfilingInfo; +import com.oracle.jvmci.meta.ConstantPool; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ProfilingInfo; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static com.oracle.graal.nodes.StructuredGraph.*; @@ -36,7 +41,6 @@ import java.util.jar.*; import java.util.stream.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.bytecode.*; import com.oracle.graal.compiler.*; import com.oracle.graal.compiler.CompilerThreadFactory.DebugConfigAccess; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotBackend.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotBackend.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotBackend.java Wed May 27 00:36:16 2015 +0200 @@ -26,9 +26,6 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.stack.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.target.*; import com.oracle.graal.hotspot.meta.*; @@ -45,7 +42,10 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.phases.tiers.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.code.stack.*; import com.oracle.jvmci.hotspot.*; +import com.oracle.jvmci.meta.*; import com.oracle.jvmci.options.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompiledRuntimeStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompiledRuntimeStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompiledRuntimeStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.hotspot; +import com.oracle.jvmci.code.CompilationResult; import static com.oracle.graal.hotspot.HotSpotHostBackend.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CompilationResult.Call; -import com.oracle.graal.api.code.CompilationResult.ConstantReference; -import com.oracle.graal.api.code.CompilationResult.DataPatch; -import com.oracle.graal.api.code.CompilationResult.Infopoint; +import com.oracle.jvmci.code.CompilationResult.Call; +import com.oracle.jvmci.code.CompilationResult.ConstantReference; +import com.oracle.jvmci.code.CompilationResult.DataPatch; +import com.oracle.jvmci.code.CompilationResult.Infopoint; import com.oracle.jvmci.hotspot.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCounterOp.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCounterOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCounterOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,15 @@ */ package com.oracle.graal.hotspot; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.hotspot.debug.*; import com.oracle.graal.hotspot.meta.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugInfoBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,12 @@ */ package com.oracle.graal.hotspot; -import static com.oracle.graal.api.code.BytecodeFrame.*; - -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.code.StackLockValue; +import com.oracle.jvmci.code.BytecodeFrame; +import com.oracle.jvmci.code.VirtualObject; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.BytecodeFrame.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotForeignCallLinkage.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotForeignCallLinkage.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotForeignCallLinkage.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,12 @@ */ package com.oracle.graal.hotspot; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.InvokeTarget; +import com.oracle.jvmci.meta.ForeignCallDescriptor; import com.oracle.graal.compiler.target.*; import com.oracle.graal.hotspot.stubs.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotForeignCallLinkageImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotForeignCallLinkageImpl.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotForeignCallLinkageImpl.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,24 @@ */ package com.oracle.graal.hotspot; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.ForeignCallDescriptor; import static com.oracle.graal.hotspot.HotSpotForeignCallLinkage.RegisterEffect.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.compiler.target.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,12 @@ */ package com.oracle.graal.hotspot; +import com.oracle.jvmci.code.stack.InspectedFrameVisitor; +import com.oracle.jvmci.code.stack.StackIntrospection; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.compiler.GraalDebugConfig.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.Options.*; @@ -31,10 +37,7 @@ import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.stack.*; import com.oracle.graal.api.collections.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.target.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntimeProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntimeProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntimeProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,10 @@ */ package com.oracle.graal.hotspot; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.stack.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.stack.StackIntrospection; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.ResolvedJavaType; import com.oracle.graal.api.runtime.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.runtime.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotHostBackend.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotHostBackend.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotHostBackend.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,11 @@ */ package com.oracle.graal.hotspot; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ForeignCallDescriptor; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.jvmci.hotspot.InitTimer.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.nodes.spi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotInstructionProfiling.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotInstructionProfiling.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotInstructionProfiling.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,11 @@ */ package com.oracle.graal.hotspot; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Value; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.Assembler.InstructionCounter; import com.oracle.graal.compiler.common.cfg.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotLIRGenerator.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotLIRGenerator.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,10 @@ */ package com.oracle.graal.hotspot; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.DeoptimizationAction; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.nodes.*; import com.oracle.graal.lir.StandardOp.SaveRegistersOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotLockStack.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotLockStack.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotLockStack.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.hotspot; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.meta.LIRKind; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.framemap.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReplacementsImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReplacementsImpl.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReplacementsImpl.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.hotspot; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.lang.reflect.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.hotspot.word.*; import com.oracle.graal.phases.util.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotTargetDescription.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotTargetDescription.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotTargetDescription.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.hotspot; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.code.ReferenceMap; import com.oracle.jvmci.hotspot.*; public class HotSpotTargetDescription extends TargetDescription { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,18 @@ */ package com.oracle.graal.hotspot.meta; -import static com.oracle.graal.api.meta.LocationIdentity.*; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.meta.LocationIdentity.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.hotspot.meta.HotSpotForeignCallsProviderImpl.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; @@ -30,8 +41,6 @@ import java.lang.ref.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotDisassemblerProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotDisassemblerProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotDisassemblerProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.hotspot.meta; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.DisassemblerProvider; +import com.oracle.jvmci.code.InstalledCode; import com.oracle.graal.hotspot.*; import com.oracle.jvmci.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotForeignCallsProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotForeignCallsProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.hotspot.meta; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.Value; /** * HotSpot extension of {@link ForeignCallsProvider}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotForeignCallsProviderImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotForeignCallsProviderImpl.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotForeignCallsProviderImpl.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,17 @@ */ package com.oracle.graal.hotspot.meta; -import static com.oracle.graal.api.code.CallingConvention.Type.*; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import static com.oracle.jvmci.code.CallingConvention.Type.*; import static com.oracle.graal.hotspot.HotSpotForeignCallLinkage.RegisterEffect.*; import static com.oracle.graal.hotspot.HotSpotForeignCallLinkage.Transition.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.HotSpotForeignCallLinkage.RegisterEffect; import com.oracle.graal.hotspot.HotSpotForeignCallLinkage.Transition; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraalConstantReflectionProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraalConstantReflectionProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraalConstantReflectionProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,11 @@ */ package com.oracle.graal.hotspot.meta; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.JavaField; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static com.oracle.graal.hotspot.meta.HotSpotGraalConstantReflectionProvider.ImmutableCodeLazy.*; @@ -29,7 +34,6 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.replacements.*; import com.oracle.graal.replacements.SnippetTemplate.Arguments; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraphBuilderPlugins.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraphBuilderPlugins.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotGraphBuilderPlugins.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,12 @@ */ package com.oracle.graal.hotspot.meta; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.hotspot.replacements.SystemSubstitutions.*; @@ -30,8 +36,6 @@ import sun.reflect.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotHostForeignCallsProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.hotspot.meta; -import static com.oracle.graal.api.code.CallingConvention.Type.*; -import static com.oracle.graal.api.meta.LocationIdentity.*; import static com.oracle.graal.compiler.target.Backend.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.hotspot.HotSpotBackend.Options.*; @@ -45,16 +43,18 @@ import static com.oracle.graal.hotspot.stubs.UnwindExceptionToCallerStub.*; import static com.oracle.graal.nodes.java.ForeignCallDescriptors.*; import static com.oracle.graal.replacements.Log.*; +import static com.oracle.jvmci.code.CallingConvention.Type.*; +import static com.oracle.jvmci.meta.LocationIdentity.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.hotspot.*; +import com.oracle.jvmci.meta.*; /** * HotSpot implementation of {@link ForeignCallsProvider}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInvocationPlugins.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInvocationPlugins.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotInvocationPlugins.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.hotspot.meta; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoadFieldPlugin.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoadFieldPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoadFieldPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,13 @@ */ package com.oracle.graal.hotspot.meta; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ConstantReflectionProvider; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.hotspot.meta.HotSpotGraalConstantReflectionProvider.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoadIndexedPlugin.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoadIndexedPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoadIndexedPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.hotspot.meta; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.hotspot.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.meta; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodHandleAccessProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodHandleAccessProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodHandleAccessProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,16 @@ */ package com.oracle.graal.hotspot.meta; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.MethodHandleAccessProvider; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static com.oracle.jvmci.hotspot.HotSpotResolvedJavaType.*; import static com.oracle.jvmci.hotspot.HotSpotResolvedObjectTypeImpl.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.hotspot.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotParameterPlugin.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotParameterPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotParameterPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.meta; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaType; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotProviders.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotProviders.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotProviders.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.hotspot.meta; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ConstantReflectionProvider; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.hotspot.word.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRegisters.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRegisters.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRegisters.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.meta; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.Register; public class HotSpotRegisters implements HotSpotRegistersProvider { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRegistersProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRegistersProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRegistersProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.meta; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.Register; /** * Special registers reserved by HotSpot for frequently used values. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntimeStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntimeStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntimeStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.hotspot.meta; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.hotspot.stubs.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.hotspot.*; +import com.oracle.jvmci.meta.*; /** * Implementation of {@link InstalledCode} for code installed as a RuntimeStub. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSnippetReflectionProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSnippetReflectionProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSnippetReflectionProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,10 @@ */ package com.oracle.graal.hotspot.meta; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.api.replacements.*; import com.oracle.graal.hotspot.*; import com.oracle.jvmci.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotWordOperationPlugin.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotWordOperationPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotWordOperationPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,12 @@ */ package com.oracle.graal.hotspot.meta; -import static com.oracle.graal.api.meta.LocationIdentity.*; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.meta.LocationIdentity.*; import static com.oracle.graal.hotspot.word.HotSpotOperation.HotspotOpcode.*; import static com.oracle.graal.nodes.ConstantNode.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graphbuilderconf.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/AllocaNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/AllocaNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/AllocaNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,11 @@ */ package com.oracle.graal.hotspot.nodes; +import com.oracle.jvmci.code.VirtualStackSlot; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.Kind; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/BeginLockScopeNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/BeginLockScopeNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/BeginLockScopeNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,9 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LocationIdentity; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CStringNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CStringNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CStringNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.AllocatableValue; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassCastNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassCastNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/ClassCastNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,11 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.Assumptions; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CompressionNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CompressionNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CompressionNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,10 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.Constant; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentJavaThreadNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentJavaThreadNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentJavaThreadNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,9 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentLockNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentLockNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentLockNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.meta.Value; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DeoptimizationFetchUnrollInfoCallNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DeoptimizationFetchUnrollInfoCallNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DeoptimizationFetchUnrollInfoCallNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,12 @@ */ package com.oracle.graal.hotspot.nodes; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.hotspot.HotSpotBackend.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DeoptimizeCallerNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DeoptimizeCallerNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DeoptimizeCallerNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.DeoptimizationAction; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DimensionsNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DimensionsNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DimensionsNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.hotspot.nodes; +import com.oracle.jvmci.code.VirtualStackSlot; +import com.oracle.jvmci.meta.Value; import static com.oracle.graal.asm.NumUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.lir.gen.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DirectCompareAndSwapNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DirectCompareAndSwapNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/DirectCompareAndSwapNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.LocationIdentity; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/EndLockScopeNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/EndLockScopeNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/EndLockScopeNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.LocationIdentity; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/EnterUnpackFramesStackFrameNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/EnterUnpackFramesStackFrameNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/EnterUnpackFramesStackFrameNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/GetObjectAddressNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/GetObjectAddressNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/GetObjectAddressNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotDirectCallTargetNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotDirectCallTargetNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotDirectCallTargetNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,11 @@ */ package com.oracle.graal.hotspot.nodes; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.util.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotIndirectCallTargetNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotIndirectCallTargetNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/HotSpotIndirectCallTargetNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,11 @@ */ package com.oracle.graal.hotspot.nodes; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.util.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/LeaveDeoptimizedStackFrameNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/LeaveDeoptimizedStackFrameNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/LeaveDeoptimizedStackFrameNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/LoadIndexedPointerNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/LoadIndexedPointerNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/LoadIndexedPointerNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorCounterNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorCounterNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/MonitorCounterNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.hotspot.nodes; +import com.oracle.jvmci.code.VirtualStackSlot; +import com.oracle.jvmci.meta.Value; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/PushInterpreterFrameNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/PushInterpreterFrameNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/PushInterpreterFrameNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/SaveAllRegistersNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/SaveAllRegistersNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/SaveAllRegistersNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/StubForeignCallNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/StubForeignCallNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/StubForeignCallNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,14 @@ */ package com.oracle.graal.hotspot.nodes; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import com.oracle.jvmci.meta.Kind; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.replacements.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/UncommonTrapCallNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/UncommonTrapCallNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/UncommonTrapCallNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,12 @@ */ package com.oracle.graal.hotspot.nodes; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.hotspot.HotSpotBackend.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VMErrorNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VMErrorNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/VMErrorNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,14 @@ */ package com.oracle.graal.hotspot.nodes; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.meta.MetaUtil; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.hotspot.nodes.CStringNode.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/KlassPointerStamp.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/KlassPointerStamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/KlassPointerStamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,14 @@ */ package com.oracle.graal.hotspot.nodes.type; +import com.oracle.jvmci.meta.MemoryAccessProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Constant; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.spi.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.jvmci.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/MetaspacePointerStamp.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/MetaspacePointerStamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/MetaspacePointerStamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.hotspot.nodes.type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LIRKind; import com.oracle.graal.compiler.common.spi.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.jvmci.common.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/MethodPointerStamp.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/MethodPointerStamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/MethodPointerStamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,10 @@ */ package com.oracle.graal.hotspot.nodes.type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.MemoryAccessProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Constant; import com.oracle.graal.compiler.common.type.*; import com.oracle.jvmci.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/NarrowOopStamp.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/NarrowOopStamp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/NarrowOopStamp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,12 @@ */ package com.oracle.graal.hotspot.nodes.type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.MemoryAccessProvider; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.spi.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.jvmci.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.phases; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.nodes.ConstantNode.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.type.*; import com.oracle.graal.phases.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/LoadJavaMirrorWithKlassPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,14 @@ */ package com.oracle.graal.hotspot.phases; -import static com.oracle.graal.api.meta.LocationIdentity.*; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import static com.oracle.jvmci.meta.LocationIdentity.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.nodes.ConstantNode.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.nodes.*; import com.oracle.graal.hotspot.nodes.type.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/OnStackReplacementPhase.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/OnStackReplacementPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/OnStackReplacementPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.phases; +import com.oracle.jvmci.code.BailoutException; import static com.oracle.graal.phases.common.DeadCodeEliminationPhase.Optionality.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.loop.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AESCryptSubstitutions.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,14 @@ */ package com.oracle.graal.hotspot.replacements; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.word.Word.*; import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; import com.oracle.graal.hotspot.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AssertionSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AssertionSnippets.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AssertionSnippets.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.hotspot.replacements; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.ForeignCallDescriptor; import static com.oracle.graal.hotspot.nodes.CStringNode.*; import static com.oracle.graal.replacements.SnippetTemplate.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; import com.oracle.graal.hotspot.meta.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CRC32Substitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CRC32Substitutions.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CRC32Substitutions.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,13 @@ */ package com.oracle.graal.hotspot.replacements; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import java.util.zip.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CallSiteTargetNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,11 @@ */ package com.oracle.graal.hotspot.replacements; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Assumptions; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CardTableAddressNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CardTableAddressNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CardTableAddressNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.hotspot.replacements; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CardTableShiftNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CardTableShiftNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CardTableShiftNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.replacements; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CheckCastDynamicSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CheckCastDynamicSnippets.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CheckCastDynamicSnippets.java Wed May 27 00:36:16 2015 +0200 @@ -22,15 +22,15 @@ */ package com.oracle.graal.hotspot.replacements; -import static com.oracle.graal.api.meta.DeoptimizationAction.*; -import static com.oracle.graal.api.meta.DeoptimizationReason.*; +import com.oracle.jvmci.code.TargetDescription; +import static com.oracle.jvmci.meta.DeoptimizationAction.*; +import static com.oracle.jvmci.meta.DeoptimizationReason.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.hotspot.replacements.TypeCheckSnippetUtils.*; import static com.oracle.graal.nodes.PiNode.*; import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; import static com.oracle.graal.replacements.SnippetTemplate.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CipherBlockChainingSubstitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CipherBlockChainingSubstitutions.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/CipherBlockChainingSubstitutions.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,13 @@ */ package com.oracle.graal.hotspot.replacements; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ClassGetHubNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ClassGetHubNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ClassGetHubNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,11 @@ */ package com.oracle.graal.hotspot.replacements; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Constant; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,17 @@ */ package com.oracle.graal.hotspot.replacements; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.meta.NamedLocationIdentity; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static com.oracle.graal.hotspot.meta.HotSpotForeignCallsProviderImpl.*; import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; import static com.oracle.jvmci.common.UnsafeAccess.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotSubstitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotSubstitutions.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotSubstitutions.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.hotspot.replacements; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.MetaAccessProvider; import sun.misc.*; import sun.reflect.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.replacements.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HubGetClassNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HubGetClassNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HubGetClassNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,11 @@ */ package com.oracle.graal.hotspot.replacements; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Constant; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/IdentityHashCodeNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/IdentityHashCodeNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/IdentityHashCodeNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,12 @@ */ package com.oracle.graal.hotspot.replacements; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.graal.compiler.common.GraalOptions.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/InstanceOfSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/InstanceOfSnippets.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/InstanceOfSnippets.java Wed May 27 00:36:16 2015 +0200 @@ -22,15 +22,20 @@ */ package com.oracle.graal.hotspot.replacements; -import static com.oracle.graal.api.meta.DeoptimizationAction.*; -import static com.oracle.graal.api.meta.DeoptimizationReason.*; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.TypeCheckHints; +import com.oracle.jvmci.meta.TriState; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.Assumptions; +import com.oracle.jvmci.meta.DeoptimizationAction; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.meta.DeoptimizationAction.*; +import static com.oracle.jvmci.meta.DeoptimizationReason.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.hotspot.replacements.InstanceOfSnippets.Options.*; import static com.oracle.graal.hotspot.replacements.TypeCheckSnippetUtils.*; import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/KlassLayoutHelperNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/KlassLayoutHelperNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/KlassLayoutHelperNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.hotspot.replacements; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/LoadExceptionObjectSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/LoadExceptionObjectSnippets.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/LoadExceptionObjectSnippets.java Wed May 27 00:36:16 2015 +0200 @@ -27,7 +27,6 @@ import static com.oracle.graal.nodes.PiNode.*; import static com.oracle.graal.replacements.SnippetTemplate.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.nodes.*; @@ -41,6 +40,7 @@ import com.oracle.graal.replacements.SnippetTemplate.SnippetInfo; import com.oracle.graal.replacements.nodes.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.code.*; /** * Snippet for loading the exception object at the start of an exception dispatcher. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/MonitorSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/MonitorSnippets.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/MonitorSnippets.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,17 @@ */ package com.oracle.graal.hotspot.replacements; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.BytecodeFrame; +import com.oracle.jvmci.meta.NamedLocationIdentity; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.DeoptimizationAction; +import com.oracle.jvmci.meta.ForeignCallDescriptor; import static com.oracle.graal.hotspot.nodes.BeginLockScopeNode.*; import static com.oracle.graal.hotspot.nodes.DirectCompareAndSwapNode.*; import static com.oracle.graal.hotspot.nodes.EndLockScopeNode.*; @@ -32,8 +43,6 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/NewObjectSnippets.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,15 @@ */ package com.oracle.graal.hotspot.replacements; -import static com.oracle.graal.api.code.UnsignedMath.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.NamedLocationIdentity; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.code.UnsignedMath.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.hotspot.nodes.CStringNode.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; @@ -33,8 +41,6 @@ import static com.oracle.graal.replacements.nodes.ExplodeLoopNode.*; import static com.oracle.jvmci.hotspot.HotSpotMetaAccessProvider.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,13 @@ */ package com.oracle.graal.hotspot.replacements; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.Assumptions; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.lang.reflect.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneSnippets.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ObjectCloneSnippets.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.hotspot.replacements; +import com.oracle.jvmci.meta.Kind; import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.hotspot.replacements.arraycopy.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ReflectionGetCallerClassNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ReflectionGetCallerClassNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ReflectionGetCallerClassNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.hotspot.replacements; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/SystemSubstitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/SystemSubstitutions.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/SystemSubstitutions.java Wed May 27 00:36:16 2015 +0200 @@ -25,8 +25,8 @@ import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; +import com.oracle.jvmci.meta.*; /** * Substitutions for {@link java.lang.System} methods. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ThreadSubstitutions.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ThreadSubstitutions.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/ThreadSubstitutions.java Wed May 27 00:36:16 2015 +0200 @@ -22,16 +22,16 @@ */ package com.oracle.graal.hotspot.replacements; -import static com.oracle.graal.api.meta.LocationIdentity.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; +import static com.oracle.jvmci.meta.LocationIdentity.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; import com.oracle.graal.hotspot.nodes.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.meta.*; /** * Substitutions for {@link java.lang.Thread} methods. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/TypeCheckSnippetUtils.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/TypeCheckSnippetUtils.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/TypeCheckSnippetUtils.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,14 @@ */ package com.oracle.graal.hotspot.replacements; +import com.oracle.jvmci.code.TypeCheckHints; +import com.oracle.jvmci.meta.MetaAccessProvider; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.hotspot.nodes.type.*; import com.oracle.graal.hotspot.word.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/UnsafeLoadSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/UnsafeLoadSnippets.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/UnsafeLoadSnippets.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.hotspot.replacements; +import com.oracle.jvmci.code.TargetDescription; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.replacements.SnippetTemplate.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,18 @@ */ package com.oracle.graal.hotspot.replacements; -import static com.oracle.graal.api.code.MemoryBarriers.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.NamedLocationIdentity; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.code.MemoryBarriers.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; import static com.oracle.graal.replacements.SnippetTemplate.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyCallNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyCallNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyCallNode.java Wed May 27 00:36:16 2015 +0200 @@ -23,7 +23,12 @@ //JaCoCo Exclude package com.oracle.graal.hotspot.replacements.arraycopy; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.NamedLocationIdentity; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.PrimitiveConstant; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopyNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,10 @@ */ package com.oracle.graal.hotspot.replacements.arraycopy; -import static com.oracle.graal.api.meta.LocationIdentity.*; - -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.NamedLocationIdentity; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.meta.LocationIdentity.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySlowPathNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySlowPathNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySlowPathNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,12 @@ */ package com.oracle.graal.hotspot.replacements.arraycopy; -import static com.oracle.graal.api.meta.LocationIdentity.*; +import com.oracle.jvmci.code.BytecodeFrame; +import com.oracle.jvmci.meta.NamedLocationIdentity; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.meta.LocationIdentity.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySnippets.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/ArrayCopySnippets.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,14 @@ */ package com.oracle.graal.hotspot.replacements.arraycopy; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.NamedLocationIdentity; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.DeoptimizationAction; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.nodes.GuardingPiNode.*; @@ -30,8 +38,6 @@ import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.meta.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java Wed May 27 00:36:16 2015 +0200 @@ -23,7 +23,9 @@ //JaCoCo Exclude package com.oracle.graal.hotspot.replacements.arraycopy; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,10 @@ */ package com.oracle.graal.hotspot.replacements.arraycopy; -import static com.oracle.graal.api.meta.LocationIdentity.*; - -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.NamedLocationIdentity; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.meta.LocationIdentity.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,16 @@ */ package com.oracle.graal.hotspot.replacements.arraycopy; -import static com.oracle.graal.api.meta.LocationIdentity.*; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.NamedLocationIdentity; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.meta.LocationIdentity.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; import static com.oracle.graal.replacements.SnippetTemplate.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.asm.*; import com.oracle.graal.hotspot.meta.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/DeoptimizationStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/DeoptimizationStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/DeoptimizationStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,15 @@ */ package com.oracle.graal.hotspot.stubs; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.ForeignCallDescriptor; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.hotspot.HotSpotBackend.Options.*; import static com.oracle.graal.hotspot.nodes.DeoptimizationFetchUnrollInfoCallNode.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.hotspot.stubs.UncommonTrapStub.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.asm.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ExceptionHandlerStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ExceptionHandlerStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ExceptionHandlerStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.hotspot.stubs; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.ForeignCallDescriptor; import static com.oracle.graal.hotspot.nodes.JumpToExceptionHandlerNode.*; import static com.oracle.graal.hotspot.nodes.PatchReturnAddressNode.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.hotspot.stubs.StubUtil.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,18 @@ */ package com.oracle.graal.hotspot.stubs; -import static com.oracle.graal.api.code.CallingConvention.Type.*; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.JavaMethod; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Signature; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.code.CallingConvention.Type.*; import static com.oracle.graal.hotspot.HotSpotForeignCallLinkage.RegisterEffect.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.HotSpotForeignCallLinkage.Transition; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewArrayStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewArrayStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewArrayStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,14 @@ */ package com.oracle.graal.hotspot.stubs; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.ForeignCallDescriptor; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.hotspot.replacements.NewObjectSnippets.*; import static com.oracle.graal.hotspot.stubs.NewInstanceStub.*; import static com.oracle.graal.hotspot.stubs.StubUtil.*; import static com.oracle.jvmci.hotspot.HotSpotMetaAccessProvider.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/NewInstanceStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,14 @@ */ package com.oracle.graal.hotspot.stubs; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.hotspot.nodes.DirectCompareAndSwapNode.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.hotspot.stubs.StubUtil.*; import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/SnippetStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/SnippetStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/SnippetStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,14 @@ */ package com.oracle.graal.hotspot.stubs; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.LocalVariableTable; +import com.oracle.jvmci.meta.Local; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.graal.graphbuilderconf.IntrinsicContext.CompilationContext.*; import java.lang.reflect.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.hotspot.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,19 @@ */ package com.oracle.graal.hotspot.stubs; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.graal.compiler.GraalCompiler.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.target.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/StubUtil.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/StubUtil.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/StubUtil.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.hotspot.stubs; -import static com.oracle.graal.api.meta.DeoptimizationReason.*; +import com.oracle.jvmci.meta.DeoptimizationAction; +import com.oracle.jvmci.meta.ForeignCallDescriptor; +import static com.oracle.jvmci.meta.DeoptimizationReason.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static com.oracle.graal.hotspot.nodes.CStringNode.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; @@ -31,7 +33,6 @@ import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/UncommonTrapStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/UncommonTrapStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/UncommonTrapStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,15 @@ */ package com.oracle.graal.hotspot.stubs; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.NamedLocationIdentity; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ForeignCallDescriptor; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.hotspot.HotSpotBackend.Options.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.asm.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/UnwindExceptionToCallerStub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/UnwindExceptionToCallerStub.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/UnwindExceptionToCallerStub.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.hotspot.stubs; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.ForeignCallDescriptor; import static com.oracle.graal.hotspot.nodes.JumpToExceptionHandlerInCallerNode.*; import static com.oracle.graal.hotspot.replacements.HotSpotReplacementsUtil.*; import static com.oracle.graal.hotspot.stubs.ExceptionHandlerStub.*; import static com.oracle.graal.hotspot.stubs.StubUtil.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/HotSpotWordTypes.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/HotSpotWordTypes.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/HotSpotWordTypes.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,10 @@ */ package com.oracle.graal.hotspot.word; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.nodes.type.*; import com.oracle.graal.word.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/KlassPointer.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/KlassPointer.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/KlassPointer.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.word; +import com.oracle.jvmci.meta.LocationIdentity; import static com.oracle.graal.hotspot.word.HotSpotOperation.HotspotOpcode.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.word.*; import com.oracle.graal.word.Word.Opcode; import com.oracle.graal.word.Word.Operation; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/MetaspacePointer.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/MetaspacePointer.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/MetaspacePointer.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.word; +import com.oracle.jvmci.meta.LocationIdentity; import static com.oracle.graal.hotspot.word.HotSpotOperation.HotspotOpcode.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; import com.oracle.graal.word.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/PointerCastNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/PointerCastNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/word/PointerCastNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.word; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.hotspot.word.HotSpotOperation.HotspotOpcode; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/ConstantTest.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/ConstantTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/ConstantTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,10 @@ */ package com.oracle.graal.java.test; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Kind; import org.junit.*; -import com.oracle.graal.api.meta.*; public class ConstantTest extends FieldUniverse { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/FieldUniverse.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/FieldUniverse.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/FieldUniverse.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,12 @@ */ package com.oracle.graal.java.test; +import com.oracle.jvmci.meta.ResolvedJavaField; import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.meta.*; - /** - * Context for field related api.meta tests. + * Context for field related tests. */ public class FieldUniverse extends TypeUniverse { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/MethodUniverse.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/MethodUniverse.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/MethodUniverse.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,12 @@ */ package com.oracle.graal.java.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.meta.*; - /** - * Context for method related api.meta tests. + * Context for method related tests. */ public class MethodUniverse extends TypeUniverse { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/NameAndSignature.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/NameAndSignature.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/NameAndSignature.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,13 @@ */ package com.oracle.graal.java.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Signature; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.MetaAccessProvider; import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.runtime.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/ResolvedJavaTypeResolveConcreteMethodTest.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/ResolvedJavaTypeResolveConcreteMethodTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/ResolvedJavaTypeResolveConcreteMethodTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,13 @@ */ package com.oracle.graal.java.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.MetaAccessProvider; import static org.junit.Assert.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.phases.util.*; import com.oracle.graal.runtime.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/ResolvedJavaTypeResolveMethodTest.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/ResolvedJavaTypeResolveMethodTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/ResolvedJavaTypeResolveMethodTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,13 @@ */ package com.oracle.graal.java.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.MetaAccessProvider; import static org.junit.Assert.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.phases.util.*; import com.oracle.graal.runtime.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestBytecodeDisassemblerProvider.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestBytecodeDisassemblerProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestBytecodeDisassemblerProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,10 @@ */ package com.oracle.graal.java.test; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.BytecodeDisassemblerProvider; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.java.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestConstantReflectionProvider.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestConstantReflectionProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestConstantReflectionProvider.java Wed May 27 00:36:16 2015 +0200 @@ -28,7 +28,7 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * Tests for {@link ConstantReflectionProvider}. It assumes an implementation of the interface that diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestJavaField.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestJavaField.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestJavaField.java Wed May 27 00:36:16 2015 +0200 @@ -29,7 +29,7 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * Tests for {@link JavaField}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestJavaMethod.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestJavaMethod.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestJavaMethod.java Wed May 27 00:36:16 2015 +0200 @@ -29,7 +29,7 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * Tests for {@link JavaMethod}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestJavaType.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestJavaType.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestJavaType.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,12 @@ */ package com.oracle.graal.java.test; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.Kind; import static org.junit.Assert.*; import org.junit.*; -import com.oracle.graal.api.meta.*; /** * Tests for {@link JavaType}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestMetaAccessProvider.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestMetaAccessProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestMetaAccessProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,14 @@ */ package com.oracle.graal.java.test; -import static com.oracle.graal.api.meta.MetaUtil.*; +import static com.oracle.jvmci.meta.MetaUtil.*; import static org.junit.Assert.*; import java.lang.reflect.*; import org.junit.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * Tests for {@link MetaAccessProvider}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestResolvedJavaField.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestResolvedJavaField.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestResolvedJavaField.java Wed May 27 00:36:16 2015 +0200 @@ -30,7 +30,7 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * Tests for {@link ResolvedJavaField}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestResolvedJavaMethod.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestResolvedJavaMethod.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestResolvedJavaMethod.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,9 @@ */ package com.oracle.graal.java.test; +import com.oracle.jvmci.meta.ExceptionHandler; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ConstantPool; import static org.junit.Assert.*; import java.lang.annotation.*; @@ -30,7 +33,6 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; /** * Tests for {@link ResolvedJavaMethod}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestResolvedJavaType.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestResolvedJavaType.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TestResolvedJavaType.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,12 @@ */ package com.oracle.graal.java.test; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.TrustedInterface; +import com.oracle.jvmci.meta.ResolvedJavaType; import static java.lang.reflect.Modifier.*; import static org.junit.Assert.*; @@ -34,8 +40,7 @@ import sun.reflect.ConstantPool; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; import com.oracle.jvmci.common.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TypeUniverse.java --- a/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TypeUniverse.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java.test/src/com/oracle/graal/java/test/TypeUniverse.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,10 @@ */ package com.oracle.graal.java.test; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.TrustedInterface; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; import java.io.*; import java.lang.reflect.*; import java.util.*; @@ -31,14 +35,13 @@ import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.phases.util.*; import com.oracle.graal.runtime.*; /** - * Context for type related api.meta tests. + * Context for type related tests. */ public class TypeUniverse { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,15 @@ */ package com.oracle.graal.java; +import com.oracle.jvmci.code.BailoutException; +import com.oracle.jvmci.code.BytecodeFrame; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ExceptionHandler; import static com.oracle.graal.bytecode.Bytecodes.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.bytecode.*; import com.oracle.graal.compiler.common.*; import com.oracle.jvmci.debug.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeDisassembler.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeDisassembler.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeDisassembler.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,15 @@ */ package com.oracle.graal.java; +import com.oracle.jvmci.meta.JavaField; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.BytecodeDisassemblerProvider; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.JavaMethod; +import com.oracle.jvmci.meta.ConstantPool; import static com.oracle.graal.bytecode.Bytecodes.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.bytecode.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,19 @@ */ package com.oracle.graal.java; +import com.oracle.jvmci.code.BailoutException; +import com.oracle.jvmci.code.BytecodeFrame; +import com.oracle.jvmci.code.BytecodePosition; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Signature; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaType; import static com.oracle.graal.graph.iterators.NodePredicates.*; import static com.oracle.graal.java.GraphBuilderPhase.Options.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graphbuilderconf.IntrinsicContext.SideEffectsState; import com.oracle.graal.graphbuilderconf.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,33 @@ */ package com.oracle.graal.java; -import static com.oracle.graal.api.code.TypeCheckHints.*; -import static com.oracle.graal.api.meta.DeoptimizationAction.*; -import static com.oracle.graal.api.meta.DeoptimizationReason.*; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.code.BailoutException; +import com.oracle.jvmci.code.InfopointReason; +import com.oracle.jvmci.code.BytecodeFrame; +import com.oracle.jvmci.code.BytecodePosition; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.RawConstant; +import com.oracle.jvmci.meta.ProfilingInfo; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.TriState; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaMethod; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.JavaField; +import com.oracle.jvmci.meta.MetaUtil; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.JavaTypeProfile; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.DeoptimizationAction; +import com.oracle.jvmci.meta.LineNumberTable; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.ConstantPool; +import static com.oracle.jvmci.code.TypeCheckHints.*; +import static com.oracle.jvmci.meta.DeoptimizationAction.*; +import static com.oracle.jvmci.meta.DeoptimizationReason.*; import static com.oracle.graal.bytecode.Bytecodes.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.compiler.common.type.StampFactory.*; @@ -37,8 +61,6 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.bytecode.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.calc.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.java/src/com/oracle/graal/java/JsrNotSupportedBailout.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/JsrNotSupportedBailout.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/JsrNotSupportedBailout.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.java; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.BailoutException; public class JsrNotSupportedBailout extends BailoutException { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,17 @@ */ package com.oracle.graal.jtt; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static java.lang.reflect.Modifier.*; import java.util.*; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field01.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field01.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field01.java Wed May 27 00:36:16 2015 +0200 @@ -23,9 +23,9 @@ // Checkstyle: stop package com.oracle.graal.jtt.hotpath; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.jtt.*; /* diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field03.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field03.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/hotpath/HP_field03.java Wed May 27 00:36:16 2015 +0200 @@ -23,9 +23,9 @@ // Checkstyle: stop package com.oracle.graal.jtt.hotpath; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.jtt.*; /* diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/Unsafe_compareAndSwap.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/Unsafe_compareAndSwap.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/Unsafe_compareAndSwap.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.jtt.jdk; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.jtt.*; public class Unsafe_compareAndSwap extends JTTTest { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/LambdaEagerTest.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/LambdaEagerTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/lang/LambdaEagerTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,14 @@ */ package com.oracle.graal.jtt.lang; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.util.*; import java.util.function.*; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopNewInstance.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopNewInstance.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopNewInstance.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.jtt.loop; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.jtt.*; /* diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ConditionalElimination01.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ConditionalElimination01.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ConditionalElimination01.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.jtt.optimize; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.jtt.*; public class ConditionalElimination01 extends JTTTest { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ConditionalElimination02.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ConditionalElimination02.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/optimize/ConditionalElimination02.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.jtt.optimize; +import com.oracle.jvmci.meta.DeoptimizationReason; import java.util.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.jtt.*; public class ConditionalElimination02 extends JTTTest { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64AddressValue.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64AddressValue.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64AddressValue.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,16 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Address.Scale; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,12 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.LIRKind; +import static com.oracle.jvmci.code.ValueUtil.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.ConditionFlag; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ArithmeticLIRGenerator.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ArithmeticLIRGenerator.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ArithmeticLIRGenerator.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.lir.amd64; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; /** * This interface can be used to generate AMD64 LIR for arithmetic operations. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ArrayEqualsOp.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ArrayEqualsOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ArrayEqualsOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,12 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.jvmci.common.UnsafeAccess.*; @@ -30,8 +35,6 @@ import com.oracle.graal.amd64.*; import com.oracle.graal.amd64.AMD64.CPUFeature; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Address.Scale; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Binary.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Binary.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Binary.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,13 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaConstant; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.CompilationResult.DataSectionReference; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CompilationResult.DataSectionReference; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64BinaryConsumer.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64BinaryConsumer.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64BinaryConsumer.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,13 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.CompilationResult.DataSectionReference; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CompilationResult.DataSectionReference; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64BreakpointOp.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64BreakpointOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64BreakpointOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.lir.amd64; +import com.oracle.jvmci.meta.Value; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ByteSwapOp.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ByteSwapOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ByteSwapOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.lir.amd64; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.meta.Value; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64CCall.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64CCall.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64CCall.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,11 @@ */ package com.oracle.graal.lir.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.meta.Value; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,20 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.InvokeTarget; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.AMD64Assembler.ConditionFlag; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ClearRegisterOp.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ClearRegisterOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ClearRegisterOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64RMOp; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; import com.oracle.graal.asm.amd64.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,16 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaConstant; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.CompilationResult.JumpTable; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CompilationResult.JumpTable; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Address.Scale; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64FrameMap.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64FrameMap.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64FrameMap.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,12 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; - -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.LIRKind; +import static com.oracle.jvmci.code.ValueUtil.*; import com.oracle.graal.asm.*; import com.oracle.graal.lir.framemap.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64FrameMapBuilder.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64FrameMapBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64FrameMapBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.lir.amd64; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.RegisterConfig; import com.oracle.graal.lir.framemap.*; public class AMD64FrameMapBuilder extends FrameMapBuilderImpl { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64MathIntrinsicOp.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64MathIntrinsicOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64MathIntrinsicOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,18 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaConstant; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static java.lang.Double.*; import static java.lang.Float.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MIOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64MulDivOp.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64MulDivOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64MulDivOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,14 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MOp.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MOp; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64RestoreRegistersOp.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64RestoreRegistersOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64RestoreRegistersOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,16 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.code.StackSlot; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64SaveRegistersOp.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64SaveRegistersOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64SaveRegistersOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,17 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.code.RegisterSaveLayout; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.code.StackSlot; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.SaveRegistersOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ShiftOp.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ShiftOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ShiftOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MOp; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; import com.oracle.graal.asm.amd64.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64SignExtendOp.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64SignExtendOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64SignExtendOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,13 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.LIRKind; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Unary.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Unary.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Unary.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,11 @@ */ package com.oracle.graal.lir.amd64; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MOp; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MROp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ZapRegistersOp.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ZapRegistersOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ZapRegistersOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,15 @@ */ package com.oracle.graal.lir.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.code.RegisterSaveLayout; +import com.oracle.jvmci.meta.JavaConstant; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.lir.amd64.AMD64SaveRegistersOp.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.SaveRegistersOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/LIRTest.java --- a/graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/LIRTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/LIRTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,13 @@ */ package com.oracle.graal.lir.jtt; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.Kind; import java.lang.annotation.*; import java.lang.reflect.*; import java.util.stream.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/StackMoveTest.java --- a/graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/StackMoveTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.jtt/src/com/oracle/graal/lir/jtt/StackMoveTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.lir.jtt; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.meta.Value; import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.framemap.*; import com.oracle.graal.lir.gen.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCAddressValue.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCAddressValue.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCAddressValue.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,16 @@ */ package com.oracle.graal.lir.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,13 @@ */ package com.oracle.graal.lir.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.JavaConstant; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.Annul.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.BranchPredict.*; @@ -33,8 +39,6 @@ import static com.oracle.graal.sparc.SPARC.*; import static com.oracle.graal.sparc.SPARC.CPUFeature.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.ScratchRegister; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArrayEqualsOp.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArrayEqualsOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArrayEqualsOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,11 @@ */ package com.oracle.graal.lir.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.Kind; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.Annul.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.BranchPredict.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.CC.*; @@ -35,8 +39,6 @@ import java.lang.reflect.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCAssembler.CC; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCBitManipulationOp.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCBitManipulationOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCBitManipulationOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,16 @@ */ package com.oracle.graal.lir.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCBreakpointOp.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCBreakpointOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCBreakpointOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.lir.sparc; +import com.oracle.jvmci.meta.Value; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCByteSwapOp.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCByteSwapOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCByteSwapOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,15 @@ */ package com.oracle.graal.lir.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCAssembler.Asi; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCall.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCall.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCall.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,15 @@ */ package com.oracle.graal.lir.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.InvokeTarget; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Sethix; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCompare.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCompare.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCompare.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,15 @@ */ package com.oracle.graal.lir.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaConstant; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.CC.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.Opfs.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,11 @@ */ package com.oracle.graal.lir.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaConstant; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.Annul.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.BranchPredict.*; @@ -33,8 +37,6 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.Assembler.LabelHint; import com.oracle.graal.asm.sparc.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCFrameMap.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCFrameMap.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCFrameMap.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,11 @@ */ package com.oracle.graal.lir.sparc; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.asm.*; import com.oracle.graal.lir.framemap.*; import com.oracle.graal.sparc.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCFrameMapBuilder.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCFrameMapBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCFrameMapBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.lir.sparc; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.RegisterConfig; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.StackSlot; import com.oracle.graal.lir.framemap.*; public class SPARCFrameMapBuilder extends FrameMapBuilderImpl { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMathIntrinsicOp.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMathIntrinsicOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMathIntrinsicOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,10 @@ */ package com.oracle.graal.lir.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,21 @@ */ package com.oracle.graal.lir.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; -import static com.oracle.graal.api.meta.Kind.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.JavaConstant; +import static com.oracle.jvmci.code.ValueUtil.*; +import static com.oracle.jvmci.meta.Kind.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.ScratchRegister; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Setx; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCSaveRegistersOp.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCSaveRegistersOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCSaveRegistersOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,17 @@ */ package com.oracle.graal.lir.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.ValueUtil; +import com.oracle.jvmci.code.RegisterSaveLayout; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.RegisterValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.SaveRegistersOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCTestOp.java --- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCTestOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCTestOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.lir.sparc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static com.oracle.graal.sparc.SPARC.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest1.java --- a/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest1.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest1.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,9 @@ */ package com.oracle.graal.lir.test; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AbstractValue; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import static org.junit.Assert.*; @@ -29,7 +32,6 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/CompositeValue.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/CompositeValue.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/CompositeValue.java Wed May 27 00:36:16 2015 +0200 @@ -25,10 +25,10 @@ import java.lang.annotation.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; /** * Base class to represent values that need to be stored in more than one register. This is mainly diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ControlFlowOptimizer.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ControlFlowOptimizer.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ControlFlowOptimizer.java Wed May 27 00:36:16 2015 +0200 @@ -26,10 +26,10 @@ import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.phases.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.debug.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/EdgeMoveOptimizer.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/EdgeMoveOptimizer.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/EdgeMoveOptimizer.java Wed May 27 00:36:16 2015 +0200 @@ -24,11 +24,11 @@ import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.StandardOp.MoveOp; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.phases.*; +import com.oracle.jvmci.code.*; /** * This class optimizes moves, particularly those that result from eliminating SSA form. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FullInfopointOp.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FullInfopointOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FullInfopointOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.lir; -import com.oracle.graal.api.code.*; import com.oracle.graal.lir.asm.*; +import com.oracle.jvmci.code.*; /** * Emits an infopoint (only mark the position). diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/InstructionValueConsumer.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/InstructionValueConsumer.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/InstructionValueConsumer.java Wed May 27 00:36:16 2015 +0200 @@ -24,9 +24,9 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; +import com.oracle.jvmci.meta.*; /** * Functional interface for iterating over a list of values without modifying them. See diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/InstructionValueProcedure.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/InstructionValueProcedure.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/InstructionValueProcedure.java Wed May 27 00:36:16 2015 +0200 @@ -24,9 +24,9 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; +import com.oracle.jvmci.meta.*; /** * Functional interface for iterating over a list of values, possibly returning a value to replace diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRFrameState.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRFrameState.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRFrameState.java Wed May 27 00:36:16 2015 +0200 @@ -22,15 +22,15 @@ */ package com.oracle.graal.lir; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; import com.oracle.graal.lir.framemap.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * This class represents garbage collection and deoptimization information attached to a LIR diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java Wed May 27 00:36:16 2015 +0200 @@ -28,10 +28,10 @@ import java.lang.annotation.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.asm.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; /** * The base class for an {@code LIRInstruction}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstructionClass.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstructionClass.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstructionClass.java Wed May 27 00:36:16 2015 +0200 @@ -25,12 +25,12 @@ import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; public class LIRInstructionClass extends LIRIntrospection { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRIntrospection.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRIntrospection.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRIntrospection.java Wed May 27 00:36:16 2015 +0200 @@ -29,11 +29,11 @@ import java.util.*; import java.util.Map.Entry; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; abstract class LIRIntrospection extends FieldIntrospection { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRValueUtil.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRValueUtil.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRValueUtil.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.lir; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; public final class LIRValueUtil { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRVerifier.java Wed May 27 00:36:16 2015 +0200 @@ -22,20 +22,20 @@ */ package com.oracle.graal.lir; -import static com.oracle.graal.api.code.ValueUtil.*; import static com.oracle.graal.lir.LIRValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; import com.oracle.graal.lir.framemap.*; import com.oracle.graal.lir.ssa.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; public final class LIRVerifier { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/NullCheckOptimizer.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/NullCheckOptimizer.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/NullCheckOptimizer.java Wed May 27 00:36:16 2015 +0200 @@ -24,12 +24,12 @@ import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.StandardOp.ImplicitNullCheck; import com.oracle.graal.lir.StandardOp.NullCheck; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.phases.*; +import com.oracle.jvmci.code.*; public final class NullCheckOptimizer extends PostAllocationOptimizationPhase { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/RedundantMoveElimination.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/RedundantMoveElimination.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/RedundantMoveElimination.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,10 @@ */ package com.oracle.graal.lir; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; @@ -36,7 +34,9 @@ import com.oracle.graal.lir.framemap.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.phases.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; /** * Removes move instructions, where the destination value is already in place. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/SimpleInfopointOp.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/SimpleInfopointOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/SimpleInfopointOp.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.lir; -import com.oracle.graal.api.code.*; import com.oracle.graal.lir.asm.*; +import com.oracle.jvmci.code.*; @Opcode("SIMPLE_INFOPOINT") public final class SimpleInfopointOp extends LIRInstruction { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/StandardOp.java Wed May 27 00:36:16 2015 +0200 @@ -27,13 +27,13 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.framemap.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * A collection of machine-independent LIR operations, as well as interfaces to be implemented for diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/SwitchStrategy.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/SwitchStrategy.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/SwitchStrategy.java Wed May 27 00:36:16 2015 +0200 @@ -24,10 +24,10 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.lir.asm.*; +import com.oracle.jvmci.meta.*; /** * This class encapsulates different strategies on how to generate code for switch instructions. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueConsumer.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueConsumer.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueConsumer.java Wed May 27 00:36:16 2015 +0200 @@ -24,9 +24,9 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; +import com.oracle.jvmci.meta.*; /** * Non-modifying version of {@link ValueProcedure}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueProcedure.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueProcedure.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueProcedure.java Wed May 27 00:36:16 2015 +0200 @@ -24,9 +24,9 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; +import com.oracle.jvmci.meta.*; /** * Similar to {@link InstructionValueProcedure} but without an {@link LIRInstruction} parameter. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/Variable.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/Variable.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/Variable.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.lir; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Represents a value that is yet to be bound to a machine location (such as a {@link RegisterValue} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/Interval.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/Interval.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/Interval.java Wed May 27 00:36:16 2015 +0200 @@ -22,18 +22,18 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.ValueUtil.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.lir.LIRValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.util.*; import com.oracle.graal.lir.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; /** * Represents an interval in the {@linkplain LinearScan linear scan register allocator}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScan.java Wed May 27 00:36:16 2015 +0200 @@ -22,15 +22,13 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.CodeUtil.*; -import static com.oracle.graal.api.code.ValueUtil.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.lir.LIRValueUtil.*; +import static com.oracle.jvmci.code.CodeUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.alloc.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; @@ -41,9 +39,11 @@ import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; import com.oracle.graal.lir.phases.AllocationPhase.AllocationContext; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; import com.oracle.jvmci.debug.Debug.Scope; +import com.oracle.jvmci.meta.*; import com.oracle.jvmci.options.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanAssignLocationsPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanAssignLocationsPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanAssignLocationsPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,15 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.lir.LIRValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,14 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.lir.LIRValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.MoveOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,15 +22,22 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.BailoutException; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.lir.LIRValueUtil.*; import static com.oracle.graal.lir.debug.LIRGenerationDebugContext.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.alloc.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.common.util.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.compiler.common.cfg.AbstractControlFlowGraph.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.OperandMode; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.lir.alloc.lsra; +import com.oracle.jvmci.code.TargetDescription; import static com.oracle.graal.compiler.common.GraalOptions.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.alloc.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.gen.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.lir.alloc.lsra; +import com.oracle.jvmci.code.TargetDescription; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.lir.alloc.lsra; +import com.oracle.jvmci.code.TargetDescription; import static com.oracle.graal.compiler.common.GraalOptions.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.gen.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanWalker.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanWalker.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LinearScanWalker.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,15 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.CodeUtil.*; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.BailoutException; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.CodeUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.common.util.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LocationMarker.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LocationMarker.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/LocationMarker.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,17 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.RegisterAttributes; +import com.oracle.jvmci.code.ReferenceMap; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/MoveResolver.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/MoveResolver.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/MoveResolver.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,15 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import static java.lang.String.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/OptimizingLinearScanWalker.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/OptimizingLinearScanWalker.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/OptimizingLinearScanWalker.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,9 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.ValueUtil.*; - -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.alloc.lsra.Interval.RegisterBinding; import com.oracle.graal.lir.alloc.lsra.Interval.RegisterBindingLists; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/OutOfRegistersException.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/OutOfRegistersException.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/OutOfRegistersException.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.lir.alloc.lsra; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.BailoutException; public class OutOfRegistersException extends BailoutException { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/RegisterVerifier.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/RegisterVerifier.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/RegisterVerifier.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.common.util.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinarScanResolveDataFlowPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinarScanResolveDataFlowPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinarScanResolveDataFlowPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.ssa.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScan.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScan.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScan.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.lir.alloc.lsra; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.TargetDescription; import com.oracle.graal.compiler.common.alloc.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.gen.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScanEliminateSpillMovePhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScanEliminateSpillMovePhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScanEliminateSpillMovePhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRValueUtil.*; import com.oracle.graal.compiler.common.cfg.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScanLifetimeAnalysisPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScanLifetimeAnalysisPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSALinearScanLifetimeAnalysisPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,10 @@ */ package com.oracle.graal.lir.alloc.lsra; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSAMoveResolver.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSAMoveResolver.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/lsra/SSAMoveResolver.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,12 @@ */ package com.oracle.graal.lir.alloc.lsra; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.framemap.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilder.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,16 +22,28 @@ */ package com.oracle.graal.lir.asm; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.DebugInfo; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.AbstractAddress; +import com.oracle.jvmci.code.InfopointReason; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.VMConstant; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.InvokeTarget; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CompilationResult.ConstantReference; -import com.oracle.graal.api.code.CompilationResult.DataSectionReference; -import com.oracle.graal.api.code.DataSection.Data; -import com.oracle.graal.api.code.DataSection.DataBuilder; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CompilationResult.ConstantReference; +import com.oracle.jvmci.code.CompilationResult.DataSectionReference; +import com.oracle.jvmci.code.DataSection.Data; +import com.oracle.jvmci.code.DataSection.DataBuilder; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilderFactory.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilderFactory.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/CompilationResultBuilderFactory.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.lir.asm; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.ForeignCallsProvider; import com.oracle.graal.asm.*; import com.oracle.graal.lir.framemap.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,16 @@ */ package com.oracle.graal.lir.constopt; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRValueUtil.*; import static com.oracle.graal.lir.phases.LIRPhase.Options.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/DefUseTree.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/DefUseTree.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/DefUseTree.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,11 @@ */ package com.oracle.graal.lir.constopt; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaConstant; import java.util.*; import java.util.function.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.MoveOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/UseEntry.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/UseEntry.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/UseEntry.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.lir.constopt; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/debug/LIRGenerationDebugContext.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/debug/LIRGenerationDebugContext.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/debug/LIRGenerationDebugContext.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.lir.debug; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; import com.oracle.graal.lir.*; import com.oracle.jvmci.debug.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMap.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMap.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMap.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.lir.framemap; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * This class is used to build the stack frame layout for a compiled method. A {@link StackSlot} is diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMapBuilder.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMapBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMapBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -24,10 +24,10 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.stackslotalloc.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * A {@link FrameMapBuilder} is used to collect all information necessary to diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMapBuilderImpl.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMapBuilderImpl.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMapBuilderImpl.java Wed May 27 00:36:16 2015 +0200 @@ -22,21 +22,21 @@ */ package com.oracle.graal.lir.framemap; -import static com.oracle.graal.api.code.ValueUtil.*; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; import com.oracle.graal.lir.LIRInstruction.OperandMode; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.stackslotalloc.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; import com.oracle.jvmci.debug.Debug.Scope; +import com.oracle.jvmci.meta.*; /** * A FrameMapBuilder that records allocation. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMapBuilderTool.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMapBuilderTool.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/FrameMapBuilderTool.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,8 @@ import java.util.*; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.*; + /** * A {@link FrameMapBuilder} that allows access to the underlying {@link FrameMap}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/SimpleVirtualStackSlot.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/SimpleVirtualStackSlot.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/SimpleVirtualStackSlot.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.lir.framemap; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Represents a {@link VirtualStackSlot virtual stack slot} for a specific {@link LIRKind kind}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/VirtualStackSlotRange.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/VirtualStackSlotRange.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/framemap/VirtualStackSlotRange.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,9 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; + /** * Represents a {@link #getSlots() numbered} range of {@link VirtualStackSlot virtual stack slot} of diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/ArithmeticLIRGenerator.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/ArithmeticLIRGenerator.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/ArithmeticLIRGenerator.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.lir.gen; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/BenchmarkCounterFactory.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/BenchmarkCounterFactory.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/BenchmarkCounterFactory.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.lir.gen; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; import com.oracle.graal.lir.*; public interface BenchmarkCounterFactory { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/DefaultLIRKindTool.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/DefaultLIRKindTool.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/DefaultLIRKindTool.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.lir.gen; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.LIRKind; import com.oracle.graal.compiler.common.spi.*; import com.oracle.jvmci.common.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,27 @@ */ package com.oracle.graal.lir.gen; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.RegisterAttributes; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.MetaAccessProvider; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.cfg.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGeneratorTool.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGeneratorTool.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGeneratorTool.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,22 @@ */ package com.oracle.graal.lir.gen; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.ForeignCallLinkage; +import com.oracle.jvmci.code.RegisterAttributes; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.StackSlotValue; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.MetaAccessProvider; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.common.spi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/PhiResolver.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/PhiResolver.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/PhiResolver.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,14 @@ */ package com.oracle.graal.lir.gen; -import static com.oracle.graal.api.code.ValueUtil.*; -import static com.oracle.graal.api.meta.Value.*; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; +import static com.oracle.jvmci.meta.Value.*; import static com.oracle.graal.lir.LIRValueUtil.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/AllocationPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/AllocationPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/AllocationPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.lir.phases; +import com.oracle.jvmci.code.TargetDescription; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.lir.phases; +import com.oracle.jvmci.code.TargetDescription; import java.util.*; import java.util.regex.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.gen.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRPhaseSuite.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRPhaseSuite.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRPhaseSuite.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.lir.phases; +import com.oracle.jvmci.code.TargetDescription; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.gen.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/LIRSuites.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.lir.phases; -import com.oracle.graal.api.code.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.phases.AllocationPhase.AllocationContext; import com.oracle.graal.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; import com.oracle.graal.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; +import com.oracle.jvmci.code.*; public class LIRSuites { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PostAllocationOptimizationPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PostAllocationOptimizationPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PostAllocationOptimizationPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.lir.phases; +import com.oracle.jvmci.code.TargetDescription; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.gen.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PreAllocationOptimizationPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PreAllocationOptimizationPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/phases/PreAllocationOptimizationPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.lir.phases; +import com.oracle.jvmci.code.TargetDescription; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.gen.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/profiling/MoveProfiling.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/profiling/MoveProfiling.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/profiling/MoveProfiling.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,14 @@ */ package com.oracle.graal.lir.profiling; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.StandardOp.BlockEndOp; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ssa/SSADestructionPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ssa/SSADestructionPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ssa/SSADestructionPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.lir.ssa; +import com.oracle.jvmci.code.TargetDescription; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.gen.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ssa/SSAUtils.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ssa/SSAUtils.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ssa/SSAUtils.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.lir.ssa; +import com.oracle.jvmci.meta.Value; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.OperandMode; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ssa/SSAVerifier.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ssa/SSAVerifier.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ssa/SSAVerifier.java Wed May 27 00:36:16 2015 +0200 @@ -23,11 +23,11 @@ package com.oracle.graal.lir.ssa; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/FixPointIntervalBuilder.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/FixPointIntervalBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/FixPointIntervalBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.lir.stackslotalloc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.VirtualStackSlot; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/LSStackSlotAllocator.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,17 @@ */ package com.oracle.graal.lir.stackslotalloc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.VirtualStackSlot; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; +import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.phases.LIRPhase.Options.*; import java.util.*; import java.util.function.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.OperandFlag; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/SimpleStackSlotAllocator.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/SimpleStackSlotAllocator.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/SimpleStackSlotAllocator.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,13 @@ */ package com.oracle.graal.lir.stackslotalloc; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.code.VirtualStackSlot; +import static com.oracle.jvmci.code.ValueUtil.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.framemap.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/StackInterval.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/StackInterval.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/StackInterval.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,9 @@ */ package com.oracle.graal.lir.stackslotalloc; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.StackSlot; +import com.oracle.jvmci.code.VirtualStackSlot; +import com.oracle.jvmci.meta.LIRKind; public final class StackInterval { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/StackSlotAllocator.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/StackSlotAllocator.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/stackslotalloc/StackSlotAllocator.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.lir.stackslotalloc; -import com.oracle.graal.api.code.*; import com.oracle.graal.lir.framemap.*; import com.oracle.graal.lir.gen.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.debug.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/CountedLoopInfo.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,12 @@ */ package com.oracle.graal.loop; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.DeoptimizationAction; +import com.oracle.jvmci.meta.JavaConstant; import static com.oracle.graal.loop.MathUtil.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.loop.InductionVariable.Direction; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopTransformations.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopTransformations.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopTransformations.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.loop; +import com.oracle.jvmci.code.BailoutException; import static com.oracle.graal.compiler.common.GraalOptions.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.graph.Graph.Mark; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/AbstractObjectStampTest.java --- a/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/AbstractObjectStampTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/AbstractObjectStampTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.nodes.test; +import com.oracle.jvmci.meta.ResolvedJavaType; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.test.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/IntegerStampTest.java --- a/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/IntegerStampTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/IntegerStampTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,12 @@ */ package com.oracle.graal.nodes.test; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; import static org.junit.Assert.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.IntegerConvertOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.ShiftOp; import com.oracle.graal.compiler.common.type.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/NegateNodeCanonicalizationTest.java --- a/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/NegateNodeCanonicalizationTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/NegateNodeCanonicalizationTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.nodes.test; +import com.oracle.jvmci.meta.JavaConstant; import static org.junit.Assert.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampJoinTest.java --- a/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampJoinTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampJoinTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.nodes.test; +import com.oracle.jvmci.meta.Kind; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.type.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampMeetTest.java --- a/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampMeetTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampMeetTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,10 @@ */ package com.oracle.graal.nodes.test; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.ResolvedJavaType; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; public class ObjectStampMeetTest extends AbstractObjectStampTest { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampTest.java --- a/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.nodes.test; +import com.oracle.jvmci.meta.TrustedInterface; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; public class ObjectStampTest extends AbstractObjectStampTest { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractDeoptimizeNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractDeoptimizeNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractDeoptimizeNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; +import com.oracle.jvmci.meta.*; /** * This node represents an unconditional explicit request for immediate deoptimization. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractFixedGuardNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractFixedGuardNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/AbstractFixedGuardNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.meta.*; @NodeInfo public abstract class AbstractFixedGuardNode extends DeoptimizingFixedWithNextNode implements Simplifiable, GuardingNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BinaryOpLogicNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BinaryOpLogicNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BinaryOpLogicNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo public abstract class BinaryOpLogicNode extends LogicNode implements LIRLowerable, Canonicalizable.Binary { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,11 +24,11 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo(allowedUsageTypes = {InputType.Extension}) public abstract class CallTargetNode extends ValueNode implements LIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,15 +24,15 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * The {@code ConstantNode} represents a {@link Constant constant}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.spi.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "Deopt", nameTemplate = "Deopt {p#reason/s}") public final class DeoptimizeNode extends AbstractDeoptimizeNode implements Lowerable, LIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DirectCallTargetNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DirectCallTargetNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DirectCallTargetNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,11 +24,11 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; @NodeInfo public class DirectCallTargetNode extends LoweredCallTargetNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DynamicDeoptimizeNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DynamicDeoptimizeNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DynamicDeoptimizeNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo public final class DynamicDeoptimizeNode extends AbstractDeoptimizeNode implements LIRLowerable, Lowerable, Canonicalizable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/EncodedGraph.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/EncodedGraph.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/EncodedGraph.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,8 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; +import com.oracle.jvmci.meta.*; /** * A {@link StructuredGraph} encoded in a compact binary representation as a byte[] array. See diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo(nameTemplate = "FixedGuard(!={p#negated}) {p#reason/s}", allowedUsageTypes = {InputType.Guard}) public final class FixedGuardNode extends AbstractFixedGuardNode implements Lowerable, IterableNodeType { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java Wed May 27 00:36:16 2015 +0200 @@ -22,19 +22,19 @@ */ package com.oracle.graal.nodes; -import static com.oracle.graal.api.code.BytecodeFrame.*; +import static com.oracle.jvmci.code.BytecodeFrame.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.bytecode.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.virtual.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; /** * The {@code FrameState} class encapsulates the frame state (i.e. local variables and operand diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FullInfopointNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FullInfopointNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FullInfopointNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.code.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; /** * Nodes of this type are inserted into the graph to denote points of interest to debugging. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GraphDecoder.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GraphDecoder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GraphDecoder.java Wed May 27 00:36:16 2015 +0200 @@ -26,12 +26,12 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.util.*; import com.oracle.graal.graph.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; /** * Decoder for {@link EncodedGraph encoded graphs} produced by {@link GraphEncoder}. Support for diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GraphEncoder.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GraphEncoder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GraphEncoder.java Wed May 27 00:36:16 2015 +0200 @@ -24,13 +24,13 @@ import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.util.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; import com.oracle.graal.nodes.java.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.debug.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.extended.*; +import com.oracle.jvmci.meta.*; /** * A guard is a node that deoptimizes based on a conditional expression. Guards are not attached to diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardedValueNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardedValueNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardedValueNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * A node that changes the type of its input, usually narrowing it. For example, a GuardedValueNode diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -31,6 +30,7 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.meta.*; /** * A node that changes the stamp of its input based on some condition being true. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,6 @@ import java.util.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.JavaTypeProfile.ProfiledType; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; @@ -39,6 +37,8 @@ import com.oracle.graal.nodes.util.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.meta.JavaTypeProfile.ProfiledType; /** * The {@code IfNode} represents a branch that can go one of two directions depending on the outcome diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IndirectCallTargetNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IndirectCallTargetNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IndirectCallTargetNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,11 +24,11 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; @NodeInfo public class IndirectCallTargetNode extends LoweredCallTargetNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InfopointNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InfopointNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InfopointNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; +import com.oracle.jvmci.code.*; @NodeInfo public abstract class InfopointNode extends FixedWithNextNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/Invoke.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/Invoke.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/Invoke.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.meta.*; public interface Invoke extends StateSplit, Lowerable, DeoptimizingNode.DeoptDuring, GuardedNode, UncheckedInterfaceProvider { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; @@ -33,6 +32,7 @@ import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.meta.*; /** * The {@code InvokeNode} represents all kinds of method calls. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.extended.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.meta.*; @NodeInfo(nameTemplate = "Invoke!#{p#targetMethod/s}", allowedUsageTypes = {InputType.Memory}) public final class InvokeWithExceptionNode extends ControlSplitNode implements Invoke, MemoryCheckpoint.Single, LIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/KillingBeginNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/KillingBeginNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/KillingBeginNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.memory.*; +import com.oracle.jvmci.meta.*; @NodeInfo(allowedUsageTypes = {InputType.Memory}) public final class KillingBeginNode extends AbstractBeginNode implements MemoryCheckpoint.Single { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoweredCallTargetNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoweredCallTargetNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/LoweredCallTargetNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,11 +24,11 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; @NodeInfo public abstract class LoweredCallTargetNode extends CallTargetNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ParameterNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ParameterNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ParameterNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * The {@code Parameter} instruction is a placeholder for an incoming argument to a function call. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,12 +24,12 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.calc.*; +import com.oracle.jvmci.meta.*; /** * {@code PhiNode}s represent the merging of edges at a control flow merges ( diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ //JaCoCo Exclude -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.meta.*; /** * A node that changes the type of its input, usually narrowing it. For example, a {@link PiNode} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/SimpleInfopointNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/SimpleInfopointNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/SimpleInfopointNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.code.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; @NodeInfo public final class SimpleInfopointNode extends InfopointNode implements LIRLowerable, IterableNodeType, Simplifiable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/SimplifyingGraphDecoder.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/SimplifyingGraphDecoder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/SimplifyingGraphDecoder.java Wed May 27 00:36:16 2015 +0200 @@ -24,13 +24,13 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Graph decoder that simplifies nodes during decoding. The standard diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StartNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StartNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StartNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.memory.*; +import com.oracle.jvmci.meta.*; /** * The start node of a graph. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java Wed May 27 00:36:16 2015 +0200 @@ -26,14 +26,14 @@ import java.util.concurrent.atomic.*; import java.util.function.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.Assumption; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.meta.Assumptions.Assumption; /** * A graph that contains at least one distinguished node : the {@link #start() start} node. This diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/TypeProfileProxyNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/TypeProfileProxyNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/TypeProfileProxyNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,6 @@ import java.util.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; @@ -33,6 +31,8 @@ import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; +import com.oracle.jvmci.meta.*; /** * A node that attaches a type profile to a proxied input node. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnaryOpLogicNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnaryOpLogicNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnaryOpLogicNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo public abstract class UnaryOpLogicNode extends LogicNode implements LIRLowerable, Canonicalizable.Unary { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Unwinds the current frame to an exception handler in the caller frame. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.nodeinfo.*; +import com.oracle.jvmci.meta.*; /** * This class represents a value within the graph, including local variables, phis, and all other diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNodeUtil.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNodeUtil.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNodeUtil.java Wed May 27 00:36:16 2015 +0200 @@ -24,10 +24,10 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.memory.*; +import com.oracle.jvmci.meta.*; public class ValueNodeUtil { @@ -86,7 +86,7 @@ /** * Converts a given instruction to a value string. The representation of an node as a value is - * formed by concatenating the {@linkplain com.oracle.graal.api.meta.Kind#getTypeChar character} + * formed by concatenating the {@linkplain com.oracle.jvmci.meta.Kind#getTypeChar character} * denoting its {@linkplain ValueNode#getKind kind} and its id. For example, {@code "i13"}. * * @param value the instruction to convert to a value string. If {@code value == null}, then "-" diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AddNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AddNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AddNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp.Add; @@ -33,6 +32,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "+") public class AddNode extends BinaryArithmeticNode implements NarrowableArithmeticNode, BinaryCommutative { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/AndNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp.And; @@ -35,6 +33,8 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "&") public final class AndNode extends BinaryArithmeticNode implements NarrowableArithmeticNode, BinaryCommutative { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/BinaryArithmeticNode.java Wed May 27 00:36:16 2015 +0200 @@ -25,7 +25,6 @@ import java.io.*; import java.util.function.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp; import com.oracle.graal.graph.*; @@ -35,6 +34,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; @NodeInfo public abstract class BinaryArithmeticNode extends BinaryNode implements ArithmeticLIRLowerable, Canonicalizable.Binary { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /* TODO (thomaswue/gdub) For high-level optimization purpose the compare node should be a boolean *value* (it is currently only a helper node) * But in the back-end the comparison should not always be materialized (for example in x86 the comparison result will not be in a register but in a flag) diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConditionalNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConditionalNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConditionalNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import static com.oracle.graal.nodes.calc.CompareNode.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * The {@code ConditionalNode} class represents a comparison that yields one of two values. Note diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Represents a conversion between primitive types. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/DivNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/DivNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/DivNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp.Div; @@ -33,6 +31,8 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "/") public final class DivNode extends BinaryArithmeticNode
{ diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatConvertNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatConvertNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatConvertNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.FloatConvertOp; @@ -34,6 +33,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * A {@code FloatConvert} converts between integers and floating point numbers according to Java diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatEqualsNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatEqualsNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatEqualsNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.util.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "==") public final class FloatEqualsNode extends CompareNode implements BinaryCommutative { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatLessThanNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatLessThanNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/FloatLessThanNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -31,6 +30,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.util.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "<") public final class FloatLessThanNode extends CompareNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerBelowNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerBelowNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerBelowNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -31,6 +29,8 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "|<|") public final class IntegerBelowNode extends CompareNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerConvertNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerConvertNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerConvertNode.java Wed May 27 00:36:16 2015 +0200 @@ -25,7 +25,6 @@ import java.io.*; import java.util.function.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.IntegerConvertOp; import com.oracle.graal.graph.*; @@ -33,6 +32,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * An {@code IntegerConvert} converts an integer to an integer of different width. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerDivNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerDivNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerDivNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; @NodeInfo(shortName = "/") public class IntegerDivNode extends FixedBinaryNode implements Lowerable, LIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.util.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "==") public final class IntegerEqualsNode extends CompareNode implements BinaryCommutative { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -31,7 +29,9 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "<") public final class IntegerLessThanNode extends CompareNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerRemNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerRemNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerRemNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; @NodeInfo(shortName = "%") public class IntegerRemNode extends FixedBinaryNode implements Lowerable, LIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerTestNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerTestNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerTestNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.Canonicalizable.BinaryCommutative; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.meta.*; /** * This node will perform a "test" operation on its arguments. Its result is equivalent to the diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IsNullNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IsNullNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IsNullNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.meta.*; /** * An IsNullNode will be true if the supplied value is null, and false if it is non-null. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.ShiftOp.Shl; import com.oracle.graal.graph.*; @@ -31,6 +30,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "<<") public final class LeftShiftNode extends ShiftNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/MulNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/MulNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/MulNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp.Mul; @@ -34,6 +32,8 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "*") public class MulNode extends BinaryArithmeticNode implements NarrowableArithmeticNode, BinaryCommutative { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NormalizeCompareNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NormalizeCompareNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/NormalizeCompareNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Returns -1, 0, or 1 if either x < y, x == y, or x > y. If the comparison is undecided (one diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -33,6 +32,7 @@ import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "==") public final class ObjectEqualsNode extends PointerEqualsNode implements Virtualizable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/OrNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp.Or; @@ -35,6 +33,8 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "|") public final class OrNode extends BinaryArithmeticNode implements BinaryCommutative, NarrowableArithmeticNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/PointerEqualsNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/PointerEqualsNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/PointerEqualsNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -31,6 +30,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "==") public class PointerEqualsNode extends CompareNode implements BinaryCommutative { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ReinterpretNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ReinterpretNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ReinterpretNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import java.nio.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * The {@code ReinterpretNode} class represents a reinterpreting conversion that changes the stamp diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.ShiftOp.Shr; import com.oracle.graal.graph.*; @@ -31,6 +30,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; @NodeInfo(shortName = ">>") public final class RightShiftNode extends ShiftNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ShiftNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ShiftNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ShiftNode.java Wed May 27 00:36:16 2015 +0200 @@ -25,8 +25,6 @@ import java.io.*; import java.util.function.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.ShiftOp; import com.oracle.graal.graph.*; @@ -34,6 +32,8 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * The {@code ShiftOp} class represents shift operations. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SubNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SubNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/SubNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp.Sub; @@ -33,6 +32,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "-") public class SubNode extends BinaryArithmeticNode implements NarrowableArithmeticNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedDivNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedDivNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedDivNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; @NodeInfo(shortName = "|/|") public class UnsignedDivNode extends FixedBinaryNode implements Lowerable, LIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRemNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRemNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRemNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; @NodeInfo(shortName = "|%|") public class UnsignedRemNode extends FixedBinaryNode implements Lowerable, LIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.ShiftOp.UShr; import com.oracle.graal.graph.*; @@ -31,6 +30,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = ">>>") public final class UnsignedRightShiftNode extends ShiftNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/XorNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.BinaryOp.Xor; @@ -35,6 +33,8 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "^") public final class XorNode extends BinaryArithmeticNode implements BinaryCommutative, NarrowableArithmeticNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ZeroExtendNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ZeroExtendNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ZeroExtendNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.common.type.ArithmeticOpTable.IntegerConvertOp; @@ -34,6 +33,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; /** * The {@code ZeroExtendNode} converts an integer to a wider integer using zero extension. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/Block.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/Block.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/Block.java Wed May 27 00:36:16 2015 +0200 @@ -24,11 +24,11 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.memory.*; +import com.oracle.jvmci.meta.*; public final class Block extends AbstractBlockBase { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/HIRLoop.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/HIRLoop.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/HIRLoop.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.nodes.cfg; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.meta.*; public final class HIRLoop extends Loop { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/LocationSet.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/LocationSet.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/LocationSet.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,8 @@ import java.util.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; + public class LocationSet { private LocationIdentity firstLocation; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AddLocationNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AddLocationNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/AddLocationNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -31,6 +30,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Location node that is the sum of two other location nodes. Can represent locations in the form of diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -35,6 +34,7 @@ import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.virtual.*; +import com.oracle.jvmci.meta.*; /** * This node represents the boxing of a primitive value. This corresponds to a call to the valueOf diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BytecodeExceptionNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BytecodeExceptionNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BytecodeExceptionNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * A node that represents an exception thrown implicitly by a Java bytecode. It can be lowered to diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ComputeAddressNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ComputeAddressNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ComputeAddressNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo public final class ComputeAddressNode extends FloatingNode implements LIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ConstantLocationNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ConstantLocationNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ConstantLocationNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Location node that has a constant displacement. Can represent addresses of the form [base + disp] diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ForeignCallNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ForeignCallNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ForeignCallNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,14 +24,14 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Node for a {@linkplain ForeignCallDescriptor foreign} call. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/GetClassNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/GetClassNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/GetClassNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -31,6 +29,8 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; +import com.oracle.jvmci.meta.*; /** * Loads an object's class (i.e., this node can be created for {@code object.getClass()}). diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -31,6 +29,8 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Location node that has a displacement and a scaled index. Can represent locations in the form of diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IntegerSwitchNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IntegerSwitchNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IntegerSwitchNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.meta.*; /** * The {@code IntegerSwitchNode} represents a switch on integer keys, with a sorted array of key diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/JavaReadNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/JavaReadNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/JavaReadNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Read a raw memory location according to Java field or array read semantics. It will perform read diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/JavaWriteNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/JavaWriteNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/JavaWriteNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Write a raw memory location according to Java field or array write semantics. It will perform diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadHubNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadHubNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadHubNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,14 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; +import com.oracle.jvmci.meta.*; /** * Loads an object's hub. The object is not null-checked by this operation. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadMethodNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadMethodNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LoadMethodNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -31,6 +29,8 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; /** * Loads a method from the virtual method table of a given hub. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/LocationNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.Node.ValueNumberable; import com.oracle.graal.graph.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * A location for a memory access in terms of the kind of value accessed and how to access it. All diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Creates a memory barrier. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,12 +24,12 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * The {@code SwitchNode} class is the base of both lookup and table switches. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.meta.*; @NodeInfo public final class UnboxNode extends FixedWithNextNode implements Virtualizable, Lowerable, Canonicalizable.Unary { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeAccessNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.meta.*; @NodeInfo public abstract class UnsafeAccessNode extends FixedWithNextNode implements Canonicalizable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.meta.*; /** * The {@code UnsafeCastNode} produces the same value as its input, but with a different type. It diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCopyNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCopyNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCopyNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.meta.*; /** * Copy a value at a location specified as an offset relative to a source object to another location diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Load of a value from a location specified as an offset relative to an object. No null check is diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.extended; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Store of a value at a location specified as an offset relative to an object. No null check is diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * The base class of all instructions that access fields. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessIndexedNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessIndexedNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessIndexedNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * The {@code AccessIndexedNode} class is the base class of instructions that read or write elements diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessMonitorNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessMonitorNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessMonitorNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.memory.*; +import com.oracle.jvmci.code.*; /** * The {@code AccessMonitorNode} is the base class of both monitor acquisition and release. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.meta.*; /** * The {@code ArrayLength} instruction gets the length of an array. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AtomicReadAndAddNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AtomicReadAndAddNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AtomicReadAndAddNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Represents an atomic read-and-add operation like {@link Unsafe#getAndAddInt(Object, long, int)}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AtomicReadAndWriteNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AtomicReadAndWriteNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AtomicReadAndWriteNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,13 +24,13 @@ import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Represents an atomic read-and-write operation like {@link Unsafe#getAndSetInt(Object, long, int)} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastDynamicNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastDynamicNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastDynamicNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.meta.*; /** * Implements a type check where the type being checked is loaded at runtime. This is used, for diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,10 @@ */ package com.oracle.graal.nodes.java; -import static com.oracle.graal.api.meta.DeoptimizationAction.*; -import static com.oracle.graal.api.meta.DeoptimizationReason.*; import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; +import static com.oracle.jvmci.meta.DeoptimizationAction.*; +import static com.oracle.jvmci.meta.DeoptimizationReason.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -36,6 +34,8 @@ import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; /** * Implements a type check against a compile-time known type. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ClassIsAssignableFromNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ClassIsAssignableFromNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ClassIsAssignableFromNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * The {@code ClassIsAssignableFromNode} represents a type check against {@link Class} instead of diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CompareAndSwapNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CompareAndSwapNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CompareAndSwapNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Represents an atomic compare-and-swap operation The result is a boolean that contains whether the diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewArrayNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewArrayNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewArrayNode.java Wed May 27 00:36:16 2015 +0200 @@ -25,12 +25,12 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.meta.*; /** * The {@code DynamicNewArrayNode} is used for allocation of arrays when the type is not a diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewInstanceNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewInstanceNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/DynamicNewInstanceNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.meta.*; @NodeInfo public final class DynamicNewInstanceNode extends AbstractNewObjectNode implements Canonicalizable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ExceptionObjectNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ExceptionObjectNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ExceptionObjectNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * The entry to an exception handler with the exception coming from a call (as opposed to a local diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ForeignCallDescriptors.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ForeignCallDescriptors.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ForeignCallDescriptors.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * The foreign call descriptors used by nodes in this package. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfDynamicNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfDynamicNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfDynamicNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * The {@code InstanceOfDynamicNode} represents a type check where the type being checked is not diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -31,6 +29,8 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; /** * The {@code InstanceOfNode} represents an instanceof test. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import static com.oracle.graal.graph.iterators.NodePredicates.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -33,6 +32,7 @@ import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.virtual.*; +import com.oracle.jvmci.meta.*; /** * The {@code LoadFieldNode} represents a read of a static or instance field. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.meta.*; /** * The {@code LoadIndexedNode} represents a read from an element of an array. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoweredAtomicReadAndWriteNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoweredAtomicReadAndWriteNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoweredAtomicReadAndWriteNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,13 +24,13 @@ import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Represents the lowered version of an atomic read-and-write operation like diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoweredCompareAndSwapNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoweredCompareAndSwapNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoweredCompareAndSwapNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Represents the lowered version of an atomic compare-and-swap operation{@code CompareAndSwapNode}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,6 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -32,6 +29,9 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; @NodeInfo public class MethodCallTargetNode extends CallTargetNode implements IterableNodeType, Simplifiable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorEnterNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorEnterNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorEnterNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * The {@code MonitorEnterNode} represents the acquisition of a monitor. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorExitNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorExitNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MonitorExitNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; @@ -31,6 +29,8 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * The {@code MonitorExitNode} represents a monitor release. If it is the release of the monitor of diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.virtual.*; +import com.oracle.jvmci.meta.*; /** * The {@code NewArrayNode} is used for all array allocations where the element type is know at diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewInstanceNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewInstanceNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewInstanceNode.java Wed May 27 00:36:16 2015 +0200 @@ -25,13 +25,13 @@ import java.lang.ref.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.virtual.*; +import com.oracle.jvmci.meta.*; /** * The {@code NewInstanceNode} represents the allocation of an instance class object. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * The {@code NewMultiArrayNode} represents an allocation of a multi-dimensional object array. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/RegisterFinalizerNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/RegisterFinalizerNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/RegisterFinalizerNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,15 +24,15 @@ import static com.oracle.graal.nodes.java.ForeignCallDescriptors.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; /** * This node is used to perform the finalizer registration at the end of the java.lang.Object diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreFieldNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreFieldNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreFieldNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.virtual.*; +import com.oracle.jvmci.meta.*; /** * The {@code StoreFieldNode} represents a write to a static or instance field. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreIndexedNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreIndexedNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreIndexedNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.type.*; +import com.oracle.jvmci.meta.*; /** * The {@code StoreIndexedNode} represents a write to an array element. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeCheckNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeCheckNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeCheckNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.nodes.java; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -31,6 +29,8 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; /** * The {@code TypeCheckNode} represents a test equivalent to (o != null && o.getClass() == type). diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeSwitchNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeSwitchNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeSwitchNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -33,6 +32,7 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.meta.*; /** * The {@code TypeSwitchNode} performs a lookup based on the type of the input value. The type diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/AbstractWriteNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/AbstractWriteNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/AbstractWriteNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes.memory; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; +import com.oracle.jvmci.meta.*; @NodeInfo(allowedUsageTypes = {InputType.Memory}) public abstract class AbstractWriteNode extends FixedAccessNode implements StateSplit, MemoryCheckpoint.Single, MemoryAccess, GuardingNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/FloatingAccessNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/FloatingAccessNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/FloatingAccessNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes.memory; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; +import com.oracle.jvmci.meta.*; @NodeInfo public abstract class FloatingAccessNode extends FloatingGuardedNode implements Access, MemoryAccess { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/FloatingReadNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/FloatingReadNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/FloatingReadNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.memory; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * A floating read of a value from memory specified in terms of an object base and an object diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryAccess.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryAccess.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryAccess.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.nodes.memory; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * This interface marks nodes that access some memory location, and that have an edge to the last diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryCheckpoint.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryCheckpoint.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryCheckpoint.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.nodes.memory; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.meta.*; /** * This interface marks subclasses of {@link FixedNode} that kill a set of memory locations diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryMap.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryMap.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryMap.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,8 @@ import java.util.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; + /** * Maps a {@linkplain LocationIdentity location} to the last node that (potentially) wrote to the diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryMapNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryMapNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryMapNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,10 @@ */ package com.oracle.graal.nodes.memory; -import static com.oracle.graal.api.meta.LocationIdentity.*; +import static com.oracle.jvmci.meta.LocationIdentity.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -34,6 +33,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo(allowedUsageTypes = {InputType.Extension, InputType.Memory}) public final class MemoryMapNode extends FloatingNode implements MemoryMap, MemoryNode, LIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryPhiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryPhiNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/MemoryPhiNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.nodes.memory; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.meta.*; /** * Memory {@code PhiNode}s merge memory dependencies at control flow merges. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/ReadNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/ReadNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/ReadNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.memory; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -33,6 +32,7 @@ import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.util.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * Reads an {@linkplain FixedAccessNode accessed} value. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/WriteNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/WriteNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/memory/WriteNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.memory; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; @@ -31,6 +30,7 @@ import com.oracle.graal.nodes.extended.LocationNode.Location; import com.oracle.graal.nodes.spi.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * Writes a given {@linkplain #value() value} a {@linkplain FixedAccessNode memory location}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/ArithmeticLIRLowerable.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/ArithmeticLIRLowerable.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/ArithmeticLIRLowerable.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes.spi; -import com.oracle.graal.api.code.*; import com.oracle.graal.lir.gen.*; +import com.oracle.jvmci.code.*; public interface ArithmeticLIRLowerable extends ArithmeticOperation { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LoweringProvider.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LoweringProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LoweringProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.nodes.spi; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; +import com.oracle.jvmci.meta.*; /** * Provides a capability for replacing a higher node with one or more lower level nodes. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LoweringTool.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LoweringTool.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LoweringTool.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.nodes.spi; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; +import com.oracle.jvmci.meta.*; public interface LoweringTool { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/MemoryProxy.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/MemoryProxy.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/MemoryProxy.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes.spi; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.memory.*; +import com.oracle.jvmci.meta.*; public interface MemoryProxy extends Proxy, MemoryNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/NodeLIRBuilderTool.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/NodeLIRBuilderTool.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/NodeLIRBuilderTool.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,6 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -35,6 +33,8 @@ import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.nodes.extended.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; public interface NodeLIRBuilderTool extends NodeMappableLIRBuilder { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/NodeMappableLIRBuilder.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/NodeMappableLIRBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/NodeMappableLIRBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -23,9 +23,9 @@ package com.oracle.graal.nodes.spi; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.meta.*; public interface NodeMappableLIRBuilder { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Replacements.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Replacements.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/Replacements.java Wed May 27 00:36:16 2015 +0200 @@ -25,9 +25,9 @@ import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.meta.*; /** * Interface for managing replacements. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/ReplacementsProvider.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/ReplacementsProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/ReplacementsProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.nodes.spi; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; import com.oracle.jvmci.runtime.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/UncheckedInterfaceProvider.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/UncheckedInterfaceProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/UncheckedInterfaceProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.nodes.spi; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; +import com.oracle.jvmci.meta.*; public interface UncheckedInterfaceProvider { /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/VirtualizerTool.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/VirtualizerTool.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/VirtualizerTool.java Wed May 27 00:36:16 2015 +0200 @@ -24,12 +24,12 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.Virtualizable.State; import com.oracle.graal.nodes.virtual.*; +import com.oracle.jvmci.meta.*; /** * This tool can be used to query the current state (normal/virtualized/re-materialized) of values diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampTool.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampTool.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampTool.java Wed May 27 00:36:16 2015 +0200 @@ -24,9 +24,9 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.meta.*; /** * Helper class that is used to keep all stamp-related operations in one place. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java Wed May 27 00:36:16 2015 +0200 @@ -24,14 +24,14 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; public class GraphUtil { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualArrayNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualArrayNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualArrayNode.java Wed May 27 00:36:16 2015 +0200 @@ -26,11 +26,11 @@ import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo(nameTemplate = "VirtualArray {p#componentType/s}[{p#length}]") public class VirtualArrayNode extends VirtualObjectNode implements ArrayLengthProvider { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualBoxingNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualBoxingNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualBoxingNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.nodes.virtual; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; +import com.oracle.jvmci.meta.*; @NodeInfo public final class VirtualBoxingNode extends VirtualInstanceNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualInstanceNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualInstanceNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualInstanceNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.nodes.virtual; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.meta.*; @NodeInfo(nameTemplate = "VirtualInstance {p#type/s}") public class VirtualInstanceNode extends VirtualObjectNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.nodes.virtual; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo public abstract class VirtualObjectNode extends ValueNode implements LIRLowerable, IterableNodeType { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common.test/src/com/oracle/graal/phases/common/test/StampFactoryTest.java --- a/graal/com.oracle.graal.phases.common.test/src/com/oracle/graal/phases/common/test/StampFactoryTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common.test/src/com/oracle/graal/phases/common/test/StampFactoryTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,12 @@ */ package com.oracle.graal.phases.common.test; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.Kind; import java.lang.reflect.*; import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.runtime.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,9 @@ */ package com.oracle.graal.phases.common; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.MetaAccessProvider; import com.oracle.graal.graph.*; import com.oracle.graal.graph.Graph.Mark; import com.oracle.graal.graph.Graph.NodeEventListener; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,11 @@ */ package com.oracle.graal.phases.common; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConvertDeoptimizeToGuardPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConvertDeoptimizeToGuardPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConvertDeoptimizeToGuardPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,13 @@ */ package com.oracle.graal.phases.common; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.DeoptimizationAction; import static com.oracle.graal.phases.common.DeadCodeEliminationPhase.Optionality.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/DominatorConditionalEliminationPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/DominatorConditionalEliminationPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/DominatorConditionalEliminationPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,14 @@ */ package com.oracle.graal.phases.common; -import static com.oracle.graal.api.meta.DeoptimizationAction.*; -import static com.oracle.graal.api.meta.DeoptimizationReason.*; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.TriState; +import static com.oracle.jvmci.meta.DeoptimizationAction.*; +import static com.oracle.jvmci.meta.DeoptimizationReason.*; import java.util.*; import java.util.function.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/FloatingReadPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.phases.common; -import static com.oracle.graal.api.meta.LocationIdentity.*; +import com.oracle.jvmci.meta.LocationIdentity; +import static com.oracle.jvmci.meta.LocationIdentity.*; import static com.oracle.graal.graph.Graph.NodeEvent.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.graph.Graph.NodeEventScope; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/GuardLoweringPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.phases.common; +import com.oracle.jvmci.meta.JavaConstant; import static com.oracle.graal.compiler.common.GraalOptions.*; import java.util.*; import java.util.Map.Entry; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/IterativeConditionalEliminationPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/IterativeConditionalEliminationPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/IterativeConditionalEliminationPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.phases.common; +import com.oracle.jvmci.code.BailoutException; import static com.oracle.graal.graph.Graph.NodeEvent.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.graph.Graph.NodeEventScope; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/LoweringPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,16 @@ */ package com.oracle.graal.phases.common; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.DeoptimizationAction; +import com.oracle.jvmci.meta.MetaAccessProvider; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.phases.common.LoweringPhase.ProcessBlockState.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.Graph.Mark; import com.oracle.graal.graph.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/UseTrappingNullChecksPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/UseTrappingNullChecksPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/UseTrappingNullChecksPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,11 @@ */ package com.oracle.graal.phases.common; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.MetaAccessProvider; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java Wed May 27 00:36:16 2015 +0200 @@ -22,16 +22,22 @@ */ package com.oracle.graal.phases.common.inlining; -import static com.oracle.graal.api.meta.DeoptimizationAction.*; -import static com.oracle.graal.api.meta.DeoptimizationReason.*; +import com.oracle.jvmci.code.BytecodeFrame; +import com.oracle.jvmci.code.BytecodePosition; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Assumptions; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.DeoptimizationAction; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import static com.oracle.jvmci.meta.DeoptimizationAction.*; +import static com.oracle.jvmci.meta.DeoptimizationReason.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.compiler.common.type.StampFactory.*; import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/AbstractInlineInfo.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/AbstractInlineInfo.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/AbstractInlineInfo.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.phases.common.inlining.info; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.phases.common.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/AssumptionInlineInfo.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/AssumptionInlineInfo.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/AssumptionInlineInfo.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.phases.common.inlining.info; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.util.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/ExactInlineInfo.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/ExactInlineInfo.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/ExactInlineInfo.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.phases.common.inlining.info; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.phases.common.inlining.info.elem.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/InlineInfo.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/InlineInfo.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/InlineInfo.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.phases.common.inlining.info; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.phases.common.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/MultiTypeGuardInlineInfo.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/MultiTypeGuardInlineInfo.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/MultiTypeGuardInlineInfo.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,16 @@ */ package com.oracle.graal.phases.common.inlining.info; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.DeoptimizationAction; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.MetaAccessProvider; import java.util.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.JavaTypeProfile.ProfiledType; +import com.oracle.jvmci.meta.JavaTypeProfile.ProfiledType; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/TypeGuardInlineInfo.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/TypeGuardInlineInfo.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/TypeGuardInlineInfo.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,12 @@ */ package com.oracle.graal.phases.common.inlining.info; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.DeoptimizationAction; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/Inlineable.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/Inlineable.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/Inlineable.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.phases.common.inlining.info.elem; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import com.oracle.graal.nodes.*; import com.oracle.graal.phases.common.*; import com.oracle.graal.phases.tiers.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/info/elem/InlineableGraph.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,13 @@ */ package com.oracle.graal.phases.common.inlining.info.elem; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.phases.common.DeadCodeEliminationPhase.Optionality.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/AbstractInliningPolicy.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/AbstractInliningPolicy.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/AbstractInliningPolicy.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,12 @@ */ package com.oracle.graal.phases.common.inlining.policy; +import com.oracle.jvmci.meta.ProfilingInfo; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.graal.phases.common.inlining.InliningPhase.Options.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.phases.common.inlining.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/InlineEverythingPolicy.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/InlineEverythingPolicy.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/InlineEverythingPolicy.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.phases.common.inlining.policy; +import com.oracle.jvmci.code.BailoutException; import static com.oracle.graal.compiler.common.GraalOptions.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.phases.common.inlining.walker.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.phases.common.inlining.policy; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/CallsiteHolder.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/CallsiteHolder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/CallsiteHolder.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.phases.common.inlining.walker; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import com.oracle.graal.nodes.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/CallsiteHolderExplorable.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/CallsiteHolderExplorable.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/CallsiteHolderExplorable.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.phases.common.inlining.walker; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.util.*; import java.util.function.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.phases.common.inlining.policy.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/InliningData.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,15 @@ */ package com.oracle.graal.phases.common.inlining.walker; +import com.oracle.jvmci.code.BailoutException; +import com.oracle.jvmci.meta.JavaTypeProfile; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.graal.compiler.common.GraalOptions.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/MethodInvocation.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/MethodInvocation.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/walker/MethodInvocation.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.phases.common.inlining.walker; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.phases.common.inlining.info.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/OptimisticOptimizations.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/OptimisticOptimizations.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/OptimisticOptimizations.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,10 @@ */ package com.oracle.graal.phases; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.ProfilingInfo; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.jvmci.debug.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/MemoryScheduleVerification.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/MemoryScheduleVerification.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/MemoryScheduleVerification.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.phases.schedule; +import com.oracle.jvmci.meta.LocationIdentity; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.graph.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.phases.schedule; +import com.oracle.jvmci.meta.LocationIdentity; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.compiler.common.cfg.AbstractControlFlowGraph.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/LowTierContext.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/LowTierContext.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/LowTierContext.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.phases.tiers; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.TargetDescription; import com.oracle.graal.phases.util.*; public class LowTierContext extends PhaseContext { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/MidTierContext.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/MidTierContext.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/MidTierContext.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,9 @@ */ package com.oracle.graal.phases.tiers; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.SpeculationLog; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.ProfilingInfo; import com.oracle.graal.phases.*; import com.oracle.graal.phases.util.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/PhaseContext.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/PhaseContext.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/PhaseContext.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.phases.tiers; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ConstantReflectionProvider; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.phases.util.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/MethodDebugValueName.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/MethodDebugValueName.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/MethodDebugValueName.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.phases.util; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.JavaMethod; import com.oracle.graal.phases.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/Providers.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/Providers.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/Providers.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,10 @@ */ package com.oracle.graal.phases.util; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ConstantReflectionProvider; import com.oracle.graal.compiler.common.spi.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.phases.tiers.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyDebugUsage.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyDebugUsage.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyDebugUsage.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.phases.verify; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ResolvedJavaType; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.phases.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,12 @@ */ package com.oracle.graal.phases.verify; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Signature; +import com.oracle.jvmci.meta.TrustedInterface; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/BinaryGraphPrinter.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,10 @@ */ package com.oracle.graal.printer; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.Signature; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.JavaType; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.graph.Edges.Type.*; @@ -31,7 +35,6 @@ import java.util.*; import java.util.Map.Entry; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,17 @@ */ package com.oracle.graal.printer; -import static com.oracle.graal.api.code.ValueUtil.*; +import com.oracle.jvmci.code.DebugInfo; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.MetaUtil; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import static com.oracle.jvmci.code.ValueUtil.*; import java.io.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.graph.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,15 @@ */ package com.oracle.graal.printer; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.JavaMethod; import java.io.*; import java.util.*; import java.util.concurrent.atomic.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.graph.*; import com.oracle.graal.java.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CompilationPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CompilationPrinter.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CompilationPrinter.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,21 @@ */ package com.oracle.graal.printer; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.code.VirtualObject; +import com.oracle.jvmci.code.BytecodePosition; +import com.oracle.jvmci.code.BytecodeFrame; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.code.RegisterSaveLayout; +import com.oracle.jvmci.code.ReferenceMap; +import com.oracle.jvmci.meta.MetaUtil; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaMethod; import java.io.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CodeUtil.RefMapFormatter; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CodeUtil.RefMapFormatter; import com.oracle.jvmci.debug.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinter.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinter.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.printer; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.io.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.phases.schedule.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/GraphPrinterDumpHandler.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,8 @@ */ package com.oracle.graal.printer; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.JavaMethod; import static com.oracle.graal.compiler.GraalDebugConfig.*; import static com.oracle.graal.compiler.common.GraalOptions.*; @@ -32,7 +34,6 @@ import java.text.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.phases.schedule.*; import com.oracle.jvmci.debug.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.printer; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.graal.compiler.common.GraalOptions.*; import java.io.*; import java.util.*; import java.util.Map.Entry; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.java.*; import com.oracle.graal.nodeinfo.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64ConvertSnippets.java --- a/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64ConvertSnippets.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64ConvertSnippets.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.replacements.amd64; +import com.oracle.jvmci.code.TargetDescription; import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; import static com.oracle.graal.replacements.SnippetTemplate.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64CountLeadingZerosNode.java --- a/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64CountLeadingZerosNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64CountLeadingZerosNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,10 @@ */ package com.oracle.graal.replacements.amd64; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaConstant; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64CountTrailingZerosNode.java --- a/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64CountTrailingZerosNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64CountTrailingZerosNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,10 @@ */ package com.oracle.graal.replacements.amd64; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CodeUtil; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaConstant; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64GraphBuilderPlugins.java --- a/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64GraphBuilderPlugins.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64GraphBuilderPlugins.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,15 @@ */ package com.oracle.graal.replacements.amd64; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.LocationIdentity; import static com.oracle.graal.compiler.target.Backend.*; import static com.oracle.graal.replacements.amd64.AMD64MathIntrinsicNode.Operation.*; import sun.misc.*; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.graphbuilderconf.InvocationPlugin.Receiver; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64MathIntrinsicNode.java --- a/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64MathIntrinsicNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64MathIntrinsicNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.replacements.amd64; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64MathSubstitutions.java --- a/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64MathSubstitutions.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64MathSubstitutions.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.replacements.amd64; +import com.oracle.jvmci.meta.ForeignCallDescriptor; import static com.oracle.graal.compiler.target.Backend.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; import com.oracle.graal.nodes.extended.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.sparc/src/com/oracle/graal/replacements/sparc/SPARCGraphBuilderPlugins.java --- a/graal/com.oracle.graal.replacements.sparc/src/com/oracle/graal/replacements/sparc/SPARCGraphBuilderPlugins.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.sparc/src/com/oracle/graal/replacements/sparc/SPARCGraphBuilderPlugins.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.replacements.sparc; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.compiler.target.Backend.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.graphbuilderconf.InvocationPlugins.Registration; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/BitOpNodesTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/BitOpNodesTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/BitOpNodesTest.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; @@ -33,6 +32,7 @@ import com.oracle.graal.phases.common.inlining.*; import com.oracle.graal.phases.tiers.*; import com.oracle.graal.replacements.nodes.*; +import com.oracle.jvmci.meta.*; public class BitOpNodesTest extends GraalCompilerTest { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/CheckCastTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/CheckCastTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/CheckCastTest.java Wed May 27 00:36:16 2015 +0200 @@ -24,9 +24,9 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; +import com.oracle.jvmci.meta.*; /** * Tests the implementation of checkcast, allowing profiling information to be manually specified. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/CompiledExceptionHandlerTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/CompiledExceptionHandlerTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/CompiledExceptionHandlerTest.java Wed May 27 00:36:16 2015 +0200 @@ -24,12 +24,12 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; import com.oracle.graal.nodes.java.*; import com.oracle.graal.phases.common.*; +import com.oracle.jvmci.meta.*; /** * Tests compilation of a hot exception handler. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/DeoptimizeOnExceptionTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/DeoptimizeOnExceptionTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/DeoptimizeOnExceptionTest.java Wed May 27 00:36:16 2015 +0200 @@ -26,9 +26,9 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.phases.common.*; +import com.oracle.jvmci.meta.*; /** * Tests that deoptimization upon exception handling works. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/DynamicNewArrayTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/DynamicNewArrayTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/DynamicNewArrayTest.java Wed May 27 00:36:16 2015 +0200 @@ -26,8 +26,8 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; +import com.oracle.jvmci.meta.*; /** * Tests the implementation of Array.createInstance. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/EdgesTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/EdgesTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/EdgesTest.java Wed May 27 00:36:16 2015 +0200 @@ -26,7 +26,6 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; @@ -38,6 +37,7 @@ import com.oracle.graal.phases.common.inlining.*; import com.oracle.graal.phases.common.inlining.policy.*; import com.oracle.graal.phases.tiers.*; +import com.oracle.jvmci.meta.*; public class EdgesTest extends GraalCompilerTest { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/InstanceOfTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/InstanceOfTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/InstanceOfTest.java Wed May 27 00:36:16 2015 +0200 @@ -26,16 +26,16 @@ import org.junit.*; -import com.oracle.graal.api.code.CompilationResult.Call; -import com.oracle.graal.api.code.CompilationResult.Mark; -import com.oracle.graal.api.code.CompilationResult.Site; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.phases.common.*; import com.oracle.graal.replacements.test.CheckCastTest.Depth12; import com.oracle.graal.replacements.test.CheckCastTest.Depth13; import com.oracle.graal.replacements.test.CheckCastTest.Depth14; +import com.oracle.jvmci.code.CompilationResult.Call; +import com.oracle.jvmci.code.CompilationResult.Mark; +import com.oracle.jvmci.code.CompilationResult.Site; +import com.oracle.jvmci.meta.*; /** * Tests the implementation of instanceof, allowing profiling information to be manually specified. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/MethodSubstitutionTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/MethodSubstitutionTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/MethodSubstitutionTest.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,6 @@ import java.lang.reflect.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.graph.*; @@ -34,8 +32,10 @@ import com.oracle.graal.phases.common.*; import com.oracle.graal.phases.common.inlining.*; import com.oracle.graal.phases.tiers.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.debug.*; import com.oracle.jvmci.debug.Debug.Scope; +import com.oracle.jvmci.meta.*; /** * Tests if {@link MethodSubstitution}s are inlined correctly. Most test cases only assert that diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/NewMultiArrayTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/NewMultiArrayTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/NewMultiArrayTest.java Wed May 27 00:36:16 2015 +0200 @@ -27,11 +27,11 @@ import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Tests the lowering of the MULTIANEWARRAY instruction. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ObjectAccessTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ObjectAccessTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ObjectAccessTest.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,6 @@ import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; @@ -33,6 +31,8 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.replacements.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Tests for the {@link Pointer} read and write operations. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,6 @@ import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; @@ -37,6 +35,8 @@ import com.oracle.graal.replacements.*; import com.oracle.graal.word.*; import com.oracle.graal.word.nodes.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Tests for the {@link Pointer} read and write operations. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ReplacementsParseTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ReplacementsParseTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ReplacementsParseTest.java Wed May 27 00:36:16 2015 +0200 @@ -26,7 +26,6 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.test.*; @@ -35,6 +34,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.runtime.*; +import com.oracle.jvmci.meta.*; /** * Tests for expected behavior when parsing snippets and intrinsics. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/StandardMethodSubstitutionsTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/StandardMethodSubstitutionsTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/StandardMethodSubstitutionsTest.java Wed May 27 00:36:16 2015 +0200 @@ -26,12 +26,12 @@ import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.replacements.nodes.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Tests the VM independent {@link MethodSubstitution}s. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/StringSubstitutionsTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/StringSubstitutionsTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/StringSubstitutionsTest.java Wed May 27 00:36:16 2015 +0200 @@ -24,11 +24,11 @@ import org.junit.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.replacements.*; import com.oracle.graal.replacements.nodes.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Tests {@link StringSubstitutions}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/SubstitutionsTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/SubstitutionsTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/SubstitutionsTest.java Wed May 27 00:36:16 2015 +0200 @@ -27,7 +27,6 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.compiler.test.*; @@ -40,6 +39,7 @@ import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.memory.*; +import com.oracle.jvmci.meta.*; public class SubstitutionsTest extends GraalCompilerTest { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/TypeCheckTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/TypeCheckTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/TypeCheckTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.replacements.test; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.JavaTypeProfile.ProfiledType; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.meta.JavaTypeProfile.ProfiledType; /** * Base class for checkcast and instanceof test classes. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/UnsafeSubstitutionsTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/UnsafeSubstitutionsTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/UnsafeSubstitutionsTest.java Wed May 27 00:36:16 2015 +0200 @@ -28,9 +28,9 @@ import sun.misc.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.replacements.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Tests the VM independent {@link UnsafeSubstitutions}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/UnsignedMathTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/UnsignedMathTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/UnsignedMathTest.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,8 @@ import org.junit.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.test.*; +import com.oracle.jvmci.code.*; /** * Tests the substitutions for the {@link UnsignedMath} class. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/WordTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/WordTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/WordTest.java Wed May 27 00:36:16 2015 +0200 @@ -24,12 +24,12 @@ import org.junit.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; import com.oracle.graal.replacements.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.meta.*; /** * Tests for the {@link Word} type. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements.verifier/src/com/oracle/graal/replacements/verifier/NodeIntrinsicVerifier.java --- a/graal/com.oracle.graal.replacements.verifier/src/com/oracle/graal/replacements/verifier/NodeIntrinsicVerifier.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements.verifier/src/com/oracle/graal/replacements/verifier/NodeIntrinsicVerifier.java Wed May 27 00:36:16 2015 +0200 @@ -54,7 +54,7 @@ } private TypeMirror resolvedJavaTypeType() { - return env.getElementUtils().getTypeElement("com.oracle.graal.api.meta.ResolvedJavaType").asType(); + return env.getElementUtils().getTypeElement("com.oracle.jvmci.meta.ResolvedJavaType").asType(); } private TypeMirror structuralInputType() { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ArraySubstitutions.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ArraySubstitutions.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ArraySubstitutions.java Wed May 27 00:36:16 2015 +0200 @@ -24,9 +24,9 @@ import static com.oracle.graal.nodes.extended.BranchProbabilityNode.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; +import com.oracle.jvmci.meta.*; // JaCoCo Exclude diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/BoxingSnippets.java Wed May 27 00:36:16 2015 +0200 @@ -27,8 +27,6 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; @@ -40,7 +38,9 @@ import com.oracle.graal.replacements.SnippetTemplate.AbstractTemplates; import com.oracle.graal.replacements.SnippetTemplate.Arguments; import com.oracle.graal.replacements.SnippetTemplate.SnippetInfo; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; public class BoxingSnippets implements Snippets { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/CachingPEGraphDecoder.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/CachingPEGraphDecoder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/CachingPEGraphDecoder.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,6 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.java.*; import com.oracle.graal.nodes.*; @@ -34,7 +32,9 @@ import com.oracle.graal.phases.common.*; import com.oracle.graal.phases.tiers.*; import com.oracle.graal.phases.util.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; /** * A graph decoder that provides all necessary encoded graphs on-the-fly (by parsing the methods and diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ConstantBindingParameterPlugin.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ConstantBindingParameterPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ConstantBindingParameterPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.replacements; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; +import com.oracle.jvmci.meta.*; /** * A {@link ParameterPlugin} that binds constant values to some parameters. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultGenericInvocationPlugin.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultGenericInvocationPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultGenericInvocationPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,11 @@ */ package com.oracle.graal.replacements; -import static com.oracle.graal.api.meta.MetaUtil.*; import static com.oracle.graal.replacements.NodeIntrinsificationPhase.*; +import static com.oracle.jvmci.meta.MetaUtil.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.*; import com.oracle.graal.compiler.common.type.*; @@ -39,6 +38,7 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.word.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * An {@link GenericInvocationPlugin} that handles methods annotated by {@link Fold}, diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultInlineInvokePlugin.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultInlineInvokePlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultInlineInvokePlugin.java Wed May 27 00:36:16 2015 +0200 @@ -25,9 +25,9 @@ import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.java.GraphBuilderPhase.Options.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.meta.*; public final class DefaultInlineInvokePlugin implements InlineInvokePlugin { private final ReplacementsImpl replacements; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/DefaultJavaLoweringProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,16 +22,14 @@ */ package com.oracle.graal.replacements; -import static com.oracle.graal.api.code.MemoryBarriers.*; -import static com.oracle.graal.api.meta.DeoptimizationAction.*; -import static com.oracle.graal.api.meta.DeoptimizationReason.*; -import static com.oracle.graal.api.meta.LocationIdentity.*; import static com.oracle.graal.nodes.java.ArrayLengthNode.*; +import static com.oracle.jvmci.code.MemoryBarriers.*; +import static com.oracle.jvmci.meta.DeoptimizationAction.*; +import static com.oracle.jvmci.meta.DeoptimizationReason.*; +import static com.oracle.jvmci.meta.LocationIdentity.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.type.*; @@ -48,7 +46,9 @@ import com.oracle.graal.nodes.util.*; import com.oracle.graal.nodes.virtual.*; import com.oracle.graal.phases.util.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * VM-independent lowerings for standard Java nodes. VM-specific methods are abstract and must be diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/GraphKit.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/GraphKit.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/GraphKit.java Wed May 27 00:36:16 2015 +0200 @@ -27,8 +27,6 @@ import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; @@ -45,6 +43,8 @@ import com.oracle.graal.phases.common.inlining.*; import com.oracle.graal.phases.util.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * A utility for manually creating a graph. This will be expanded as necessary to support all diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/InstanceOfSnippetsTemplates.java Wed May 27 00:36:16 2015 +0200 @@ -26,7 +26,6 @@ import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.graph.*; @@ -39,6 +38,7 @@ import com.oracle.graal.replacements.SnippetTemplate.AbstractTemplates; import com.oracle.graal.replacements.SnippetTemplate.Arguments; import com.oracle.graal.replacements.SnippetTemplate.UsageReplacer; +import com.oracle.jvmci.code.*; /** * Helper class for lowering {@link InstanceOfNode}s with snippets. The majority of the complexity diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/IntrinsicGraphBuilder.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/IntrinsicGraphBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/IntrinsicGraphBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.replacements; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.graphbuilderconf.InvocationPlugin.Receiver; @@ -32,7 +30,9 @@ import com.oracle.graal.nodes.StructuredGraph.AllowAssumptions; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * Implementation of {@link GraphBuilderContext} used to produce a graph for a method based on an diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/Log.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/Log.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/Log.java Wed May 27 00:36:16 2015 +0200 @@ -24,10 +24,10 @@ import java.io.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.Node.ConstantNodeParameter; import com.oracle.graal.graph.Node.NodeIntrinsic; import com.oracle.graal.nodes.extended.*; +import com.oracle.jvmci.meta.*; //JaCoCo Exclude diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/MethodHandleInvocationPlugin.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/MethodHandleInvocationPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/MethodHandleInvocationPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.replacements; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.MethodHandleAccessProvider.IntrinsicMethod; import com.oracle.graal.graph.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; import com.oracle.graal.replacements.nodes.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.meta.MethodHandleAccessProvider.IntrinsicMethod; public class MethodHandleInvocationPlugin implements GenericInvocationPlugin { private final MethodHandleAccessProvider methodHandleAccess; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,11 @@ */ package com.oracle.graal.replacements; -import static com.oracle.graal.api.meta.MetaUtil.*; +import static com.oracle.jvmci.meta.MetaUtil.*; import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -42,9 +40,11 @@ import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; import com.oracle.graal.phases.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; import com.oracle.jvmci.debug.internal.*; +import com.oracle.jvmci.meta.*; /** * Replaces calls to {@link NodeIntrinsic}s with nodes and calls to methods annotated with diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/PEGraphDecoder.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/PEGraphDecoder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/PEGraphDecoder.java Wed May 27 00:36:16 2015 +0200 @@ -27,8 +27,6 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -43,7 +41,9 @@ import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.phases.common.inlining.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; /** * A graph decoder that performs partial evaluation, i.e., that performs method inlining and diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.replacements; -import static com.oracle.graal.api.meta.MetaUtil.*; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.graphbuilderconf.IntrinsicContext.CompilationContext.*; import static com.oracle.graal.java.GraphBuilderPhase.Options.*; import static com.oracle.graal.phases.common.DeadCodeEliminationPhase.Optionality.*; +import static com.oracle.jvmci.meta.MetaUtil.*; import static java.lang.String.*; import java.lang.reflect.*; @@ -36,8 +36,6 @@ import sun.misc.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.graph.*; @@ -55,9 +53,11 @@ import com.oracle.graal.phases.tiers.*; import com.oracle.graal.phases.util.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; import com.oracle.jvmci.debug.Debug.Scope; +import com.oracle.jvmci.meta.*; import com.oracle.jvmci.options.*; import com.oracle.jvmci.options.OptionValue.OverrideScope; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetCounterNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetCounterNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetCounterNode.java Wed May 27 00:36:16 2015 +0200 @@ -28,8 +28,6 @@ import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -42,7 +40,9 @@ import com.oracle.graal.replacements.SnippetTemplate.Arguments; import com.oracle.graal.replacements.SnippetTemplate.SnippetInfo; import com.oracle.graal.word.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * This node can be used to add a counter to the code that will estimate the dynamic number of calls diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.replacements; -import static com.oracle.graal.api.meta.LocationIdentity.*; import static com.oracle.graal.phases.common.DeadCodeEliminationPhase.Optionality.*; import static com.oracle.graal.replacements.SnippetTemplate.AbstractTemplates.*; import static com.oracle.jvmci.debug.Debug.*; +import static com.oracle.jvmci.meta.LocationIdentity.*; import static java.util.FormattableFlags.*; import java.io.*; @@ -36,8 +36,6 @@ import java.util.function.*; import java.util.stream.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.Graph.Mark; @@ -62,9 +60,11 @@ import com.oracle.graal.replacements.Snippet.VarargsParameter; import com.oracle.graal.replacements.nodes.*; import com.oracle.graal.word.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; import com.oracle.jvmci.debug.Debug.Scope; +import com.oracle.jvmci.meta.*; /** * A snippet template is a graph created by parsing a snippet method and then specialized by binding diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StandardGraphBuilderPlugins.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StandardGraphBuilderPlugins.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/StandardGraphBuilderPlugins.java Wed May 27 00:36:16 2015 +0200 @@ -22,16 +22,14 @@ */ package com.oracle.graal.replacements; -import static com.oracle.graal.api.code.MemoryBarriers.*; +import static com.oracle.jvmci.code.MemoryBarriers.*; import java.lang.reflect.*; import java.util.*; import sun.misc.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.api.directives.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -46,7 +44,9 @@ import com.oracle.graal.nodes.util.*; import com.oracle.graal.replacements.nodes.*; import com.oracle.graal.replacements.nodes.arithmetic.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; import com.oracle.jvmci.options.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/UnsafeSubstitutions.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/UnsafeSubstitutions.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/UnsafeSubstitutions.java Wed May 27 00:36:16 2015 +0200 @@ -28,10 +28,10 @@ import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; +import com.oracle.jvmci.meta.*; /** * Substitutions for {@link sun.misc.Unsafe} methods. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/WordOperationPlugin.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/WordOperationPlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/WordOperationPlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,11 @@ */ package com.oracle.graal.replacements; -import static com.oracle.graal.api.meta.LocationIdentity.*; import static com.oracle.graal.nodes.ConstantNode.*; +import static com.oracle.jvmci.meta.LocationIdentity.*; import java.lang.reflect.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; @@ -41,6 +40,7 @@ import com.oracle.graal.word.Word.Operation; import com.oracle.graal.word.nodes.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * A {@link GenericInvocationPlugin} for calls to {@linkplain Operation word operations}, and a diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ArrayEqualsNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ArrayEqualsNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ArrayEqualsNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.replacements.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -31,6 +30,7 @@ import com.oracle.graal.nodes.memory.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.meta.*; // JaCoCo Exclude diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BasicArrayCopyNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BasicArrayCopyNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BasicArrayCopyNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,8 @@ */ package com.oracle.graal.replacements.nodes; -import static com.oracle.graal.api.meta.LocationIdentity.*; +import static com.oracle.jvmci.meta.LocationIdentity.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; @@ -35,6 +34,7 @@ import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.virtual.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; @NodeInfo public class BasicArrayCopyNode extends AbstractMemoryCheckpoint implements Virtualizable, MemoryCheckpoint.Single, MemoryAccess, Lowerable, DeoptimizingNode.DeoptDuring { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BasicObjectCloneNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BasicObjectCloneNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BasicObjectCloneNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,6 @@ import java.util.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; @@ -35,6 +33,8 @@ import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; import com.oracle.graal.nodes.virtual.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; @NodeInfo public abstract class BasicObjectCloneNode extends MacroStateSplitNode implements VirtualizableAllocation, ArrayLengthProvider { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitCountNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitCountNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitCountNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.replacements.nodes; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -31,6 +29,8 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; @NodeInfo public final class BitCountNode extends UnaryNode implements LIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanForwardNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanForwardNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanForwardNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.replacements.nodes; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -31,6 +29,8 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Determines the index of the least significant "1" bit. Note that the result is undefined if the diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanReverseNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanReverseNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BitScanReverseNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.replacements.nodes; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -31,6 +29,8 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Determines the index of the most significant "1" bit. Note that the result is undefined if the diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DeferredPiNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DeferredPiNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DeferredPiNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ //JaCoCo Exclude -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -32,6 +31,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.replacements.*; +import com.oracle.jvmci.meta.*; /** * A node for use in method substitutions or snippets that changes the type of its input where the diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectObjectStoreNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectObjectStoreNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectObjectStoreNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.replacements.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * A special purpose store node that differs from {@link UnsafeStoreNode} in that it is not a diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectReadNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectReadNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectReadNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.replacements.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * A special purpose store node that differs from {@link UnsafeStoreNode} in that it is not a diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectStoreNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectStoreNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectStoreNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.replacements.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * A special purpose store node that differs from {@link UnsafeStoreNode} in that it is not a diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,8 @@ */ package com.oracle.graal.replacements.nodes; -import static com.oracle.graal.api.code.BytecodeFrame.*; +import static com.oracle.jvmci.code.BytecodeFrame.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; @@ -41,6 +40,7 @@ import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; import com.oracle.jvmci.debug.Debug.Scope; +import com.oracle.jvmci.meta.*; /** * Macro nodes can be used to temporarily replace an invoke. They can, for example, be used to diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroStateSplitNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroStateSplitNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroStateSplitNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,15 +22,15 @@ */ package com.oracle.graal.replacements.nodes; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.memory.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * This is an extension of {@link MacroNode} that is a {@link StateSplit} and a diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MethodHandleNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MethodHandleNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MethodHandleNode.java Wed May 27 00:36:16 2015 +0200 @@ -25,9 +25,6 @@ import java.lang.invoke.*; import java.util.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; -import com.oracle.graal.api.meta.MethodHandleAccessProvider.IntrinsicMethod; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -38,6 +35,9 @@ import com.oracle.graal.nodes.type.*; import com.oracle.graal.nodes.util.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; +import com.oracle.jvmci.meta.MethodHandleAccessProvider.IntrinsicMethod; /** * Node for invocation methods defined on the class {@link MethodHandle}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/PureFunctionMacroNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/PureFunctionMacroNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/PureFunctionMacroNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.replacements.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; import com.oracle.graal.nodes.*; +import com.oracle.jvmci.meta.*; /** * This node class can be used to create {@link MacroNode}s for simple pure functions like diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReadRegisterNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReadRegisterNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReadRegisterNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.replacements.nodes; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Access the value of a specific register. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ResolvedMethodHandleCallTargetNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ResolvedMethodHandleCallTargetNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ResolvedMethodHandleCallTargetNode.java Wed May 27 00:36:16 2015 +0200 @@ -26,13 +26,13 @@ import java.lang.invoke.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; import com.oracle.graal.nodes.spi.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * A call target that replaces itself in the graph when being lowered by restoring the original diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReverseBytesNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReverseBytesNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReverseBytesNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.replacements.nodes; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -31,6 +29,8 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; @NodeInfo public final class ReverseBytesNode extends UnaryNode implements LIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/VirtualizableInvokeMacroNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/VirtualizableInvokeMacroNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/VirtualizableInvokeMacroNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.replacements.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * A helper class to allow elimination of byte code instrumentation that could interfere with escape diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/WriteRegisterNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/WriteRegisterNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/WriteRegisterNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.replacements.nodes; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; /** * Changes the value of a specific register. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerAddExactNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerAddExactNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerAddExactNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.replacements.nodes.arithmetic; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Node representing an exact integer addition that will throw an {@link ArithmeticException} in diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.replacements.nodes.arithmetic; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo public final class IntegerAddExactSplitNode extends IntegerExactArithmeticSplitNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.replacements.nodes.arithmetic; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo public abstract class IntegerExactArithmeticSplitNode extends ControlSplitNode implements LIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerMulExactNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerMulExactNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerMulExactNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.replacements.nodes.arithmetic; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -30,6 +29,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; /** * Node representing an exact integer multiplication that will throw an {@link ArithmeticException} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.replacements.nodes.arithmetic; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo public final class IntegerMulExactSplitNode extends IntegerExactArithmeticSplitNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerMulHighNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerMulHighNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerMulHighNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import java.util.function.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -33,6 +32,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "*H") public final class IntegerMulHighNode extends BinaryNode implements ArithmeticLIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerSubExactNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerSubExactNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerSubExactNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.replacements.nodes.arithmetic; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -31,6 +30,7 @@ import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; import com.oracle.graal.nodes.util.*; +import com.oracle.jvmci.meta.*; /** * Node representing an exact integer substraction that will throw an {@link ArithmeticException} in diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.replacements.nodes.arithmetic; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo public final class IntegerSubExactSplitNode extends IntegerExactArithmeticSplitNode { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/UnsignedMulHighNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/UnsignedMulHighNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/arithmetic/UnsignedMulHighNode.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,6 @@ import java.util.function.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; @@ -33,6 +32,7 @@ import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.meta.*; @NodeInfo(shortName = "|*H|") public final class UnsignedMulHighNode extends BinaryNode implements ArithmeticLIRLowerable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.runtime/src/com/oracle/graal/runtime/RuntimeProvider.java --- a/graal/com.oracle.graal.runtime/src/com/oracle/graal/runtime/RuntimeProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.runtime/src/com/oracle/graal/runtime/RuntimeProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.runtime; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.Architecture; import com.oracle.graal.compiler.target.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.sparc/src/com/oracle/graal/sparc/SPARC.java --- a/graal/com.oracle.graal.sparc/src/com/oracle/graal/sparc/SPARC.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.sparc/src/com/oracle/graal/sparc/SPARC.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,17 @@ */ package com.oracle.graal.sparc; -import static com.oracle.graal.api.code.MemoryBarriers.*; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.PlatformKind; +import static com.oracle.jvmci.code.MemoryBarriers.*; import java.nio.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.Register.RegisterCategory; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.Register.RegisterCategory; /** * Represents the SPARC architecture. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle.hotspot.amd64/src/com/oracle/graal/truffle/hotspot/amd64/AMD64OptimizedCallTargetInstrumentationFactory.java --- a/graal/com.oracle.graal.truffle.hotspot.amd64/src/com/oracle/graal/truffle/hotspot/amd64/AMD64OptimizedCallTargetInstrumentationFactory.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot.amd64/src/com/oracle/graal/truffle/hotspot/amd64/AMD64OptimizedCallTargetInstrumentationFactory.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,15 @@ */ package com.oracle.graal.truffle.hotspot.amd64; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import com.oracle.graal.amd64.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.ConditionFlag; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle.hotspot.amd64/src/com/oracle/graal/truffle/hotspot/amd64/AMD64RawNativeCallNodeFactory.java --- a/graal/com.oracle.graal.truffle.hotspot.amd64/src/com/oracle/graal/truffle/hotspot/amd64/AMD64RawNativeCallNodeFactory.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot.amd64/src/com/oracle/graal/truffle/hotspot/amd64/AMD64RawNativeCallNodeFactory.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.truffle.hotspot.amd64; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; import com.oracle.graal.hotspot.amd64.*; import com.oracle.graal.nodes.*; import com.oracle.graal.truffle.hotspot.nfi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle.hotspot.sparc/src/com/oracle/graal/truffle/hotspot/sparc/SPARCOptimizedCallTargetInstumentationFactory.java --- a/graal/com.oracle.graal.truffle.hotspot.sparc/src/com/oracle/graal/truffle/hotspot/sparc/SPARCOptimizedCallTargetInstumentationFactory.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot.sparc/src/com/oracle/graal/truffle/hotspot/sparc/SPARCOptimizedCallTargetInstumentationFactory.java Wed May 27 00:36:16 2015 +0200 @@ -22,16 +22,20 @@ */ package com.oracle.graal.truffle.hotspot.sparc; -import static com.oracle.graal.api.code.CallingConvention.Type.*; -import static com.oracle.graal.api.meta.Kind.*; +import com.oracle.jvmci.code.Register; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.ForeignCallsProvider; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import static com.oracle.jvmci.code.CallingConvention.Type.*; +import static com.oracle.jvmci.meta.Kind.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.Annul.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.BranchPredict.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.CC.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag.*; import static com.oracle.graal.sparc.SPARC.CPUFeature.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.ScratchRegister; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,14 @@ */ package com.oracle.graal.truffle.hotspot; -import static com.oracle.graal.api.code.CodeUtil.*; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.BailoutException; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.MetaAccessProvider; +import static com.oracle.jvmci.code.CodeUtil.*; import static com.oracle.graal.compiler.GraalCompiler.*; import static com.oracle.graal.graph.util.CollectionsAccess.*; import static com.oracle.graal.hotspot.meta.HotSpotSuitesProvider.*; @@ -32,9 +39,7 @@ import java.util.concurrent.*; import java.util.stream.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.*; import com.oracle.graal.compiler.target.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/OptimizedCallTargetInstrumentation.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/OptimizedCallTargetInstrumentation.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/OptimizedCallTargetInstrumentation.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,12 @@ */ package com.oracle.graal.truffle.hotspot; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.ForeignCallsProvider; import java.lang.reflect.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CompilationResult.Mark; +import com.oracle.jvmci.code.CompilationResult.Mark; import com.oracle.graal.asm.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/HotSpotNativeFunctionHandle.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/HotSpotNativeFunctionHandle.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/HotSpotNativeFunctionHandle.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,11 @@ */ package com.oracle.graal.truffle.hotspot.nfi; +import com.oracle.jvmci.code.InvalidInstalledCodeException; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.Kind; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; import com.oracle.jvmci.debug.Debug.Scope; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/HotSpotNativeFunctionInterface.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/HotSpotNativeFunctionInterface.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/HotSpotNativeFunctionInterface.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,16 @@ */ package com.oracle.graal.truffle.hotspot.nfi; -import static com.oracle.graal.api.code.CodeUtil.*; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.meta.TriState; +import com.oracle.jvmci.meta.DefaultProfilingInfo; +import static com.oracle.jvmci.code.CodeUtil.*; import static com.oracle.graal.truffle.hotspot.nfi.NativeCallStubGraphBuilder.*; import static com.oracle.jvmci.common.UnsafeAccess.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.graal.compiler.*; import com.oracle.graal.compiler.target.*; import com.oracle.graal.hotspot.meta.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/NativeCallStubGraphBuilder.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/NativeCallStubGraphBuilder.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/NativeCallStubGraphBuilder.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,17 @@ */ package com.oracle.graal.truffle.hotspot.nfi; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.NamedLocationIdentity; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/RawNativeCallNodeFactory.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/RawNativeCallNodeFactory.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/nfi/RawNativeCallNodeFactory.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,8 @@ */ package com.oracle.graal.truffle.hotspot.nfi; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; import com.oracle.graal.nodes.*; import com.oracle.jvmci.runtime.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/CompilerAssertsTest.java --- a/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/CompilerAssertsTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/CompilerAssertsTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.truffle.test; +import com.oracle.jvmci.code.BailoutException; import org.junit.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.truffle.test.nodes.*; import com.oracle.truffle.api.*; import com.oracle.truffle.api.frame.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/ConditionAnchoringTest.java --- a/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/ConditionAnchoringTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/ConditionAnchoringTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,12 @@ */ package com.oracle.graal.truffle.test; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.ResolvedJavaField; import static com.oracle.graal.graph.test.matchers.NodeIterableCount.*; import static com.oracle.graal.graph.test.matchers.NodeIterableIsEmpty.*; import static org.hamcrest.core.IsInstanceOf.*; @@ -31,7 +37,6 @@ import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.test.*; import com.oracle.graal.graph.iterators.*; import com.oracle.graal.graphbuilderconf.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/SimplePartialEvaluationTest.java --- a/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/SimplePartialEvaluationTest.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/SimplePartialEvaluationTest.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.truffle.test; +import com.oracle.jvmci.code.SourceStackTrace; import org.junit.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.truffle.test.nodes.*; import com.oracle.truffle.api.frame.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalFrameInstance.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalFrameInstance.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalFrameInstance.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.truffle; +import com.oracle.jvmci.code.stack.InspectedFrame; import java.lang.reflect.*; -import com.oracle.graal.api.code.stack.*; import com.oracle.jvmci.common.*; import com.oracle.truffle.api.*; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleCompilationListener.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleCompilationListener.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleCompilationListener.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.truffle; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.CompilationResult; import com.oracle.graal.nodes.*; import com.oracle.truffle.api.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleRuntime.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleRuntime.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleRuntime.java Wed May 27 00:36:16 2015 +0200 @@ -22,14 +22,17 @@ */ package com.oracle.graal.truffle; +import com.oracle.jvmci.code.stack.InspectedFrameVisitor; +import com.oracle.jvmci.code.stack.InspectedFrame; +import com.oracle.jvmci.code.stack.StackIntrospection; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.graal.truffle.TruffleCompilerOptions.*; import java.util.*; import java.util.concurrent.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.stack.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.nodes.*; import com.oracle.graal.truffle.debug.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedAssumption.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedAssumption.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedAssumption.java Wed May 27 00:36:16 2015 +0200 @@ -22,13 +22,13 @@ */ package com.oracle.graal.truffle; +import com.oracle.jvmci.code.InstalledCode; import static com.oracle.graal.truffle.TruffleCompilerOptions.*; import java.lang.ref.*; import java.util.*; import java.util.stream.*; -import com.oracle.graal.api.code.*; import com.oracle.jvmci.debug.*; import com.oracle.truffle.api.*; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTarget.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,9 @@ */ package com.oracle.graal.truffle; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.code.SpeculationLog; +import com.oracle.jvmci.code.BailoutException; import static com.oracle.graal.truffle.TruffleCompilerOptions.*; import java.io.*; @@ -30,7 +33,6 @@ import java.util.concurrent.atomic.*; import java.util.stream.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.truffle.debug.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTargetInstrumentationFactory.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTargetInstrumentationFactory.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/OptimizedCallTargetInstrumentationFactory.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.truffle; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import com.oracle.graal.lir.asm.*; import com.oracle.jvmci.runtime.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,13 @@ */ package com.oracle.graal.truffle; +import com.oracle.jvmci.code.Architecture; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.compiler.common.GraalOptions.*; import static com.oracle.graal.java.GraphBuilderPhase.Options.*; import static com.oracle.graal.truffle.TruffleCompilerOptions.*; @@ -29,8 +36,6 @@ import java.lang.invoke.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graphbuilderconf.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompiler.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompiler.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompiler.java Wed May 27 00:36:16 2015 +0200 @@ -22,15 +22,21 @@ */ package com.oracle.graal.truffle; -import static com.oracle.graal.api.code.CodeUtil.*; +import com.oracle.jvmci.code.CallingConvention; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.InstalledCode; +import com.oracle.jvmci.code.SpeculationLog; +import com.oracle.jvmci.code.CompilationResult; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import static com.oracle.jvmci.code.CodeUtil.*; import static com.oracle.graal.compiler.GraalCompiler.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CallingConvention.Type; -import com.oracle.graal.api.meta.Assumptions.Assumption; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CallingConvention.Type; +import com.oracle.jvmci.meta.Assumptions.Assumption; import com.oracle.graal.compiler.target.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleConstantReflectionProvider.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleConstantReflectionProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleConstantReflectionProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,17 @@ */ package com.oracle.graal.truffle; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.MemoryAccessProvider; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.JavaField; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.MethodHandleAccessProvider; +import com.oracle.jvmci.meta.Kind; import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; import com.oracle.truffle.api.nodes.Node.Child; import com.oracle.truffle.api.nodes.Node.Children; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleDebugJavaMethod.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleDebugJavaMethod.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleDebugJavaMethod.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,11 @@ */ package com.oracle.graal.truffle; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.JavaMethod; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.Signature; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Kind; import com.oracle.jvmci.debug.*; import com.oracle.truffle.api.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleExpansionLogger.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleExpansionLogger.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleExpansionLogger.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,12 @@ */ package com.oracle.graal.truffle; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.io.*; import java.util.*; import java.util.Map.Entry; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.java.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/AbstractDebugCompilationListener.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/AbstractDebugCompilationListener.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/AbstractDebugCompilationListener.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,10 @@ */ package com.oracle.graal.truffle.debug; +import com.oracle.jvmci.code.CompilationResult; import java.io.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.nodes.*; import com.oracle.graal.truffle.*; import com.oracle.jvmci.debug.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/CompilationStatisticsListener.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/CompilationStatisticsListener.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/CompilationStatisticsListener.java Wed May 27 00:36:16 2015 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.truffle.debug; +import com.oracle.jvmci.code.CompilationResult; import static java.util.function.Function.*; import static java.util.stream.Collectors.*; @@ -30,7 +31,6 @@ import java.util.function.*; import java.util.stream.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.nodes.*; import com.oracle.graal.truffle.*; import com.oracle.graal.truffle.TruffleInlining.CallTreeNodeVisitor; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/HistogramInlineInvokePlugin.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/HistogramInlineInvokePlugin.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/HistogramInlineInvokePlugin.java Wed May 27 00:36:16 2015 +0200 @@ -22,10 +22,11 @@ */ package com.oracle.graal.truffle.debug; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import java.io.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graphbuilderconf.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationASTListener.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationASTListener.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationASTListener.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.truffle.debug; +import com.oracle.jvmci.code.CompilationResult; import static com.oracle.graal.truffle.TruffleCompilerOptions.*; import java.io.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.nodes.*; import com.oracle.graal.truffle.*; import com.oracle.graal.truffle.TruffleInlining.CallTreeNodeVisitor; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationCallTreeListener.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationCallTreeListener.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationCallTreeListener.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.truffle.debug; +import com.oracle.jvmci.code.CompilationResult; import static com.oracle.graal.truffle.TruffleCompilerOptions.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.nodes.*; import com.oracle.graal.truffle.*; import com.oracle.graal.truffle.TruffleInlining.CallTreeNodeVisitor; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationFailureListener.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationFailureListener.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationFailureListener.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.truffle.debug; +import com.oracle.jvmci.code.BailoutException; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.nodes.*; import com.oracle.graal.truffle.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationListener.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationListener.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationListener.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.truffle.debug; +import com.oracle.jvmci.code.CompilationResult; import static com.oracle.graal.truffle.TruffleCompilerOptions.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.nodes.*; import com.oracle.graal.truffle.*; import com.oracle.truffle.api.source.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationPolymorphismListener.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationPolymorphismListener.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/debug/TraceCompilationPolymorphismListener.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.truffle.debug; +import com.oracle.jvmci.code.CompilationResult; import static com.oracle.graal.truffle.TruffleCompilerOptions.*; import java.util.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.nodes.*; import com.oracle.graal.truffle.*; import com.oracle.truffle.api.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/AssumptionValidAssumption.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/AssumptionValidAssumption.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/AssumptionValidAssumption.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.truffle.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Assumptions; import com.oracle.graal.truffle.*; public final class AssumptionValidAssumption extends Assumptions.Assumption { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/IsCompilationConstantNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/IsCompilationConstantNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/IsCompilationConstantNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.truffle.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/ObjectLocationIdentity.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/ObjectLocationIdentity.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/ObjectLocationIdentity.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,11 @@ */ package com.oracle.graal.truffle.nodes; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.LocationIdentity; import java.util.*; -import com.oracle.graal.api.meta.*; /** * A {@link LocationIdentity} wrapping an object. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/NewFrameNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/NewFrameNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/frame/NewFrameNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,11 @@ */ package com.oracle.graal.truffle.nodes.frame; +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Kind; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.common.type.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/TruffleGraphBuilderPlugins.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/TruffleGraphBuilderPlugins.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/TruffleGraphBuilderPlugins.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,20 @@ */ package com.oracle.graal.truffle.substitutions; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.DeoptimizationAction; +import com.oracle.jvmci.meta.DeoptimizationReason; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.Kind; import static java.lang.Character.*; import java.util.concurrent.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.compiler.common.type.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationBlockState.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationBlockState.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationBlockState.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.virtual.phases.ea; +import com.oracle.jvmci.meta.LocationIdentity; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.virtual.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationClosure.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationClosure.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationClosure.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,17 @@ */ package com.oracle.graal.virtual.phases.ea; -import static com.oracle.graal.api.meta.LocationIdentity.*; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.NamedLocationIdentity; +import com.oracle.jvmci.meta.JavaConstant; +import static com.oracle.jvmci.meta.LocationIdentity.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,12 @@ */ package com.oracle.graal.virtual.phases.ea; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaConstant; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.cfg.*; import com.oracle.graal.compiler.common.type.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationBlockState.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationBlockState.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationBlockState.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.virtual.phases.ea; +import com.oracle.jvmci.meta.LocationIdentity; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,12 @@ */ package com.oracle.graal.virtual.phases.ea; -import static com.oracle.graal.api.meta.LocationIdentity.*; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.LocationIdentity; +import static com.oracle.jvmci.meta.LocationIdentity.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualUtil.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualUtil.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualUtil.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,11 @@ */ package com.oracle.graal.virtual.phases.ea; +import com.oracle.jvmci.meta.ResolvedJavaMethod; import static com.oracle.graal.compiler.common.GraalOptions.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodes.*; import com.oracle.jvmci.common.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualizerToolImpl.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualizerToolImpl.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualizerToolImpl.java Wed May 27 00:36:16 2015 +0200 @@ -22,11 +22,13 @@ */ package com.oracle.graal.virtual.phases.ea; +import com.oracle.jvmci.meta.ConstantReflectionProvider; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.Kind; import static com.oracle.graal.compiler.common.GraalOptions.*; import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; import com.oracle.graal.nodes.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.word/src/com/oracle/graal/word/BarrieredAccess.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/BarrieredAccess.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/BarrieredAccess.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.word; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.LocationIdentity; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.word.Word.Opcode; import com.oracle.graal.word.Word.Operation; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.word/src/com/oracle/graal/word/ObjectAccess.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/ObjectAccess.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/ObjectAccess.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.word; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.LocationIdentity; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.word.Word.Opcode; import com.oracle.graal.word.Word.Operation; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.word/src/com/oracle/graal/word/Pointer.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/Pointer.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/Pointer.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.word; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.LocationIdentity; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.memory.HeapAccess.BarrierType; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.word/src/com/oracle/graal/word/Word.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/Word.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/Word.java Wed May 27 00:36:16 2015 +0200 @@ -22,12 +22,12 @@ */ package com.oracle.graal.word; +import com.oracle.jvmci.code.UnsignedMath; +import com.oracle.jvmci.meta.LocationIdentity; import static com.oracle.jvmci.common.UnsafeAccess.*; import java.lang.annotation.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.calc.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.calc.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.word/src/com/oracle/graal/word/WordBase.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/WordBase.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/WordBase.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.word; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.TrustedInterface; public interface WordBase extends TrustedInterface { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.word/src/com/oracle/graal/word/WordTypes.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/WordTypes.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/WordTypes.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,11 @@ */ package com.oracle.graal.word; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.ResolvedJavaType; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.type.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/SnippetLocationNode.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/SnippetLocationNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/SnippetLocationNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.word.nodes; -import static com.oracle.graal.api.meta.LocationIdentity.*; - -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LocationIdentity; +import static com.oracle.jvmci.meta.LocationIdentity.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/WordCastNode.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/WordCastNode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/WordCastNode.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,11 @@ */ package com.oracle.graal.word.nodes; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.meta.Kind; import com.oracle.graal.compiler.common.type.*; import com.oracle.graal.graph.*; import com.oracle.graal.graph.spi.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/overview.html Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,37 @@ + + + + + + + + +The com.oracle.jvmci.code project provides an API to the runtime's native code cache. +It allows installation and execution of native code. + + + diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/AbstractAddress.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/AbstractAddress.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2013, 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 com.oracle.jvmci.code; + +/** + * Abstract base class that represents a platform specific address. + */ +public abstract class AbstractAddress { +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/Architecture.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/Architecture.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,250 @@ +/* + * Copyright (c) 2009, 2011, 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.PlatformKind; +import java.nio.*; +import java.util.*; + +import com.oracle.jvmci.code.Register.RegisterCategory; + +/** + * Represents a CPU architecture, including information such as its endianness, CPU registers, word + * width, etc. + */ +public abstract class Architecture { + + /** + * The number of entries required in a {@link ReferenceMap} covering all the registers that may + * store references. The index of a register in the reference map is given by + * {@link Register#getReferenceMapIndex()}. + */ + private final int registerReferenceMapSize; + + /** + * Represents the natural size of words (typically registers and pointers) of this architecture, + * in bytes. + */ + private final int wordSize; + + /** + * The name of this architecture (e.g. "AMD64", "SPARCv9"). + */ + private final String name; + + /** + * Array of all available registers on this architecture. The index of each register in this + * array is equal to its {@linkplain Register#number number}. + */ + private final Register[] registers; + + /** + * The byte ordering can be either little or big endian. + */ + private final ByteOrder byteOrder; + + /** + * Whether the architecture supports unaligned memory accesses. + */ + private final boolean unalignedMemoryAccess; + + /** + * Mask of the barrier constants denoting the barriers that are not required to be explicitly + * inserted under this architecture. + */ + private final int implicitMemoryBarriers; + + /** + * Offset in bytes from the beginning of a call instruction to the displacement. + */ + private final int machineCodeCallDisplacementOffset; + + /** + * The size of the return address pushed to the stack by a call instruction. A value of 0 + * denotes that call linkage uses registers instead (e.g. SPARC). + */ + private final int returnAddressSize; + + protected Architecture(String name, int wordSize, ByteOrder byteOrder, boolean unalignedMemoryAccess, Register[] registers, int implicitMemoryBarriers, int nativeCallDisplacementOffset, + int registerReferenceMapSize, int returnAddressSize) { + this.name = name; + this.registers = registers; + this.wordSize = wordSize; + this.byteOrder = byteOrder; + this.unalignedMemoryAccess = unalignedMemoryAccess; + this.implicitMemoryBarriers = implicitMemoryBarriers; + this.machineCodeCallDisplacementOffset = nativeCallDisplacementOffset; + this.registerReferenceMapSize = registerReferenceMapSize; + this.returnAddressSize = returnAddressSize; + } + + /** + * Converts this architecture to a string. + * + * @return the string representation of this architecture + */ + @Override + public final String toString() { + return getName().toLowerCase(); + } + + public int getRegisterReferenceMapSize() { + return registerReferenceMapSize; + } + + /** + * Gets the natural size of words (typically registers and pointers) of this architecture, in + * bytes. + */ + public int getWordSize() { + return wordSize; + } + + /** + * Gets the name of this architecture. + */ + public String getName() { + return name; + } + + /** + * Gets an array of all available registers on this architecture. The index of each register in + * this array is equal to its {@linkplain Register#number number}. + */ + public Register[] getRegisters() { + return registers.clone(); + } + + public ByteOrder getByteOrder() { + return byteOrder; + } + + /** + * @return true if the architecture supports unaligned memory accesses. + */ + public boolean supportsUnalignedMemoryAccess() { + return unalignedMemoryAccess; + } + + /** + * Gets the size of the return address pushed to the stack by a call instruction. A value of 0 + * denotes that call linkage uses registers instead. + */ + public int getReturnAddressSize() { + return returnAddressSize; + } + + /** + * Gets the offset in bytes from the beginning of a call instruction to the displacement. + */ + public int getMachineCodeCallDisplacementOffset() { + return machineCodeCallDisplacementOffset; + } + + /** + * Determines the barriers in a given barrier mask that are explicitly required on this + * architecture. + * + * @param barriers a mask of the barrier constants + * @return the value of {@code barriers} minus the barriers unnecessary on this architecture + */ + public final int requiredBarriers(int barriers) { + return barriers & ~implicitMemoryBarriers; + } + + /** + * 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 + * @param kind the kind that should be stored in the register + */ + public abstract boolean canStoreValue(RegisterCategory category, PlatformKind kind); + + /** + * Return the largest kind that can be stored in a register of a given category. + * + * @param category the category of the register + * @return the largest kind that can be stored in a register {@code category} + */ + public abstract PlatformKind getLargestStorableKind(RegisterCategory category); + + @Override + public final boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj instanceof Architecture) { + Architecture that = (Architecture) obj; + if (this.name.equals(that.name)) { + assert this.byteOrder.equals(that.byteOrder); + assert this.implicitMemoryBarriers == that.implicitMemoryBarriers; + assert this.machineCodeCallDisplacementOffset == that.machineCodeCallDisplacementOffset; + assert this.registerReferenceMapSize == that.registerReferenceMapSize; + assert Arrays.equals(this.registers, that.registers); + assert this.returnAddressSize == that.returnAddressSize; + assert this.unalignedMemoryAccess == that.unalignedMemoryAccess; + assert this.wordSize == that.wordSize; + return true; + } + } + return false; + } + + @Override + public final int hashCode() { + return name.hashCode(); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/ArithmeticOperation.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/ArithmeticOperation.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2013, 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 com.oracle.jvmci.code; + +/** + * An {@code ArithmeticOperation} is an operation that does primitive value arithmetic without side + * effect. + */ +public interface ArithmeticOperation { +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/BailoutException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/BailoutException.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2009, 2011, 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 com.oracle.jvmci.code; + +import java.util.*; + +/** + * Exception thrown when the compiler refuses to compile a method because of problems with the + * method. e.g. bytecode wouldn't verify, too big, JSR/ret too complicated, etc. This exception is + * not meant to indicate problems with the compiler itself. + */ +public class BailoutException extends RuntimeException { + + public static final long serialVersionUID = 8974598793458772L; + private final boolean permanent; + + /** + * Creates a new {@link BailoutException}. + * + * + * @param args parameters to the formatter + */ + public BailoutException(String format, Object... args) { + super(String.format(Locale.ENGLISH, format, args)); + this.permanent = true; + } + + /** + * Creates a new {@link BailoutException}. + * + * + * @param args parameters to the formatter + */ + public BailoutException(Throwable cause, String format, Object... args) { + super(String.format(Locale.ENGLISH, format, args), cause); + this.permanent = true; + } + + /** + * Creates a new {@link BailoutException}. + * + * @param permanent specifies whether this exception will occur again if compilation is retried + * @param args parameters to the formatter + */ + public BailoutException(boolean permanent, String format, Object... args) { + super(String.format(Locale.ENGLISH, format, args)); + this.permanent = permanent; + } + + /** + * @return whether this exception will occur again if compilation is retried + */ + public boolean isPermanent() { + return permanent; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/BytecodeFrame.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/BytecodeFrame.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,273 @@ +/* + * 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.Value; +import java.util.*; + + +/** + * Represents the Java bytecode frame state(s) at a given position including {@link Value locations} + * where to find the local variables, operand stack values and locked objects of the bytecode + * frame(s). + */ +public class BytecodeFrame extends BytecodePosition { + + /** + * An array of values representing how to reconstruct the state of the Java frame. This is array + * is partitioned as follows: + *

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Start index (inclusive)End index (exclusive)Description
0numLocalsLocal variables
numLocalsnumLocals + numStackOperand stack
numLocals + numStackvalues.lengthLocked objects
+ *

+ * 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; + + /** + * The number of locals in the values array. + */ + public final int numLocals; + + /** + * The number of stack slots in the values array. + */ + public final int numStack; + + /** + * The number of locks in the values array. + */ + public final int numLocks; + + /** + * True if this is a position inside an exception handler before the exception object has been + * consumed. In this case, {@link #numStack} {@code == 1} and {@link #getStackValue(int) + * getStackValue(0)} is the location of the exception object. If deoptimization happens at this + * position, the interpreter will rethrow the exception instead of executing the bytecode + * instruction at this position. + */ + public final boolean rethrowException; + + public final boolean duringCall; + + /** + * This BCI should be used for frame states that are built for code with no meaningful BCI. + */ + public static final int UNKNOWN_BCI = -5; + + /** + * The BCI for exception unwind. This is synthetic code and has no representation in bytecode. + * In contrast with {@link #AFTER_EXCEPTION_BCI}, at this point, if the method is synchronized, + * the monitor is still held. + */ + public static final int UNWIND_BCI = -1; + + /** + * The BCI for the state before starting to execute a method. Note that if the method is + * synchronized, the monitor is not yet held. + */ + public static final int BEFORE_BCI = -2; + + /** + * The BCI for the state after finishing the execution of a method and returning normally. Note + * that if the method was synchronized the monitor is already released. + */ + public static final int AFTER_BCI = -3; + + /** + * The BCI for exception unwind. This is synthetic code and has no representation in bytecode. + * In contrast with {@link #UNWIND_BCI}, at this point, if the method is synchronized, the + * monitor is already released. + */ + public static final int AFTER_EXCEPTION_BCI = -4; + + /** + * This BCI should be used for states that cannot be the target of a deoptimization, like + * snippet frame states. + */ + public static final int INVALID_FRAMESTATE_BCI = -6; + + /** + * Determines if a given BCI matches one of the placeholder BCI constants defined in this class. + */ + public static boolean isPlaceholderBci(int bci) { + return bci < 0; + } + + /** + * Gets the name of a given placeholder BCI. + */ + public static String getPlaceholderBciName(int bci) { + assert isPlaceholderBci(bci); + if (bci == BytecodeFrame.AFTER_BCI) { + return "AFTER_BCI"; + } else if (bci == BytecodeFrame.AFTER_EXCEPTION_BCI) { + return "AFTER_EXCEPTION_BCI"; + } else if (bci == BytecodeFrame.INVALID_FRAMESTATE_BCI) { + return "INVALID_FRAMESTATE_BCI"; + } else if (bci == BytecodeFrame.BEFORE_BCI) { + return "BEFORE_BCI"; + } else if (bci == BytecodeFrame.UNKNOWN_BCI) { + return "UNKNOWN_BCI"; + } else { + assert bci == BytecodeFrame.UNWIND_BCI; + return "UNWIND_BCI"; + } + } + + /** + * Creates a new frame object. + * + * @param caller the caller frame (which may be {@code null}) + * @param method the method + * @param bci a BCI within the method + * @param rethrowException specifies if the VM should re-throw the pending exception when + * deopt'ing using this frame + * @param values the frame state {@link #values} + * @param numLocals the number of local variables + * @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) { + super(caller, method, bci); + assert values != null; + this.rethrowException = rethrowException; + this.duringCall = duringCall; + this.values = values; + this.numLocals = numLocals; + this.numStack = numStack; + this.numLocks = numLocks; + assert !rethrowException || numStack == 1 : "must have exception on top of the stack"; + } + + /** + * Ensure that the frame state is formatted as expected by the JVM, with null or Illegal in the + * 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) { + if (caller() != null) { + caller().validateFormat(derivedOk); + } + for (int i = 0; i < numLocals + numStack; i++) { + if (values[i] != null) { + Kind kind = values[i].getKind(); + 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 derivedOk || ValueUtil.isIllegal(values[i]) || !values[i].getLIRKind().isDerivedReference() : "Unexpected derived value: " + values[i]; + } + } + return true; + } + + /** + * Gets the value representing the specified local variable. + * + * @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) { + return values[i]; + } + + /** + * Gets the value representing the specified stack slot. + * + * @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) { + return values[i + numLocals]; + } + + /** + * Gets the value representing the specified lock. + * + * @param i the lock index + * @return the value that can be used to reconstruct the lock's current value + */ + public Value getLockValue(int i) { + return values[i + numLocals + numStack]; + } + + /** + * Gets the caller of this frame. + * + * @return {@code null} if this frame has no caller + */ + public BytecodeFrame caller() { + return (BytecodeFrame) getCaller(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof BytecodeFrame && super.equals(obj)) { + BytecodeFrame that = (BytecodeFrame) obj; + // @formatter:off + if (this.duringCall == that.duringCall && + this.rethrowException == that.rethrowException && + this.numLocals == that.numLocals && + this.numLocks == that.numLocks && + this.numStack == that.numStack && + Arrays.equals(this.values, that.values)) { + return true; + } + // @formatter:off + return true; + } + return false; + } + + @Override + public String toString() { + return CodeUtil.append(new StringBuilder(100), this).toString(); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/BytecodePosition.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/BytecodePosition.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2009, 2011, 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import java.util.*; + + +/** + * Represents a code position, that is, a chain of inlined methods with bytecode locations, that is + * communicated from the compiler to the runtime system. A code position can be used by the runtime + * system to reconstruct a source-level stack trace for exceptions and to create + * {@linkplain BytecodeFrame frames} for deoptimization. + */ +public class BytecodePosition { + + private final BytecodePosition caller; + private final ResolvedJavaMethod method; + private final int bci; + + /** + * Constructs a new object representing a given parent/caller, a given method, and a given BCI. + * + * @param caller the parent position + * @param method the method + * @param bci a BCI within the method + */ + public BytecodePosition(BytecodePosition caller, ResolvedJavaMethod method, int bci) { + assert method != null; + this.caller = caller; + this.method = method; + this.bci = bci; + } + + /** + * Converts this code position to a string representation. + * + * @return a string representation of this code position + */ + @Override + public String toString() { + return CodeUtil.append(new StringBuilder(100), this).toString(); + } + + /** + * Deep equality test. + */ + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj != null && getClass() == obj.getClass()) { + BytecodePosition that = (BytecodePosition) obj; + if (this.bci == that.bci && Objects.equals(this.getMethod(), that.getMethod()) && Objects.equals(this.caller, that.caller)) { + return true; + } + } + return false; + } + + @Override + public int hashCode() { + return getBCI(); + } + + /** + * @return The location within the method, as a bytecode index. The constant {@code -1} may be + * used to indicate the location is unknown, for example within code synthesized by the + * compiler. + */ + public int getBCI() { + return bci; + } + + /** + * @return The runtime interface method for this position. + */ + public ResolvedJavaMethod getMethod() { + return method; + } + + /** + * The position where this position has been called, {@code null} if none. + */ + public BytecodePosition getCaller() { + return caller; + } + + /** + * Adds a caller to the current position returning the new position. + */ + public BytecodePosition addCaller(BytecodePosition link) { + if (getCaller() == null) { + return new BytecodePosition(link, getMethod(), getBCI()); + } else { + return new BytecodePosition(getCaller().addCaller(link), getMethod(), getBCI()); + } + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CalleeSaveLayout.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CalleeSaveLayout.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,182 @@ +/* + * Copyright (c) 2010, 2011, 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.PlatformKind; +import java.util.*; + + +/** + * The callee save area (CSA) is a contiguous space in a stack frame used to save (and restore) the + * values of the caller's registers. This class describes the layout of a CSA in terms of its + * {@linkplain #size size}, {@linkplain #slotSize slot size} and the {@linkplain #registers callee + * save registers} covered by the CSA. + */ +public class CalleeSaveLayout { + + /** + * The size (in bytes) of the CSA. + */ + public final int size; + + /** + * The size (in bytes) of an {@linkplain #registerAt(int) indexable} slot in the CSA. + */ + public final int slotSize; + + /** + * Map from {@linkplain Register#number register numbers} to slot indexes in the CSA. + */ + private final int[] regNumToIndex; + + private final Register[] indexToReg; + + /** + * The list of registers {@linkplain #contains(int) contained} by this CSA. + */ + public final Register[] registers; + + /** + * The offset from the frame pointer to the CSA. If this is not known, then this field will have + * the value {@link Integer#MAX_VALUE}. + */ + public final int frameOffsetToCSA; + + /** + * Creates a CSA layout. + * + * @param size size (in bytes) of the CSA. If this is {@code -1}, then the CSA size will be + * computed from {@code registers}. + * @param slotSize the size (in bytes) of an {@linkplain #registerAt(int) indexable} slot in the + * CSA + * @param registers the registers that can be saved in the CSA + */ + public CalleeSaveLayout(TargetDescription target, int frameOffsetToCSA, int size, int slotSize, Register... registers) { + this.frameOffsetToCSA = frameOffsetToCSA; + assert slotSize == 0 || CodeUtil.isPowerOf2(slotSize); + this.slotSize = slotSize; + int maxRegNum = -1; + int maxOffset = 0; + this.registers = registers; + int offset = 0; + for (Register reg : registers) { + assert offset % slotSize == 0; + assert reg.number >= 0; + if (reg.number > maxRegNum) { + maxRegNum = reg.number; + } + if (offset > maxOffset) { + maxOffset = offset; + } + PlatformKind kind = target.arch.getLargestStorableKind(reg.getRegisterCategory()); + offset += target.getSizeInBytes(kind); + } + if (size == -1) { + this.size = offset; + } else { + assert offset <= size; + this.size = size; + } + + this.regNumToIndex = new int[maxRegNum + 1]; + this.indexToReg = offset == 0 ? new Register[0] : new Register[offset / slotSize]; + Arrays.fill(regNumToIndex, -1); + offset = 0; + for (Register reg : registers) { + int index = offset / slotSize; + regNumToIndex[reg.number] = index; + indexToReg[index] = reg; + PlatformKind kind = target.arch.getLargestStorableKind(reg.getRegisterCategory()); + offset += target.getSizeInBytes(kind); + } + } + + /** + * Gets the offset of a given register in the CSA. + * + * @return the offset (in bytes) of {@code reg} in the CSA + * @throws IllegalArgumentException if {@code reg} does not have a slot in the CSA + */ + public int offsetOf(int reg) { + return indexOf(reg) * slotSize; + } + + /** + * Gets the index of a given register in the CSA. + * + * @return the index of {@code reg} in the CSA + * @throws IllegalArgumentException if {@code reg} does not have a slot in the CSA + */ + public int indexOf(int reg) { + if (!contains(reg)) { + throw new IllegalArgumentException(String.valueOf(reg)); + } + return regNumToIndex[reg]; + } + + /** + * Gets the offset of a given register in the CSA. + * + * @return the offset (in bytes) of {@code reg} in the CSA + * @throws IllegalArgumentException if {@code reg} does not have a slot in the CSA + */ + public int offsetOf(Register reg) { + return offsetOf(reg.number); + } + + /** + * Determines if the CSA includes a slot for a given register. + * + * @param reg the register to test + * @return true if the CSA contains a slot for {@code reg} + */ + public boolean contains(int reg) { + return reg >= 0 && reg < regNumToIndex.length && regNumToIndex[reg] != -1; + } + + /** + * Gets the register whose slot in the CSA is at a given index. + * + * @param index an index of a slot in the CSA + * @return the register whose slot in the CSA is at {@code index} or {@code null} if + * {@code index} does not denote a slot in the CSA aligned with a register + */ + public Register registerAt(int index) { + if (index < 0 || index >= indexToReg.length) { + return null; + } + return indexToReg[index]; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("["); + for (Register reg : registers) { + if (sb.length() != 1) { + sb.append(", "); + } + sb.append(reg).append("{+").append(offsetOf(reg)).append('}'); + } + return sb.append("] size=").append(size).toString(); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CallingConvention.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CallingConvention.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2009, 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import static com.oracle.jvmci.code.ValueUtil.*; + + +/** + * A calling convention describes the locations in which the arguments for a call are placed and the + * location in which the return value is placed if the call is not void. + */ +public class CallingConvention { + + /** + * Constants denoting the type of a call for which a calling convention is requested. + */ + public enum Type { + /** + * A request for the outgoing argument locations at a call site to Java code. + */ + JavaCall(true), + + /** + * A request for the incoming argument locations. + */ + JavaCallee(false), + + /** + * A request for the outgoing argument locations at a call site to external native code that + * complies with the platform ABI. + */ + NativeCall(true); + + /** + * Determines if this is a request for the outgoing argument locations at a call site. + */ + public final boolean out; + + public static final Type[] VALUES = values(); + + private Type(boolean out) { + this.out = out; + } + } + + /** + * The amount of stack space (in bytes) required for the stack-based arguments of the call. + */ + private final int stackSize; + + private final AllocatableValue returnLocation; + + /** + * The ordered locations in which the arguments are placed. + */ + private final AllocatableValue[] argumentLocations; + + /** + * Creates a description of the registers and stack locations used by a call. + * + * @param stackSize amount of stack space (in bytes) required for the stack-based arguments of + * the call + * @param returnLocation the location for the return value or {@link Value#ILLEGAL} if a void + * call + * @param argumentLocations the ordered locations in which the arguments are placed + */ + public CallingConvention(int stackSize, AllocatableValue returnLocation, AllocatableValue... argumentLocations) { + assert argumentLocations != null; + assert returnLocation != null; + this.argumentLocations = argumentLocations; + this.stackSize = stackSize; + this.returnLocation = returnLocation; + assert verify(); + } + + /** + * Gets the location for the return value or {@link Value#ILLEGAL} if a void call. + */ + public AllocatableValue getReturn() { + return returnLocation; + } + + /** + * Gets the location for the {@code index}'th argument. + */ + public AllocatableValue getArgument(int index) { + return argumentLocations[index]; + } + + /** + * Gets the amount of stack space (in bytes) required for the stack-based arguments of the call. + */ + public int getStackSize() { + return stackSize; + } + + /** + * Gets the number of locations required for the arguments. + */ + public int getArgumentCount() { + return argumentLocations.length; + } + + /** + * Gets the locations required for the arguments. + */ + public AllocatableValue[] getArguments() { + if (argumentLocations.length == 0) { + return argumentLocations; + } + return argumentLocations.clone(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("CallingConvention["); + String sep = ""; + for (Value op : argumentLocations) { + sb.append(sep).append(op); + sep = ", "; + } + if (!returnLocation.equals(Value.ILLEGAL)) { + sb.append(" -> ").append(returnLocation); + } + sb.append("]"); + return sb.toString(); + } + + private boolean verify() { + for (int i = 0; i < argumentLocations.length; i++) { + Value location = argumentLocations[i]; + assert isStackSlot(location) || isAllocatableValue(location); + } + return true; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CodeCacheProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CodeCacheProvider.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,103 @@ +/* + * 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.Constant; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.code.CompilationResult.DataPatch; +import com.oracle.jvmci.code.DataSection.Data; + +/** + * Access to code cache related details and requirements. + */ +public interface CodeCacheProvider { + + /** + * Adds the given compilation result as an implementation of the given method without making it + * the default implementation. + * + * @param method a method to which the executable code is begin added + * @param compResult the compilation result to be added + * @param speculationLog the speculation log to be used + * @return a reference to the compiled and ready-to-run code or throws a + * {@link BailoutException} if the code installation failed + */ + InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, SpeculationLog speculationLog, InstalledCode predefinedInstalledCode); + + /** + * Sets the given compilation result as the default implementation of the given method. + * + * @param method a method to which the executable code is begin added + * @param compResult the compilation result to be added + * @return a reference to the compiled and ready-to-run code or null if the code installation + * failed + */ + InstalledCode setDefaultMethod(ResolvedJavaMethod method, CompilationResult compResult); + + /** + * Returns a disassembly of some compiled code. + * + * @param compResult some compiled code + * @param installedCode the result of installing the code in {@code compResult} or null if the + * code has not yet been installed + * + * @return a disassembly. This will be of length 0 if the runtime does not support + * disassembling. + */ + String disassemble(CompilationResult compResult, InstalledCode installedCode); + + /** + * Gets the register configuration to use when compiling a given method. + */ + RegisterConfig getRegisterConfig(); + + /** + * Minimum size of the stack area reserved for outgoing parameters. This area is reserved in all + * cases, even when the compiled method has no regular call instructions. + * + * @return the minimum size of the outgoing parameter area in bytes + */ + int getMinimumOutgoingSize(); + + /** + * Determines if a {@link DataPatch} should be created for a given primitive constant that is + * part of a {@link CompilationResult}. A data patch is always created for an object constant. + */ + boolean needsDataPatch(JavaConstant constant); + + /** + * Create a {@link Data} item for a {@link Constant}, that can be used in a {@link DataPatch}. + */ + Data createDataItem(Constant constant); + + /** + * Gets a description of the target architecture. + */ + TargetDescription getTarget(); + + /** + * Create a new speculation log for the target runtime. + */ + SpeculationLog createSpeculationLog(); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CodeUtil.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CodeUtil.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,482 @@ +/* + * Copyright (c) 2010, 2013, 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.Signature; +import com.oracle.jvmci.meta.ResolvedJavaMethod; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.MetaUtil; +import java.util.*; + + +/** + * Miscellaneous collection of utility methods used by {@code com.oracle.jvmci.code} and its + * clients. + */ +public class CodeUtil { + + public static final String NEW_LINE = String.format("%n"); + + public static final int K = 1024; + public static final int M = 1024 * 1024; + + public static boolean isOdd(int n) { + return (n & 1) == 1; + } + + public static boolean isEven(int n) { + return (n & 1) == 0; + } + + /** + * Checks whether the specified integer is a power of two. + * + * @param val the value to check + * @return {@code true} if the value is a power of two; {@code false} otherwise + */ + public static boolean isPowerOf2(int val) { + return val > 0 && (val & val - 1) == 0; + } + + /** + * Checks whether the specified long is a power of two. + * + * @param val the value to check + * @return {@code true} if the value is a power of two; {@code false} otherwise + */ + public static boolean isPowerOf2(long val) { + return val > 0 && (val & val - 1) == 0; + } + + /** + * Computes the log (base 2) of the specified integer, rounding down. (E.g {@code log2(8) = 3}, + * {@code log2(21) = 4} ) + * + * @param val the value + * @return the log base 2 of the value + */ + public static int log2(int val) { + assert val > 0; + return (Integer.SIZE - 1) - Integer.numberOfLeadingZeros(val); + } + + /** + * Computes the log (base 2) of the specified long, rounding down. (E.g {@code log2(8) = 3}, + * {@code log2(21) = 4}) + * + * @param val the value + * @return the log base 2 of the value + */ + public static int log2(long val) { + assert val > 0; + return (Long.SIZE - 1) - Long.numberOfLeadingZeros(val); + } + + /** + * Narrow an integer value to a given bit width, and return the result as a signed long. + * + * @param value the value + * @param resultBits the result bit width + * @return {@code value} interpreted as {@code resultBits} bit number, encoded as signed long + */ + public static long narrow(long value, int resultBits) { + long ret = value & mask(resultBits); + return signExtend(ret, resultBits); + } + + /** + * Sign extend an integer. + * + * @param value the input value + * @param inputBits the bit width of the input value + * @return a signed long with the same value as the signed {@code inputBits}-bit number + * {@code value} + */ + public static long signExtend(long value, int inputBits) { + if (inputBits < 64) { + if ((value >>> (inputBits - 1) & 1) == 1) { + return value | (-1L << inputBits); + } else { + return value & ~(-1L << inputBits); + } + } else { + return value; + } + } + + /** + * Zero extend an integer. + * + * @param value the input value + * @param inputBits the bit width of the input value + * @return an unsigned long with the same value as the unsigned {@code inputBits}-bit number + * {@code value} + */ + public static long zeroExtend(long value, int inputBits) { + if (inputBits < 64) { + return value & ~(-1L << inputBits); + } else { + return value; + } + } + + /** + * Convert an integer to long. + * + * @param value the input value + * @param inputBits the bit width of the input value + * @param unsigned whether the values should be interpreted as signed or unsigned + * @return a long with the same value as the {@code inputBits}-bit number {@code value} + */ + public static long convert(long value, int inputBits, boolean unsigned) { + if (unsigned) { + return zeroExtend(value, inputBits); + } else { + return signExtend(value, inputBits); + } + } + + /** + * Get a bitmask with the low {@code bits} bit set and the high {@code 64 - bits} bit clear. + */ + public static long mask(int bits) { + assert 0 <= bits && bits <= 64; + if (bits == 64) { + return 0xffffffffffffffffL; + } else { + return (1L << bits) - 1; + } + } + + /** + * Get the minimum value representable in a {@code bits} bit signed integer. + */ + public static long minValue(int bits) { + assert 0 < bits && bits <= 64; + return -1L << (bits - 1); + } + + /** + * Get the maximum value representable in a {@code bits} bit signed integer. + */ + public static long maxValue(int bits) { + assert 0 < bits && bits <= 64; + return mask(bits - 1); + } + + /** + * Formats the values in a frame as a tabulated string. + * + * @param frame + * @return the values in {@code frame} as a tabulated string + */ + public static String tabulateValues(BytecodeFrame frame) { + int cols = Math.max(frame.numLocals, Math.max(frame.numStack, frame.numLocks)); + assert cols > 0; + ArrayList cells = new ArrayList<>(); + cells.add(""); + for (int i = 0; i < cols; i++) { + cells.add(i); + } + cols++; + if (frame.numLocals != 0) { + cells.add("locals:"); + cells.addAll(Arrays.asList(frame.values).subList(0, frame.numLocals)); + cells.addAll(Collections.nCopies(cols - frame.numLocals - 1, "")); + } + if (frame.numStack != 0) { + cells.add("stack:"); + cells.addAll(Arrays.asList(frame.values).subList(frame.numLocals, frame.numLocals + frame.numStack)); + cells.addAll(Collections.nCopies(cols - frame.numStack - 1, "")); + } + if (frame.numLocks != 0) { + cells.add("locks:"); + cells.addAll(Arrays.asList(frame.values).subList(frame.numLocals + frame.numStack, frame.values.length)); + cells.addAll(Collections.nCopies(cols - frame.numLocks - 1, "")); + } + Object[] cellArray = cells.toArray(); + for (int i = 0; i < cellArray.length; i++) { + if ((i % cols) != 0) { + cellArray[i] = "|" + cellArray[i]; + } + } + return CodeUtil.tabulate(cellArray, cols, 1, 1); + } + + /** + * Formats a given table as a string. The value of each cell is produced by + * {@link String#valueOf(Object)}. + * + * @param cells the cells of the table in row-major order + * @param cols the number of columns per row + * @param lpad the number of space padding inserted before each formatted cell value + * @param rpad the number of space padding inserted after each formatted cell value + * @return a string with one line per row and each column left-aligned + */ + public static String tabulate(Object[] cells, int cols, int lpad, int rpad) { + int rows = (cells.length + (cols - 1)) / cols; + int[] colWidths = new int[cols]; + for (int col = 0; col < cols; col++) { + for (int row = 0; row < rows; row++) { + int index = col + (row * cols); + if (index < cells.length) { + Object cell = cells[index]; + colWidths[col] = Math.max(colWidths[col], String.valueOf(cell).length()); + } + } + } + StringBuilder sb = new StringBuilder(); + String nl = NEW_LINE; + for (int row = 0; row < rows; row++) { + for (int col = 0; col < cols; col++) { + int index = col + (row * cols); + if (index < cells.length) { + for (int i = 0; i < lpad; i++) { + sb.append(' '); + } + Object cell = cells[index]; + String s = String.valueOf(cell); + int w = s.length(); + sb.append(s); + while (w < colWidths[col]) { + sb.append(' '); + w++; + } + for (int i = 0; i < rpad; i++) { + sb.append(' '); + } + } + } + sb.append(nl); + } + return sb.toString(); + } + + /** + * Appends a formatted code position to a {@link StringBuilder}. + * + * @param sb the {@link StringBuilder} to append to + * @param pos the code position to format and append to {@code sb} + * @return the value of {@code sb} + */ + public static StringBuilder append(StringBuilder sb, BytecodePosition pos) { + MetaUtil.appendLocation(sb.append("at "), pos.getMethod(), pos.getBCI()); + if (pos.getCaller() != null) { + sb.append(NEW_LINE); + append(sb, pos.getCaller()); + } + return sb; + } + + /** + * Appends a formatted frame to a {@link StringBuilder}. + * + * @param sb the {@link StringBuilder} to append to + * @param frame the frame to format and append to {@code sb} + * @return the value of {@code sb} + */ + public static StringBuilder append(StringBuilder sb, BytecodeFrame frame) { + MetaUtil.appendLocation(sb.append("at "), frame.getMethod(), frame.getBCI()); + assert sb.charAt(sb.length() - 1) == ']'; + sb.deleteCharAt(sb.length() - 1); + sb.append(", duringCall: ").append(frame.duringCall).append(", rethrow: ").append(frame.rethrowException).append(']'); + if (frame.values != null && frame.values.length > 0) { + sb.append(NEW_LINE); + String table = tabulateValues(frame); + String[] rows = table.split(NEW_LINE); + for (int i = 0; i < rows.length; i++) { + String row = rows[i]; + if (!row.trim().isEmpty()) { + sb.append(" ").append(row); + if (i != rows.length - 1) { + sb.append(NEW_LINE); + } + } + } + } + if (frame.caller() != null) { + sb.append(NEW_LINE); + append(sb, frame.caller()); + } else if (frame.getCaller() != null) { + sb.append(NEW_LINE); + append(sb, frame.getCaller()); + } + return sb; + } + + public interface RefMapFormatter { + + String formatStackSlot(int frameRefMapIndex); + + String formatRegister(int regRefMapIndex); + } + + /** + * Formats a location in a register reference map. + */ + public static class DefaultRegFormatter implements RefMapFormatter { + + private final Register[] registers; + + public DefaultRegFormatter(Architecture arch) { + registers = new Register[arch.getRegisterReferenceMapSize()]; + for (Register r : arch.getRegisters()) { + if (r.getReferenceMapIndex() >= 0) { + registers[r.getReferenceMapIndex()] = r; + } + } + } + + public String formatStackSlot(int frameRefMapIndex) { + return null; + } + + public String formatRegister(int regRefMapIndex) { + int i = regRefMapIndex; + int idx = 0; + while (registers[i] == null) { + i--; + idx++; + } + if (idx == 0) { + return registers[i].toString(); + } else { + return String.format("%s+%d", registers[i].toString(), idx); + } + } + } + + /** + * Formats a location present in a register or frame reference map. + */ + public static class DefaultRefMapFormatter extends DefaultRegFormatter { + + /** + * The size of a stack slot. + */ + public final int slotSize; + + /** + * The register used as the frame pointer. + */ + public final Register fp; + + /** + * The offset (in bytes) from the slot pointed to by {@link #fp} to the slot corresponding + * to bit 0 in the frame reference map. + */ + public final int refMapToFPOffset; + + public DefaultRefMapFormatter(Architecture arch, int slotSize, Register fp, int refMapToFPOffset) { + super(arch); + this.slotSize = slotSize; + this.fp = fp; + this.refMapToFPOffset = refMapToFPOffset; + } + + @Override + public String formatStackSlot(int frameRefMapIndex) { + int refMapOffset = frameRefMapIndex * slotSize; + int fpOffset = refMapOffset + refMapToFPOffset; + if (fpOffset >= 0) { + return fp + "+" + fpOffset; + } + return fp.name + fpOffset; + } + } + + public static class NumberedRefMapFormatter implements RefMapFormatter { + + public String formatStackSlot(int frameRefMapIndex) { + return "s" + frameRefMapIndex; + } + + public String formatRegister(int regRefMapIndex) { + return "r" + regRefMapIndex; + } + } + + /** + * Appends a formatted debug info to a {@link StringBuilder}. + * + * @param sb the {@link StringBuilder} to append to + * @param info the debug info to format and append to {@code sb} + * @return the value of {@code sb} + */ + public static StringBuilder append(StringBuilder sb, DebugInfo info, RefMapFormatter formatterArg) { + RefMapFormatter formatter = formatterArg; + if (formatter == null) { + formatter = new NumberedRefMapFormatter(); + } + String nl = NEW_LINE; + ReferenceMap refMap = info.getReferenceMap(); + if (refMap != null && refMap.hasRegisterRefMap()) { + sb.append(" reg-ref-map:"); + refMap.appendRegisterMap(sb, formatter); + sb.append(nl); + } + if (refMap != null && refMap.hasFrameRefMap()) { + sb.append("frame-ref-map:"); + refMap.appendFrameMap(sb, formatter); + sb.append(nl); + } + RegisterSaveLayout calleeSaveInfo = info.getCalleeSaveInfo(); + if (calleeSaveInfo != null) { + sb.append("callee-save-info:").append(nl); + Map map = calleeSaveInfo.slotsToRegisters(true); + for (Map.Entry e : map.entrySet()) { + sb.append(" ").append(e.getValue()).append(" -> ").append(formatter.formatStackSlot(e.getKey())).append(nl); + } + } + BytecodeFrame frame = info.frame(); + if (frame != null) { + append(sb, frame); + } else if (info.getBytecodePosition() != null) { + append(sb, info.getBytecodePosition()); + } + return sb; + } + + /** + * Create a calling convention from a {@link ResolvedJavaMethod}. + */ + public static CallingConvention getCallingConvention(CodeCacheProvider codeCache, CallingConvention.Type type, ResolvedJavaMethod method, boolean stackOnly) { + Signature sig = method.getSignature(); + JavaType retType = sig.getReturnType(null); + int sigCount = sig.getParameterCount(false); + JavaType[] argTypes; + int argIndex = 0; + if (!method.isStatic()) { + argTypes = new JavaType[sigCount + 1]; + argTypes[argIndex++] = method.getDeclaringClass(); + } else { + argTypes = new JavaType[sigCount]; + } + for (int i = 0; i < sigCount; i++) { + argTypes[argIndex++] = sig.getParameterType(i, null); + } + + RegisterConfig registerConfig = codeCache.getRegisterConfig(); + return registerConfig.getCallingConvention(type, retType, argTypes, codeCache.getTarget(), stackOnly); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CompilationResult.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/CompilationResult.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,951 @@ +/* + * 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 com.oracle.jvmci.code; + +import static com.oracle.jvmci.meta.MetaUtil.*; +import static java.util.Collections.*; + +import java.util.*; + +import com.oracle.jvmci.code.CodeUtil.RefMapFormatter; +import com.oracle.jvmci.meta.Assumptions.Assumption; +import com.oracle.jvmci.meta.*; + +/** + * Represents the output from compiling a method, including the compiled machine code, associated + * data and references, relocation information, deoptimization information, etc. + */ +public class CompilationResult { + + /** + * Represents a code position with associated additional information. + */ + public abstract static class Site { + + /** + * The position (or offset) of this site with respect to the start of the target method. + */ + public final int pcOffset; + + public Site(int pos) { + this.pcOffset = pos; + } + + @Override + public final int hashCode() { + throw new UnsupportedOperationException("hashCode"); + } + + @Override + public String toString() { + return identityHashCodeString(this); + } + + @Override + public abstract boolean equals(Object obj); + } + + /** + * Represents an infopoint with associated debug info. Note that safepoints are also infopoints. + */ + public static class Infopoint extends Site implements Comparable { + + public final DebugInfo debugInfo; + + public final InfopointReason reason; + + public Infopoint(int pcOffset, DebugInfo debugInfo, InfopointReason reason) { + super(pcOffset); + this.debugInfo = debugInfo; + this.reason = reason; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(pcOffset); + sb.append("[]"); + appendDebugInfo(sb, debugInfo); + return sb.toString(); + } + + @Override + public int compareTo(Infopoint o) { + if (pcOffset < o.pcOffset) { + return -1; + } else if (pcOffset > o.pcOffset) { + return 1; + } + return this.reason.compareTo(o.reason); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj != null && obj.getClass() == getClass()) { + Infopoint that = (Infopoint) obj; + if (this.pcOffset == that.pcOffset && Objects.equals(this.debugInfo, that.debugInfo) && Objects.equals(this.reason, that.reason)) { + return true; + } + } + return false; + } + } + + /** + * Represents a call in the code. + */ + public static final class Call extends Infopoint { + + /** + * The target of the call. + */ + public final InvokeTarget target; + + /** + * The size of the call instruction. + */ + public final int size; + + /** + * Specifies if this call is direct or indirect. A direct call has an immediate operand + * encoding the absolute or relative (to the call itself) address of the target. An indirect + * call has a register or memory operand specifying the target address of the call. + */ + public final boolean direct; + + public Call(InvokeTarget target, int pcOffset, int size, boolean direct, DebugInfo debugInfo) { + super(pcOffset, debugInfo, InfopointReason.CALL); + this.size = size; + this.target = target; + this.direct = direct; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof Call && super.equals(obj)) { + Call that = (Call) obj; + if (this.size == that.size && this.direct == that.direct && Objects.equals(this.target, that.target)) { + return true; + } + } + return false; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(pcOffset); + sb.append('['); + sb.append(target); + sb.append(']'); + + if (debugInfo != null) { + appendDebugInfo(sb, debugInfo); + } + + return sb.toString(); + } + } + + /** + * Represents some external data that is referenced by the code. + */ + public abstract static class Reference { + + @Override + public abstract int hashCode(); + + @Override + public abstract boolean equals(Object obj); + } + + public static final class ConstantReference extends Reference { + + private final VMConstant constant; + + public ConstantReference(VMConstant constant) { + this.constant = constant; + } + + public VMConstant getConstant() { + return constant; + } + + @Override + public String toString() { + return constant.toString(); + } + + @Override + public int hashCode() { + return constant.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof ConstantReference) { + ConstantReference that = (ConstantReference) obj; + return Objects.equals(this.constant, that.constant); + } + return false; + } + } + + public static final class DataSectionReference extends Reference { + + private boolean initialized; + private int offset; + + public DataSectionReference() { + // will be set after the data section layout is fixed + offset = 0xDEADDEAD; + } + + public int getOffset() { + assert initialized; + + return offset; + } + + public void setOffset(int offset) { + assert !initialized; + initialized = true; + + this.offset = offset; + } + + @Override + public int hashCode() { + return offset; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof DataSectionReference) { + DataSectionReference that = (DataSectionReference) obj; + return this.offset == that.offset; + } + return false; + } + } + + /** + * Represents a code site that references some data. The associated data can be either a + * {@link DataSectionReference reference} to the data section, or it may be an inlined + * {@link JavaConstant} that needs to be patched. + */ + public static final class DataPatch extends Site { + + public Reference reference; + + public DataPatch(int pcOffset, Reference reference) { + super(pcOffset); + this.reference = reference; + } + + @Override + public String toString() { + return String.format("%d[]", pcOffset, reference.toString()); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof DataPatch) { + DataPatch that = (DataPatch) obj; + if (this.pcOffset == that.pcOffset && Objects.equals(this.reference, that.reference)) { + return true; + } + } + return false; + } + } + + /** + * Provides extra information about instructions or data at specific positions in + * {@link CompilationResult#getTargetCode()}. This is optional information that can be used to + * enhance a disassembly of the code. + */ + public abstract static class CodeAnnotation { + + public final int position; + + public CodeAnnotation(int position) { + this.position = position; + } + + @Override + public final int hashCode() { + throw new UnsupportedOperationException("hashCode"); + } + + @Override + public String toString() { + return identityHashCodeString(this); + } + + @Override + public abstract boolean equals(Object obj); + } + + /** + * A string comment about one or more instructions at a specific position in the code. + */ + public static final class CodeComment extends CodeAnnotation { + + public final String value; + + public CodeComment(int position, String comment) { + super(position); + this.value = comment; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof CodeComment) { + CodeComment that = (CodeComment) obj; + if (this.position == that.position && this.value.equals(that.value)) { + return true; + } + } + return false; + } + + @Override + public String toString() { + return getClass().getSimpleName() + "@" + position + ": " + value; + } + } + + /** + * Describes a table of signed offsets embedded in the code. The offsets are relative to the + * starting address of the table. This type of table maybe generated when translating a + * multi-way branch based on a key value from a dense value set (e.g. the {@code tableswitch} + * JVM instruction). + * + * The table is indexed by the contiguous range of integers from {@link #low} to {@link #high} + * inclusive. + */ + public static final class JumpTable extends CodeAnnotation { + + /** + * The low value in the key range (inclusive). + */ + public final int low; + + /** + * The high value in the key range (inclusive). + */ + public final int high; + + /** + * The size (in bytes) of each table entry. + */ + public final int entrySize; + + public JumpTable(int position, int low, int high, int entrySize) { + super(position); + this.low = low; + this.high = high; + this.entrySize = entrySize; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof JumpTable) { + JumpTable that = (JumpTable) obj; + if (this.position == that.position && this.entrySize == that.entrySize && this.low == that.low && this.high == that.high) { + return true; + } + } + return false; + } + + @Override + public String toString() { + return getClass().getSimpleName() + "@" + position + ": [" + low + " .. " + high + "]"; + } + } + + /** + * Represents exception handler information for a specific code position. It includes the catch + * code position as well as the caught exception type. + */ + public static final class ExceptionHandler extends Site { + + public final int handlerPos; + + ExceptionHandler(int pcOffset, int handlerPos) { + super(pcOffset); + this.handlerPos = handlerPos; + } + + @Override + public String toString() { + return String.format("%d[]", pcOffset, handlerPos); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof ExceptionHandler) { + ExceptionHandler that = (ExceptionHandler) obj; + if (this.pcOffset == that.pcOffset && this.handlerPos == that.handlerPos) { + return true; + } + } + return false; + } + } + + /** + * Represents a mark in the machine code that can be used by the runtime for its own purposes. A + * mark can reference other marks. + */ + public static final class Mark extends Site { + + public final Object id; + + public Mark(int pcOffset, Object id) { + super(pcOffset); + this.id = id; + } + + @Override + public String toString() { + if (id == null) { + return String.format("%d[]", pcOffset); + } else if (id instanceof Integer) { + return String.format("%d[]", pcOffset, Integer.toHexString((Integer) id)); + } else { + return String.format("%d[]", pcOffset, id.toString()); + } + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof Mark) { + Mark that = (Mark) obj; + if (this.pcOffset == that.pcOffset && Objects.equals(this.id, that.id)) { + return true; + } + } + return false; + } + } + + private int id = -1; + private int entryBCI = -1; + + private final DataSection dataSection = new DataSection(); + + private final List infopoints = new ArrayList<>(); + private final List dataPatches = new ArrayList<>(); + private final List exceptionHandlers = new ArrayList<>(); + private final List marks = new ArrayList<>(); + + private int totalFrameSize = -1; + private int customStackAreaOffset = -1; + + private final String name; + + /** + * The buffer containing the emitted machine code. + */ + private byte[] targetCode; + + /** + * The leading number of bytes in {@link #targetCode} containing the emitted machine code. + */ + private int targetCodeSize; + + private ArrayList annotations; + + private Assumption[] assumptions; + + /** + * The list of the methods whose bytecodes were used as input to the compilation. If + * {@code null}, then the compilation did not record method dependencies. Otherwise, the first + * element of this array is the root method of the compilation. + */ + private ResolvedJavaMethod[] methods; + + public CompilationResult() { + this(null); + } + + public CompilationResult(String name) { + this.name = name; + } + + @Override + public int hashCode() { + // CompilationResult instances should not be used as hash map keys + throw new UnsupportedOperationException("hashCode"); + } + + @Override + public String toString() { + if (methods != null) { + return getClass().getName() + "[" + methods[0].format("%H.%n(%p)%r") + "]"; + } + return identityHashCodeString(this); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj != null && obj.getClass() == getClass()) { + CompilationResult that = (CompilationResult) obj; + // @formatter:off + if (this.entryBCI == that.entryBCI && + this.id == that.id && + this.customStackAreaOffset == that.customStackAreaOffset && + this.totalFrameSize == that.totalFrameSize && + this.targetCodeSize == that.targetCodeSize && + Objects.equals(this.name, that.name) && + Objects.equals(this.annotations, that.annotations) && + Objects.equals(this.dataSection, that.dataSection) && + Objects.equals(this.exceptionHandlers, that.exceptionHandlers) && + Objects.equals(this.dataPatches, that.dataPatches) && + Objects.equals(this.infopoints, that.infopoints) && + Objects.equals(this.marks, that.marks) && + Arrays.equals(this.assumptions, that.assumptions) && + Arrays.equals(targetCode, that.targetCode)) { + return true; + } + // @formatter:on + } + return false; + } + + /** + * @return the compile id + */ + public int getId() { + return id; + } + + /** + * @param id the compile id to set + */ + public void setId(int id) { + this.id = id; + } + + /** + * @return the entryBCI + */ + public int getEntryBCI() { + return entryBCI; + } + + /** + * @param entryBCI the entryBCI to set + */ + public void setEntryBCI(int entryBCI) { + this.entryBCI = entryBCI; + } + + /** + * Sets the assumptions made during compilation. + */ + public void setAssumptions(Assumption[] assumptions) { + this.assumptions = assumptions; + } + + /** + * Gets a fixed-size {@linkplain Arrays#asList(Object...) view} of the assumptions made during + * compilation. + */ + public Collection getAssumptions() { + return assumptions == null ? Collections.emptyList() : Arrays.asList(assumptions); + } + + /** + * Sets the methods whose bytecodes were used as input to the compilation. + * + * @param rootMethod the root method of the compilation + * @param inlinedMethods the methods inlined during compilation + */ + public void setMethods(ResolvedJavaMethod rootMethod, Collection inlinedMethods) { + assert rootMethod != null; + assert inlinedMethods != null; + if (inlinedMethods.contains(rootMethod)) { + methods = inlinedMethods.toArray(new ResolvedJavaMethod[inlinedMethods.size()]); + for (int i = 0; i < methods.length; i++) { + if (methods[i].equals(rootMethod)) { + if (i != 0) { + ResolvedJavaMethod tmp = methods[0]; + methods[0] = methods[i]; + methods[i] = tmp; + } + break; + } + } + } else { + methods = new ResolvedJavaMethod[1 + inlinedMethods.size()]; + methods[0] = rootMethod; + int i = 1; + for (ResolvedJavaMethod m : inlinedMethods) { + methods[i++] = m; + } + } + } + + /** + * Gets a fixed-size {@linkplain Arrays#asList(Object...) view} of the methods whose bytecodes + * were used as input to the compilation. + * + * @return {@code null} if the compilation did not record method dependencies otherwise the + * methods whose bytecodes were used as input to the compilation with the first element + * being the root method of the compilation + */ + public Collection getMethods() { + return methods == null ? null : Arrays.asList(methods); + } + + public DataSection getDataSection() { + return dataSection; + } + + /** + * The total frame size of the method in bytes. This includes the return address pushed onto the + * stack, if any. + * + * @return the frame size + */ + public int getTotalFrameSize() { + assert totalFrameSize != -1 : "frame size not yet initialized!"; + return totalFrameSize; + } + + /** + * Sets the total frame size in bytes. This includes the return address pushed onto the stack, + * if any. + * + * @param size the size of the frame in bytes + */ + public void setTotalFrameSize(int size) { + totalFrameSize = size; + } + + /** + * Sets the machine that has been generated by the compiler. + * + * @param code the machine code generated + * @param size the size of the machine code + */ + public void setTargetCode(byte[] code, int size) { + targetCode = code; + targetCodeSize = size; + } + + /** + * Records a data patch in the code section. The data patch can refer to something in the + * {@link DataSectionReference data section} or directly to an {@link ConstantReference inlined + * constant}. + * + * @param codePos The position in the code that needs to be patched. + * @param ref The reference that should be inserted in the code. + */ + public void recordDataPatch(int codePos, Reference ref) { + assert codePos >= 0 && ref != null; + dataPatches.add(new DataPatch(codePos, ref)); + } + + /** + * Records a call in the code array. + * + * @param codePos the position of the call in the code array + * @param size the size of the call instruction + * @param target the being called + * @param debugInfo the debug info for the call + * @param direct specifies if this is a {@linkplain Call#direct direct} call + */ + public void recordCall(int codePos, int size, InvokeTarget target, DebugInfo debugInfo, boolean direct) { + final Call call = new Call(target, codePos, size, direct, debugInfo); + addInfopoint(call); + } + + /** + * Records an exception handler for this method. + * + * @param codePos the position in the code that is covered by the handler + * @param handlerPos the position of the handler + */ + public void recordExceptionHandler(int codePos, int handlerPos) { + assert validateExceptionHandlerAdd(codePos, handlerPos) : String.format("Duplicate exception handler for pc 0x%x handlerPos 0x%x", codePos, handlerPos); + exceptionHandlers.add(new ExceptionHandler(codePos, handlerPos)); + } + + /** + * Validate if the exception handler for codePos already exists and handlerPos is different. + * + * @param codePos + * @param handlerPos + * @return true if the validation is successful + */ + private boolean validateExceptionHandlerAdd(int codePos, int handlerPos) { + ExceptionHandler exHandler = getExceptionHandlerForCodePos(codePos); + return exHandler == null || exHandler.handlerPos == handlerPos; + } + + /** + * Returns the first ExceptionHandler which matches codePos. + * + * @param codePos position to search for + * @return first matching ExceptionHandler + */ + private ExceptionHandler getExceptionHandlerForCodePos(int codePos) { + for (ExceptionHandler h : exceptionHandlers) { + if (h.pcOffset == codePos) { + return h; + } + } + return null; + } + + /** + * Records an infopoint in the code array. + * + * @param codePos the position of the infopoint in the code array + * @param debugInfo the debug info for the infopoint + */ + public void recordInfopoint(int codePos, DebugInfo debugInfo, InfopointReason reason) { + addInfopoint(new Infopoint(codePos, debugInfo, reason)); + } + + /** + * Records a custom infopoint in the code section. + * + * Compiler implementations can use this method to record non-standard infopoints, which are not + * handled by the dedicated methods like {@link #recordCall}. + * + * @param infopoint the infopoint to record, usually a derived class from {@link Infopoint} + */ + public void addInfopoint(Infopoint infopoint) { + // The infopoints list must always be sorted + if (!infopoints.isEmpty()) { + Infopoint previousInfopoint = infopoints.get(infopoints.size() - 1); + if (previousInfopoint.pcOffset > infopoint.pcOffset) { + // This re-sorting should be very rare + Collections.sort(infopoints); + previousInfopoint = infopoints.get(infopoints.size() - 1); + } + if (previousInfopoint.pcOffset == infopoint.pcOffset) { + if (infopoint.reason.canBeOmitted()) { + return; + } + if (previousInfopoint.reason.canBeOmitted()) { + Infopoint removed = infopoints.remove(infopoints.size() - 1); + assert removed == previousInfopoint; + } else { + throw new RuntimeException("Infopoints that can not be omited should have distinct PCs"); + } + } + } + infopoints.add(infopoint); + } + + /** + * Records an instruction mark within this method. + * + * @param codePos the position in the code that is covered by the handler + * @param markId the identifier for this mark + */ + public Mark recordMark(int codePos, Object markId) { + Mark mark = new Mark(codePos, markId); + marks.add(mark); + return mark; + } + + /** + * Offset in bytes for the custom stack area (relative to sp). + * + * @return the offset in bytes + */ + public int getCustomStackAreaOffset() { + return customStackAreaOffset; + } + + /** + * @see #getCustomStackAreaOffset() + * @param offset + */ + public void setCustomStackAreaOffset(int offset) { + customStackAreaOffset = offset; + } + + /** + * @return the machine code generated for this method + */ + public byte[] getTargetCode() { + return targetCode; + } + + /** + * @return the size of the machine code generated for this method + */ + public int getTargetCodeSize() { + return targetCodeSize; + } + + /** + * @return the code annotations or {@code null} if there are none + */ + public List getAnnotations() { + if (annotations == null) { + return Collections.emptyList(); + } + return annotations; + } + + public void addAnnotation(CodeAnnotation annotation) { + assert annotation != null; + if (annotations == null) { + annotations = new ArrayList<>(); + } + annotations.add(annotation); + } + + private static void appendDebugInfo(StringBuilder sb, DebugInfo info) { + if (info != null) { + ReferenceMap refMap = info.getReferenceMap(); + if (refMap != null) { + RefMapFormatter formatter = new CodeUtil.NumberedRefMapFormatter(); + if (refMap.hasFrameRefMap()) { + sb.append(" stackMap["); + refMap.appendFrameMap(sb, formatter); + sb.append(']'); + } + if (refMap.hasRegisterRefMap()) { + sb.append(" registerMap["); + refMap.appendRegisterMap(sb, formatter); + sb.append(']'); + } + } + RegisterSaveLayout calleeSaveInfo = info.getCalleeSaveInfo(); + if (calleeSaveInfo != null) { + sb.append(" callee-save-info["); + String sep = ""; + for (Map.Entry e : calleeSaveInfo.registersToSlots(true).entrySet()) { + sb.append(sep).append(e.getKey()).append("->").append(e.getValue()); + sep = ", "; + } + sb.append(']'); + } + BytecodePosition codePos = info.getBytecodePosition(); + if (codePos != null) { + MetaUtil.appendLocation(sb.append(" "), codePos.getMethod(), codePos.getBCI()); + if (info.hasFrame()) { + sb.append(" #locals=").append(info.frame().numLocals).append(" #expr=").append(info.frame().numStack); + if (info.frame().numLocks > 0) { + sb.append(" #locks=").append(info.frame().numLocks); + } + } + } + } + } + + /** + * @return the list of infopoints, sorted by {@link Site#pcOffset} + */ + public List getInfopoints() { + if (infopoints.isEmpty()) { + return emptyList(); + } + return unmodifiableList(infopoints); + } + + /** + * @return the list of data references + */ + public List getDataPatches() { + if (dataPatches.isEmpty()) { + return emptyList(); + } + return unmodifiableList(dataPatches); + } + + /** + * @return the list of exception handlers + */ + public List getExceptionHandlers() { + if (exceptionHandlers.isEmpty()) { + return emptyList(); + } + return unmodifiableList(exceptionHandlers); + } + + /** + * @return the list of marks + */ + public List getMarks() { + if (marks.isEmpty()) { + return emptyList(); + } + return unmodifiableList(marks); + } + + public String getName() { + return name; + } + + public void reset() { + infopoints.clear(); + dataPatches.clear(); + exceptionHandlers.clear(); + marks.clear(); + if (annotations != null) { + annotations.clear(); + } + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/DataSection.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/DataSection.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.SerializableConstant; +import static com.oracle.jvmci.meta.MetaUtil.*; + +import java.nio.*; +import java.util.*; +import java.util.function.*; + +import com.oracle.jvmci.code.CompilationResult.DataPatch; +import com.oracle.jvmci.code.CompilationResult.DataSectionReference; +import com.oracle.jvmci.code.DataSection.Data; + +public final class DataSection implements Iterable { + + @FunctionalInterface + public interface DataBuilder { + + void emit(ByteBuffer buffer, Consumer patch); + + static DataBuilder raw(byte[] data) { + return (buffer, patch) -> buffer.put(data); + } + + static DataBuilder serializable(SerializableConstant c) { + return (buffer, patch) -> c.serialize(buffer); + } + + static DataBuilder zero(int size) { + switch (size) { + case 1: + return (buffer, patch) -> buffer.put((byte) 0); + case 2: + return (buffer, patch) -> buffer.putShort((short) 0); + case 4: + return (buffer, patch) -> buffer.putInt(0); + case 8: + return (buffer, patch) -> buffer.putLong(0L); + default: + return (buffer, patch) -> { + int rest = size; + while (rest > 8) { + buffer.putLong(0L); + rest -= 8; + } + while (rest > 0) { + buffer.put((byte) 0); + rest--; + } + }; + } + } + } + + public static final class Data { + + private int alignment; + private final int size; + private final DataBuilder builder; + + private DataSectionReference ref; + + public Data(int alignment, int size, DataBuilder builder) { + this.alignment = alignment; + this.size = size; + this.builder = builder; + + // initialized in DataSection.insertData(Data) + ref = null; + } + + public void updateAlignment(int newAlignment) { + if (newAlignment == alignment) { + return; + } + alignment = lcm(alignment, newAlignment); + } + + public int getAlignment() { + return alignment; + } + + public int getSize() { + return size; + } + + public DataBuilder getBuilder() { + return builder; + } + + @Override + public int hashCode() { + // Data instances should not be used as hash map keys + throw new UnsupportedOperationException("hashCode"); + } + + @Override + public String toString() { + return identityHashCodeString(this); + } + + @Override + public boolean equals(Object obj) { + assert ref != null; + if (obj == this) { + return true; + } + if (obj instanceof Data) { + Data that = (Data) obj; + if (this.alignment == that.alignment && this.size == that.size && this.ref.equals(that.ref)) { + return true; + } + } + return false; + } + } + + private final ArrayList dataItems = new ArrayList<>(); + + private boolean finalLayout; + private int sectionAlignment; + private int sectionSize; + + @Override + public int hashCode() { + // DataSection instances should not be used as hash map keys + throw new UnsupportedOperationException("hashCode"); + } + + @Override + public String toString() { + return identityHashCodeString(this); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof DataSection) { + DataSection that = (DataSection) obj; + if (this.finalLayout == that.finalLayout && this.sectionAlignment == that.sectionAlignment && this.sectionSize == that.sectionSize && Objects.equals(this.dataItems, that.dataItems)) { + return true; + } + } + return false; + } + + /** + * Insert a {@link Data} item into the data section. If the item is already in the data section, + * the same {@link DataSectionReference} is returned. + * + * @param data the {@link Data} item to be inserted + * @return a unique {@link DataSectionReference} identifying the {@link Data} item + */ + public DataSectionReference insertData(Data data) { + assert !finalLayout; + if (data.ref == null) { + data.ref = new DataSectionReference(); + dataItems.add(data); + } + return data.ref; + } + + /** + * Compute the layout of the data section. This can be called only once, and after it has been + * called, the data section can no longer be modified. + */ + public void finalizeLayout() { + assert !finalLayout; + finalLayout = true; + + // simple heuristic: put items with larger alignment requirement first + dataItems.sort((a, b) -> a.alignment - b.alignment); + + int position = 0; + for (Data d : dataItems) { + sectionAlignment = lcm(sectionAlignment, d.alignment); + position = align(position, d.alignment); + + d.ref.setOffset(position); + position += d.size; + } + + sectionSize = position; + } + + /** + * Get the size of the data section. Can only be called after {@link #finalizeLayout}. + */ + public int getSectionSize() { + assert finalLayout; + return sectionSize; + } + + /** + * Get the minimum alignment requirement of the data section. Can only be called after + * {@link #finalizeLayout}. + */ + public int getSectionAlignment() { + assert finalLayout; + return sectionAlignment; + } + + /** + * Build the data section. Can only be called after {@link #finalizeLayout}. + * + * @param buffer The {@link ByteBuffer} where the data section should be built. The buffer must + * hold at least {@link #getSectionSize()} bytes. + * @param patch A {@link Consumer} to receive {@link DataPatch data patches} for relocations in + * the data section. + */ + public void buildDataSection(ByteBuffer buffer, Consumer patch) { + assert finalLayout; + for (Data d : dataItems) { + buffer.position(d.ref.getOffset()); + d.builder.emit(buffer, patch); + } + } + + public Data findData(DataSectionReference ref) { + for (Data d : dataItems) { + if (d.ref == ref) { + return d; + } + } + return null; + } + + public Iterator iterator() { + return dataItems.iterator(); + } + + private static int lcm(int x, int y) { + if (x == 0) { + return y; + } else if (y == 0) { + return x; + } + + int a = Math.max(x, y); + int b = Math.min(x, y); + while (b > 0) { + int tmp = a % b; + a = b; + b = tmp; + } + + int gcd = a; + return x * y / gcd; + } + + private static int align(int position, int alignment) { + return ((position + alignment - 1) / alignment) * alignment; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/DebugInfo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/DebugInfo.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2009, 2011, 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.Value; +import java.util.*; + + +/** + * Represents the debugging information for a particular point of execution. This information + * includes: + *
    + *
  • a {@linkplain #getBytecodePosition() bytecode position}
  • + *
  • a reference map for registers and stack slots in the current frame
  • + *
  • a map from bytecode locals and operand stack slots to their values or locations from which + * their values can be read
  • + *
  • a map from the registers (in the caller's frame) to the slots where they are saved in the + * current frame
  • + *
+ */ +public final class DebugInfo { + + private final BytecodePosition bytecodePosition; + private final ReferenceMap referenceMap; + @SuppressWarnings("unused") private final Value[] virtualObjectMapping; + private RegisterSaveLayout calleeSaveInfo; + + /** + * Creates a new {@link DebugInfo} from the given values. + * + * @param codePos the {@linkplain BytecodePosition code position} or {@linkplain BytecodeFrame + * frame} info + * @param referenceMap the reference map + * @param virtualObjectMapping the mapping of {@link VirtualObject}s to their real values + */ + public DebugInfo(BytecodePosition codePos, ReferenceMap referenceMap, Value[] virtualObjectMapping) { + this.bytecodePosition = codePos; + this.referenceMap = referenceMap; + this.virtualObjectMapping = virtualObjectMapping; + } + + public DebugInfo(BytecodePosition codePos) { + this(codePos, null, null); + } + + /** + * @return {@code true} if this debug information has a frame + */ + public boolean hasFrame() { + return getBytecodePosition() instanceof BytecodeFrame; + } + + /** + * Gets the deoptimization information for each inlined frame (if available). + * + * @return {@code null} if no frame de-opt info is {@linkplain #hasFrame() available} + */ + public BytecodeFrame frame() { + if (hasFrame()) { + return (BytecodeFrame) getBytecodePosition(); + } + return null; + } + + @Override + public String toString() { + return CodeUtil.append(new StringBuilder(100), this, null).toString(); + } + + /** + * @return The code position (including all inlined methods) of this debug info. If this is a + * {@link BytecodeFrame} instance, then it is also the deoptimization information for + * each inlined frame. + */ + public BytecodePosition getBytecodePosition() { + return bytecodePosition; + } + + public ReferenceMap getReferenceMap() { + return referenceMap; + } + + /** + * Sets the map from the registers (in the caller's frame) to the slots where they are saved in + * the current frame. + */ + public void setCalleeSaveInfo(RegisterSaveLayout calleeSaveInfo) { + this.calleeSaveInfo = calleeSaveInfo; + } + + /** + * Gets the map from the registers (in the caller's frame) to the slots where they are saved in + * the current frame. If no such information is available, {@code null} is returned. + */ + public RegisterSaveLayout getCalleeSaveInfo() { + return calleeSaveInfo; + } + + @Override + public int hashCode() { + throw new UnsupportedOperationException("hashCode"); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof DebugInfo) { + DebugInfo that = (DebugInfo) obj; + if (Objects.equals(this.bytecodePosition, that.bytecodePosition) && Objects.equals(this.calleeSaveInfo, that.calleeSaveInfo) && Objects.equals(this.referenceMap, that.referenceMap)) { + return true; + } + } + return false; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/DisassemblerProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/DisassemblerProvider.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2013, 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 com.oracle.jvmci.code; + +/** + * Interface providing capability for disassembling machine code. + */ +public interface DisassemblerProvider { + + /** + * Gets a textual disassembly of some given installed code. + * + * @return a non-zero length string containing a disassembly of {@code code} or null if + * {@code code} is {@link InstalledCode#isValid() invalid} or it could not be + * disassembled for some other reason + */ + String disassemble(InstalledCode code); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/ForeignCallLinkage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/ForeignCallLinkage.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2009, 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.InvokeTarget; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.ForeignCallDescriptor; + +/** + * The runtime specific details of a {@linkplain ForeignCallDescriptor foreign} call. + */ +public interface ForeignCallLinkage extends InvokeTarget { + + /** + * Gets the details of where parameters are passed and value(s) are returned from the caller's + * perspective. + */ + CallingConvention getOutgoingCallingConvention(); + + /** + * Gets the details of where parameters are passed and value(s) are returned from the callee's + * perspective. + */ + CallingConvention getIncomingCallingConvention(); + + /** + * Returns the maximum absolute offset of PC relative call to this stub from any position in the + * code cache or -1 when not applicable. Intended for determining the required size of + * address/offset fields. + */ + long getMaxCallTargetOffset(); + + ForeignCallDescriptor getDescriptor(); + + /** + * Gets the values used/killed by this foreign call. + */ + Value[] getTemporaries(); + + /** + * Determines if the foreign call target destroys all registers. + * + * @return {@code true} if the register allocator must save all live registers around a call to + * this target + */ + boolean destroysRegisters(); + + /** + * Determines if this is call to a function that does not deoptimize, and therefore also does + * not lock, GC or throw exceptions. That is, the thread's execution state during the call is + * never inspected by another thread. + */ + boolean canDeoptimize(); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/ForeignCallsProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/ForeignCallsProvider.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2013, 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.LocationIdentity; +import com.oracle.jvmci.meta.ForeignCallDescriptor; + +/** + * Details about a set of supported {@link ForeignCallDescriptor foreign calls}. + */ +public interface ForeignCallsProvider { + + /** + * Determines if a given foreign call is side-effect free. Deoptimization cannot return + * execution to a point before a foreign call that has a side effect. + */ + boolean isReexecutable(ForeignCallDescriptor descriptor); + + /** + * Gets the set of memory locations killed by a given foreign call. Returning the special value + * {@link LocationIdentity#any()} denotes that the call kills all memory locations. Returning + * any empty array denotes that the call does not kill any memory locations. + */ + LocationIdentity[] getKilledLocations(ForeignCallDescriptor descriptor); + + /** + * Determines if deoptimization can occur during a given foreign call. + */ + boolean canDeoptimize(ForeignCallDescriptor descriptor); + + /** + * Gets the linkage for a foreign call. + */ + ForeignCallLinkage lookupForeignCall(ForeignCallDescriptor descriptor); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/InfopointReason.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/InfopointReason.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2013, 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 com.oracle.jvmci.code; + +/** + * A reason for infopoint insertion. + */ +public enum InfopointReason { + UNKNOWN(false), + SAFEPOINT(false), + CALL(false), + IMPLICIT_EXCEPTION(false), + METHOD_START(true), + METHOD_END(true), + LINE_NUMBER(true); + + private InfopointReason(boolean canBeOmitted) { + this.canBeOmitted = canBeOmitted; + } + + private final boolean canBeOmitted; + + public boolean canBeOmitted() { + return canBeOmitted; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/InstalledCode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/InstalledCode.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2011, 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 com.oracle.jvmci.code; + +/** + * Represents a compiled instance of a method. It may have been invalidated or removed in the + * meantime. + */ +public class InstalledCode { + + /** + * Raw address of this code blob. + */ + private long address; + + /** + * Counts how often the address field was reassigned. + */ + private long version; + + protected final String name; + + public InstalledCode(String name) { + this.name = name; + } + + public final void setAddress(long address) { + this.address = address; + version++; + } + + /** + * @return the address of this code blob + */ + public final long getAddress() { + return address; + } + + /** + * @return the address of this code blob + */ + public final long getVersion() { + return version; + } + + /** + * Returns the name of this code blob. + */ + public String getName() { + return name; + } + + /** + * Returns the start address of this installed code if it is {@linkplain #isValid() valid}, 0 + * otherwise. + */ + public long getStart() { + return 0; + } + + /** + * Returns the number of instruction bytes for this code. + */ + public long getCodeSize() { + return 0; + } + + /** + * Returns a copy of this installed code if it is {@linkplain #isValid() valid}, null otherwise. + */ + public byte[] getCode() { + return null; + } + + /** + * @return true if the code represented by this object is still valid, false otherwise (may + * happen due to deopt, etc.) + */ + public boolean isValid() { + return address != 0; + } + + /** + * Invalidates this installed code such that any subsequent invocation will throw an + * {@link InvalidInstalledCodeException}. + */ + public void invalidate() { + throw new UnsupportedOperationException(); + } + + /** + * Executes the installed code with a variable number of arguments. + * + * @param args the array of object arguments + * @return the value returned by the executed code + */ + @SuppressWarnings("unused") + public Object executeVarargs(Object... args) throws InvalidInstalledCodeException { + throw new UnsupportedOperationException(); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/InvalidInstalledCodeException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/InvalidInstalledCodeException.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2013, 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 com.oracle.jvmci.code; + +/** + * Exception thrown by the runtime in case an invalidated machine code is called. + */ +public final class InvalidInstalledCodeException extends Exception { + + private static final long serialVersionUID = -3540232440794244844L; +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/MemoryBarriers.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/MemoryBarriers.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2011, 2011, 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 com.oracle.jvmci.code; + +/** + * Constants and intrinsic definition for memory barriers. + * + * The documentation for each constant is taken from Doug Lea's The JSR-133 Cookbook for Compiler + * Writers. + *

+ * The {@code JMM_*} constants capture the memory barriers necessary to implement the Java Memory + * Model with respect to volatile field accesses. Their values are explained by this comment from + * templateTable_i486.cpp in the HotSpot source code: + * + *

+ * Volatile variables demand their effects be made known to all CPU's in
+ * order.  Store buffers on most chips allow reads & writes to reorder; the
+ * JMM's ReadAfterWrite.java test fails in -Xint mode without some kind of
+ * memory barrier (i.e., it's not sufficient that the interpreter does not
+ * reorder volatile references, the hardware also must not reorder them).
+ *
+ * According to the new Java Memory Model (JMM):
+ * (1) All volatiles are serialized wrt to each other.
+ * ALSO reads & writes act as acquire & release, so:
+ * (2) A read cannot let unrelated NON-volatile memory refs that happen after
+ * the read float up to before the read.  It's OK for non-volatile memory refs
+ * that happen before the volatile read to float down below it.
+ * (3) Similarly, a volatile write cannot let unrelated NON-volatile memory refs
+ * that happen BEFORE the write float down to after the write.  It's OK for
+ * non-volatile memory refs that happen after the volatile write to float up
+ * before it.
+ *
+ * We only put in barriers around volatile refs (they are expensive), not
+ * _between_ memory refs (which would require us to track the flavor of the
+ * previous memory refs).  Requirements (2) and (3) require some barriers
+ * before volatile stores and after volatile loads.  These nearly cover
+ * requirement (1) but miss the volatile-store-volatile-load case.  This final
+ * case is placed after volatile-stores although it could just as well go
+ * before volatile-loads.
+ * 
+ */ +public class MemoryBarriers { + + /** + * The sequence {@code Load1; LoadLoad; Load2} ensures that {@code Load1}'s data are loaded + * before data accessed by {@code Load2} and all subsequent load instructions are loaded. In + * general, explicit {@code LoadLoad} barriers are needed on processors that perform speculative + * loads and/or out-of-order processing in which waiting load instructions can bypass waiting + * stores. On processors that guarantee to always preserve load ordering, these barriers amount + * to no-ops. + */ + public static final int LOAD_LOAD = 0x0001; + + /** + * The sequence {@code Load1; LoadStore; Store2} ensures that {@code Load1}'s data are loaded + * before all data associated with {@code Store2} and subsequent store instructions are flushed. + * {@code LoadStore} barriers are needed only on those out-of-order processors in which waiting + * store instructions can bypass loads. + */ + public static final int LOAD_STORE = 0x0002; + + /** + * The sequence {@code Store1; StoreLoad; Load2} ensures that {@code Store1}'s data are made + * visible to other processors (i.e., flushed to main memory) before data accessed by + * {@code Load2} and all subsequent load instructions are loaded. {@code StoreLoad} barriers + * protect against a subsequent load incorrectly using {@code Store1}'s data value rather than + * that from a more recent store to the same location performed by a different processor. + * Because of this, on the processors discussed below, a {@code StoreLoad} is strictly necessary + * only for separating stores from subsequent loads of the same location(s) as were stored + * before the barrier. {@code StoreLoad} barriers are needed on nearly all recent + * multiprocessors, and are usually the most expensive kind. Part of the reason they are + * expensive is that they must disable mechanisms that ordinarily bypass cache to satisfy loads + * from write-buffers. This might be implemented by letting the buffer fully flush, among other + * possible stalls. + */ + public static final int STORE_LOAD = 0x0004; + + /** + * The sequence {@code Store1; StoreStore; Store2} ensures that {@code Store1}'s data are + * visible to other processors (i.e., flushed to memory) before the data associated with + * {@code Store2} and all subsequent store instructions. In general, {@code StoreStore} barriers + * are needed on processors that do not otherwise guarantee strict ordering of flushes from + * write buffers and/or caches to other processors or main memory. + */ + public static final int STORE_STORE = 0x0008; + + public static final int JMM_PRE_VOLATILE_WRITE = LOAD_STORE | STORE_STORE; + public static final int JMM_POST_VOLATILE_WRITE = STORE_LOAD | STORE_STORE; + public static final int JMM_PRE_VOLATILE_READ = 0; + public static final int JMM_POST_VOLATILE_READ = LOAD_LOAD | LOAD_STORE; + + public static String barriersString(int barriers) { + StringBuilder sb = new StringBuilder(); + sb.append((barriers & LOAD_LOAD) != 0 ? "LOAD_LOAD " : ""); + sb.append((barriers & LOAD_STORE) != 0 ? "LOAD_STORE " : ""); + sb.append((barriers & STORE_LOAD) != 0 ? "STORE_LOAD " : ""); + sb.append((barriers & STORE_STORE) != 0 ? "STORE_STORE " : ""); + return sb.toString().trim(); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/ReferenceMap.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/ReferenceMap.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,41 @@ +/* + * 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.code.CodeUtil.RefMapFormatter; + +public abstract class ReferenceMap implements Cloneable { + + public abstract void setRegister(int idx, LIRKind kind); + + public abstract void setStackSlot(int offset, LIRKind kind); + + public abstract boolean hasRegisterRefMap(); + + public abstract boolean hasFrameRefMap(); + + public abstract void appendRegisterMap(StringBuilder sb, RefMapFormatter formatterArg); + + public abstract void appendFrameMap(StringBuilder sb, RefMapFormatter formatterArg); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/Register.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/Register.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,241 @@ +/* + * 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.*; + +/** + * Represents a target machine register. + */ +public final class Register implements Comparable { + + public static final RegisterCategory SPECIAL = new RegisterCategory("SPECIAL"); + + /** + * Invalid register. + */ + public static final Register None = new Register(-1, -1, "noreg", SPECIAL); + + /** + * Frame pointer of the current method. All spill slots and outgoing stack-based arguments are + * addressed relative to this register. + */ + public static final Register Frame = new Register(-2, -2, "framereg", SPECIAL); + + public static final Register CallerFrame = new Register(-3, -3, "callerframereg", SPECIAL); + + /** + * The identifier for this register that is unique across all the registers in a + * {@link Architecture}. A valid register has {@code number > 0}. + */ + public final int number; + + /** + * The mnemonic of this register. + */ + public final String name; + + /** + * The actual encoding in a target machine instruction for this register, which may or may not + * be the same as {@link #number}. + */ + public final int encoding; + + /** + * The assembler calls this method to get the register's encoding. + */ + public int encoding() { + return encoding; + } + + /** + * A platform specific register category that describes which values can be stored in a + * register. + */ + private final RegisterCategory registerCategory; + + /** + * A platform specific register type that describes which values can be stored in a register. + */ + public static class RegisterCategory { + + private final String name; + + private final int referenceMapOffset; + private final int referenceMapShift; + + public RegisterCategory(String name) { + this(name, 0, 0); + } + + public RegisterCategory(String name, int referenceMapOffset) { + this(name, referenceMapOffset, 0); + } + + public RegisterCategory(String name, int referenceMapOffset, int referenceMapShift) { + this.name = name; + this.referenceMapOffset = referenceMapOffset; + this.referenceMapShift = referenceMapShift; + } + + @Override + public String toString() { + return name; + } + + @Override + public int hashCode() { + return 23 + name.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof RegisterCategory) { + RegisterCategory that = (RegisterCategory) obj; + return this.referenceMapOffset == that.referenceMapOffset && this.referenceMapShift == that.referenceMapShift && this.name.equals(that.name); + } + return false; + } + } + + /** + * Creates a {@link Register} instance. + * + * @param number unique identifier for the register + * @param encoding the target machine encoding for the register + * @param name the mnemonic name for the register + * @param registerCategory the register category + */ + public Register(int number, int encoding, String name, RegisterCategory registerCategory) { + this.number = number; + this.name = name; + this.registerCategory = registerCategory; + this.encoding = encoding; + } + + public RegisterCategory getRegisterCategory() { + return registerCategory; + } + + /** + * Get the start index of this register in the {@link ReferenceMap}. + */ + public int getReferenceMapIndex() { + return (encoding << registerCategory.referenceMapShift) + registerCategory.referenceMapOffset; + } + + /** + * Gets this register as a {@linkplain RegisterValue value} with a specified kind. + * + * @param kind the specified kind + * @return the {@link RegisterValue} + */ + public RegisterValue asValue(LIRKind kind) { + return new RegisterValue(kind, this); + } + + /** + * Gets this register as a {@linkplain RegisterValue value} with no particular kind. + * + * @return a {@link RegisterValue} with {@link Kind#Illegal} kind. + */ + public RegisterValue asValue() { + return asValue(LIRKind.Illegal); + } + + /** + * Determines if this is a valid register. + * + * @return {@code true} iff this register is valid + */ + public boolean isValid() { + return number >= 0; + } + + /** + * Gets the maximum register {@linkplain #number number} in a given set of registers. + * + * @param registers the set of registers to process + * @return the maximum register number for any register in {@code registers} + */ + public static int maxRegisterNumber(Register[] registers) { + int max = Integer.MIN_VALUE; + for (Register r : registers) { + if (r.number > max) { + max = r.number; + } + } + return max; + } + + /** + * Gets the maximum register {@linkplain #encoding encoding} in a given set of registers. + * + * @param registers the set of registers to process + * @return the maximum register encoding for any register in {@code registers} + */ + public static int maxRegisterEncoding(Register[] registers) { + int max = Integer.MIN_VALUE; + for (Register r : registers) { + if (r.encoding > max) { + max = r.encoding; + } + } + return max; + } + + @Override + public String toString() { + return name; + } + + @Override + public int compareTo(Register o) { + if (number < o.number) { + return -1; + } + if (number > o.number) { + return 1; + } + return 0; + } + + @Override + public int hashCode() { + return 17 + name.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof Register) { + Register other = (Register) obj; + if (number == other.number) { + assert name.equals(other.name); + assert encoding == other.encoding; + assert registerCategory.equals(other.registerCategory); + return true; + } + } + return false; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/RegisterAttributes.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/RegisterAttributes.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2010, 2011, 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 com.oracle.jvmci.code; + +import java.util.*; + +/** + * A collection of register attributes. The specific attribute values for a register may be local to + * a compilation context. For example, a {@link RegisterConfig} in use during a compilation will + * determine which registers are callee saved. + */ +public class RegisterAttributes { + + private final boolean callerSave; + private final boolean calleeSave; + private final boolean allocatable; + + public RegisterAttributes(boolean isCallerSave, boolean isCalleeSave, boolean isAllocatable) { + this.callerSave = isCallerSave; + this.calleeSave = isCalleeSave; + this.allocatable = isAllocatable; + } + + public static final RegisterAttributes NONE = new RegisterAttributes(false, false, false); + + /** + * Creates a map from register {@linkplain Register#number numbers} to register + * {@linkplain RegisterAttributes attributes} for a given register configuration and set of + * registers. + * + * @param registerConfig a register configuration + * @param registers a set of registers + * @return an array whose length is the max register number in {@code registers} plus 1. An + * element at index i holds the attributes of the register whose number is i. + */ + public static RegisterAttributes[] createMap(RegisterConfig registerConfig, Register[] registers) { + RegisterAttributes[] map = new RegisterAttributes[registers.length]; + for (Register reg : registers) { + if (reg != null) { + CalleeSaveLayout csl = registerConfig.getCalleeSaveLayout(); + RegisterAttributes attr = new RegisterAttributes(Arrays.asList(registerConfig.getCallerSaveRegisters()).contains(reg), + csl == null ? false : Arrays.asList(csl.registers).contains(reg), Arrays.asList(registerConfig.getAllocatableRegisters()).contains(reg)); + if (map.length <= reg.number) { + map = Arrays.copyOf(map, reg.number + 1); + } + map[reg.number] = attr; + } + } + for (int i = 0; i < map.length; i++) { + if (map[i] == null) { + map[i] = NONE; + } + } + return map; + } + + /** + * @return Denotes a register that is available for use by a register allocator. + */ + public boolean isAllocatable() { + return allocatable; + } + + /** + * @return Denotes a register whose value preservation (if required) across a call is the + * responsibility of the callee. + */ + public boolean isCalleeSave() { + return calleeSave; + } + + /** + * @return Denotes a register whose value preservation (if required) across a call is the + * responsibility of the caller. + */ + public boolean isCallerSave() { + return callerSave; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/RegisterConfig.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/RegisterConfig.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2009, 2011, 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.JavaType; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.code.CallingConvention.Type; + +/** + * A register configuration binds roles and {@linkplain RegisterAttributes attributes} to physical + * registers. + */ +public interface RegisterConfig { + + /** + * Gets the register to be used for returning a value of a given kind. + */ + Register getReturnRegister(Kind kind); + + /** + * Gets the maximum allowed size of the frame. + */ + default int getMaximumFrameSize() { + return Integer.MAX_VALUE; + } + + /** + * Gets the register to which {@link Register#Frame} and {@link Register#CallerFrame} are bound. + */ + Register getFrameRegister(); + + /** + * Gets the calling convention describing how arguments are passed. + * + * @param type the type of calling convention being requested + * @param returnType the return type (can be null for methods returning {@code void}) + * @param parameterTypes the types of the arguments of the call + * @param target the target platform + * @param stackOnly ignore registers + */ + CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly); + + /** + * Gets the ordered set of registers that are can be used to pass parameters according to a + * given calling convention. + * + * @param type the type of calling convention + * @param kind specifies what kind of registers is being requested + * @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); + + /** + * Gets the set of all registers that might be used by the register allocator. + * + * To get the set of registers the register allocator is allowed to use see + * {@link RegisterAllocationConfig#getAllocatableRegisters()} + */ + @SuppressWarnings("javadoc") + Register[] getAllocatableRegisters(); + + /** + * Filters a set of registers and returns only those that can be used by the register allocator + * for a value of a particular kind. + */ + Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers); + + /** + * Gets the registers whose values must be preserved by a method across any call it makes. + */ + Register[] getCallerSaveRegisters(); + + /** + * Gets the layout of the callee save area of this register configuration. + * + * @return {@code null} if there is no callee save area + */ + CalleeSaveLayout getCalleeSaveLayout(); + + /** + * Gets a map from register {@linkplain Register#number numbers} to register + * {@linkplain RegisterAttributes attributes} for this register configuration. + * + * @return an array where an element at index i holds the attributes of the register whose + * number is i + */ + RegisterAttributes[] getAttributesMap(); + + /** + * Gets the register corresponding to a runtime-defined role. + * + * @param id the identifier of a runtime-defined register role + * @return the register playing the role specified by {@code id} + */ + Register getRegisterForRole(int id); + + /** + * Determines if all {@link #getAllocatableRegisters() allocatable} registers are + * {@link #getCallerSaveRegisters() caller saved}. + */ + boolean areAllAllocatableRegistersCallerSaved(); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/RegisterSaveLayout.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/RegisterSaveLayout.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2013, 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 com.oracle.jvmci.code; + +import java.util.*; + +/** + * A map from registers to frame slots. This can be used to describe where callee saved registers + * are saved in a callee's frame. + */ +public final class RegisterSaveLayout { + + /** + * Keys. + */ + private final Register[] registers; + + /** + * Slot indexes relative to stack pointer. + */ + private final int[] slots; + + /** + * Creates a map from registers to frame slots. + * + * @param registers the keys in the map + * @param slots frame slot index for each register in {@code registers} + */ + public RegisterSaveLayout(Register[] registers, int[] slots) { + assert registers.length == slots.length; + this.registers = registers; + this.slots = slots; + assert registersToSlots(false).size() == registers.length : "non-unique registers"; + assert new HashSet<>(registersToSlots(false).values()).size() == slots.length : "non-unqiue slots"; + } + + /** + * Gets the frame slot index for a given register. + * + * @param register register to get the frame slot index for + * @return frame slot index + */ + public int registerToSlot(Register register) { + for (int i = 0; i < registers.length; i++) { + if (register.equals(registers[i])) { + return slots[i]; + } + } + throw new IllegalArgumentException(register + " not saved by this layout: " + this); + } + + /** + * Gets this layout information as a {@link Map} from registers to slots. + */ + public Map registersToSlots(boolean sorted) { + Map result; + if (sorted) { + result = new TreeMap<>(); + } else { + result = new HashMap<>(); + } + for (int i = 0; i < registers.length; i++) { + result.put(registers[i], slots[i]); + } + return result; + } + + /** + * Gets this layout information as a {@link Map} from slots to registers. + */ + public Map slotsToRegisters(boolean sorted) { + Map result; + if (sorted) { + result = new TreeMap<>(); + } else { + result = new HashMap<>(); + } + for (int i = 0; i < registers.length; i++) { + result.put(slots[i], registers[i]); + } + return result; + } + + @Override + public int hashCode() { + throw new UnsupportedOperationException(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof RegisterSaveLayout) { + RegisterSaveLayout that = (RegisterSaveLayout) obj; + if (Arrays.equals(registers, that.registers) && Arrays.equals(slots, that.slots)) { + return true; + } + } + return false; + } + + @Override + public String toString() { + return registersToSlots(true).toString(); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/RegisterValue.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/RegisterValue.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,70 @@ +/* + * 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.*; + +/** + * 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 + * {@link Register#asValue(LIRKind)} to retrieve the canonical {@link RegisterValue} instance for a + * given (register,kind) pair. + */ +public final class RegisterValue extends AllocatableValue { + + private final Register reg; + + /** + * Should only be called from {@link Register#Register} to ensure canonicalization. + */ + protected RegisterValue(LIRKind kind, Register register) { + super(kind); + this.reg = register; + } + + @Override + public String toString() { + return getRegister().name + getKindSuffix(); + } + + /** + * @return the register that contains the value + */ + public Register getRegister() { + return reg; + } + + @Override + public int hashCode() { + return 29 * super.hashCode() + reg.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof RegisterValue) { + RegisterValue other = (RegisterValue) obj; + return super.equals(obj) && reg.equals(other.reg); + } + return false; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/SourceStackTrace.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/SourceStackTrace.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2015, 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 com.oracle.jvmci.code; + +/** + * Class representing a exception with a stack trace of the currently processed position in the + * compiled Java program instead of the stack trace of the compiler. The exception of the compiler + * is saved as the cause of this exception. + */ +public abstract class SourceStackTrace extends BailoutException { + private static final long serialVersionUID = 2144811793442316776L; + + public static SourceStackTrace create(Throwable cause, String format, StackTraceElement[] elements) { + return new SourceStackTrace(cause, format) { + + private static final long serialVersionUID = 6279381376051787907L; + + @Override + public final synchronized Throwable fillInStackTrace() { + assert elements != null; + setStackTrace(elements); + return this; + } + }; + } + + private SourceStackTrace(Throwable cause, String format) { + super(cause, format); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/SpeculationLog.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/SpeculationLog.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2012, 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.JavaConstant; +import java.util.*; +import java.util.concurrent.*; + + +/** + * Manages a list of unique deoptimization reasons. + * + */ +public abstract class SpeculationLog { + private volatile Object lastFailed; + private volatile Collection speculations; + private Set failedSpeculations; + + public synchronized void collectFailedSpeculations() { + if (lastFailed != null) { + if (failedSpeculations == null) { + failedSpeculations = new HashSet<>(2); + } + failedSpeculations.add(lastFailed); + lastFailed = null; + speculations = null; + } + } + + public boolean maySpeculate(Object reason) { + if (failedSpeculations != null && failedSpeculations.contains(reason)) { + return false; + } + return true; + } + + protected void addSpeculation(Object reason) { + assert maySpeculate(reason); + if (speculations == null) { + synchronized (this) { + if (speculations == null) { + speculations = new ConcurrentLinkedQueue<>(); + } + } + } + speculations.add(reason); + } + + public abstract JavaConstant speculate(Object reason); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/StackLockValue.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/StackLockValue.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,92 @@ +/* + * 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.JavaValue; +import com.oracle.jvmci.meta.AbstractValue; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.LIRKind; +import static com.oracle.jvmci.code.ValueUtil.*; + + +/** + * Represents lock information in the debug information. + */ +public final class StackLockValue extends AbstractValue implements JavaValue { + + private Value owner; + private StackSlotValue slot; + private final boolean eliminated; + + public StackLockValue(Value object, StackSlotValue slot, boolean eliminated) { + super(LIRKind.Illegal); + this.owner = object; + this.slot = slot; + this.eliminated = eliminated; + } + + public Value getOwner() { + return owner; + } + + public void setOwner(Value newOwner) { + this.owner = newOwner; + } + + public Value getSlot() { + return slot; + } + + public boolean isEliminated() { + return eliminated; + } + + @Override + public String toString() { + return "monitor[" + owner + (slot != null ? ", " + slot : "") + (eliminated ? ", eliminated" : "") + "]"; + } + + @Override + public int hashCode() { + final int prime = 43; + int result = super.hashCode(); + result = prime * result + (eliminated ? 1231 : 1237); + result = prime * result + owner.hashCode(); + result = prime * result + slot.hashCode(); + return result; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof StackLockValue) { + StackLockValue other = (StackLockValue) obj; + return super.equals(obj) && eliminated == other.eliminated && owner.equals(other.owner) && slot.equals(other.slot); + } + return false; + } + + public void setSlot(StackSlotValue stackSlot) { + assert slot == null || (isVirtualStackSlot(slot) && (slot.equals(stackSlot) || isStackSlot(stackSlot))) : String.format("Can not set slot for %s to %s", this, stackSlot); + slot = stackSlot; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/StackSlot.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/StackSlot.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2010, 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.LIRKind; + +/** + * Represents a compiler spill slot or an outgoing stack-based argument in a method's frame or an + * incoming stack-based argument in a method's {@linkplain #isInCallerFrame() caller's frame}. + */ +public final class StackSlot extends StackSlotValue { + + private final int offset; + private final boolean addFrameSize; + + /** + * Gets a {@link StackSlot} instance representing a stack slot at a given index holding a value + * of a given kind. + * + * @param kind The kind of the value stored in the stack slot. + * @param offset The offset of the stack slot (in bytes) + * @param addFrameSize Specifies if the offset is relative to the stack pointer, or the + * beginning of the frame (stack pointer + total frame size). + */ + public static StackSlot get(LIRKind kind, int offset, boolean addFrameSize) { + assert addFrameSize || offset >= 0; + return new StackSlot(kind, offset, addFrameSize); + } + + /** + * Private constructor to enforce use of {@link #get(LIRKind, int, boolean)} so that a cache can + * be used. + */ + private StackSlot(LIRKind kind, int offset, boolean addFrameSize) { + super(kind); + this.offset = offset; + this.addFrameSize = addFrameSize; + } + + /** + * Gets the offset of this stack slot, relative to the stack pointer. + * + * @return The offset of this slot (in bytes). + */ + public int getOffset(int totalFrameSize) { + assert totalFrameSize > 0 || !addFrameSize; + int result = offset + (addFrameSize ? totalFrameSize : 0); + assert result >= 0; + return result; + } + + public boolean isInCallerFrame() { + return addFrameSize && offset >= 0; + } + + public int getRawOffset() { + return offset; + } + + public boolean getRawAddFrameSize() { + return addFrameSize; + } + + @Override + public String toString() { + if (!addFrameSize) { + return "out:" + offset + getKindSuffix(); + } else if (offset >= 0) { + return "in:" + offset + getKindSuffix(); + } else { + return "stack:" + (-offset) + getKindSuffix(); + } + } + + /** + * Gets this stack slot used to pass an argument from the perspective of a caller. + */ + public StackSlot asOutArg() { + assert offset >= 0; + if (addFrameSize) { + return get(getLIRKind(), offset, false); + } + return this; + } + + /** + * Gets this stack slot used to pass an argument from the perspective of a callee. + */ + public StackSlot asInArg() { + assert offset >= 0; + if (!addFrameSize) { + return get(getLIRKind(), offset, true); + } + return this; + } + + @Override + public int hashCode() { + final int prime = 37; + int result = super.hashCode(); + result = prime * result + (addFrameSize ? 1231 : 1237); + result = prime * result + offset; + return result; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof StackSlot) { + StackSlot other = (StackSlot) obj; + return super.equals(obj) && addFrameSize == other.addFrameSize && offset == other.offset; + } + return false; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/StackSlotValue.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/StackSlotValue.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.LIRKind; + +/** + * Common base class for {@linkplain StackSlot real} and {@linkplain VirtualStackSlot virtual} stack + * slots. + */ +public abstract class StackSlotValue extends AllocatableValue { + + public StackSlotValue(LIRKind lirKind) { + super(lirKind); + } + +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/TargetDescription.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/TargetDescription.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,143 @@ +/* + * 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.PlatformKind; +import com.oracle.jvmci.meta.LIRKind; +import static com.oracle.jvmci.meta.MetaUtil.*; + +/** + * Represents the target machine for a compiler, including the CPU architecture, the size of + * pointers and references, alignment of stacks, caches, etc. + */ +public abstract class TargetDescription { + + public final Architecture arch; + + /** + * Specifies if this is a multi-processor system. + */ + public final boolean isMP; + + /** + * Specifies if this target supports encoding objects inline in the machine code. + */ + public final boolean inlineObjects; + + /** + * The machine word size on this target. + */ + public final int wordSize; + + /** + * The kind to be used for representing raw pointers and CPU registers. + */ + public final Kind wordKind; + + /** + * The stack alignment requirement of the platform. For example, from Appendix D of Intel 64 and IA-32 Architectures + * Optimization Reference Manual: + * + *
+     *     "It is important to ensure that the stack frame is aligned to a
+     *      16-byte boundary upon function entry to keep local __m128 data,
+     *      parameters, and XMM register spill locations aligned throughout
+     *      a function invocation."
+     * 
+ */ + public final int stackAlignment; + + /** + * Maximum constant displacement at which a memory access can no longer be an implicit null + * check. + */ + public final int implicitNullCheckLimit; + + public TargetDescription(Architecture arch, boolean isMP, int stackAlignment, int implicitNullCheckLimit, boolean inlineObjects) { + this.arch = arch; + this.isMP = isMP; + this.wordSize = arch.getWordSize(); + this.wordKind = Kind.fromWordSize(wordSize); + this.stackAlignment = stackAlignment; + this.implicitNullCheckLimit = implicitNullCheckLimit; + this.inlineObjects = inlineObjects; + } + + @Override + public final int hashCode() { + throw new UnsupportedOperationException(); + } + + @Override + public final boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof TargetDescription) { + TargetDescription that = (TargetDescription) obj; + // @formatter:off + if (this.implicitNullCheckLimit == that.implicitNullCheckLimit && + this.inlineObjects == that.inlineObjects && + this.isMP == that.isMP && + this.stackAlignment == that.stackAlignment && + this.wordKind.equals(that.wordKind) && + this.wordSize == that.wordSize && + this.arch.equals(that.arch)) { + return true; + } + // @formatter:on + } + return false; + } + + @Override + public String toString() { + return identityHashCodeString(this); + } + + public int getSizeInBytes(PlatformKind kind) { + return arch.getSizeInBytes(kind); + } + + 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 abstract ReferenceMap createReferenceMap(boolean hasRegisters, int stackSlotCount); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/TypeCheckHints.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/TypeCheckHints.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,160 @@ +/* + * Copyright (c) 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.JavaTypeProfile; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.Assumptions; +import java.util.*; + +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; +import com.oracle.jvmci.meta.JavaTypeProfile.ProfiledType; + +/** + * Utility for deriving hint types for a type check instruction (e.g. checkcast or instanceof) based + * on the target type of the check and any profiling information available for the instruction. + */ +public class TypeCheckHints { + + /** + * A receiver type profiled in a type check instruction. + */ + public static class Hint { + + /** + * A type seen while profiling a type check instruction. + */ + public final ResolvedJavaType type; + + /** + * Specifies if {@link #type} is a sub-type of the checked type. + */ + public final boolean positive; + + Hint(ResolvedJavaType type, boolean positive) { + this.type = type; + this.positive = positive; + } + } + + private static final Hint[] NO_HINTS = {}; + + /** + * If non-null, then this is the only type that could pass the type check because the target of + * the type check is a final class or has been speculated to be a final class and this value is + * the only concrete subclass of the target type. + */ + public final ResolvedJavaType exact; + + /** + * The most likely types that the type check instruction will see. + */ + public final Hint[] hints; + + /** + * The profile from which this information was derived. + */ + public final JavaTypeProfile profile; + + /** + * The total probability that the type check will hit one of the types in {@link #hints}. + */ + public final double hintHitProbability; + + /** + * Derives hint information for use when generating the code for a type check instruction. + * + * @param targetType the target type of the type check + * @param profile the profiling information available for the instruction (if any) + * @param assumptions the object in which speculations are recorded. This is null if + * speculations are not supported. + * @param minHintHitProbability if the probability that the type check will hit one of the + * profiled types (up to {@code maxHints}) is below this value, then {@link #hints} + * will be null + * @param maxHints the maximum length of {@link #hints} + */ + public TypeCheckHints(ResolvedJavaType targetType, JavaTypeProfile profile, Assumptions assumptions, double minHintHitProbability, int maxHints) { + this.profile = profile; + if (targetType != null && !canHaveSubtype(targetType)) { + exact = targetType; + } else { + if (assumptions != null) { + AssumptionResult leafConcreteSubtype = targetType == null ? null : targetType.findLeafConcreteSubtype(); + if (leafConcreteSubtype != null) { + assumptions.record(leafConcreteSubtype); + exact = leafConcreteSubtype.getResult(); + } else { + exact = null; + } + } else { + exact = null; + } + } + Double[] hitProbability = {null}; + this.hints = makeHints(targetType, profile, minHintHitProbability, maxHints, hitProbability); + this.hintHitProbability = hitProbability[0]; + } + + private static Hint[] makeHints(ResolvedJavaType targetType, JavaTypeProfile profile, double minHintHitProbability, int maxHints, Double[] hitProbability) { + double hitProb = 0.0d; + Hint[] hintsBuf = NO_HINTS; + if (profile != null) { + double notRecordedTypes = profile.getNotRecordedProbability(); + ProfiledType[] ptypes = profile.getTypes(); + if (notRecordedTypes < (1D - minHintHitProbability) && ptypes != null && ptypes.length > 0) { + hintsBuf = new Hint[ptypes.length]; + int hintCount = 0; + for (ProfiledType ptype : ptypes) { + if (targetType != null) { + ResolvedJavaType hintType = ptype.getType(); + hintsBuf[hintCount++] = new Hint(hintType, targetType.isAssignableFrom(hintType)); + hitProb += ptype.getProbability(); + } + if (hintCount == maxHints) { + break; + } + } + if (hitProb >= minHintHitProbability) { + if (hintsBuf.length != hintCount || hintCount > maxHints) { + hintsBuf = Arrays.copyOf(hintsBuf, Math.min(maxHints, hintCount)); + } + } else { + hintsBuf = NO_HINTS; + hitProb = 0.0d; + } + } + } + hitProbability[0] = hitProb; + return hintsBuf; + } + + /** + * Determines if a given type can have subtypes other than itself. This analysis is purely + * static; no assumptions are made. + * + * @return true if {@code type} can have subtypes + */ + public static boolean canHaveSubtype(ResolvedJavaType type) { + return !type.getElementalType().isFinal(); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/UnsignedMath.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/UnsignedMath.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2011, 2011, 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 com.oracle.jvmci.code; + +import java.math.*; + +//JaCoCo Exclude + +/** + * Utilities for unsigned comparisons. All methods have correct, but slow, standard Java + * implementations so that they can be used with compilers not supporting the intrinsics. + */ +public class UnsignedMath { + + private static final long MASK = 0xffffffffL; + + /** + * Unsigned comparison aboveThan for two numbers. + */ + public static boolean aboveThan(int a, int b) { + return (a & MASK) > (b & MASK); + } + + /** + * Unsigned comparison aboveOrEqual for two numbers. + */ + public static boolean aboveOrEqual(int a, int b) { + return (a & MASK) >= (b & MASK); + } + + /** + * Unsigned comparison belowThan for two numbers. + */ + public static boolean belowThan(int a, int b) { + return (a & MASK) < (b & MASK); + } + + /** + * Unsigned comparison belowOrEqual for two numbers. + */ + public static boolean belowOrEqual(int a, int b) { + return (a & MASK) <= (b & MASK); + } + + /** + * Unsigned comparison aboveThan for two numbers. + */ + public static boolean aboveThan(long a, long b) { + return (a > b) ^ ((a < 0) != (b < 0)); + } + + /** + * Unsigned comparison aboveOrEqual for two numbers. + */ + public static boolean aboveOrEqual(long a, long b) { + return (a >= b) ^ ((a < 0) != (b < 0)); + } + + /** + * Unsigned comparison belowThan for two numbers. + */ + public static boolean belowThan(long a, long b) { + return (a < b) ^ ((a < 0) != (b < 0)); + } + + /** + * Unsigned comparison belowOrEqual for two numbers. + */ + public static boolean belowOrEqual(long a, long b) { + return (a <= b) ^ ((a < 0) != (b < 0)); + } + + /** + * Unsigned division for two numbers. + */ + public static int divide(int a, int b) { + return (int) ((a & MASK) / (b & MASK)); + } + + /** + * Unsigned remainder for two numbers. + */ + public static int remainder(int a, int b) { + return (int) ((a & MASK) % (b & MASK)); + } + + /** + * Unsigned division for two numbers. + */ + public static long divide(long a, long b) { + return bi(a).divide(bi(b)).longValue(); + } + + /** + * Unsigned remainder for two numbers. + */ + public static long remainder(long a, long b) { + return bi(a).remainder(bi(b)).longValue(); + } + + private static BigInteger bi(long unsigned) { + return unsigned >= 0 ? BigInteger.valueOf(unsigned) : BigInteger.valueOf(unsigned & 0x7fffffffffffffffL).setBit(63); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/ValueUtil.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/ValueUtil.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2012, 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.meta.JavaConstant; +import java.util.*; + + +/** + * Utility class for working with the {@link Value} class and its subclasses. + */ +public final class ValueUtil { + + public static boolean isIllegal(Value value) { + assert value != null; + return Value.ILLEGAL.equals(value); + } + + public static boolean isLegal(Value value) { + return !isIllegal(value); + } + + public static boolean isVirtualObject(Value value) { + assert value != null; + return value instanceof VirtualObject; + } + + public static VirtualObject asVirtualObject(Value value) { + assert value != null; + return (VirtualObject) value; + } + + public static boolean isConstant(Value 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; + } + + public static AllocatableValue asAllocatableValue(Value value) { + assert value != null; + return (AllocatableValue) value; + } + + public static boolean isStackSlot(Value value) { + assert value != null; + return value instanceof StackSlot; + } + + public static StackSlot asStackSlot(Value value) { + assert value != null; + return (StackSlot) value; + } + + public static boolean isStackSlotValue(Value value) { + assert value != null; + return value instanceof StackSlotValue; + } + + public static StackSlotValue asStackSlotValue(Value value) { + assert value != null; + return (StackSlotValue) value; + } + + public static boolean isVirtualStackSlot(Value value) { + assert value != null; + return value instanceof VirtualStackSlot; + } + + public static VirtualStackSlot asVirtualStackSlot(Value value) { + assert value != null; + return (VirtualStackSlot) value; + } + + public static boolean isRegister(Value value) { + assert value != null; + return value instanceof RegisterValue; + } + + public static Register asRegister(Value value) { + assert value != null; + return ((RegisterValue) value).getRegister(); + } + + public static Register asIntReg(Value value) { + if (value.getKind().getStackKind() != Kind.Int) { + throw new InternalError("needed Int got: " + value.getKind()); + } 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)); + } + + public static boolean sameRegister(Value v1, Value v2, Value v3) { + return sameRegister(v1, v2) && sameRegister(v1, v3); + } + + /** + * Checks if all the provided values are different physical registers. The parameters can be + * either {@link Register registers}, {@link Value values} or arrays of them. All values that + * are not {@link RegisterValue registers} are ignored. + */ + public static boolean differentRegisters(Object... values) { + List registers = collectRegisters(values, new ArrayList()); + for (int i = 1; i < registers.size(); i++) { + Register r1 = registers.get(i); + for (int j = 0; j < i; j++) { + Register r2 = registers.get(j); + if (r1.equals(r2)) { + return false; + } + } + } + return true; + } + + private static List collectRegisters(Object[] values, List registers) { + for (Object o : values) { + if (o instanceof Register) { + registers.add((Register) o); + } else if (o instanceof Value) { + if (isRegister((Value) o)) { + registers.add(asRegister((Value) o)); + } + } else if (o instanceof Object[]) { + collectRegisters((Object[]) o, registers); + } else { + throw new IllegalArgumentException("Not a Register or Value: " + o); + } + } + return registers; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/VirtualObject.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/VirtualObject.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2010, 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 com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.ResolvedJavaField; +import com.oracle.jvmci.meta.JavaValue; +import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.meta.AbstractValue; +import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.meta.ResolvedJavaType; +import com.oracle.jvmci.meta.LIRKind; +import java.util.*; + + +/** + * An instance of this class represents an object whose allocation was removed by escape analysis. + * The information stored in the {@link VirtualObject} is used during deoptimization to recreate the + * object. + */ +public final class VirtualObject extends AbstractValue implements JavaValue { + + private final ResolvedJavaType type; + private Value[] values; + private final int id; + + /** + * Creates a new {@link VirtualObject} for the given type, with the given fields. If + * {@code type} is an instance class then {@code values} provides the values for the fields + * returned by {@link ResolvedJavaType#getInstanceFields(boolean) getInstanceFields(true)}. If + * {@code type} is an array then the length of the values array determines the reallocated array + * length. + * + * @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); + } + + private VirtualObject(ResolvedJavaType type, Value[] values, int id) { + super(LIRKind.reference(Kind.Object)); + this.type = type; + this.values = values; + this.id = id; + } + + private static StringBuilder appendValue(StringBuilder buf, Value value, Set visited) { + if (value instanceof VirtualObject) { + VirtualObject vo = (VirtualObject) value; + buf.append("vobject:").append(vo.type.toJavaName(false)).append(':').append(vo.id); + if (!visited.contains(vo)) { + visited.add(vo); + buf.append('{'); + if (vo.values == null) { + buf.append(""); + } else { + if (vo.type.isArray()) { + for (int i = 0; i < vo.values.length; i++) { + if (i != 0) { + buf.append(','); + } + buf.append(i).append('='); + appendValue(buf, vo.values[i], visited); + } + } else { + ResolvedJavaField[] fields = vo.type.getInstanceFields(true); + assert fields.length == vo.values.length : vo.type + ", fields=" + Arrays.toString(fields) + ", values=" + Arrays.toString(vo.values); + for (int i = 0; i < vo.values.length; i++) { + if (i != 0) { + buf.append(','); + } + buf.append(fields[i].getName()).append('='); + appendValue(buf, vo.values[i], visited); + } + } + } + buf.append('}'); + } + } else { + buf.append(value); + } + return buf; + } + + @Override + public String toString() { + Set visited = Collections.newSetFromMap(new IdentityHashMap()); + return appendValue(new StringBuilder(), this, visited).toString(); + } + + /** + * Returns the type of the object whose allocation was removed during compilation. This can be + * either an instance of an array type. + */ + public ResolvedJavaType getType() { + return type; + } + + /** + * Returns an array containing all the values to be stored into the object when it is recreated. + */ + public Value[] getValues() { + return values; + } + + /** + * Returns the unique id that identifies the object within the debug information for one + * position in the compiled code. + */ + public int getId() { + return id; + } + + private static boolean checkValues(ResolvedJavaType type, Value[] values) { + if (values != null) { + 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(); + } else { + if ((valKind == Kind.Double || valKind == Kind.Long) && field.getKind() == Kind.Int) { + assert fields[fieldIndex].getKind() == Kind.Int; + fieldIndex++; + } else { + assert valKind == field.getKind().getStackKind() : field + ": " + valKind + " != " + field.getKind(); + } + } + } + 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) { + for (int i = 0; i < values.length; i++) { + assert values[i].getLIRKind().isReference(0) : values[i].getKind() + " != " + 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; + } + } + } + } + return true; + } + + /** + * Overwrites the current set of values with a new one. + * + * @param values an array containing all the values to be stored into the object when it is + * recreated. + */ + public void setValues(Value[] values) { + assert checkValues(type, values); + this.values = values; + } + + @Override + public int hashCode() { + return getLIRKind().hashCode() + type.hashCode(); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof VirtualObject) { + VirtualObject l = (VirtualObject) o; + if (!l.type.equals(type) || l.values.length != values.length) { + return false; + } + for (int i = 0; i < values.length; i++) { + /* + * Virtual objects can form cycles. Calling equals() could therefore lead to + * infinite recursion. + */ + if (!same(values[i], l.values[i])) { + return false; + } + } + return true; + } + return false; + } + + private static boolean same(Object o1, Object o2) { + return o1 == o2; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/VirtualStackSlot.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/VirtualStackSlot.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.jvmci.code; + +import com.oracle.jvmci.meta.LIRKind; + +/** + * {@link VirtualStackSlot}s are stack slots that are not yet fixed to specific frame offset. They + * are replaced by real {@link StackSlot}s with a fixed position in the frame before code emission. + */ +public abstract class VirtualStackSlot extends StackSlotValue { + + private final int id; + + public VirtualStackSlot(int id, LIRKind lirKind) { + super(lirKind); + this.id = id; + } + + public int getId() { + return id; + } + + @Override + public String toString() { + return "vstack:" + id + getKindSuffix(); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + id; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + VirtualStackSlot other = (VirtualStackSlot) obj; + if (id != other.id) { + return false; + } + return true; + } + +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/package-info.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/package-info.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2010, 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 that defines the interface between a Java application that wants to install code and the runtime. + * The runtime provides in implementation of the {@link com.oracle.jvmci.code.CodeCacheProvider} interface. + * The method {@link com.oracle.jvmci.code.CodeCacheProvider#addMethod(com.oracle.jvmci.meta.ResolvedJavaMethod, CompilationResult, SpeculationLog, InstalledCode)} + * can be used to install code for a given method. + */ +package com.oracle.jvmci.code; + diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/stack/InspectedFrame.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/stack/InspectedFrame.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,69 @@ +/* + * 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 com.oracle.jvmci.code.stack; + +import com.oracle.jvmci.meta.ResolvedJavaMethod; + +public interface InspectedFrame { + + /** + * Returns the value of the local at the given index. Currently only works for object values. + * This value is a copy iff {@link #isVirtual(int)} is true. + */ + Object getLocal(int index); + + /** + * Returns whether the local at the given index is a virtual object, and therefore the object + * returned by {@link #getLocal(int)} is a copy. + */ + boolean isVirtual(int index); + + /** + * Returns true if the stack frame is a compiled stack frame and there are virtual objects + * anywhere in the current state of the compiled method. This can return true even if + * {@link #isVirtual(int)} return false for all locals. + */ + boolean hasVirtualObjects(); + + /** + * This method will materialize all virtual objects, deoptimize the stack frame and make sure + * that subsequent execution of the deoptimized frame uses the materialized values. + */ + void materializeVirtualObjects(boolean invalidateCode); + + /** + * @return the current bytecode index + */ + int getBytecodeIndex(); + + /** + * @return the current method + */ + ResolvedJavaMethod getMethod(); + + /** + * Checks if the current method is equal to the given method. This is semantically equivalent to + * {@code method.equals(getMethod())}, but can be implemented more efficiently. + */ + boolean isMethod(ResolvedJavaMethod method); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/stack/InspectedFrameVisitor.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/stack/InspectedFrameVisitor.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,34 @@ +/* + * 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 com.oracle.jvmci.code.stack; + +/** + * Callback interface for {@link StackIntrospection#iterateFrames}. Implementations of + * {@link #visitFrame} return null to indicate that frame iteration should continue and the next + * caller frame should be visited; and return any non-null value to indicate that frame iteration + * should stop. + */ +public interface InspectedFrameVisitor { + + T visitFrame(InspectedFrame frame); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/stack/StackIntrospection.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/stack/StackIntrospection.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,45 @@ +/* + * 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 com.oracle.jvmci.code.stack; + +import com.oracle.jvmci.meta.ResolvedJavaMethod; + +public interface StackIntrospection { + + /** + * Accesses the current stack, providing {@link InspectedFrame}s to the visitor that can be used + * to inspect the stack frames' contents. Iteration continues as long as + * {@link InspectedFrameVisitor#visitFrame}, which is invoked for every {@link InspectedFrame}, + * returns null. Any non-null result of the visitor indicates that frame iteration should stop. + * + * @param initialMethods if this is non-{@code null}, then the stack trace will start at these + * methods + * @param matchingMethods if this is non-{@code null}, then only matching stack frames are + * returned + * @param initialSkip the number of matching methods to skip (including the initial method) + * @param visitor the visitor that is called for every matching method + * @return the last result returned by the visitor (which is non-null to indicate that iteration + * should stop), or null if the whole stack was iterated. + */ + T iterateFrames(ResolvedJavaMethod[] initialMethods, ResolvedJavaMethod[] matchingMethods, int initialSkip, InspectedFrameVisitor visitor); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/CompilerToVM.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/CompilerToVM.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/CompilerToVM.java Wed May 27 00:36:16 2015 +0200 @@ -25,9 +25,9 @@ import sun.misc.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.hotspotvmconfig.*; +import com.oracle.jvmci.meta.*; /** * Calls from Java into HotSpot. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/CompilerToVMImpl.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/CompilerToVMImpl.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/CompilerToVMImpl.java Wed May 27 00:36:16 2015 +0200 @@ -25,7 +25,8 @@ import static com.oracle.jvmci.hotspot.InitTimer.*; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.*; + /** * Entries into the HotSpot VM from Java code. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HexCodeFile.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HexCodeFile.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HexCodeFile.java Wed May 27 00:36:16 2015 +0200 @@ -26,10 +26,10 @@ import java.util.*; import java.util.regex.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CompilationResult.CodeAnnotation; -import com.oracle.graal.api.code.CompilationResult.CodeComment; -import com.oracle.graal.api.code.CompilationResult.JumpTable; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.code.CompilationResult.CodeAnnotation; +import com.oracle.jvmci.code.CompilationResult.CodeComment; +import com.oracle.jvmci.code.CompilationResult.JumpTable; /** * A HexCodeFile is a textual format for representing a chunk of machine code along with extra diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCodeCacheProvider.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCodeCacheProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCodeCacheProvider.java Wed May 27 00:36:16 2015 +0200 @@ -27,19 +27,19 @@ import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CodeUtil.DefaultRefMapFormatter; -import com.oracle.graal.api.code.CodeUtil.RefMapFormatter; -import com.oracle.graal.api.code.CompilationResult.Call; -import com.oracle.graal.api.code.CompilationResult.ConstantReference; -import com.oracle.graal.api.code.CompilationResult.DataPatch; -import com.oracle.graal.api.code.CompilationResult.Infopoint; -import com.oracle.graal.api.code.CompilationResult.Mark; -import com.oracle.graal.api.code.DataSection.Data; -import com.oracle.graal.api.code.DataSection.DataBuilder; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.code.CodeUtil.DefaultRefMapFormatter; +import com.oracle.jvmci.code.CodeUtil.RefMapFormatter; +import com.oracle.jvmci.code.CompilationResult.Call; +import com.oracle.jvmci.code.CompilationResult.ConstantReference; +import com.oracle.jvmci.code.CompilationResult.DataPatch; +import com.oracle.jvmci.code.CompilationResult.Infopoint; +import com.oracle.jvmci.code.CompilationResult.Mark; +import com.oracle.jvmci.code.DataSection.Data; +import com.oracle.jvmci.code.DataSection.DataBuilder; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; /** * HotSpot implementation of {@link CodeCacheProvider}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCompiledCode.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCompiledCode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCompiledCode.java Wed May 27 00:36:16 2015 +0200 @@ -27,15 +27,15 @@ import java.util.stream.*; import java.util.stream.Stream.Builder; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.code.CompilationResult.CodeAnnotation; -import com.oracle.graal.api.code.CompilationResult.CodeComment; -import com.oracle.graal.api.code.CompilationResult.DataPatch; -import com.oracle.graal.api.code.CompilationResult.ExceptionHandler; -import com.oracle.graal.api.code.CompilationResult.Infopoint; -import com.oracle.graal.api.code.CompilationResult.JumpTable; -import com.oracle.graal.api.code.CompilationResult.Mark; -import com.oracle.graal.api.code.CompilationResult.Site; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.code.CompilationResult.CodeAnnotation; +import com.oracle.jvmci.code.CompilationResult.CodeComment; +import com.oracle.jvmci.code.CompilationResult.DataPatch; +import com.oracle.jvmci.code.CompilationResult.ExceptionHandler; +import com.oracle.jvmci.code.CompilationResult.Infopoint; +import com.oracle.jvmci.code.CompilationResult.JumpTable; +import com.oracle.jvmci.code.CompilationResult.Mark; +import com.oracle.jvmci.code.CompilationResult.Site; /** * A {@link CompilationResult} with additional HotSpot-specific information required for installing diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCompiledNmethod.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCompiledNmethod.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCompiledNmethod.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.*; import edu.umd.cs.findbugs.annotations.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCompressedNullConstant.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCompressedNullConstant.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotCompressedNullConstant.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * The compressed representation of the {@link JavaConstant#NULL_POINTER null constant}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotConstant.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotConstant.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotConstant.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * Marker interface for hotspot specific constants. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotConstantPool.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotConstantPool.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotConstantPool.java Wed May 27 00:36:16 2015 +0200 @@ -27,8 +27,8 @@ import java.lang.invoke.*; -import com.oracle.graal.api.meta.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * Implementation of {@link ConstantPool} for HotSpot. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotConstantReflectionProvider.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotConstantReflectionProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotConstantReflectionProvider.java Wed May 27 00:36:16 2015 +0200 @@ -26,7 +26,7 @@ import java.lang.reflect.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; import com.oracle.jvmci.options.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotForeignCallTarget.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotForeignCallTarget.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotForeignCallTarget.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; public class HotSpotForeignCallTarget { /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotInstalledCode.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotInstalledCode.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotInstalledCode.java Wed May 27 00:36:16 2015 +0200 @@ -25,7 +25,7 @@ import static com.oracle.jvmci.common.UnsafeAccess.*; import sun.misc.*; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.*; import edu.umd.cs.findbugs.annotations.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotJVMCIRuntime.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotJVMCIRuntime.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotJVMCIRuntime.java Wed May 27 00:36:16 2015 +0200 @@ -28,11 +28,11 @@ import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; import com.oracle.jvmci.hotspot.logging.*; +import com.oracle.jvmci.meta.*; import com.oracle.jvmci.options.*; import com.oracle.jvmci.runtime.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotJVMCIRuntimeProvider.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotJVMCIRuntimeProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotJVMCIRuntimeProvider.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,8 @@ import sun.misc.*; -import com.oracle.graal.api.meta.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; import com.oracle.jvmci.runtime.*; //JaCoCo Exclude diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotJavaType.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotJavaType.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotJavaType.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * Common base class for all HotSpot {@link JavaType} implementations. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMemoryAccessProvider.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMemoryAccessProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMemoryAccessProvider.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.meta.*; import com.oracle.jvmci.hotspot.HotSpotVMConfig.CompressEncoding; +import com.oracle.jvmci.meta.*; /** * HotSpot specific extension of {@link MemoryAccessProvider}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMemoryAccessProviderImpl.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMemoryAccessProviderImpl.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMemoryAccessProviderImpl.java Wed May 27 00:36:16 2015 +0200 @@ -24,10 +24,10 @@ import static com.oracle.jvmci.common.UnsafeAccess.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.hotspot.HotSpotVMConfig.CompressEncoding; +import com.oracle.jvmci.meta.*; /** * HotSpot implementation of {@link MemoryAccessProvider}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMetaAccessProvider.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMetaAccessProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMetaAccessProvider.java Wed May 27 00:36:16 2015 +0200 @@ -28,9 +28,9 @@ import java.lang.reflect.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * HotSpot implementation of {@link MetaAccessProvider}. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMetaspaceConstant.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMetaspaceConstant.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMetaspaceConstant.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.meta.*; import com.oracle.jvmci.hotspot.HotSpotVMConfig.CompressEncoding; +import com.oracle.jvmci.meta.*; public interface HotSpotMetaspaceConstant extends HotSpotConstant, VMConstant { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMetaspaceConstantImpl.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMetaspaceConstantImpl.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMetaspaceConstantImpl.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,8 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.jvmci.hotspot.HotSpotVMConfig.CompressEncoding; +import com.oracle.jvmci.meta.*; public final class HotSpotMetaspaceConstantImpl extends PrimitiveConstant implements HotSpotMetaspaceConstant, VMConstant, HotSpotProxified { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethod.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethod.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethod.java Wed May 27 00:36:16 2015 +0200 @@ -27,7 +27,8 @@ import java.util.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; + public abstract class HotSpotMethod implements JavaMethod, Formattable { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethodData.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethodData.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethodData.java Wed May 27 00:36:16 2015 +0200 @@ -30,10 +30,10 @@ import sun.misc.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.api.meta.JavaMethodProfile.ProfiledMethod; -import com.oracle.graal.api.meta.JavaTypeProfile.ProfiledType; import com.oracle.jvmci.hotspot.HotSpotMethodDataAccessor.Tag; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.meta.JavaMethodProfile.ProfiledMethod; +import com.oracle.jvmci.meta.JavaTypeProfile.ProfiledType; /** * Access to a HotSpot MethodData structure (defined in methodData.hpp). diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethodDataAccessor.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethodDataAccessor.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethodDataAccessor.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,8 @@ import static com.oracle.jvmci.hotspot.HotSpotJVMCIRuntime.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; + /** * Interface for accessor objects that encapsulate the logic for accessing the different kinds of diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethodHandleAccessProvider.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethodHandleAccessProvider.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethodHandleAccessProvider.java Wed May 27 00:36:16 2015 +0200 @@ -26,8 +26,8 @@ import static com.oracle.jvmci.hotspot.HotSpotResolvedJavaType.*; import static com.oracle.jvmci.hotspot.HotSpotResolvedObjectTypeImpl.*; -import com.oracle.graal.api.meta.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; public class HotSpotMethodHandleAccessProvider implements MethodHandleAccessProvider, HotSpotProxified { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethodUnresolved.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethodUnresolved.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotMethodUnresolved.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * Implementation of {@link JavaMethod} for unresolved HotSpot methods. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotNmethod.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotNmethod.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotNmethod.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,9 @@ import static com.oracle.jvmci.hotspot.HotSpotJVMCIRuntime.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; + /** * Implementation of {@link InstalledCode} for code installed as an nmethod. The nmethod stores a diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotObjectConstant.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotObjectConstant.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotObjectConstant.java Wed May 27 00:36:16 2015 +0200 @@ -25,7 +25,8 @@ import java.lang.invoke.*; import java.util.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; + /** * Represents a constant non-{@code null} object reference, within the compiler and across the diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotObjectConstantImpl.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotObjectConstantImpl.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotObjectConstantImpl.java Wed May 27 00:36:16 2015 +0200 @@ -26,7 +26,7 @@ import java.lang.invoke.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; import edu.umd.cs.findbugs.annotations.*; diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotProfilingInfo.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotProfilingInfo.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotProfilingInfo.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.meta.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; public final class HotSpotProfilingInfo implements ProfilingInfo, HotSpotProxified { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotReferenceMap.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotReferenceMap.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotReferenceMap.java Wed May 27 00:36:16 2015 +0200 @@ -24,10 +24,10 @@ import java.util.*; -import com.oracle.graal.api.code.CodeUtil.RefMapFormatter; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CodeUtil.RefMapFormatter; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; public final class HotSpotReferenceMap extends ReferenceMap { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaField.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaField.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaField.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * Represents a field in a HotSpot type. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaFieldImpl.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaFieldImpl.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaFieldImpl.java Wed May 27 00:36:16 2015 +0200 @@ -29,8 +29,8 @@ import java.lang.annotation.*; import java.lang.reflect.*; -import com.oracle.graal.api.meta.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; import com.oracle.jvmci.options.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaMethod.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaMethod.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaMethod.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,9 @@ import java.lang.reflect.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; + /** * Implementation of {@link JavaMethod} for resolved HotSpot methods. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaMethodImpl.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaMethodImpl.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaMethodImpl.java Wed May 27 00:36:16 2015 +0200 @@ -30,10 +30,10 @@ import java.lang.reflect.*; import java.util.*; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; +import com.oracle.jvmci.meta.*; import com.oracle.jvmci.options.*; /** diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaType.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaType.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedJavaType.java Wed May 27 00:36:16 2015 +0200 @@ -24,7 +24,8 @@ import static com.oracle.jvmci.hotspot.HotSpotJVMCIRuntime.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; + public abstract class HotSpotResolvedJavaType extends HotSpotJavaType implements ResolvedJavaType { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedObjectType.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedObjectType.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedObjectType.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; +import com.oracle.jvmci.meta.*; /** * Implementation of {@link JavaType} for resolved non-primitive HotSpot classes. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedObjectTypeImpl.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedObjectTypeImpl.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedObjectTypeImpl.java Wed May 27 00:36:16 2015 +0200 @@ -32,13 +32,13 @@ import java.nio.*; import java.util.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; -import com.oracle.graal.api.meta.Assumptions.ConcreteMethod; -import com.oracle.graal.api.meta.Assumptions.ConcreteSubtype; -import com.oracle.graal.api.meta.Assumptions.LeafType; -import com.oracle.graal.api.meta.Assumptions.NoFinalizableSubclass; -import com.oracle.graal.api.meta.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; +import com.oracle.jvmci.meta.Assumptions.ConcreteMethod; +import com.oracle.jvmci.meta.Assumptions.ConcreteSubtype; +import com.oracle.jvmci.meta.Assumptions.LeafType; +import com.oracle.jvmci.meta.Assumptions.NoFinalizableSubclass; +import com.oracle.jvmci.meta.*; /** * Implementation of {@link JavaType} for resolved non-primitive HotSpot classes. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedPrimitiveType.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedPrimitiveType.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotResolvedPrimitiveType.java Wed May 27 00:36:16 2015 +0200 @@ -28,9 +28,9 @@ import java.lang.reflect.*; import java.net.*; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; -import com.oracle.graal.api.meta.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; +import com.oracle.jvmci.meta.*; /** * Implementation of {@link JavaType} for primitive HotSpot types. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotSignature.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotSignature.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotSignature.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,8 @@ import java.util.*; -import com.oracle.graal.api.meta.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.meta.*; /** * Represents a method signature. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotSpeculationLog.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotSpeculationLog.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotSpeculationLog.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.meta.*; public class HotSpotSpeculationLog extends SpeculationLog { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotStackFrameReference.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotStackFrameReference.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotStackFrameReference.java Wed May 27 00:36:16 2015 +0200 @@ -24,8 +24,9 @@ import java.util.*; -import com.oracle.graal.api.code.stack.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.stack.*; +import com.oracle.jvmci.meta.*; + public class HotSpotStackFrameReference implements InspectedFrame { diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotUnresolvedField.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotUnresolvedField.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotUnresolvedField.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * A implementation of {@link JavaField} for an unresolved field. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotUnresolvedJavaType.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotUnresolvedJavaType.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotUnresolvedJavaType.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.jvmci.hotspot; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.meta.*; /** * Implementation of {@link JavaType} for unresolved HotSpot classes. diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/overview.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/overview.html Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,38 @@ + + + + + + + + +The com.oracle.jvmci.meta project provides an API to the runtime data structures +for various Java elements. Unlike standard Java reflection, it can model elements that are not yet loaded. +It can also expose profiling information collected by the runtime system. + + + diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/AbstractJavaProfile.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/AbstractJavaProfile.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2013, 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 com.oracle.jvmci.meta; + +/** + * This object holds probability information for a set of items that were profiled at a specific + * BCI. The precision of the supplied values may vary, but a runtime that provides this information + * should be aware that it will be used to guide performance-critical decisions like speculative + * inlining, etc. + * + * @param a subclass of AbstractProfiledItem + * @param the class of the items that are profiled at the specific BCI and for which + * probabilities are stored. E.g., a ResolvedJavaType or a ResolvedJavaMethod. + */ +public abstract class AbstractJavaProfile, U> { + + private final double notRecordedProbability; + private final T[] pitems; + + public AbstractJavaProfile(double notRecordedProbability, T[] pitems) { + this.pitems = pitems; + assert !Double.isNaN(notRecordedProbability); + this.notRecordedProbability = notRecordedProbability; + assert isSorted(); + assert totalProbablility() >= 0 && totalProbablility() <= 1.0001 : totalProbablility() + " " + this; + } + + private double totalProbablility() { + double total = notRecordedProbability; + for (T item : pitems) { + total += item.probability; + } + return total; + } + + /** + * Determines if an array of profiled items are sorted in descending order of their + * probabilities. + */ + private boolean isSorted() { + for (int i = 1; i < pitems.length; i++) { + if (pitems[i - 1].getProbability() < pitems[i].getProbability()) { + return false; + } + } + return true; + } + + /** + * Returns the estimated probability of all types that could not be recorded due to profiling + * limitations. + * + * @return double value ≥ 0.0 and ≤ 1.0 + */ + public double getNotRecordedProbability() { + return notRecordedProbability; + } + + protected T[] getItems() { + return pitems; + } + + /** + * Searches for an entry of a given resolved Java type. + * + * @param type the type for which an entry should be searched + * @return the entry or null if no entry for this type can be found + */ + public T findEntry(ResolvedJavaType type) { + if (pitems != null) { + for (T pt : pitems) { + if (pt.getItem().equals(type)) { + return pt; + } + } + } + return null; + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append(this.getClass().getName()); + builder.append("["); + if (pitems != null) { + for (T pt : pitems) { + builder.append(pt.toString()); + builder.append(", "); + } + } + builder.append(this.notRecordedProbability); + builder.append("]"); + return builder.toString(); + } + + public boolean isIncluded(U item) { + if (this.getNotRecordedProbability() > 0.0) { + return true; + } else { + for (int i = 0; i < getItems().length; i++) { + T pitem = getItems()[i]; + U curType = pitem.getItem(); + if (curType == item) { + return true; + } + } + } + return false; + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof AbstractJavaProfile)) { + return false; + } + AbstractJavaProfile that = (AbstractJavaProfile) obj; + if (that.notRecordedProbability != notRecordedProbability) { + return false; + } + if (that.pitems.length != pitems.length) { + return false; + } + for (int i = 0; i < pitems.length; ++i) { + if (!pitems[i].equals(that.pitems[i])) { + return false; + } + } + return true; + } + + @Override + public int hashCode() { + return (int) Double.doubleToLongBits(notRecordedProbability) + pitems.length * 13; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/AbstractProfiledItem.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/AbstractProfiledItem.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2013, 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 com.oracle.jvmci.meta; + +/** + * A profiled type that has a probability. Profiled types are naturally sorted in descending order + * of their probabilities. + */ +public abstract class AbstractProfiledItem implements Comparable> { + + protected final T item; + protected final double probability; + + public AbstractProfiledItem(T item, double probability) { + assert item != null; + assert probability >= 0.0D && probability <= 1.0D; + this.item = item; + this.probability = probability; + } + + protected T getItem() { + return item; + } + + /** + * Returns the estimated probability of {@link #getItem()}. + * + * @return double value ≥ 0.0 and ≤ 1.0 + */ + public double getProbability() { + return probability; + } + + @Override + public int compareTo(AbstractProfiledItem o) { + if (getProbability() > o.getProbability()) { + return -1; + } else if (getProbability() < o.getProbability()) { + return 1; + } + return 0; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + long temp; + temp = Double.doubleToLongBits(probability); + result = prime * result + (int) (temp ^ (temp >>> 32)); + result = prime * result + item.hashCode(); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + AbstractProfiledItem other = (AbstractProfiledItem) obj; + if (Double.doubleToLongBits(probability) != Double.doubleToLongBits(other.probability)) { + return false; + } + return item.equals(other.item); + } + + @Override + public abstract String toString(); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/AbstractValue.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/AbstractValue.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,99 @@ +/* + * 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 com.oracle.jvmci.meta; + +/** + * Abstract base class for values. + */ +public abstract class AbstractValue implements Value, KindProvider { + + 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. + */ + @ExcludeFromIdentityComparisonVerification + public final boolean identityEquals(AbstractValue other) { + return this == other; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/AllocatableValue.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/AllocatableValue.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2013, 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 com.oracle.jvmci.meta; + +/** + * 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, KindProvider { + + public static final AllocatableValue[] NONE = {}; + + public AllocatableValue(LIRKind lirKind) { + super(lirKind); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Assumptions.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Assumptions.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,380 @@ +/* + * Copyright (c) 2011, 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 com.oracle.jvmci.meta; + +import java.lang.invoke.*; +import java.util.*; + +/** + * Class for recording assumptions made during compilation. + */ +public final class Assumptions implements Iterable { + + /** + * Abstract base class for assumptions. An assumption assumes a property of the runtime that may + * be invalidated by subsequent execution (e.g., that a class has no subclasses implementing + * {@link NoFinalizableSubclass Object.finalize()}). + */ + public abstract static class Assumption { + } + + /** + * A class for providing information that is only valid in association with a set of + * {@link Assumption}s. + * + * @param + */ + public static class AssumptionResult { + Assumption[] assumptions; + final T result; + + private static final Assumption[] EMPTY = new Assumption[0]; + + public AssumptionResult(T result, Assumption... assumptions) { + this.result = result; + this.assumptions = assumptions; + } + + public AssumptionResult(T result) { + this(result, EMPTY); + } + + public T getResult() { + return result; + } + + public boolean isAssumptionFree() { + return assumptions.length == 0; + } + + public void add(AssumptionResult other) { + Assumption[] newAssumptions = Arrays.copyOf(this.assumptions, this.assumptions.length + other.assumptions.length); + System.arraycopy(other.assumptions, 0, newAssumptions, this.assumptions.length, other.assumptions.length); + this.assumptions = newAssumptions; + } + } + + /** + * An assumption that a given class has no subclasses implementing {@link Object#finalize()}). + */ + public static final class NoFinalizableSubclass extends Assumption { + + private ResolvedJavaType receiverType; + + public NoFinalizableSubclass(ResolvedJavaType receiverType) { + this.receiverType = receiverType; + } + + @Override + public int hashCode() { + return 31 + receiverType.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof NoFinalizableSubclass) { + NoFinalizableSubclass other = (NoFinalizableSubclass) obj; + return other.receiverType.equals(receiverType); + } + return false; + } + + @Override + public String toString() { + return "NoFinalizableSubclass[receiverType=" + receiverType.toJavaName() + "]"; + } + + } + + /** + * An assumption that a given abstract or interface type has one direct concrete subtype. There + * is no requirement that the subtype is a leaf type. + */ + public static final class ConcreteSubtype extends Assumption { + + /** + * Type the assumption is made about. + */ + public final ResolvedJavaType context; + + /** + * Assumed concrete sub-type of the context type. + */ + public final ResolvedJavaType subtype; + + public ConcreteSubtype(ResolvedJavaType context, ResolvedJavaType subtype) { + this.context = context; + this.subtype = subtype; + assert context.isAbstract(); + assert subtype.isConcrete() || context.isInterface() : subtype.toString() + " : " + context.toString(); + assert !subtype.isArray() || subtype.getElementalType().isFinal() : subtype.toString() + " : " + context.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + context.hashCode(); + result = prime * result + subtype.hashCode(); + return result; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof ConcreteSubtype) { + ConcreteSubtype other = (ConcreteSubtype) obj; + return other.context.equals(context) && other.subtype.equals(subtype); + } + return false; + } + + @Override + public String toString() { + return "ConcreteSubtype[context=" + context.toJavaName() + ", subtype=" + subtype.toJavaName() + "]"; + } + } + + /** + * An assumption that a given type has no subtypes. + */ + public static final class LeafType extends Assumption { + + /** + * Type the assumption is made about. + */ + public final ResolvedJavaType context; + + public LeafType(ResolvedJavaType context) { + this.context = context; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + context.hashCode(); + return result; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof LeafType) { + LeafType other = (LeafType) obj; + return other.context.equals(context); + } + return false; + } + + @Override + public String toString() { + return "LeafSubtype[context=" + context.toJavaName() + "]"; + } + } + + /** + * An assumption that a given virtual method has a given unique implementation. + */ + public static final class ConcreteMethod extends Assumption { + + /** + * A virtual (or interface) method whose unique implementation for the receiver type in + * {@link #context} is {@link #impl}. + */ + public final ResolvedJavaMethod method; + + /** + * A receiver type. + */ + public final ResolvedJavaType context; + + /** + * The unique implementation of {@link #method} for {@link #context}. + */ + public final ResolvedJavaMethod impl; + + public ConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl) { + this.method = method; + this.context = context; + this.impl = impl; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + method.hashCode(); + result = prime * result + context.hashCode(); + result = prime * result + impl.hashCode(); + return result; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof ConcreteMethod) { + ConcreteMethod other = (ConcreteMethod) obj; + return other.method.equals(method) && other.context.equals(context) && other.impl.equals(impl); + } + return false; + } + + @Override + public String toString() { + return "ConcreteMethod[method=" + method.format("%H.%n(%p)%r") + ", context=" + context.toJavaName() + ", impl=" + impl.format("%H.%n(%p)%r") + "]"; + } + } + + /** + * An assumption that a given call site's method handle did not change. + */ + public static final class CallSiteTargetValue extends Assumption { + + public final CallSite callSite; + public final MethodHandle methodHandle; + + public CallSiteTargetValue(CallSite callSite, MethodHandle methodHandle) { + this.callSite = callSite; + this.methodHandle = methodHandle; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + callSite.hashCode(); + result = prime * result + methodHandle.hashCode(); + return result; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof CallSiteTargetValue) { + CallSiteTargetValue other = (CallSiteTargetValue) obj; + return callSite.equals(other.callSite) && methodHandle.equals(other.methodHandle); + } + return false; + } + + @Override + public String toString() { + return "CallSiteTargetValue[callSite=" + callSite + ", methodHandle=" + methodHandle + "]"; + } + } + + private final Set assumptions = new HashSet<>(); + + /** + * Returns whether any assumptions have been registered. + * + * @return {@code true} if at least one assumption has been registered, {@code false} otherwise. + */ + public boolean isEmpty() { + return assumptions.isEmpty(); + } + + @Override + public int hashCode() { + throw new UnsupportedOperationException("hashCode"); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof Assumptions) { + Assumptions that = (Assumptions) obj; + if (!this.assumptions.equals(that.assumptions)) { + return false; + } + return true; + } + return false; + } + + @Override + public Iterator iterator() { + return assumptions.iterator(); + } + + /** + * Records an assumption that the specified type has no finalizable subclasses. + * + * @param receiverType the type that is assumed to have no finalizable subclasses + */ + public void recordNoFinalizableSubclassAssumption(ResolvedJavaType receiverType) { + record(new NoFinalizableSubclass(receiverType)); + } + + /** + * Records that {@code subtype} is the only concrete subtype in the class hierarchy below + * {@code context}. + * + * @param context the root of the subtree of the class hierarchy that this assumptions is about + * @param subtype the one concrete subtype + */ + public void recordConcreteSubtype(ResolvedJavaType context, ResolvedJavaType subtype) { + record(new ConcreteSubtype(context, subtype)); + } + + /** + * Records that {@code impl} is the only possible concrete target for a virtual call to + * {@code method} with a receiver of type {@code context}. + * + * @param method a method that is the target of a virtual call + * @param context the receiver type of a call to {@code method} + * @param impl the concrete method that is the only possible target for the virtual call + */ + public void recordConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl) { + record(new ConcreteMethod(method, context, impl)); + } + + public void record(AssumptionResult result) { + for (Assumption assumption : result.assumptions) { + record(assumption); + } + } + + public void record(Assumption assumption) { + assumptions.add(assumption); + } + + /** + * Gets a copy of the assumptions recorded in this object as an array. + */ + public Assumption[] toArray() { + return assumptions.toArray(new Assumption[assumptions.size()]); + } + + /** + * Copies assumptions recorded by another {@link Assumptions} object into this object. + */ + public void record(Assumptions other) { + assert other != this; + assumptions.addAll(other.assumptions); + } + + @Override + public String toString() { + return "Assumptions[" + assumptions + "]"; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/BytecodeDisassemblerProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/BytecodeDisassemblerProvider.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2013, 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 com.oracle.jvmci.meta; + +/** + * Interface for disassembling bytecode. + */ +public interface BytecodeDisassemblerProvider { + + /** + * Gets a textual disassembly of the bytecode for a given method. In the absence of bytecode + * rewriting, disassembling a method will produce the same result. + * + * @return a non-zero length string containing a disassembly of {@code method}'s bytecode or + * null if {@code method} has no bytecode (i.e., {@code method.getCodeSize() == 0}) + */ + String disassemble(ResolvedJavaMethod method); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Constant.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Constant.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.jvmci.meta; + +/** + * Represents a compile-time constant (boxed) value within the compiler. + */ +public interface Constant { + + boolean isDefaultForKind(); + + String toValueString(); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ConstantPool.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ConstantPool.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,121 @@ +/* + * 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 com.oracle.jvmci.meta; + +/** + * Represents the runtime representation of the constant pool that is used by the compiler when + * parsing bytecode. Provides methods to look up a constant pool entry without performing + * resolution. They are used during compilation. + */ +public interface ConstantPool { + + /** + * Returns the number of entries the constant pool. + * + * @return number of entries in the constant pool + */ + int length(); + + /** + * Ensures that the type referenced by the specified constant pool entry is loaded and + * initialized. This can be used to compile time resolve a type. It works for field, method, or + * type constant pool entries. + * + * @param cpi the index of the constant pool entry that references the type + * @param opcode the opcode of the instruction that references the type + */ + void loadReferencedType(int cpi, int opcode); + + /** + * Looks up a reference to a field. If {@code opcode} is non-negative, then resolution checks + * specific to the bytecode it denotes are performed if the field is already resolved. Should + * any of these checks fail, an unresolved field reference is returned. + * + * @param cpi the constant pool index + * @param opcode the opcode of the instruction for which the lookup is being performed or + * {@code -1} + * @return a reference to the field at {@code cpi} in this pool + * @throws ClassFormatError if the entry at {@code cpi} is not a field + */ + JavaField lookupField(int cpi, int opcode); + + /** + * Looks up a reference to a method. If {@code opcode} is non-negative, then resolution checks + * specific to the bytecode it denotes are performed if the method is already resolved. Should + * any of these checks fail, an unresolved method reference is returned. + * + * @param cpi the constant pool index + * @param opcode the opcode of the instruction for which the lookup is being performed or + * {@code -1} + * @return a reference to the method at {@code cpi} in this pool + * @throws ClassFormatError if the entry at {@code cpi} is not a method + */ + JavaMethod lookupMethod(int cpi, int opcode); + + /** + * Looks up a reference to a type. If {@code opcode} is non-negative, then resolution checks + * specific to the bytecode it denotes are performed if the type is already resolved. Should any + * of these checks fail, an unresolved type reference is returned. + * + * @param cpi the constant pool index + * @param opcode the opcode of the instruction for which the lookup is being performed or + * {@code -1} + * @return a reference to the compiler interface type + */ + JavaType lookupType(int cpi, int opcode); + + /** + * Looks up an Utf8 string. + * + * @param cpi the constant pool index + * @return the Utf8 string at index {@code cpi} in this constant pool + */ + String lookupUtf8(int cpi); + + /** + * Looks up a method signature. + * + * @param cpi the constant pool index + * @return the method signature at index {@code cpi} in this constant pool + */ + Signature lookupSignature(int cpi); + + /** + * Looks up a constant at the specified index. + * + * @param cpi the constant pool index + * @return the {@code Constant} or {@code JavaType} instance representing the constant pool + * entry + */ + Object lookupConstant(int cpi); + + /** + * Looks up the appendix at the specified index. + * + * @param cpi the constant pool index + * @param opcode the opcode of the instruction for which the lookup is being performed or + * {@code -1} + * @return the appendix if it exists and is resolved or {@code null} + */ + JavaConstant lookupAppendix(int cpi, int opcode); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ConstantReflectionProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ConstantReflectionProvider.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2012, 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 com.oracle.jvmci.meta; + +import java.lang.invoke.*; + +/** + * 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. + */ +public interface ConstantReflectionProvider { + + /** + * Compares two constants for equality. The equality relationship is symmetric. Returns + * {@link Boolean#TRUE true} if the two constants represent the same run time value, + * {@link Boolean#FALSE false} if they are different. Returns {@code null} if the constants + * cannot be compared at this point. + */ + Boolean constantEquals(Constant x, Constant y); + + /** + * Returns the length of the array constant. Returns {@code null} if the constant is not an + * array, or if the array length is not available at this point. + */ + Integer readArrayLength(JavaConstant array); + + /** + * Reads a value from the given array at the given index. Returns {@code null} if the constant + * is not an array, if the index is out of bounds, or if the value is not available at this + * point. + */ + JavaConstant readArrayElement(JavaConstant array, int index); + + /** + * Reads a value from the given array at the given index if it is a stable array. Returns + * {@code null} if the constant is not a stable array, if it is a default value, if the index is + * out of bounds, or if the value is not available at this point. + */ + JavaConstant readConstantArrayElement(JavaConstant array, int index); + + /** + * Reads a value from the given array at the given offset if it is a stable array. The offset + * will decoded relative to the platform addressing into an index into the array. Returns + * {@code null} if the constant is not a stable array, if it is a default value, if the offset + * is out of bounds, or if the value is not available at this point. + */ + JavaConstant readConstantArrayElementForOffset(JavaConstant array, long offset); + + /** + * Gets the constant value of this field. Note that a {@code static final} field may not be + * considered constant if its declaring class is not yet initialized or if it is a well known + * field that can be updated via other means (e.g., {@link System#setOut(java.io.PrintStream)}). + * + * @param receiver object from which this field's value is to be read. This value is ignored if + * this field is static. + * @return the constant value of this field or {@code null} if this field is not considered + * constant by the runtime + */ + JavaConstant readConstantFieldValue(JavaField field, JavaConstant receiver); + + /** + * Gets the current value of this field for a given object, if available. + * + * There is no guarantee that the same value will be returned by this method for a field unless + * the field is considered to be {@linkplain #readConstantFieldValue(JavaField, JavaConstant) + * constant} by the runtime. + * + * @param receiver object from which this field's value is to be read. This value is ignored if + * this field is static. + * @return the value of this field or {@code null} if the value is not available (e.g., because + * the field holder is not yet initialized). + */ + JavaConstant readFieldValue(JavaField field, JavaConstant receiver); + + /** + * Gets the current value of this field for a given object, if available. Like + * {@link #readFieldValue(JavaField, JavaConstant)} but treats array fields as stable. + * + * There is no guarantee that the same value will be returned by this method for a field unless + * the field is considered to be {@linkplain #readConstantFieldValue(JavaField, JavaConstant) + * constant} by the runtime. + * + * @param receiver object from which this field's value is to be read. This value is ignored if + * this field is static. + * @param isDefaultStable if {@code true}, default values are considered stable + * @return the value of this field or {@code null} if the value is not available (e.g., because + * the field holder is not yet initialized). + */ + 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. + */ + 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. + */ + JavaConstant unboxPrimitive(JavaConstant source); + + /** + * Gets a string as a {@link JavaConstant}. + */ + JavaConstant forString(String value); + + /** + * Returns the {@link ResolvedJavaType} for a {@link Class} object (or any other object regarded + * as a class by the VM) encapsulated in the given constant. Returns {@code null} if the + * constant does not encapsulate a class, or if the type is not available at this point. + */ + ResolvedJavaType asJavaType(Constant constant); + + /** + * Gets access to the internals of {@link MethodHandle}. + */ + MethodHandleAccessProvider getMethodHandleAccess(); + + /** + * Gets raw memory access. + */ + MemoryAccessProvider getMemoryAccessProvider(); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/DefaultProfilingInfo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/DefaultProfilingInfo.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 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 com.oracle.jvmci.meta; + +/** + * An implementation of {@link ProfilingInfo} that can used in the absence of real profile + * information. + */ +public final class DefaultProfilingInfo implements ProfilingInfo { + + private static final ProfilingInfo[] NO_PROFILING_INFO = new ProfilingInfo[]{new DefaultProfilingInfo(TriState.TRUE), new DefaultProfilingInfo(TriState.FALSE), + new DefaultProfilingInfo(TriState.UNKNOWN)}; + + private final TriState exceptionSeen; + + DefaultProfilingInfo(TriState exceptionSeen) { + this.exceptionSeen = exceptionSeen; + } + + @Override + public int getCodeSize() { + return 0; + } + + @Override + public JavaTypeProfile getTypeProfile(int bci) { + return null; + } + + @Override + public JavaMethodProfile getMethodProfile(int bci) { + return null; + } + + @Override + public double getBranchTakenProbability(int bci) { + return -1; + } + + @Override + public double[] getSwitchProbabilities(int bci) { + return null; + } + + @Override + public TriState getExceptionSeen(int bci) { + return exceptionSeen; + } + + @Override + public TriState getNullSeen(int bci) { + return TriState.UNKNOWN; + } + + @Override + public int getExecutionCount(int bci) { + return -1; + } + + public static ProfilingInfo get(TriState exceptionSeen) { + return NO_PROFILING_INFO[exceptionSeen.ordinal()]; + } + + @Override + public int getDeoptimizationCount(DeoptimizationReason reason) { + return 0; + } + + @Override + public boolean isMature() { + return false; + } + + @Override + public String toString() { + return "BaseProfilingInfo<" + this.toString(null, "; ") + ">"; + } + + public void setMature() { + // Do nothing + } + + public boolean setCompilerIRSize(Class irType, int nodeCount) { + return false; + } + + public int getCompilerIRSize(Class irType) { + return -1; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/DeoptimizationAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/DeoptimizationAction.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 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 com.oracle.jvmci.meta; + +/** + * Specifies the action that should be taken by the runtime in case a certain deoptimization is + * triggered. + */ +public enum DeoptimizationAction { + /** + * Do not invalidate the machine code. This is typically used when deoptimizing at a point where + * it's highly likely nothing will change the likelihood of the deoptimization happening again. + * For example, a compiled array allocation where the size is negative. + */ + None(false), + + /** + * Do not invalidate the machine code, but schedule a recompilation if this deoptimization is + * triggered too often. + */ + RecompileIfTooManyDeopts(true), + + /** + * Invalidate the machine code and reset the profiling information. + */ + InvalidateReprofile(true), + + /** + * Invalidate the machine code and immediately schedule a recompilation. This is typically used + * when deoptimizing to resolve an unresolved symbol in which case extra profiling is not + * required to determine that the deoptimization will not re-occur. + */ + InvalidateRecompile(true), + + /** + * Invalidate the machine code and stop compiling the outermost method of this compilation. + */ + InvalidateStopCompiling(true); + + private final boolean invalidatesCompilation; + + private DeoptimizationAction(boolean invalidatesCompilation) { + this.invalidatesCompilation = invalidatesCompilation; + } + + public boolean doesInvalidateCompilation() { + return invalidatesCompilation; + } + +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/DeoptimizationReason.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/DeoptimizationReason.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,45 @@ +/* + * 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 com.oracle.jvmci.meta; + +/** + * Enumeration of reasons for why a deoptimization is happening. + */ +public enum DeoptimizationReason { + None, + NullCheckException, + BoundsCheckException, + ClassCastException, + ArrayStoreException, + UnreachedCode, + TypeCheckedInliningViolated, + OptimizedTypeCheckViolated, + NotCompiledExceptionHandler, + Unresolved, + JavaSubroutineMismatch, + ArithmeticException, + RuntimeConstraint, + LoopLimitCheck, + Aliasing, + TransferToInterpreter, +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ExceptionHandler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ExceptionHandler.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2009, 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 com.oracle.jvmci.meta; + +import java.util.*; + +/** + * Represents an exception handler within the bytecodes. + */ +public final class ExceptionHandler { + + private final int startBCI; + private final int endBCI; + private final int handlerBCI; + private final int catchTypeCPI; + private final JavaType catchType; + + /** + * Creates a new exception handler with the specified ranges. + * + * @param startBCI the start index of the protected range + * @param endBCI the end index of the protected range + * @param catchBCI the index of the handler + * @param catchTypeCPI the index of the throwable class in the constant pool + * @param catchType the type caught by this exception handler + */ + public ExceptionHandler(int startBCI, int endBCI, int catchBCI, int catchTypeCPI, JavaType catchType) { + this.startBCI = startBCI; + this.endBCI = endBCI; + this.handlerBCI = catchBCI; + this.catchTypeCPI = catchTypeCPI; + this.catchType = catchType; + } + + /** + * Returns the start bytecode index of the protected range of this handler. + */ + public int getStartBCI() { + return startBCI; + } + + /** + * Returns the end bytecode index of the protected range of this handler. + */ + public int getEndBCI() { + return endBCI; + } + + /** + * Returns the bytecode index of the handler block of this handler. + */ + public int getHandlerBCI() { + return handlerBCI; + } + + /** + * Returns the index into the constant pool representing the type of exception caught by this + * handler. + */ + public int catchTypeCPI() { + return catchTypeCPI; + } + + /** + * Checks whether this handler catches all exceptions. + * + * @return {@code true} if this handler catches all exceptions + */ + public boolean isCatchAll() { + return catchTypeCPI == 0; + } + + /** + * Returns the type of exception caught by this exception handler. + */ + public JavaType getCatchType() { + return catchType; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof ExceptionHandler)) { + return false; + } + ExceptionHandler that = (ExceptionHandler) obj; + if (this.startBCI != that.startBCI || this.endBCI != that.endBCI || this.handlerBCI != that.handlerBCI || this.catchTypeCPI != that.catchTypeCPI) { + return false; + } + return Objects.equals(this.catchType, that.catchType); + } + + @Override + public String toString() { + return "ExceptionHandler"; + } + + @Override + public int hashCode() { + return catchTypeCPI ^ endBCI ^ handlerBCI; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ExcludeFromIdentityComparisonVerification.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ExcludeFromIdentityComparisonVerification.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.jvmci.meta; + +import java.lang.annotation.*; + +/** + * This annotation denotes methods which are allowed to use identity checks (==/!=) on restricted + * types. + * + * @see CheckGraalInvariants + */ +@SuppressWarnings("javadoc") +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface ExcludeFromIdentityComparisonVerification { + +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ForeignCallDescriptor.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ForeignCallDescriptor.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2009, 2013, 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 com.oracle.jvmci.meta; + +import java.util.*; + +/** + * The name and signature of a foreign call. A foreign call differs from a normal compiled Java call + * in at least one of these aspects: + *
    + *
  • The call is to C/C++/assembler code.
  • + *
  • The call uses different conventions for passing parameters or returning values.
  • + *
  • The callee has different register saving semantics. For example, the callee may save all + * registers (apart from some specified temporaries) in which case the register allocator doesn't + * not need to spill all live registers around the call site.
  • + *
  • The call does not occur at an INVOKE* bytecode. Such a call could be transformed into a + * standard Java call if the foreign routine is a normal Java method and the runtime supports + * linking Java calls at arbitrary bytecodes.
  • + *
+ */ +public class ForeignCallDescriptor { + + private final String name; + private final Class resultType; + private final Class[] argumentTypes; + + public ForeignCallDescriptor(String name, Class resultType, Class... argumentTypes) { + this.name = name; + this.resultType = resultType; + this.argumentTypes = argumentTypes; + } + + /** + * Gets the name of this foreign call. + */ + public String getName() { + return name; + } + + /** + * Gets the return type of this foreign call. + */ + public Class getResultType() { + return resultType; + } + + /** + * Gets the argument types of this foreign call. + */ + public Class[] getArgumentTypes() { + return argumentTypes.clone(); + } + + @Override + public int hashCode() { + return name.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof ForeignCallDescriptor) { + ForeignCallDescriptor other = (ForeignCallDescriptor) obj; + return other.name.equals(name) && other.resultType.equals(resultType) && Arrays.equals(other.argumentTypes, argumentTypes); + } + return false; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(name).append('('); + String sep = ""; + for (Class arg : argumentTypes) { + sb.append(sep).append(arg.getSimpleName()); + sep = ","; + } + return sb.append(')').append(resultType.getSimpleName()).toString(); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/InvokeTarget.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/InvokeTarget.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2013, 2013, 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 com.oracle.jvmci.meta; + +/** + * Represents the resolved target of an invocation. + */ +public interface InvokeTarget { +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaConstant.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaConstant.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,458 @@ +/* + * 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 com.oracle.jvmci.meta; + +/** + * Represents a constant (boxed) value, such as an integer, floating point number, or object + * reference, within the compiler and across the compiler/runtime interface. Exports a set of + * {@code JavaConstant} instances that represent frequently used constant values, such as + * {@link #NULL_POINTER}. + */ +public interface JavaConstant extends Constant, JavaValue, Value { + + /* + * 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); + + /** + * Checks whether this constant is null. + * + * @return {@code true} if this constant is the null constant + */ + boolean isNull(); + + static boolean isNull(Constant c) { + if (c instanceof JavaConstant) { + return ((JavaConstant) c).isNull(); + } else { + return false; + } + } + + /** + * Checks whether this constant is non-null. + * + * @return {@code true} if this constant is a primitive, or an object constant that is not null + */ + default boolean isNonNull() { + return !isNull(); + } + + /** + * Checks whether this constant is the default value for its kind (null, 0, 0.0, false). + * + * @return {@code true} if this constant is the default value for its kind + */ + boolean isDefaultForKind(); + + /** + * Returns the value of this constant as a boxed Java value. + * + * @return the value of this constant + */ + Object asBoxedPrimitive(); + + /** + * Returns the primitive int value this constant represents. The constant must have a + * {@link Kind#getStackKind()} of {@link Kind#Int}. + * + * @return the constant value + */ + int asInt(); + + /** + * Returns the primitive boolean value this constant represents. The constant must have kind + * {@link Kind#Boolean}. + * + * @return the constant value + */ + boolean asBoolean(); + + /** + * Returns the primitive long value this constant represents. The constant must have kind + * {@link Kind#Long}, a {@link Kind#getStackKind()} of {@link Kind#Int}. + * + * @return the constant value + */ + long asLong(); + + /** + * Returns the primitive float value this constant represents. The constant must have kind + * {@link Kind#Float}. + * + * @return the constant value + */ + float asFloat(); + + /** + * Returns the primitive double value this constant represents. The constant must have kind + * {@link Kind#Double}. + * + * @return the constant value + */ + double asDouble(); + + default String toValueString() { + if (getKind() == Kind.Illegal) { + return "illegal"; + } else { + return getKind().format(asBoxedPrimitive()); + } + } + + static String toString(JavaConstant constant) { + if (constant.getKind() == Kind.Illegal) { + return "illegal"; + } else { + return constant.getKind().getJavaName() + "[" + constant.toValueString() + "]"; + } + } + + /** + * Creates a boxed double constant. + * + * @param d the double value to box + * @return a boxed copy of {@code value} + */ + static PrimitiveConstant forDouble(double d) { + if (Double.compare(0.0D, d) == 0) { + return DOUBLE_0; + } + if (Double.compare(d, 1.0D) == 0) { + return DOUBLE_1; + } + return new PrimitiveConstant(Kind.Double, Double.doubleToRawLongBits(d)); + } + + /** + * Creates a boxed float constant. + * + * @param f the float value to box + * @return a boxed copy of {@code value} + */ + static PrimitiveConstant forFloat(float f) { + if (Float.compare(f, 0.0F) == 0) { + return FLOAT_0; + } + if (Float.compare(f, 1.0F) == 0) { + return FLOAT_1; + } + return new PrimitiveConstant(Kind.Float, Float.floatToRawIntBits(f)); + } + + /** + * Creates a boxed long constant. + * + * @param i the long value to box + * @return a boxed copy of {@code value} + */ + static PrimitiveConstant forLong(long i) { + if (i == 0) { + return LONG_0; + } else if (i == 1) { + return LONG_1; + } else { + return new PrimitiveConstant(Kind.Long, i); + } + } + + /** + * Creates a boxed integer constant. + * + * @param i the integer value to box + * @return a boxed copy of {@code value} + */ + static PrimitiveConstant forInt(int i) { + switch (i) { + case -1: + return INT_MINUS_1; + case 0: + return INT_0; + case 1: + return INT_1; + case 2: + return INT_2; + default: + return new PrimitiveConstant(Kind.Int, i); + } + } + + /** + * Creates a boxed byte constant. + * + * @param i the byte value to box + * @return a boxed copy of {@code value} + */ + static PrimitiveConstant forByte(byte i) { + return new PrimitiveConstant(Kind.Byte, i); + } + + /** + * Creates a boxed boolean constant. + * + * @param i the boolean value to box + * @return a boxed copy of {@code value} + */ + static PrimitiveConstant forBoolean(boolean i) { + return i ? TRUE : FALSE; + } + + /** + * Creates a boxed char constant. + * + * @param i the char value to box + * @return a boxed copy of {@code value} + */ + static PrimitiveConstant forChar(char i) { + return new PrimitiveConstant(Kind.Char, i); + } + + /** + * Creates a boxed short constant. + * + * @param i the short value to box + * @return a boxed copy of {@code value} + */ + static PrimitiveConstant forShort(short i) { + return new PrimitiveConstant(Kind.Short, i); + } + + /** + * Creates a {@link JavaConstant} from a primitive integer of a certain kind. + */ + static PrimitiveConstant forIntegerKind(Kind kind, long i) { + switch (kind) { + case Boolean: + return forBoolean(i != 0); + case Byte: + return forByte((byte) i); + case Short: + return forShort((short) i); + case Char: + return forChar((char) i); + case Int: + return forInt((int) i); + case Long: + return forLong(i); + default: + throw new IllegalArgumentException("not an integer kind: " + kind); + } + } + + /** + * Creates a {@link JavaConstant} from a primitive integer of a certain width. + */ + static PrimitiveConstant forPrimitiveInt(int bits, long i) { + assert bits <= 64; + switch (bits) { + case 1: + return forBoolean(i != 0); + case 8: + return forByte((byte) i); + case 16: + return forShort((short) i); + case 32: + return forInt((int) i); + case 64: + return forLong(i); + default: + throw new IllegalArgumentException("unsupported integer width: " + bits); + } + } + + /** + * Creates a boxed constant for the given boxed primitive value. + * + * @param value the Java boxed value + * @return the primitive constant holding the {@code value} + */ + static PrimitiveConstant forBoxedPrimitive(Object value) { + if (value instanceof Boolean) { + return forBoolean((Boolean) value); + } else if (value instanceof Byte) { + return forByte((Byte) value); + } else if (value instanceof Character) { + return forChar((Character) value); + } else if (value instanceof Short) { + return forShort((Short) value); + } else if (value instanceof Integer) { + return forInt((Integer) value); + } else if (value instanceof Long) { + return forLong((Long) value); + } else if (value instanceof Float) { + return forFloat((Float) value); + } else if (value instanceof Double) { + return forDouble((Double) value); + } else { + return null; + } + } + + static PrimitiveConstant forIllegal() { + return new PrimitiveConstant(Kind.Illegal, 0); + } + + /** + * Returns a constant with the default value for the given kind. + */ + static JavaConstant defaultForKind(Kind kind) { + switch (kind) { + case Boolean: + return FALSE; + case Byte: + return forByte((byte) 0); + case Char: + return forChar((char) 0); + case Short: + return forShort((short) 0); + case Int: + return INT_0; + case Double: + return DOUBLE_0; + case Float: + return FLOAT_0; + case Long: + return LONG_0; + case Object: + return NULL_POINTER; + default: + throw new IllegalArgumentException(kind.toString()); + } + } + + /** + * Returns the zero value for a given numeric kind. + */ + static JavaConstant zero(Kind kind) { + switch (kind) { + case Boolean: + return FALSE; + case Byte: + return forByte((byte) 0); + case Char: + return forChar((char) 0); + case Double: + return DOUBLE_0; + case Float: + return FLOAT_0; + case Int: + return INT_0; + case Long: + return LONG_0; + case Short: + return forShort((short) 0); + default: + throw new IllegalArgumentException(kind.toString()); + } + } + + /** + * Returns the one value for a given numeric kind. + */ + static JavaConstant one(Kind kind) { + switch (kind) { + case Boolean: + return TRUE; + case Byte: + return forByte((byte) 1); + case Char: + return forChar((char) 1); + case Double: + return DOUBLE_1; + case Float: + return FLOAT_1; + case Int: + return INT_1; + case Long: + return LONG_1; + case Short: + return forShort((short) 1); + default: + throw new IllegalArgumentException(kind.toString()); + } + } + + /** + * Adds two numeric constants. + */ + static JavaConstant add(JavaConstant x, JavaConstant y) { + assert x.getKind() == y.getKind(); + switch (x.getKind()) { + case Byte: + return forByte((byte) (x.asInt() + y.asInt())); + case Char: + return forChar((char) (x.asInt() + y.asInt())); + case Double: + return forDouble(x.asDouble() + y.asDouble()); + case Float: + return forFloat(x.asFloat() + y.asFloat()); + case Int: + return forInt(x.asInt() + y.asInt()); + case Long: + return forLong(x.asLong() + y.asLong()); + case Short: + return forShort((short) (x.asInt() + y.asInt())); + default: + throw new IllegalArgumentException(x.getKind().toString()); + } + } + + /** + * Multiplies two numeric constants. + */ + static PrimitiveConstant mul(JavaConstant x, JavaConstant y) { + assert x.getKind() == y.getKind(); + switch (x.getKind()) { + case Byte: + return forByte((byte) (x.asInt() * y.asInt())); + case Char: + return forChar((char) (x.asInt() * y.asInt())); + case Double: + return forDouble(x.asDouble() * y.asDouble()); + case Float: + return forFloat(x.asFloat() * y.asFloat()); + case Int: + return forInt(x.asInt() * y.asInt()); + case Long: + return forLong(x.asLong() * y.asLong()); + case Short: + return forShort((short) (x.asInt() * y.asInt())); + default: + throw new IllegalArgumentException(x.getKind().toString()); + } + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaField.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaField.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2009, 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 com.oracle.jvmci.meta; + +import java.util.*; + +/** + * Represents a reference to a Java field, either resolved or unresolved fields. Fields, like + * methods and types, are resolved through {@link ConstantPool constant pools}. + */ +public interface JavaField extends TrustedInterface { + + /** + * Returns the name of this field. + */ + String getName(); + + /** + * Returns a {@link JavaType} object that identifies the declared type for this field. + */ + JavaType getType(); + + /** + * Returns the kind of this field. This is the same as calling {@link #getType}. + * {@link JavaType#getKind getKind}. + */ + default Kind getKind() { + return getType().getKind(); + } + + /** + * Returns the {@link JavaType} object representing the class or interface that declares this + * field. + */ + JavaType getDeclaringClass(); + + /** + * Gets a string for this field formatted according to a given format specification. A format + * specification is composed of characters that are to be copied verbatim to the result and + * specifiers that denote an attribute of this field that is to be copied to the result. A + * specifier is a single character preceded by a '%' character. The accepted specifiers and the + * field attributes they denote are described below: + * + *
+     *     Specifier | Description                                          | Example(s)
+     *     ----------+------------------------------------------------------------------------------------------
+     *     'T'       | Qualified type                                       | "int" "java.lang.String"
+     *     't'       | Unqualified type                                     | "int" "String"
+     *     'H'       | Qualified holder                                     | "java.util.Map.Entry"
+     *     'h'       | Unqualified holder                                   | "Entry"
+     *     'n'       | Field name                                           | "age"
+     *     'f'       | Indicator if field is unresolved, static or instance | "unresolved" "static" "instance"
+     *     '%'       | A '%' character                                      | "%"
+     * 
+ * + * @param format a format specification + * @return the result of formatting this field according to {@code format} + * @throws IllegalFormatException if an illegal specifier is encountered in {@code format} + */ + default String format(String format) throws IllegalFormatException { + StringBuilder sb = new StringBuilder(); + int index = 0; + JavaType type = getType(); + while (index < format.length()) { + char ch = format.charAt(index++); + if (ch == '%') { + if (index >= format.length()) { + 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)); + break; + } + case 'H': + qualified = true; + // fall through + case 'h': { + sb.append(getDeclaringClass().toJavaName(qualified)); + break; + } + case 'n': { + sb.append(getName()); + break; + } + case 'f': { + sb.append(!(this instanceof ResolvedJavaField) ? "unresolved" : ((ResolvedJavaField) this).isStatic() ? "static" : "instance"); + break; + } + case '%': { + sb.append('%'); + break; + } + default: { + throw new UnknownFormatConversionException(String.valueOf(specifier)); + } + } + } else { + sb.append(ch); + } + } + return sb.toString(); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaMethod.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaMethod.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2009, 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 com.oracle.jvmci.meta; + +import java.util.*; + +/** + * Represents a reference to a Java method, either resolved or unresolved. Methods, like fields and + * types, are resolved through {@link ConstantPool constant pools}. + */ +public interface JavaMethod extends TrustedInterface { + + /** + * Returns the name of this method. + */ + String getName(); + + /** + * Returns the {@link JavaType} object representing the class or interface that declares this + * method. + */ + JavaType getDeclaringClass(); + + /** + * Returns the signature of this method. + */ + Signature getSignature(); + + /** + * Gets a string for this method formatted according to a given format specification. A format + * specification is composed of characters that are to be copied verbatim to the result and + * specifiers that denote an attribute of this method that is to be copied to the result. A + * specifier is a single character preceded by a '%' character. The accepted specifiers and the + * method attributes they denote are described below: + * + *
+     *     Specifier | Description                                          | Example(s)
+     *     ----------+------------------------------------------------------------------------------------------
+     *     'R'       | Qualified return type                                | "int" "java.lang.String"
+     *     'r'       | Unqualified return type                              | "int" "String"
+     *     'H'       | Qualified holder                                     | "java.util.Map.Entry"
+     *     'h'       | Unqualified holder                                   | "Entry"
+     *     'n'       | Method name                                          | "add"
+     *     'P'       | Qualified parameter types, separated by ', '         | "int, java.lang.String"
+     *     'p'       | Unqualified parameter types, separated by ', '       | "int, String"
+     *     'f'       | Indicator if method is unresolved, static or virtual | "unresolved" "static" "virtual"
+     *     '%'       | A '%' character                                      | "%"
+     * 
+ * + * @param format a format specification + * @return the result of formatting this method according to {@code format} + * @throws IllegalFormatException if an illegal specifier is encountered in {@code format} + */ + default String format(String format) throws IllegalFormatException { + StringBuilder sb = new StringBuilder(); + int index = 0; + Signature sig = null; + while (index < format.length()) { + char ch = format.charAt(index++); + if (ch == '%') { + if (index >= format.length()) { + 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)); + break; + } + case 'H': + qualified = true; + // fall through + case 'h': { + sb.append(getDeclaringClass().toJavaName(qualified)); + break; + } + case 'n': { + sb.append(getName()); + break; + } + case 'P': + qualified = true; + // fall through + case 'p': { + if (sig == null) { + sig = getSignature(); + } + for (int i = 0; i < sig.getParameterCount(false); i++) { + if (i != 0) { + sb.append(", "); + } + sb.append(sig.getParameterType(i, null).toJavaName(qualified)); + } + break; + } + case 'f': { + sb.append(!(this instanceof ResolvedJavaMethod) ? "unresolved" : ((ResolvedJavaMethod) this).isStatic() ? "static" : "virtual"); + break; + } + case '%': { + sb.append('%'); + break; + } + default: { + throw new UnknownFormatConversionException(String.valueOf(specifier)); + } + } + } else { + sb.append(ch); + } + } + return sb.toString(); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaMethodProfile.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaMethodProfile.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2013, 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 com.oracle.jvmci.meta; + +import com.oracle.jvmci.meta.JavaMethodProfile.ProfiledMethod; + +/** + * This profile object represents the method profile at a specific BCI. The precision of the + * supplied values may vary, but a runtime that provides this information should be aware that it + * will be used to guide performance-critical decisions like speculative inlining, etc. + */ +public final class JavaMethodProfile extends AbstractJavaProfile { + + public JavaMethodProfile(double notRecordedProbability, ProfiledMethod[] pitems) { + super(notRecordedProbability, pitems); + } + + public ProfiledMethod[] getMethods() { + return super.getItems(); + } + + public static class ProfiledMethod extends AbstractProfiledItem { + + public ProfiledMethod(ResolvedJavaMethod method, double probability) { + super(method, probability); + } + + /** + * Returns the type for this profile entry. + */ + public ResolvedJavaMethod getMethod() { + return getItem(); + } + + @Override + public String toString() { + return "{" + item.getName() + ", " + probability + "}"; + } + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaType.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaType.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2009, 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 com.oracle.jvmci.meta; + +import static com.oracle.jvmci.meta.MetaUtil.*; + +/** + * Represents a resolved or unresolved type. Types include primitives, objects, {@code void}, and + * arrays thereof. + */ +public interface JavaType extends TrustedInterface { + + /** + * Returns the name of this type in internal form. The following are examples of strings + * returned by this method: + * + *
+     *     "Ljava/lang/Object;"
+     *     "I"
+     *     "[[B"
+     * 
+ */ + String getName(); + + /** + * Returns an unqualified name of this type. + * + *
+     *     "Object"
+     *     "Integer"
+     * 
+ */ + default String getUnqualifiedName() { + String name = getName(); + if (name.indexOf('/') != -1) { + name = name.substring(name.lastIndexOf('/') + 1); + } + if (name.endsWith(";")) { + name = name.substring(0, name.length() - 1); + } + return name; + } + + /** + * For array types, gets the type of the components, or {@code null} if this is not an array + * type. This method is analogous to {@link Class#getComponentType()}. + */ + JavaType getComponentType(); + + /** + * Gets the elemental type for this given type. The elemental type is the corresponding zero + * dimensional type of an array type. For example, the elemental type of {@code int[][][]} is + * {@code int}. A non-array type is its own elemental type. + */ + default JavaType getElementalType() { + JavaType t = this; + while (t.getComponentType() != null) { + t = t.getComponentType(); + } + return t; + } + + /** + * Gets the array class type representing an array with elements of this type. + */ + JavaType getArrayClass(); + + /** + * Gets the kind of this type. + */ + Kind getKind(); + + /** + * Resolves this type to a {@link ResolvedJavaType}. + * + * @param accessingClass the context of resolution (must not be null) + * @return the resolved Java type + * @throws LinkageError if the resolution failed + * @throws NullPointerException if {@code accessingClass} is {@code null} + */ + ResolvedJavaType resolve(ResolvedJavaType accessingClass); + + /** + * Gets the Java programming language name for this type. The following are examples of strings + * returned by this method: + * + *
+     *      java.lang.Object
+     *      int
+     *      boolean[][]
+     * 
+ * + * @return the Java name corresponding to this type + */ + default String toJavaName() { + return internalNameToJava(getName(), true, false); + } + + /** + * Gets the Java programming language name for this type. The following are examples of strings + * returned by this method: + * + *
+     *     qualified == true:
+     *         java.lang.Object
+     *         int
+     *         boolean[][]
+     *     qualified == false:
+     *         Object
+     *         int
+     *         boolean[][]
+     * 
+ * + * @param qualified specifies if the package prefix of this type should be included in the + * returned name + * @return the Java name corresponding to this type + */ + default String toJavaName(boolean qualified) { + Kind kind = getKind(); + if (kind == Kind.Object) { + return internalNameToJava(getName(), qualified, false); + } + return getKind().getJavaName(); + } + + /** + * Returns this type's name in the same format as {@link Class#getName()}. + */ + default String toClassName() { + return internalNameToJava(getName(), true, true); + } + +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaTypeProfile.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaTypeProfile.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,177 @@ +/* + * 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. + */ +package com.oracle.jvmci.meta; + +import java.util.*; + +import com.oracle.jvmci.meta.JavaTypeProfile.ProfiledType; + +/** + * This profile object represents the type profile at a specific BCI. The precision of the supplied + * values may vary, but a runtime that provides this information should be aware that it will be + * used to guide performance-critical decisions like speculative inlining, etc. + */ +public final class JavaTypeProfile extends AbstractJavaProfile { + + private static final ProfiledType[] EMPTY_ARRAY = new ProfiledType[0]; + + private final TriState nullSeen; + + public JavaTypeProfile(TriState nullSeen, double notRecordedProbability, ProfiledType[] pitems) { + super(notRecordedProbability, pitems); + this.nullSeen = nullSeen; + } + + /** + * Returns whether a null value was at the type check. + */ + public TriState getNullSeen() { + return nullSeen; + } + + /** + * A list of types for which the runtime has recorded probability information. Note that this + * includes both positive and negative types where a positive type is a subtype of the checked + * type and a negative type is not. + */ + public ProfiledType[] getTypes() { + return getItems(); + } + + public JavaTypeProfile restrict(JavaTypeProfile otherProfile) { + if (otherProfile.getNotRecordedProbability() > 0.0) { + // Not useful for restricting since there is an unknown set of types occurring. + return this; + } + + if (this.getNotRecordedProbability() > 0.0) { + // We are unrestricted, so the other profile is always a better estimate. + return otherProfile; + } + + ArrayList result = new ArrayList<>(); + for (int i = 0; i < getItems().length; i++) { + ProfiledType ptype = getItems()[i]; + ResolvedJavaType type = ptype.getItem(); + if (otherProfile.isIncluded(type)) { + result.add(ptype); + } + } + + TriState newNullSeen = (otherProfile.getNullSeen() == TriState.FALSE) ? TriState.FALSE : getNullSeen(); + double newNotRecorded = getNotRecordedProbability(); + return createAdjustedProfile(result, newNullSeen, newNotRecorded); + } + + public JavaTypeProfile restrict(ResolvedJavaType declaredType, boolean nonNull) { + ArrayList result = new ArrayList<>(); + for (int i = 0; i < getItems().length; i++) { + ProfiledType ptype = getItems()[i]; + ResolvedJavaType type = ptype.getItem(); + if (declaredType.isAssignableFrom(type)) { + result.add(ptype); + } + } + + TriState newNullSeen = (nonNull) ? TriState.FALSE : getNullSeen(); + double newNotRecorded = this.getNotRecordedProbability(); + // Assume for the types not recorded, the incompatibility rate is the same. + if (getItems().length != 0) { + newNotRecorded *= ((double) result.size() / (double) getItems().length); + } + return createAdjustedProfile(result, newNullSeen, newNotRecorded); + } + + private JavaTypeProfile createAdjustedProfile(ArrayList result, TriState newNullSeen, double newNotRecorded) { + if (result.size() != this.getItems().length || newNotRecorded != getNotRecordedProbability() || newNullSeen != getNullSeen()) { + if (result.size() == 0) { + return new JavaTypeProfile(newNullSeen, 1.0, EMPTY_ARRAY); + } + double factor; + if (result.size() == this.getItems().length) { + /* List of types did not change, no need to recompute probabilities. */ + factor = 1.0; + } else { + double probabilitySum = 0.0; + for (int i = 0; i < result.size(); i++) { + probabilitySum += result.get(i).getProbability(); + } + probabilitySum += newNotRecorded; + + factor = 1.0 / probabilitySum; // Normalize to 1.0 + assert factor >= 1.0; + } + ProfiledType[] newResult = new ProfiledType[result.size()]; + for (int i = 0; i < newResult.length; ++i) { + ProfiledType curType = result.get(i); + newResult[i] = new ProfiledType(curType.getItem(), Math.min(1.0, curType.getProbability() * factor)); + } + double newNotRecordedTypeProbability = Math.min(1.0, newNotRecorded * factor); + return new JavaTypeProfile(newNullSeen, newNotRecordedTypeProbability, newResult); + } + return this; + } + + @Override + public boolean equals(Object other) { + return super.equals(other) && nullSeen.equals(((JavaTypeProfile) other).nullSeen); + } + + @Override + public int hashCode() { + return nullSeen.hashCode() + super.hashCode(); + } + + public static class ProfiledType extends AbstractProfiledItem { + + public ProfiledType(ResolvedJavaType type, double probability) { + super(type, probability); + assert type.isArray() || type.isConcrete() : type; + } + + /** + * Returns the type for this profile entry. + */ + public ResolvedJavaType getType() { + return getItem(); + } + + @Override + public String toString() { + return String.format("%.6f#%s", probability, item); + } + } + + @Override + public String toString() { + StringBuilder buf = new StringBuilder("JavaTypeProfile", getNotRecordedProbability())).toString(); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaValue.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/JavaValue.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.jvmci.meta; + +/** + * Interface for things that represent a Java value. + */ +public interface JavaValue { + + /** + * Returns the kind of this value. + */ + Kind getKind(); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Kind.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Kind.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,486 @@ +/* + * 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 com.oracle.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); + } + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/KindProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/KindProvider.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.oracle.jvmci.meta; + +/** + * Interface for classes which can be associated with a Kind. + */ +public interface KindProvider { + + Kind getKind(); + +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LIRKind.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LIRKind.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,349 @@ +/* + * 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 com.oracle.jvmci.meta; + +import java.util.*; + +/** + * Represents the type of values in the LIR. It is composed of a {@link PlatformKind} that gives the + * low level representation of the value, and a {@link #referenceMask} that describes the location + * of object references in the value. + * + *

Constructing {@link LIRKind} instances

+ * + * During LIR generation, every new {@link Value} should get a {@link LIRKind} of the correct + * {@link PlatformKind} that also contains the correct reference information. {@linkplain LIRKind + * LIRKinds} should be created as follows: + * + *

+ * If the result value is created from one or more input values, the {@link LIRKind} should be + * created with {@link LIRKind#derive}(inputs). If the result has a different {@link PlatformKind} + * than the inputs, {@link LIRKind#derive}(inputs).{@link #changeType}(resultKind) should be used. + *

+ * If the result is an exact copy of one of the inputs, {@link Value#getLIRKind()} can be used. Note + * that this is only correct for move-like operations, like conditional move or compare-and-swap. + * For convert operations, {@link LIRKind#derive} should be used. + *

+ * If it is known that the result will be a reference (e.g. pointer arithmetic where the end result + * is a valid oop), {@link LIRKind#reference} should be used. + *

+ * If it is known that the result will neither be a reference nor be derived from a reference, + * {@link LIRKind#value} can be used. If the operation producing this value has inputs, this is very + * likely wrong, and {@link LIRKind#derive} should be used instead. + *

+ * If it is known that the result is derived from a reference, {@link LIRKind#derivedReference} can + * be used. In most cases, {@link LIRKind#derive} should be used instead, since it is able to detect + * this automatically. + */ +public final class LIRKind { + + /** + * The non-type. This uses {@link #derivedReference}, so it can never be part of an oop map. + */ + public static final LIRKind Illegal = derivedReference(Kind.Illegal); + + private final PlatformKind platformKind; + private final int referenceMask; + + private static final int DERIVED_REFERENCE = -1; + + private LIRKind(PlatformKind platformKind, int referenceMask) { + this.platformKind = platformKind; + this.referenceMask = referenceMask; + } + + /** + * Create a {@link LIRKind} of type {@code platformKind} that contains a primitive value. Should + * be only used when it's guaranteed that the value is not even indirectly derived from a + * reference. Otherwise, {@link #derive(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); + } + + /** + * Create a {@link LIRKind} of type {@code platformKind} that contains a single tracked oop + * reference. + */ + public static LIRKind reference(PlatformKind platformKind) { + int length = platformKind.getVectorLength(); + assert 0 < length && length < 32 : "vector of " + length + " references not supported"; + return new LIRKind(platformKind, (1 << length) - 1); + } + + /** + * Create a {@link LIRKind} of type {@code platformKind} that contains a value that is derived + * from a reference. Values of this {@link LIRKind} can not be live at safepoints. In most + * cases, this should not be called directly. {@link #derive} should be used instead to + * automatically propagate this information. + */ + public static LIRKind derivedReference(PlatformKind platformKind) { + return new LIRKind(platformKind, DERIVED_REFERENCE); + } + + /** + * Derive a new type from inputs. The result will have the {@link PlatformKind} of one of the + * inputs. If all inputs are values, the result is a value. Otherwise, the result is a derived + * reference. + * + * This method should be used to construct the result {@link LIRKind} of any operation that + * modifies values (e.g. arithmetics). + */ + public static LIRKind derive(Value... inputs) { + assert inputs.length > 0; + for (Value input : inputs) { + LIRKind kind = input.getLIRKind(); + if (kind.isDerivedReference()) { + return kind; + } else if (!kind.isValue()) { + return kind.makeDerivedReference(); + } + } + + // all inputs are values, just return one of them + return inputs[0].getLIRKind(); + } + + /** + * Merge the types of the inputs. The result will have the {@link PlatformKind} of one of the + * inputs. If all inputs are values (references), the result is a value (reference). Otherwise, + * the result is a derived reference. + * + * This method should be used to construct the result {@link LIRKind} of merge operation that do + * not modify values (e.g. phis). + */ + public static LIRKind merge(Value... inputs) { + assert inputs.length > 0; + ArrayList kinds = new ArrayList<>(inputs.length); + for (int i = 0; i < inputs.length; i++) { + kinds.add(inputs[i].getLIRKind()); + } + return merge(kinds); + } + + /** + * @see #merge(Value...) + */ + public static LIRKind merge(Iterable kinds) { + LIRKind mergeKind = null; + + for (LIRKind kind : kinds) { + + assert mergeKind == null || verifyMoveKinds(mergeKind, kind) : String.format("Input kinds do not match %s vs. %s", mergeKind, kind); + + if (kind.isDerivedReference()) { + /** + * Kind is a derived reference therefore the result can only be also a derived + * reference. + */ + return kind; + } + if (mergeKind == null) { + mergeKind = kind; + continue; + } + + if (kind.isValue()) { + /* Kind is a value. */ + if (mergeKind.referenceMask != 0) { + /* + * Inputs consists of values and references. Make the result a derived + * reference. + */ + return mergeKind.makeDerivedReference(); + } + /* Check that other inputs are also values. */ + } else { + /* Kind is a reference. */ + if (mergeKind.referenceMask != kind.referenceMask) { + /* + * Reference maps do not match so the result can only be a derived reference. + */ + return mergeKind.makeDerivedReference(); + } + } + + } + assert mergeKind != null; + + // all inputs are values or references, just return one of them + return mergeKind; + } + + /** + * Create a new {@link LIRKind} with the same reference information and a new + * {@linkplain #getPlatformKind platform kind}. If the new kind is a longer vector than this, + * the new elements are marked as untracked values. + */ + public LIRKind changeType(PlatformKind newPlatformKind) { + if (newPlatformKind == platformKind) { + return this; + } else if (isDerivedReference()) { + return derivedReference(newPlatformKind); + } else if (referenceMask == 0) { + // value type + return new LIRKind(newPlatformKind, 0); + } else { + // reference type + int newLength = Math.min(32, newPlatformKind.getVectorLength()); + int newReferenceMask = referenceMask & (0xFFFFFFFF >>> (32 - newLength)); + assert newReferenceMask != DERIVED_REFERENCE; + return new LIRKind(newPlatformKind, newReferenceMask); + } + } + + /** + * Create a new {@link LIRKind} with a new {@linkplain #getPlatformKind platform kind}. If the + * new kind is longer than this, the reference positions are repeated to fill the vector. + */ + public LIRKind repeat(PlatformKind newPlatformKind) { + if (isDerivedReference()) { + return derivedReference(newPlatformKind); + } else if (referenceMask == 0) { + // value type + return new LIRKind(newPlatformKind, 0); + } else { + // reference type + int oldLength = platformKind.getVectorLength(); + int newLength = newPlatformKind.getVectorLength(); + assert oldLength <= newLength && newLength < 32 && (newLength % oldLength) == 0; + + // repeat reference mask to fill new kind + int newReferenceMask = 0; + for (int i = 0; i < newLength; i += platformKind.getVectorLength()) { + newReferenceMask |= referenceMask << i; + } + + assert newReferenceMask != DERIVED_REFERENCE; + return new LIRKind(newPlatformKind, newReferenceMask); + } + } + + /** + * Create a new {@link LIRKind} with the same type, but marked as containing a derivedReference. + */ + public LIRKind makeDerivedReference() { + return new LIRKind(platformKind, DERIVED_REFERENCE); + } + + /** + * Get the low level type that is used in code generation. + */ + public PlatformKind getPlatformKind() { + return platformKind; + } + + /** + * Check whether this value is derived from a reference. If this returns {@code true}, this + * value must not be live at safepoints. + */ + public boolean isDerivedReference() { + return referenceMask == DERIVED_REFERENCE; + } + + /** + * Check whether the {@code idx}th part of this value is a reference that must be tracked at + * safepoints. + * + * @param idx The index into the vector if this is a vector kind. Must be 0 if this is a scalar + * kind. + */ + public boolean isReference(int idx) { + assert 0 <= idx && idx < platformKind.getVectorLength() : "invalid index " + idx + " in " + this; + return !isDerivedReference() && (referenceMask & 1 << idx) != 0; + } + + /** + * Check whether this kind is a value type that doesn't need to be tracked at safepoints. + */ + public boolean isValue() { + return referenceMask == 0; + } + + @Override + public String toString() { + if (isValue()) { + return platformKind.name(); + } else if (isDerivedReference()) { + return platformKind.name() + "[*]"; + } else { + StringBuilder ret = new StringBuilder(); + ret.append(platformKind.name()); + ret.append('['); + for (int i = 0; i < platformKind.getVectorLength(); i++) { + if (isReference(i)) { + ret.append('.'); + } else { + ret.append(' '); + } + } + ret.append(']'); + return ret.toString(); + } + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((platformKind == null) ? 0 : platformKind.hashCode()); + result = prime * result + referenceMask; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof LIRKind)) { + return false; + } + + LIRKind other = (LIRKind) obj; + return platformKind == other.platformKind && referenceMask == other.referenceMask; + } + + public static boolean verifyMoveKinds(LIRKind dst, LIRKind src) { + if (src.equals(dst)) { + return true; + } + /* + * TODO(je,rs) What we actually want is toStackKind(src.getPlatformKind()).equals( + * dst.getPlatformKind()) but due to the handling of sub-integer at the current point + * (phi-)moves from e.g. integer to short can happen. Therefore we compare stack kinds. + */ + if (toStackKind(src.getPlatformKind()).equals(toStackKind(dst.getPlatformKind()))) { + return !src.isDerivedReference() || dst.isDerivedReference(); + } + return false; + } + + private static PlatformKind toStackKind(PlatformKind platformKind) { + if (platformKind instanceof Kind) { + return ((Kind) platformKind).getStackKind(); + } + return platformKind; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LineNumberTable.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LineNumberTable.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2011, 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 com.oracle.jvmci.meta; + +public interface LineNumberTable { + + int[] getLineNumberEntries(); + + int[] getBciEntries(); + + int getLineNumber(int bci); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LineNumberTableImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LineNumberTableImpl.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2011, 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 com.oracle.jvmci.meta; + +public class LineNumberTableImpl implements LineNumberTable { + + private final int[] lineNumbers; + private final int[] bci; + + public LineNumberTableImpl(int[] lineNumbers, int[] bci) { + this.lineNumbers = lineNumbers; + this.bci = bci; + } + + @Override + public int[] getLineNumberEntries() { + return lineNumbers; + } + + @Override + public int[] getBciEntries() { + return bci; + } + + @Override + public int getLineNumber(@SuppressWarnings("hiding") int bci) { + for (int i = 0; i < this.bci.length - 1; i++) { + if (this.bci[i] <= bci && bci < this.bci[i + 1]) { + return lineNumbers[i]; + } + } + return lineNumbers[lineNumbers.length - 1]; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Local.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Local.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2011, 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 com.oracle.jvmci.meta; + +public interface Local { + + int getStartBCI(); + + int getEndBCI(); + + int getSlot(); + + String getName(); + + JavaType getType(); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LocalImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LocalImpl.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2011, 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 com.oracle.jvmci.meta; + +public class LocalImpl implements Local { + + private final String name; + private final int startBci; + private final int endBci; + private final int slot; + private final JavaType type; + + public LocalImpl(String name, JavaType type, int startBci, int endBci, int slot) { + this.name = name; + this.startBci = startBci; + this.endBci = endBci; + this.slot = slot; + this.type = type; + } + + @Override + public int getStartBCI() { + return startBci; + } + + @Override + public int getEndBCI() { + return endBci; + } + + @Override + public String getName() { + return name; + } + + @Override + public JavaType getType() { + return type; + } + + @Override + public int getSlot() { + return slot; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof LocalImpl)) { + return false; + } + LocalImpl that = (LocalImpl) obj; + return this.name.equals(that.name) && this.startBci == that.startBci && this.endBci == that.endBci && this.slot == that.slot && this.type.equals(that.type); + } + + @Override + public int hashCode() { + return super.hashCode(); + } + + @Override + public String toString() { + return "LocalImpl"; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LocalVariableTable.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LocalVariableTable.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2011, 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 com.oracle.jvmci.meta; + +public interface LocalVariableTable { + + Local[] getLocals(); + + Local[] getLocalsAt(int bci); + + Local getLocal(int slot, int bci); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LocalVariableTableImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LocalVariableTableImpl.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2011, 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 com.oracle.jvmci.meta; + +import java.util.*; + +public class LocalVariableTableImpl implements LocalVariableTable { + + private final Local[] locals; + + public LocalVariableTableImpl(Local[] locals) { + this.locals = locals; + } + + @Override + public Local getLocal(int slot, int bci) { + Local result = null; + for (Local local : locals) { + if (local.getSlot() == slot && local.getStartBCI() <= bci && local.getEndBCI() >= bci) { + if (result == null) { + result = local; + } else { + throw new IllegalStateException("Locals overlap!"); + } + } + } + return result; + } + + @Override + public Local[] getLocals() { + return locals; + } + + @Override + public Local[] getLocalsAt(int bci) { + List result = new ArrayList<>(); + for (Local l : locals) { + if (l.getStartBCI() <= bci && bci <= l.getEndBCI()) { + result.add(l); + } + } + return result.toArray(new Local[result.size()]); + } + +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LocationIdentity.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/LocationIdentity.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,82 @@ +/* + * 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. + */ +package com.oracle.jvmci.meta; + +import java.util.*; + +// JaCoCo Exclude + +/** + * Marker interface for location identities. Apart from the special values {@link #ANY_LOCATION} and + * {@link #FINAL_LOCATION}, a different location identity of two memory accesses guarantees that the + * two accesses do not interfere. + * + * Clients of {@link LocationIdentity} must use {@link #equals(Object)}, not {@code ==}, when + * comparing two {@link LocationIdentity} values for equality. Likewise, they must not use + * {@link IdentityHashMap}s with {@link LocationIdentity} values as keys. + */ +public abstract class LocationIdentity { + + /** + * Denotes any location. A write to such a location kills all values in a memory map during an + * analysis of memory accesses. A read from this location cannot be moved or coalesced with + * other reads because its interaction with other reads is not known. + */ + private static final LocationIdentity ANY_LOCATION = NamedLocationIdentity.mutable("ANY_LOCATION"); + + /** + * Denotes the location of a value that is guaranteed to be unchanging. + */ + public static final LocationIdentity FINAL_LOCATION = NamedLocationIdentity.immutable("FINAL_LOCATION"); + + /** + * Denotes the location of the length field of a Java array. + */ + public static final LocationIdentity ARRAY_LENGTH_LOCATION = NamedLocationIdentity.immutable("[].length"); + + public static LocationIdentity any() { + return ANY_LOCATION; + } + + /** + * Denotes a location is unchanging in all cases. Not that this is different than the Java + * notion of final which only requires definite assignment. + */ + public abstract boolean isImmutable(); + + public final boolean isMutable() { + return !isImmutable(); + } + + public final boolean isAny() { + return this == ANY_LOCATION; + } + + public final boolean isSingle() { + return this != ANY_LOCATION; + } + + public final boolean overlaps(LocationIdentity other) { + return isAny() || other.isAny() || this.equals(other); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/MemoryAccessProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/MemoryAccessProvider.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2012, 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 com.oracle.jvmci.meta; + +/** + * Provides memory access operations for the target VM. + */ +public interface MemoryAccessProvider { + + /** + * Reads a value of this kind using a base address and a displacement. No bounds checking or + * type checking is performed. Returns {@code null} if the value is not available at this point. + * + * @param base the base address from which the value is read. + * @param displacement the displacement within the object in bytes + * @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); + + /** + * Reads a primitive value using a base address and a displacement. + * + * @param kind the {@link Kind} 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 + */ + JavaConstant readPrimitiveConstant(Kind kind, Constant base, long displacement, int bits); + + /** + * Reads a Java {@link Object} value using a base address and a displacement. + * + * @param base the base address from which the value is read + * @param displacement the displacement within the object in bytes + * @return the read value encapsulated in a {@link Constant} object + */ + JavaConstant readObjectConstant(Constant base, long displacement); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/MetaAccessProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/MetaAccessProvider.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2012, 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 com.oracle.jvmci.meta; + +import java.lang.reflect.*; + +/** + * Provides access to the metadata of a class typically provided in a class file. + */ +public interface MetaAccessProvider { + + /** + * Returns the resolved Java type representing a given Java class. + * + * @param clazz the Java class object + * @return the resolved Java type object + */ + ResolvedJavaType lookupJavaType(Class clazz); + + /** + * Returns the resolved Java types representing some given Java classes. + * + * @param classes the Java class objects + * @return the resolved Java type objects + */ + default ResolvedJavaType[] lookupJavaTypes(Class[] classes) { + ResolvedJavaType[] result = new ResolvedJavaType[classes.length]; + for (int i = 0; i < result.length; i++) { + result[i] = lookupJavaType(classes[i]); + } + return result; + } + + /** + * Provides the {@link ResolvedJavaMethod} for a {@link Method} or {@link Constructor} obtained + * via reflection. + */ + ResolvedJavaMethod lookupJavaMethod(Executable reflectionMethod); + + /** + * Provides the {@link ResolvedJavaField} for a {@link Field} obtained via reflection. + */ + ResolvedJavaField lookupJavaField(Field reflectionField); + + /** + * Returns the resolved Java type of the given {@link JavaConstant} object. + * + * @return {@code null} if {@code constant.isNull() || !constant.kind.isObject()} + */ + ResolvedJavaType lookupJavaType(JavaConstant constant); + + /** + * Returns the number of bytes occupied by this constant value or constant object. + * + * @param constant the constant whose bytes should be measured + * @return the number of bytes occupied by this constant + */ + long getMemorySize(JavaConstant constant); + + /** + * Parses a method + * descriptor into a {@link Signature}. The behavior of this method is undefined if the + * method descriptor is not well formed. + */ + Signature parseMethodDescriptor(String methodDescriptor); + + /** + * Encodes a deoptimization action and a deoptimization reason in an integer value. + * + * @param debugId an integer that can be used to track the origin of a deoptimization at + * runtime. There is no guarantee that the runtime will use this value. The runtime + * may even keep fewer than 32 bits. + * + * @return the encoded value as an integer + */ + JavaConstant encodeDeoptActionAndReason(DeoptimizationAction action, DeoptimizationReason reason, int debugId); + + DeoptimizationReason decodeDeoptReason(JavaConstant constant); + + DeoptimizationAction decodeDeoptAction(JavaConstant constant); + + int decodeDebugId(JavaConstant constant); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/MetaUtil.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/MetaUtil.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,341 @@ +/* + * Copyright (c) 2012, 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 com.oracle.jvmci.meta; + +import java.io.*; +import java.util.*; + +/** + * Miscellaneous collection of utility methods used by {@code com.oracle.jvmci.meta} and its + * clients. + */ +public class MetaUtil { + + private static class ClassInfo { + public long totalSize; + public long instanceCount; + + @Override + public String toString() { + return "totalSize=" + totalSize + ", instanceCount=" + instanceCount; + } + } + + /** + * Returns the number of bytes occupied by this constant value or constant object and + * recursively all values reachable from this value. + * + * @param constant the constant whose bytes should be measured + * @param printTopN print total size and instance count of the top n classes is desired + * @return the number of bytes occupied by this constant + */ + public static long getMemorySizeRecursive(MetaAccessProvider access, ConstantReflectionProvider constantReflection, JavaConstant constant, PrintStream out, int printTopN) { + Set marked = new HashSet<>(); + Deque stack = new ArrayDeque<>(); + if (constant.getKind() == Kind.Object && constant.isNonNull()) { + marked.add(constant); + } + final HashMap histogram = new HashMap<>(); + stack.push(constant); + long sum = 0; + while (!stack.isEmpty()) { + JavaConstant c = stack.pop(); + long memorySize = access.getMemorySize(constant); + sum += memorySize; + if (c.getKind() == Kind.Object && c.isNonNull()) { + ResolvedJavaType clazz = access.lookupJavaType(c); + if (!histogram.containsKey(clazz)) { + histogram.put(clazz, new ClassInfo()); + } + ClassInfo info = histogram.get(clazz); + info.instanceCount++; + info.totalSize += memorySize; + ResolvedJavaType type = access.lookupJavaType(c); + if (type.isArray()) { + if (!type.getComponentType().isPrimitive()) { + int length = constantReflection.readArrayLength(c); + for (int i = 0; i < length; i++) { + JavaConstant value = constantReflection.readArrayElement(c, i); + pushConstant(marked, stack, value); + } + } + } else { + ResolvedJavaField[] instanceFields = type.getInstanceFields(true); + for (ResolvedJavaField f : instanceFields) { + if (f.getKind() == Kind.Object) { + JavaConstant value = constantReflection.readFieldValue(f, c); + pushConstant(marked, stack, value); + } + } + } + } + } + ArrayList clazzes = new ArrayList<>(); + clazzes.addAll(histogram.keySet()); + Collections.sort(clazzes, new Comparator() { + + @Override + public int compare(ResolvedJavaType o1, ResolvedJavaType o2) { + long l1 = histogram.get(o1).totalSize; + long l2 = histogram.get(o2).totalSize; + if (l1 > l2) { + return -1; + } else if (l1 == l2) { + return 0; + } else { + return 1; + } + } + }); + + int z = 0; + for (ResolvedJavaType c : clazzes) { + if (z > printTopN) { + break; + } + out.println("Class " + c + ", " + histogram.get(c)); + ++z; + } + + return sum; + } + + private static void pushConstant(Set marked, Deque stack, JavaConstant value) { + if (value.isNonNull()) { + if (!marked.contains(value)) { + marked.add(value); + stack.push(value); + } + } + } + + /** + * Calls {@link JavaType#resolve(ResolvedJavaType)} on an array of types. + */ + public static ResolvedJavaType[] resolveJavaTypes(JavaType[] types, ResolvedJavaType accessingClass) { + ResolvedJavaType[] result = new ResolvedJavaType[types.length]; + for (int i = 0; i < result.length; i++) { + result[i] = types[i].resolve(accessingClass); + } + return result; + } + + /** + * Extends the functionality of {@link Class#getSimpleName()} to include a non-empty string for + * anonymous and local classes. + * + * @param clazz the class for which the simple name is being requested + * @param withEnclosingClass specifies if the returned name should be qualified with the name(s) + * of the enclosing class/classes of {@code clazz} (if any). This option is ignored + * if {@code clazz} denotes an anonymous or local class. + * @return the simple name + */ + public static String getSimpleName(Class clazz, boolean withEnclosingClass) { + final String simpleName = clazz.getSimpleName(); + if (simpleName.length() != 0) { + if (withEnclosingClass) { + String prefix = ""; + Class enclosingClass = clazz; + while ((enclosingClass = enclosingClass.getEnclosingClass()) != null) { + prefix = enclosingClass.getSimpleName() + "." + prefix; + } + return prefix + simpleName; + } + return simpleName; + } + // Must be an anonymous or local class + final String name = clazz.getName(); + int index = name.indexOf('$'); + if (index == -1) { + return name; + } + index = name.lastIndexOf('.', index); + if (index == -1) { + return name; + } + return name.substring(index + 1); + } + + static String internalNameToJava(String name, boolean qualified, boolean classForNameCompatible) { + switch (name.charAt(0)) { + case 'L': { + String result = name.substring(1, name.length() - 1).replace('/', '.'); + if (!qualified) { + final int lastDot = result.lastIndexOf('.'); + if (lastDot != -1) { + result = result.substring(lastDot + 1); + } + } + return result; + } + case '[': + return classForNameCompatible ? name.replace('/', '.') : internalNameToJava(name.substring(1), qualified, classForNameCompatible) + "[]"; + default: + if (name.length() != 1) { + throw new IllegalArgumentException("Illegal internal name: " + name); + } + return Kind.fromPrimitiveOrVoidTypeChar(name.charAt(0)).getJavaName(); + } + } + + /** + * 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); + try { + String n = internalNameToJava(internal, true, true); + return metaAccess.lookupJavaType(k.isPrimitive() ? k.toJavaClass() : Class.forName(n, true, cl)); + } catch (ClassNotFoundException cnfe) { + throw new IllegalArgumentException("could not instantiate class described by " + internal, cnfe); + } + } + + /** + * Convenient shortcut for calling + * {@link #appendLocation(StringBuilder, ResolvedJavaMethod, int)} without having to supply a + * {@link StringBuilder} instance and convert the result to a string. + */ + public static String toLocation(ResolvedJavaMethod method, int bci) { + return appendLocation(new StringBuilder(), method, bci).toString(); + } + + /** + * Appends a string representation of a location specified by a given method and bci to a given + * {@link StringBuilder}. If a stack trace element with a non-null file name and non-negative + * line number is {@linkplain ResolvedJavaMethod#asStackTraceElement(int) available} for the + * given method, then the string returned is the {@link StackTraceElement#toString()} value of + * the stack trace element, suffixed by the bci location. For example: + * + *

+     *     java.lang.String.valueOf(String.java:2930) [bci: 12]
+     * 
+ * + * Otherwise, the string returned is the value of applying {@link JavaMethod#format(String)} + * with the format string {@code "%H.%n(%p)"}, suffixed by the bci location. For example: + * + *
+     *     java.lang.String.valueOf(int) [bci: 12]
+     * 
+ * + * @param sb + * @param method + * @param bci + */ + public static StringBuilder appendLocation(StringBuilder sb, ResolvedJavaMethod method, int bci) { + if (method != null) { + StackTraceElement ste = method.asStackTraceElement(bci); + if (ste.getFileName() != null && ste.getLineNumber() > 0) { + sb.append(ste); + } else { + sb.append(method.format("%H.%n(%p)")); + } + } else { + sb.append("Null method"); + } + return sb.append(" [bci: ").append(bci).append(']'); + } + + static void appendProfile(StringBuilder buf, AbstractJavaProfile profile, int bci, String type, String sep) { + if (profile != null) { + AbstractProfiledItem[] pitems = profile.getItems(); + if (pitems != null) { + buf.append(String.format("%s@%d:", type, bci)); + for (int j = 0; j < pitems.length; j++) { + AbstractProfiledItem pitem = pitems[j]; + buf.append(String.format(" %.6f (%s)%s", pitem.getProbability(), pitem.getItem(), sep)); + } + if (profile.getNotRecordedProbability() != 0) { + buf.append(String.format(" %.6f %s", profile.getNotRecordedProbability(), type, sep)); + } else { + buf.append(String.format(" %s", type, sep)); + } + } + } + } + + /** + * Converts a Java source-language class name into the internal form. + * + * @param className the class name + * @return the internal name form of the class name + */ + public static String toInternalName(String className) { + String prefix = ""; + String base = className; + while (base.endsWith("[]")) { + prefix += "["; + base = base.substring(base.length() - 2); + } + + switch (className) { + case "boolean": + return prefix + "Z"; + case "byte": + return prefix + "B"; + case "short": + return prefix + "S"; + case "char": + return prefix + "C"; + case "int": + return prefix + "I"; + case "float": + return prefix + "F"; + case "long": + return prefix + "J"; + case "double": + return prefix + "D"; + case "void": + return prefix + "V"; + default: + return prefix + "L" + className.replace('.', '/') + ";"; + } + } + + /** + * Prepends the String {@code indentation} to every line in String {@code lines}, including a + * possibly non-empty line following the final newline. + */ + public static String indent(String lines, String indentation) { + if (lines.length() == 0) { + return lines; + } + final String newLine = "\n"; + if (lines.endsWith(newLine)) { + return indentation + (lines.substring(0, lines.length() - 1)).replace(newLine, newLine + indentation) + newLine; + } + return indentation + lines.replace(newLine, newLine + indentation); + } + + /** + * Gets a string representation of an object based soley on its class and its + * {@linkplain System#identityHashCode(Object) identity hash code}. This avoids and calls to + * virtual methods on the object such as {@link Object#hashCode()}. + */ + public static String identityHashCodeString(Object obj) { + if (obj == null) { + return "null"; + } + return obj.getClass().getName() + "@" + System.identityHashCode(obj); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/MethodHandleAccessProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/MethodHandleAccessProvider.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.jvmci.meta; + +import java.lang.invoke.*; + +/** + * Interface to access the internals of the {@link MethodHandle} implementation of the VM. An + * implementation of this interface is usually required to access non-public classes, methods, and + * fields of {@link MethodHandle}, i.e., data that is not standardized by the Java specification. + */ +public interface MethodHandleAccessProvider { + + /** + * Identification for methods defined on the class {@link MethodHandle} that are processed by + * the {@link MethodHandleAccessProvider}. + */ + public enum IntrinsicMethod { + /** The method {@code MethodHandle.invokeBasic}. */ + INVOKE_BASIC, + /** The method {@code MethodHandle.linkToStatic}. */ + LINK_TO_STATIC, + /** The method {@code MethodHandle.linkToSpecial}. */ + LINK_TO_SPECIAL, + /** The method {@code MethodHandle.linkToVirtual}. */ + LINK_TO_VIRTUAL, + /** The method {@code MethodHandle.linkToInterface}. */ + LINK_TO_INTERFACE + } + + /** + * Returns the method handle method intrinsic identifier for the provided method, or + * {@code null} if the method is not an intrinsic processed by this interface. + */ + IntrinsicMethod lookupMethodHandleIntrinsic(ResolvedJavaMethod method); + + /** + * Resolves the invocation target for an invocation of {@link IntrinsicMethod#INVOKE_BASIC + * MethodHandle.invokeBasic} with the given constant receiver {@link MethodHandle}. Returns + * {@code null} if the invocation target is not available at this time. + *

+ * The first invocations of a method handle can use an interpreter to lookup the actual invoked + * method; frequently executed method handles can use Java bytecode generation to avoid the + * interpreter overhead. If the parameter forceBytecodeGeneration is set to true, the VM should + * try to generate bytecodes before this method returns. + */ + ResolvedJavaMethod resolveInvokeBasicTarget(JavaConstant methodHandle, boolean forceBytecodeGeneration); + + /** + * Resolves the invocation target for an invocation of a {@code MethodHandle.linkTo*} method + * with the given constant member name. The member name is the last parameter of the + * {@code linkTo*} method. Returns {@code null} if the invocation target is not available at + * this time. + */ + ResolvedJavaMethod resolveLinkToTarget(JavaConstant memberName); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/MethodIdHolder.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/MethodIdHolder.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,93 @@ +/* + * 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 com.oracle.jvmci.meta; + +import java.util.*; +import java.util.function.*; + +/** + * An object that can be assigned a globally unique identifier for use as a key in a + * {@link MethodIdMap}. + */ +public interface MethodIdHolder { + /** + * Sets the unique, positive, non-zero identifier for this method. + */ + void setMethodId(int id); + + /** + * Gets the identifier set by {@link #setMethodId(int)} or 0 if no identifier was assigned to + * this method. + */ + int getMethodId(); + + /** + * A singleton class for allocating globally unique method identifiers. + */ + static final class MethodIdAllocator { + + /** + * Ensures a given method has a unique identifier. + */ + public int assignId(MethodIdHolder holder) { + assert Thread.holdsLock(instance) : "must only be called from within MethodIdHolder.allocateIds"; + int id = holder.getMethodId(); + if (id == 0) { + id = nextId++; + holder.setMethodId(id); + if (idVerifierMap != null) { + idVerifierMap.put(holder, id); + } + } else { + assert !idVerifierMap.containsKey(holder) || idVerifierMap.get(holder) == id; + } + return id; + } + + private int nextId = 1; + private final Map idVerifierMap; + + @SuppressWarnings("all") + private MethodIdAllocator() { + boolean assertionsEnabled = false; + assert assertionsEnabled = true; + idVerifierMap = assertionsEnabled ? new HashMap<>() : null; + } + + /** + * Singleton instance. + */ + private static final MethodIdAllocator instance = new MethodIdAllocator(); + } + + /** + * Executes some given code that ensures some set of {@link ResolvedJavaMethod}s have unique ids + * {@linkplain MethodIdHolder#setMethodId(int) assigned} to them. The + * {@link Consumer#accept(Object)} method of the given object is called under a global lock. + */ + static void assignIds(Consumer methodIdConsumer) { + synchronized (MethodIdAllocator.instance) { + methodIdConsumer.accept(MethodIdAllocator.instance); + } + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/MethodIdMap.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/MethodIdMap.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,236 @@ +/* + * 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 com.oracle.jvmci.meta; + +import java.lang.reflect.*; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import com.oracle.jvmci.meta.MethodIdHolder.MethodIdAllocator; + +/** + * A map whose keys are {@link MethodIdHolder}s. This data structure can be used for mapping + * identifiers to methods without requiring eager resolution of the latter (e.g., to + * {@link ResolvedJavaMethod}s) and has retrieval as fast as array indexing. The constraints on + * using such a map are: + *

    + *
  • at most one value can be added for any key
  • + *
  • no more entries can be added after the first {@linkplain #get(MethodIdHolder) retrieval}
  • + *
+ * + * @param the type of the values in the map + */ +public class MethodIdMap { + + /** + * Key for a method. + */ + public static class MethodKey { + final boolean isStatic; + final Class declaringClass; + final String name; + final Class[] argumentTypes; + final T value; + int id; + + MethodKey(T data, boolean isStatic, Class declaringClass, String name, Class... argumentTypes) { + assert isStatic || argumentTypes[0] == declaringClass; + this.value = data; + this.isStatic = isStatic; + this.declaringClass = declaringClass; + this.name = name; + this.argumentTypes = argumentTypes; + assert resolveJava() != null; + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof MethodKey) { + MethodKey that = (MethodKey) obj; + boolean res = this.name.equals(that.name) && this.declaringClass.equals(that.declaringClass) && Arrays.equals(this.argumentTypes, that.argumentTypes); + assert !res || this.isStatic == that.isStatic; + return res; + } + return false; + } + + public int getDeclaredParameterCount() { + return isStatic ? argumentTypes.length : argumentTypes.length - 1; + } + + @Override + public int hashCode() { + // Replay compilation mandates use of stable hash codes + return declaringClass.getName().hashCode() ^ name.hashCode(); + } + + private MethodIdHolder resolve(MetaAccessProvider metaAccess) { + return (MethodIdHolder) metaAccess.lookupJavaMethod(resolveJava()); + } + + private Executable resolveJava() { + try { + Executable res; + Class[] parameterTypes = isStatic ? argumentTypes : Arrays.copyOfRange(argumentTypes, 1, argumentTypes.length); + if (name.equals("")) { + res = declaringClass.getDeclaredConstructor(parameterTypes); + } else { + res = declaringClass.getDeclaredMethod(name, parameterTypes); + } + assert Modifier.isStatic(res.getModifiers()) == isStatic; + return res; + } catch (NoSuchMethodException | SecurityException e) { + throw new InternalError(e); + } + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(declaringClass.getName()).append('.').append(name).append('('); + for (Class p : argumentTypes) { + if (sb.charAt(sb.length() - 1) != '(') { + sb.append(", "); + } + sb.append(p.getSimpleName()); + } + return sb.append(')').toString(); + } + } + + private final MetaAccessProvider metaAccess; + + /** + * Initial list of entries. + */ + private final List> registrations; + + /** + * Entry array that is initialized upon first call to {@link #get(MethodIdHolder)}. + * + * Note: this must be volatile since double-checked locking is used to initialize it + */ + private volatile V[] entries; + + /** + * The minimum {@linkplain MethodIdHolder#getMethodId() id} for a key in this map. + */ + private int minId = Integer.MAX_VALUE; + + public MethodIdMap(MetaAccessProvider metaAccess) { + this.metaAccess = metaAccess; + this.registrations = new ArrayList<>(INITIAL_CAPACITY); + } + + private static final int INITIAL_CAPACITY = 64; + + /** + * Adds an entry to this map for a specified method. + * + * @param value value to be associated with the specified method + * @param isStatic specifies if the method is static + * @param declaringClass the class declaring the method + * @param name the name of the method + * @param argumentTypes the argument types of the method. Element 0 of this array must be + * {@code declaringClass} iff the method is non-static. + * @return an object representing the method + */ + public MethodKey put(V value, boolean isStatic, Class declaringClass, String name, Class... argumentTypes) { + assert isStatic || argumentTypes[0] == declaringClass; + MethodKey methodKey = new MethodKey<>(value, isStatic, declaringClass, name, argumentTypes); + assert entries == null : "registration is closed"; + assert !registrations.contains(methodKey) : "a value is already registered for " + methodKey; + registrations.add(methodKey); + return methodKey; + } + + @SuppressWarnings("unchecked") + protected V[] allocateEntries(int length) { + return (V[]) new Object[length]; + } + + /** + * Determines if a method denoted by a given {@link MethodKey} is in this map. + */ + public boolean containsKey(MethodKey key) { + return registrations.contains(key); + } + + public V get(MethodIdHolder method) { + if (entries == null) { + createEntries(); + } + + int id = method.getMethodId(); + int index = id - minId; + return index >= 0 && index < entries.length ? entries[index] : null; + } + + public void createEntries() { + // 'assignIds' synchronizes on a global lock which ensures thread safe + // allocation of identifiers across all MethodIdHolder objects + MethodIdHolder.assignIds(new Consumer() { + + public void accept(MethodIdAllocator idAllocator) { + if (entries == null) { + if (registrations.isEmpty()) { + entries = allocateEntries(0); + } else { + int max = Integer.MIN_VALUE; + for (MethodKey methodKey : registrations) { + MethodIdHolder m = methodKey.resolve(metaAccess); + int id = idAllocator.assignId(m); + if (id < minId) { + minId = id; + } + if (id > max) { + max = id; + } + methodKey.id = id; + } + + int length = (max - minId) + 1; + entries = allocateEntries(length); + for (MethodKey m : registrations) { + int index = m.id - minId; + entries[index] = m.value; + } + } + } + } + }); + } + + @Override + public String toString() { + return registrations.stream().map(MethodKey::toString).collect(Collectors.joining(", ")); + } + + public MetaAccessProvider getMetaAccess() { + return metaAccess; + } + + public int size() { + return registrations.size(); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ModifiersProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ModifiersProvider.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,140 @@ +/* + * 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 com.oracle.jvmci.meta; + +import static java.lang.reflect.Modifier.*; + +import java.lang.reflect.*; + +/** + * A Java element (i.e., a class, interface, field or method) that is described by a set of Java + * language {@linkplain #getModifiers() modifiers}. + */ +public interface ModifiersProvider { + + /** + * Returns the Java language modifiers for this element. + */ + int getModifiers(); + + /** + * @see Modifier#isInterface(int) + */ + default boolean isInterface() { + return Modifier.isInterface(getModifiers()); + } + + /** + * @see Modifier#isSynchronized(int) + */ + default boolean isSynchronized() { + return Modifier.isSynchronized(getModifiers()); + } + + /** + * @see Modifier#isStatic(int) + */ + default boolean isStatic() { + return Modifier.isStatic(getModifiers()); + } + + /** + * @see Modifier#isFinal(int) + */ + default boolean isFinal() { + return Modifier.isFinal(getModifiers()); + } + + /** + * @see Modifier#isPublic(int) + */ + default boolean isPublic() { + return Modifier.isPublic(getModifiers()); + } + + /** + * Determines if this element is neither {@linkplain #isPublic() public}, + * {@linkplain #isProtected() protected} nor {@linkplain #isPrivate() private}. + */ + default boolean isPackagePrivate() { + return ((PUBLIC | PROTECTED | PRIVATE) & getModifiers()) == 0; + } + + /** + * @see Modifier#isPrivate(int) + */ + default boolean isPrivate() { + return Modifier.isPrivate(getModifiers()); + } + + /** + * @see Modifier#isProtected(int) + */ + default boolean isProtected() { + return Modifier.isProtected(getModifiers()); + } + + /** + * @see Modifier#isTransient(int) + */ + default boolean isTransient() { + return Modifier.isTransient(getModifiers()); + } + + /** + * @see Modifier#isStrict(int) + */ + default boolean isStrict() { + return Modifier.isStrict(getModifiers()); + } + + /** + * @see Modifier#isVolatile(int) + */ + default boolean isVolatile() { + return Modifier.isVolatile(getModifiers()); + } + + /** + * @see Modifier#isNative(int) + */ + default boolean isNative() { + return Modifier.isNative(getModifiers()); + } + + /** + * @see Modifier#isAbstract(int) + */ + default boolean isAbstract() { + return Modifier.isAbstract(getModifiers()); + } + + /** + * Checks that the method is concrete and not abstract. + * + * @return whether the method is a concrete method + */ + default boolean isConcrete() { + return !isAbstract(); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/NamedLocationIdentity.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/NamedLocationIdentity.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,118 @@ +/* + * 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. + */ +package com.oracle.jvmci.meta; + +import java.util.*; + +import com.oracle.jvmci.meta.Kind.FormatWithToString; + +/** + * A {@link LocationIdentity} with a name. + */ +public final class NamedLocationIdentity extends LocationIdentity implements FormatWithToString { + + /** + * Map for asserting all {@link NamedLocationIdentity} instances have a unique name. + */ + static class DB { + private static final HashMap map = new HashMap<>(); + + static boolean checkUnique(NamedLocationIdentity identity) { + NamedLocationIdentity oldValue = map.put(identity.name, identity); + if (oldValue != null) { + throw new AssertionError("identity " + identity + " already exists"); + } + return true; + } + } + + private final String name; + private final boolean immutable; + + private NamedLocationIdentity(String name, boolean immutable) { + this.name = name; + this.immutable = immutable; + } + + /** + * Creates a named unique location identity for read and write operations against mutable + * memory. + * + * @param name the name of the new location identity + */ + public static NamedLocationIdentity mutable(String name) { + return create(name, false); + } + + /** + * Creates a named unique location identity for read operations against immutable memory. + * Immutable memory will never have a visible write in the graph, which is more restictive than + * Java final. + * + * @param name the name of the new location identity + */ + public static NamedLocationIdentity immutable(String name) { + return create(name, true); + } + + /** + * Creates a named unique location identity for read and write operations. + * + * @param name the name of the new location identity + * @param immutable true if the location is immutable + */ + private static NamedLocationIdentity create(String name, boolean immutable) { + NamedLocationIdentity id = new NamedLocationIdentity(name, immutable); + assert DB.checkUnique(id); + return id; + } + + @Override + public boolean isImmutable() { + return immutable; + } + + @Override + public String toString() { + return name + (isImmutable() ? ":final" : ""); + } + + /** + * Returns the named location identity for an array of the given element kind. Array accesses of + * the same kind must have the same location identity unless an alias analysis guarantees that + * two distinct arrays are accessed. + */ + public static LocationIdentity getArrayLocation(Kind elementKind) { + return ARRAY_LOCATIONS.get(elementKind); + } + + private static final EnumMap ARRAY_LOCATIONS = initArrayLocations(); + + private static EnumMap initArrayLocations() { + EnumMap result = new EnumMap<>(Kind.class); + for (Kind kind : Kind.values()) { + result.put(kind, NamedLocationIdentity.mutable("Array: " + kind.getJavaName())); + } + return result; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/NullConstant.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/NullConstant.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.jvmci.meta; + +/** + * The implementation type of the {@link JavaConstant#NULL_POINTER null constant}. + */ +final class NullConstant extends AbstractValue implements JavaConstant { + + protected NullConstant() { + super(LIRKind.reference(Kind.Object)); + } + + @Override + public boolean isNull() { + return true; + } + + @Override + public boolean isDefaultForKind() { + return true; + } + + @Override + public Object asBoxedPrimitive() { + throw new IllegalArgumentException(); + } + + @Override + public int asInt() { + throw new IllegalArgumentException(); + } + + @Override + public boolean asBoolean() { + throw new IllegalArgumentException(); + } + + @Override + public long asLong() { + throw new IllegalArgumentException(); + } + + @Override + public float asFloat() { + throw new IllegalArgumentException(); + } + + @Override + public double asDouble() { + throw new IllegalArgumentException(); + } + + @Override + public String toString() { + return JavaConstant.toString(this); + } + + @Override + public String toValueString() { + return "null"; + } + + @Override + public int hashCode() { + return 13; + } + + @Override + public boolean equals(Object o) { + return o instanceof NullConstant; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/PlatformKind.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/PlatformKind.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2013, 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 com.oracle.jvmci.meta; + +/** + * Represents a platform-specific low-level type for values. + */ +public interface PlatformKind { + + String name(); + + JavaConstant getDefaultValue(); + + public interface Key { + + } + + public class EnumKey implements Key { + @SuppressWarnings("rawtypes") private final Enum e; + + @SuppressWarnings("rawtypes") + public EnumKey(Enum e) { + this.e = e; + } + + @Override + public int hashCode() { + return e.ordinal() ^ e.name().hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj instanceof EnumKey) { + EnumKey that = (EnumKey) obj; + return this.e == that.e; + } + return false; + } + } + + /** + * Gets a value associated with this object that can be used as a stable key in a map. The + * {@link Object#hashCode()} implementation of the returned value should be stable between VM + * executions. + */ + Key getKey(); + + default int getVectorLength() { + return 1; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/PrimitiveConstant.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/PrimitiveConstant.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,164 @@ +/* + * 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 com.oracle.jvmci.meta; + +import java.nio.*; + +/** + * 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 { + + /** + * The boxed primitive value as a {@code long}. For {@code float} and {@code double} values, + * this value is the result of {@link Float#floatToRawIntBits(float)} and + * {@link Double#doubleToRawLongBits(double)} respectively. + */ + private final long primitive; + + protected PrimitiveConstant(Kind kind, long primitive) { + super(LIRKind.value(kind)); + this.primitive = primitive; + + assert kind.isPrimitive() || kind == Kind.Illegal; + } + + @Override + public boolean isNull() { + return false; + } + + @Override + public boolean isDefaultForKind() { + return primitive == 0; + } + + @Override + public boolean asBoolean() { + assert getKind() == Kind.Boolean; + return primitive != 0L; + } + + @Override + public int asInt() { + assert getKind().getStackKind() == Kind.Int : getKind().getStackKind(); + return (int) primitive; + } + + @Override + public long asLong() { + assert getKind().isNumericInteger(); + return primitive; + } + + @Override + public float asFloat() { + assert getKind() == Kind.Float; + return Float.intBitsToFloat((int) primitive); + } + + @Override + public double asDouble() { + assert getKind() == Kind.Double; + return Double.longBitsToDouble(primitive); + } + + @Override + public Object asBoxedPrimitive() { + switch (getKind()) { + case Byte: + return Byte.valueOf((byte) primitive); + case Boolean: + return Boolean.valueOf(asBoolean()); + case Short: + return Short.valueOf((short) primitive); + case Char: + return Character.valueOf((char) primitive); + case Int: + return Integer.valueOf(asInt()); + case Long: + return Long.valueOf(asLong()); + case Float: + return Float.valueOf(asFloat()); + case Double: + return Double.valueOf(asDouble()); + default: + throw new IllegalArgumentException("unexpected kind " + getKind()); + } + } + + @Override + public int getSerializedSize() { + return getKind().getByteCount(); + } + + @Override + public void serialize(ByteBuffer buffer) { + switch (getKind()) { + case Byte: + case Boolean: + buffer.put((byte) primitive); + break; + case Short: + buffer.putShort((short) primitive); + break; + case Char: + buffer.putChar((char) primitive); + break; + case Int: + buffer.putInt(asInt()); + break; + case Long: + buffer.putLong(asLong()); + break; + case Float: + buffer.putFloat(asFloat()); + break; + case Double: + buffer.putDouble(asDouble()); + break; + default: + throw new IllegalArgumentException("unexpected kind " + getKind()); + } + } + + @Override + public int hashCode() { + return (int) (primitive ^ (primitive >>> 32)) * (getKind().ordinal() + 31); + } + + @Override + public boolean equals(Object o) { + return o == this || (o instanceof PrimitiveConstant && super.equals(o) && primitive == ((PrimitiveConstant) o).primitive); + } + + @Override + public String toString() { + if (getKind() == Kind.Illegal) { + return "illegal"; + } else { + return getKind().getJavaName() + "[" + asBoxedPrimitive() + "|0x" + Long.toHexString(primitive) + "]"; + } + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ProfilingInfo.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ProfilingInfo.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,199 @@ +/* + * 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 com.oracle.jvmci.meta; + +/** + * Provides access to the profiling information of one specific method. Every accessor method + * returns the information that is available at the time of invocation. If a method is invoked + * multiple times, it may return significantly different results for every invocation as the + * profiling information may be changed by other Java threads at any time. + */ +public interface ProfilingInfo { + + /** + * Returns the length of the bytecodes associated with this profile. + */ + int getCodeSize(); + + /** + * Returns an estimate of how often the branch at the given byte code was taken. + * + * @return The estimated probability, with 0.0 meaning never and 1.0 meaning always, or -1 if + * this information is not available. + */ + double getBranchTakenProbability(int bci); + + /** + * Returns an estimate of how often the switch cases are taken at the given BCI. The default + * case is stored as the last entry. + * + * @return A double value that contains the estimated probabilities, with 0.0 meaning never and + * 1.0 meaning always, or -1 if this information is not available. + */ + double[] getSwitchProbabilities(int bci); + + /** + * Returns the TypeProfile for the given BCI. + * + * @return Returns a JavaTypeProfile object, or null if not available. + */ + JavaTypeProfile getTypeProfile(int bci); + + /** + * Returns the MethodProfile for the given BCI. + * + * @return Returns a JavaMethodProfile object, or null if not available. + */ + JavaMethodProfile getMethodProfile(int bci); + + /** + * Returns information if the given BCI did ever throw an exception. + * + * @return {@link TriState#TRUE} if the instruction has thrown an exception at least once, + * {@link TriState#FALSE} if it never threw an exception, and {@link TriState#UNKNOWN} + * if this information was not recorded. + */ + TriState getExceptionSeen(int bci); + + /** + * Returns information if null was ever seen for the given BCI. This information is collected + * for the aastore, checkcast and instanceof bytecodes. + * + * @return {@link TriState#TRUE} if null was seen for the instruction, {@link TriState#FALSE} if + * null was NOT seen, and {@link TriState#UNKNOWN} if this information was not recorded. + */ + TriState getNullSeen(int bci); + + /** + * Returns an estimate how often the current BCI was executed. Avoid comparing execution counts + * to each other, as the returned value highly depends on the time of invocation. + * + * @return the estimated execution count or -1 if not available. + */ + int getExecutionCount(int bci); + + /** + * Returns how frequently a method was deoptimized for the given deoptimization reason. This + * only indicates how often the method did fall back to the interpreter for the execution and + * does not indicate how often it was recompiled. + * + * @param reason the reason for which the number of deoptimizations should be queried + * @return the number of times the compiled method deoptimized for the given reason. + */ + int getDeoptimizationCount(DeoptimizationReason reason); + + /** + * Records the size of the compiler intermediate representation (IR) associated with this + * method. + * + * @param irType the IR type for which the size is being recorded + * @param irSize the IR size to be recorded. The unit depends on the IR. + * @return whether recording this information for {@code irType} is supported + */ + boolean setCompilerIRSize(Class irType, int irSize); + + /** + * Gets the size of the compiler intermediate representation (IR) associated with this method + * last recorded by {@link #setCompilerIRSize(Class, int)}. + * + * @param irType the IR type for which the size is being requested + * @return the requested IR size or -1 if it is unavailable for {@code irType} + */ + int getCompilerIRSize(Class irType); + + /** + * Returns true if the profiling information can be assumed as sufficiently accurate. + * + * @return true if the profiling information was recorded often enough mature enough, false + * otherwise. + */ + boolean isMature(); + + /** + * Force data to be treated as mature if possible. + */ + void setMature(); + + /** + * Formats this profiling information to a string. + * + * @param method an optional method that augments the profile string returned + * @param sep the separator to use for each separate profile record + */ + default String toString(ResolvedJavaMethod method, String sep) { + StringBuilder buf = new StringBuilder(100); + if (method != null) { + buf.append(String.format("canBeStaticallyBound: %b%s", method.canBeStaticallyBound(), sep)); + } + for (int i = 0; i < getCodeSize(); i++) { + if (getExecutionCount(i) != -1) { + buf.append(String.format("executionCount@%d: %d%s", i, getExecutionCount(i), sep)); + } + + if (getBranchTakenProbability(i) != -1) { + buf.append(String.format("branchProbability@%d: %.6f%s", i, getBranchTakenProbability(i), sep)); + } + + double[] switchProbabilities = getSwitchProbabilities(i); + if (switchProbabilities != null) { + buf.append(String.format("switchProbabilities@%d:", i)); + for (int j = 0; j < switchProbabilities.length; j++) { + buf.append(String.format(" %.6f", switchProbabilities[j])); + } + buf.append(sep); + } + + if (getExceptionSeen(i) != TriState.UNKNOWN) { + buf.append(String.format("exceptionSeen@%d: %s%s", i, getExceptionSeen(i).name(), sep)); + } + + if (getNullSeen(i) != TriState.UNKNOWN) { + buf.append(String.format("nullSeen@%d: %s%s", i, getNullSeen(i).name(), sep)); + } + + JavaTypeProfile typeProfile = getTypeProfile(i); + MetaUtil.appendProfile(buf, typeProfile, i, "types", sep); + + JavaMethodProfile methodProfile = getMethodProfile(i); + MetaUtil.appendProfile(buf, methodProfile, i, "methods", sep); + } + + boolean firstDeoptReason = true; + for (DeoptimizationReason reason : DeoptimizationReason.values()) { + int count = getDeoptimizationCount(reason); + if (count > 0) { + if (firstDeoptReason) { + buf.append("deoptimization history").append(sep); + firstDeoptReason = false; + } + buf.append(String.format(" %s: %d%s", reason.name(), count, sep)); + } + } + if (buf.length() == 0) { + return ""; + } + String s = buf.toString(); + return s.substring(0, s.length() - sep.length()); + } + +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/RawConstant.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/RawConstant.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,30 @@ +/* + * 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 com.oracle.jvmci.meta; + +public class RawConstant extends PrimitiveConstant { + + public RawConstant(long rawValue) { + super(Kind.Int, rawValue); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ResolvedJavaField.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ResolvedJavaField.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,75 @@ +/* + * 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 com.oracle.jvmci.meta; + +import java.lang.annotation.*; +import java.lang.reflect.*; + +/** + * Represents a reference to a resolved Java field. Fields, like methods and types, are resolved + * through {@link ConstantPool constant pools}. + */ +public interface ResolvedJavaField extends JavaField, ModifiersProvider { + + /** + * {@inheritDoc} + *

+ * Only the {@linkplain Modifier#fieldModifiers() field flags} specified in the JVM + * specification will be included in the returned mask. + */ + int getModifiers(); + + /** + * Determines if this field was injected by the VM. Such a field, for example, is not derived + * from a class file. + */ + boolean isInternal(); + + /** + * Determines if this field is a synthetic field as defined by the Java Language Specification. + */ + boolean isSynthetic(); + + /** + * Returns the {@link ResolvedJavaType} object representing the class or interface that declares + * this field. + */ + ResolvedJavaType getDeclaringClass(); + + /** + * Returns the annotation for the specified type of this field, if such an annotation is + * present. + * + * @param annotationClass the Class object corresponding to the annotation type + * @return this element's annotation for the specified annotation type if present on this field, + * else {@code null} + */ + T getAnnotation(Class annotationClass); + + /** + * Returns an object representing the unique location identity of this resolved Java field. + * + * @return the location identity of the field + */ + LocationIdentity getLocationIdentity(); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ResolvedJavaMethod.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ResolvedJavaMethod.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,298 @@ +/* + * 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 com.oracle.jvmci.meta; + +import java.lang.annotation.*; +import java.lang.reflect.*; + +/** + * Represents a resolved Java method. Methods, like fields and types, are resolved through + * {@link ConstantPool constant pools}. + */ +public interface ResolvedJavaMethod extends JavaMethod, InvokeTarget, ModifiersProvider { + + /** + * Returns the bytecode of this method, if the method has code. The returned byte array does not + * contain breakpoints or non-Java bytecodes. This may return null if the + * {@link #getDeclaringClass() holder} is not {@link ResolvedJavaType#isLinked() linked}. + * + * The contained constant pool indices may not be the ones found in the original class file but + * they can be used with the Graal API (e.g. methods in {@link ConstantPool}). + * + * @return the bytecode of the method, or {@code null} if {@code getCodeSize() == 0} or if the + * code is not ready. + */ + byte[] getCode(); + + /** + * Returns the size of the bytecode of this method, if the method has code. This is equivalent + * to {@link #getCode()}. {@code length} if the method has code. + * + * @return the size of the bytecode in bytes, or 0 if no bytecode is available + */ + int getCodeSize(); + + /** + * Returns the {@link ResolvedJavaType} object representing the class or interface that declares + * this method. + */ + ResolvedJavaType getDeclaringClass(); + + /** + * Returns the maximum number of locals used in this method's bytecodes. + */ + int getMaxLocals(); + + /** + * Returns the maximum number of stack slots used in this method's bytecodes. + */ + int getMaxStackSize(); + + /** + * {@inheritDoc} + *

+ * Only the {@linkplain Modifier#methodModifiers() method flags} specified in the JVM + * specification will be included in the returned mask. + */ + int getModifiers(); + + /** + * Determines if this method is a synthetic method as defined by the Java Language + * Specification. + */ + boolean isSynthetic(); + + /** + * Returns {@code true} if this method is a default method; returns {@code false} otherwise. + * + * A default method is a public non-abstract instance method, that is, a non-static method with + * a body, declared in an interface type. + * + * @return true if and only if this method is a default method as defined by the Java Language + * Specification. + */ + boolean isDefault(); + + /** + * Checks whether this method is a class initializer. + * + * @return {@code true} if the method is a class initializer + */ + boolean isClassInitializer(); + + /** + * Checks whether this method is a constructor. + * + * @return {@code true} if the method is a constructor + */ + boolean isConstructor(); + + /** + * Checks whether this method can be statically bound (usually, that means it is final or + * private or static, but not abstract, or the declaring class is final). + * + * @return {@code true} if this method can be statically bound + */ + boolean canBeStaticallyBound(); + + /** + * Returns the list of exception handlers for this method. + */ + ExceptionHandler[] getExceptionHandlers(); + + /** + * Returns a stack trace element for this method and a given bytecode index. + */ + StackTraceElement asStackTraceElement(int bci); + + /** + * Returns an object that provides access to the profiling information recorded for this method. + */ + ProfilingInfo getProfilingInfo(); + + /** + * Invalidates the profiling information and restarts profiling upon the next invocation. + */ + void reprofile(); + + /** + * Returns the constant pool of this method. + */ + ConstantPool getConstantPool(); + + /** + * Returns all annotations of this method. If no annotations are present, an array of length 0 + * is returned. + */ + Annotation[] getAnnotations(); + + /** + * Returns the annotation for the specified type of this method, if such an annotation is + * present. + * + * @param annotationClass the Class object corresponding to the annotation type + * @return this element's annotation for the specified annotation type if present on this + * method, else {@code null} + */ + T getAnnotation(Class annotationClass); + + /** + * Returns an array of arrays that represent the annotations on the formal parameters, in + * declaration order, of this method. + * + * @see Method#getParameterAnnotations() + */ + Annotation[][] getParameterAnnotations(); + + /** + * Returns an array of {@link Type} objects that represent the formal parameter types, in + * declaration order, of this method. + * + * @see Method#getGenericParameterTypes() + */ + Type[] getGenericParameterTypes(); + + /** + * Returns {@code true} if this method is not excluded from inlining and has associated Java + * bytecodes (@see {@link ResolvedJavaMethod#hasBytecodes()}). + */ + boolean canBeInlined(); + + /** + * Returns {@code true} if the inlining of this method should be forced. + */ + boolean shouldBeInlined(); + + /** + * Returns the LineNumberTable of this method or null if this method does not have a line + * numbers table. + */ + LineNumberTable getLineNumberTable(); + + /** + * Returns the local variable table of this method or null if this method does not have a local + * variable table. + */ + LocalVariableTable getLocalVariableTable(); + + /** + * Invokes the underlying method represented by this object, on the specified object with the + * specified parameters. This method is similar to a reflective method invocation by + * {@link Method#invoke}. + * + * @param receiver The receiver for the invocation, or {@code null} if it is a static method. + * @param arguments The arguments for the invocation. + * @return The value returned by the method invocation, or {@code null} if the return type is + * {@code void}. + */ + JavaConstant invoke(JavaConstant receiver, JavaConstant[] arguments); + + /** + * Gets the encoding of (that is, a constant representing the value of) this method. + * + * @return a constant representing a reference to this method + */ + Constant getEncoding(); + + /** + * Checks if this method is present in the virtual table for subtypes of the specified + * {@linkplain ResolvedJavaType type}. + * + * @return true is this method is present in the virtual table for subtypes of this type. + */ + boolean isInVirtualMethodTable(ResolvedJavaType resolved); + + /** + * Gets the annotation of a particular type for a formal parameter of this method. + * + * @param annotationClass the Class object corresponding to the annotation type + * @param parameterIndex the index of a formal parameter of {@code method} + * @return the annotation of type {@code annotationClass} for the formal parameter present, else + * null + * @throws IndexOutOfBoundsException if {@code parameterIndex} does not denote a formal + * parameter + */ + default T getParameterAnnotation(Class annotationClass, int parameterIndex) { + if (parameterIndex >= 0) { + Annotation[][] parameterAnnotations = getParameterAnnotations(); + for (Annotation a : parameterAnnotations[parameterIndex]) { + if (a.annotationType() == annotationClass) { + return annotationClass.cast(a); + } + } + } + return null; + } + + default JavaType[] toParameterTypes() { + JavaType receiver = isStatic() || isConstructor() ? null : getDeclaringClass(); + return getSignature().toParameterTypes(receiver); + } + + /** + * Gets the annotations of a particular type for the formal parameters of this method. + * + * @param annotationClass the Class object corresponding to the annotation type + * @return the annotation of type {@code annotationClass} (if any) for each formal parameter + * present + */ + @SuppressWarnings("unchecked") + default T[] getParameterAnnotations(Class annotationClass) { + Annotation[][] parameterAnnotations = getParameterAnnotations(); + T[] result = (T[]) Array.newInstance(annotationClass, parameterAnnotations.length); + for (int i = 0; i < parameterAnnotations.length; i++) { + for (Annotation a : parameterAnnotations[i]) { + if (a.annotationType() == annotationClass) { + result[i] = annotationClass.cast(a); + } + } + } + return result; + } + + /** + * Checks whether the method has bytecodes associated with it. Methods without bytecodes are + * either abstract or native methods. + * + * @return whether the definition of this method is Java bytecodes + */ + default boolean hasBytecodes() { + return isConcrete() && !isNative(); + } + + /** + * Checks whether the method has a receiver parameter - i.e., whether it is not static. + * + * @return whether the method has a receiver parameter + */ + default boolean hasReceiver() { + return !isStatic(); + } + + /** + * Determines if this method is {@link java.lang.Object#Object()}. + */ + default boolean isJavaLangObjectInit() { + return getDeclaringClass().isJavaLangObject() && getName().equals(""); + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ResolvedJavaType.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/ResolvedJavaType.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,354 @@ +/* + * 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 com.oracle.jvmci.meta; + +import java.lang.annotation.*; +import java.net.*; + +import com.oracle.jvmci.meta.Assumptions.AssumptionResult; + +/** + * Represents a resolved Java type. Types include primitives, objects, {@code void}, and arrays + * thereof. Types, like fields and methods, are resolved through {@link ConstantPool constant pools} + * . + */ +public interface ResolvedJavaType extends JavaType, ModifiersProvider { + + /** + * Gets the runtime representation of the Java class object of this type. + */ + JavaConstant getJavaClass(); + + /** + * Gets the runtime representation of the "hub" of this type--that is, the closest part of the + * type representation which is typically stored in the object header. + */ + Constant getObjectHub(); + + /** + * Checks whether this type has a finalizer method. + * + * @return {@code true} if this class has a finalizer + */ + boolean hasFinalizer(); + + /** + * Checks whether this type has any finalizable subclasses so far. Any decisions based on this + * information require the registration of a dependency, since this information may change. + * + * @return {@code true} if this class has any subclasses with finalizers + */ + AssumptionResult hasFinalizableSubclass(); + + /** + * Checks whether this type is an interface. + * + * @return {@code true} if this type is an interface + */ + boolean isInterface(); + + /** + * Checks whether this type is an instance class. + * + * @return {@code true} if this type is an instance class + */ + boolean isInstanceClass(); + + /** + * Checks whether this type is an array class. + * + * @return {@code true} if this type is an array class + */ + boolean isArray(); + + /** + * Checks whether this type is primitive. + * + * @return {@code true} if this type is primitive + */ + boolean isPrimitive(); + + /** + * {@inheritDoc} + *

+ * Only the flags specified in the JVM specification will be included in the returned mask. This + * method is identical to {@link Class#getModifiers()} in terms of the value return for this + * type. + */ + int getModifiers(); + + /** + * Checks whether this type is initialized. If a type is initialized it implies that it was + * {@link #isLinked() linked} and that the static initializer has run. + * + * @return {@code true} if this type is initialized + */ + boolean isInitialized(); + + /** + * Initializes this type. + */ + void initialize(); + + /** + * Checks whether this type is linked and verified. When a type is linked the static initializer + * has not necessarily run. An {@link #isInitialized() initialized} type is always linked. + * + * @return {@code true} if this type is linked + */ + boolean isLinked(); + + /** + * Determines if this type is either the same as, or is a superclass or superinterface of, the + * type represented by the specified parameter. This method is identical to + * {@link Class#isAssignableFrom(Class)} in terms of the value return for this type. + */ + boolean isAssignableFrom(ResolvedJavaType other); + + /** + * Returns true if this type is exactly the type {@link java.lang.Object}. + */ + default boolean isJavaLangObject() { + // Removed assertion due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=434442 + return getSuperclass() == null && !isInterface() && getKind() == Kind.Object; + } + + /** + * Checks whether the specified object is an instance of this type. + * + * @param obj the object to test + * @return {@code true} if the object is an instance of this type + */ + boolean isInstance(JavaConstant obj); + + /** + * Returns this type if it is an exact type otherwise returns null. This type is exact if it is + * void, primitive, final, or an array of a final or primitive type. + * + * @return this type if it is exact; {@code null} otherwise + */ + ResolvedJavaType asExactType(); + + /** + * Gets the super class of this type. If this type represents either the {@code Object} class, + * an interface, a primitive type, or void, then null is returned. If this object represents an + * array class then the type object representing the {@code Object} class is returned. + */ + ResolvedJavaType getSuperclass(); + + /** + * Gets the interfaces implemented or extended by this type. This method is analogous to + * {@link Class#getInterfaces()} and as such, only returns the interfaces directly implemented + * or extended by this type. + */ + ResolvedJavaType[] getInterfaces(); + + /** + * Gets the single implementor of this type. Calling this method on a non-interface type causes + * an exception. + *

+ * If the compiler uses the result of this method for its compilation, the usage must be guarded + * because the verifier can not guarantee that the assigned type really implements this + * interface. Additionally, class loading can invalidate the result of this method. + * + * @return {@code null} if there is no implementor, the implementor if there is only one, or + * {@code this} if there are more than one. + */ + ResolvedJavaType getSingleImplementor(); + + /** + * Walks the class hierarchy upwards and returns the least common class that is a superclass of + * both the current and the given type. + * + * @return the least common type that is a super type of both the current and the given type, or + * {@code null} if primitive types are involved. + */ + ResolvedJavaType findLeastCommonAncestor(ResolvedJavaType otherType); + + /** + * Attempts to get a leaf concrete subclass of this type. + *

+ * For an {@linkplain #isArray() array} type A, the leaf concrete subclass is A if the + * {@linkplain #getElementalType() elemental} type of A is final (which includes primitive + * types). Otherwise {@code null} is returned for A. + *

+ * For a non-array type T, the result is the leaf concrete type in the current hierarchy of T. + *

+ * A runtime may decide not to manage or walk a large hierarchy and so the result is + * conservative. That is, a non-null result is guaranteed to be the leaf concrete class in T's + * hierarchy at the current point in time but a null result does not necessarily imply + * that there is no leaf concrete class in T's hierarchy. + *

+ * If the compiler uses the result of this method for its compilation, it must register the + * {@link AssumptionResult} in its {@link Assumptions} because dynamic class loading can + * invalidate the result of this method. + * + * @return an {@link AssumptionResult} containing the leaf concrete subclass for this type as + * described above + */ + AssumptionResult findLeafConcreteSubtype(); + + ResolvedJavaType getComponentType(); + + default ResolvedJavaType getElementalType() { + ResolvedJavaType t = this; + while (t.isArray()) { + t = t.getComponentType(); + } + return t; + } + + ResolvedJavaType getArrayClass(); + + /** + * Resolves the method implementation for virtual dispatches on objects of this dynamic type. + * This resolution process only searches "up" the class hierarchy of this type. + * + * @param method the method to select the implementation of + * @param callerType the caller or context type used to perform access checks + * @param includeAbstract whether abstract methods should be returned. If it is {@code false} + * this method behaves like {@link #resolveConcreteMethod}. This is just a temporary + * parameter to highlight the changed semantics of this method. TODO (je) remove this + * flag. + * @return the link-time resolved method (might be abstract) or {@code null} if it can not be + * linked + */ + ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method, ResolvedJavaType callerType, boolean includeAbstract); + + /** + * Resolves the method implementation for virtual dispatches on objects of this dynamic type. + * This resolution process only searches "up" the class hierarchy of this type. A broader search + * that also walks "down" the hierarchy is implemented by + * {@link #findUniqueConcreteMethod(ResolvedJavaMethod)}. + * + * @param method the method to select the implementation of + * @param callerType the caller or context type used to perform access checks + * @return the concrete method that would be selected at runtime, or {@code null} if there is no + * concrete implementation of {@code method} in this type or any of its superclasses + */ + ResolvedJavaMethod resolveConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType callerType); + + /** + * Given a {@link ResolvedJavaMethod} A, returns a concrete {@link ResolvedJavaMethod} B that is + * the only possible unique target for a virtual call on A(). Returns {@code null} if either no + * such concrete method or more than one such method exists. Returns the method A if A is a + * concrete method that is not overridden. + *

+ * If the compiler uses the result of this method for its compilation, it must register an + * assumption because dynamic class loading can invalidate the result of this method. + * + * @param method the method A for which a unique concrete target is searched + * @return the unique concrete target or {@code null} if no such target exists or assumptions + * are not supported by this runtime + */ + AssumptionResult findUniqueConcreteMethod(ResolvedJavaMethod method); + + /** + * Returns the instance fields of this class, including + * {@linkplain ResolvedJavaField#isInternal() internal} fields. A zero-length array is returned + * for array and primitive types. The order of fields returned by this method is stable. That + * is, for a single JVM execution the same order is returned each time this method is called. It + * is also the "natural" order, which means that the JVM would expect the fields in this order + * if no specific order is given. + * + * @param includeSuperclasses if true, then instance fields for the complete hierarchy of this + * type are included in the result + * @return an array of instance fields + */ + ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses); + + /** + * Returns the static fields of this class, including + * {@linkplain ResolvedJavaField#isInternal() internal} fields. A zero-length array is returned + * for array and primitive types. The order of fields returned by this method is stable. That + * is, for a single JVM execution the same order is returned each time this method is called. + */ + ResolvedJavaField[] getStaticFields(); + + /** + * Returns the annotation for the specified type of this class, if such an annotation is + * present. + * + * @param annotationClass the Class object corresponding to the annotation type + * @return this element's annotation for the specified annotation type if present on this class, + * else {@code null} + */ + T getAnnotation(Class annotationClass); + + /** + * Returns the instance field of this class (or one of its super classes) at the given offset, + * or {@code null} if there is no such field. + * + * @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); + + /** + * Returns name of source file of this type. + */ + String getSourceFileName(); + + /** + * Returns the class file path - if available - of this type, or {@code null}. + */ + URL getClassFilePath(); + + /** + * Returns {@code true} if the type is a local type. + */ + boolean isLocal(); + + /** + * Returns {@code true} if the type is a member type. + */ + boolean isMember(); + + /** + * Returns the enclosing type of this type, if it exists, or {@code null}. + */ + ResolvedJavaType getEnclosingType(); + + /** + * Returns an array reflecting all the constructors declared by this type. This method is + * similar to {@link Class#getDeclaredConstructors()} in terms of returned constructors. + */ + ResolvedJavaMethod[] getDeclaredConstructors(); + + /** + * Returns an array reflecting all the methods declared by this type. This method is similar to + * {@link Class#getDeclaredMethods()} in terms of returned methods. + */ + ResolvedJavaMethod[] getDeclaredMethods(); + + /** + * Returns the {@code } method for this class if there is one. + */ + ResolvedJavaMethod getClassInitializer(); + + /** + * Returns true if this type represents an interface and it should be trusted even in places + * where the JVM verifier would not give any guarantees other than {@link Object}. + */ + boolean isTrustedInterfaceType(); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/SerializableConstant.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/SerializableConstant.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,42 @@ +/* + * 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 + * 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 com.oracle.jvmci.meta; + +import java.nio.*; + +/** + * Represents a compile-time constant that can be converted to a byte array. + */ +public interface SerializableConstant extends Constant { + + /** + * Return the size in bytes of the serialized representation of this constant. + */ + int getSerializedSize(); + + /** + * Serialize the constant into the ByteBuffer. There must be at least + * {@link #getSerializedSize()} bytes available capacity in the buffer. + */ + void serialize(ByteBuffer buffer); +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Signature.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Signature.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2009, 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 com.oracle.jvmci.meta; + +/** + * Represents a method signature provided by the runtime. + * + * @see Method + * Descriptors + */ +public interface Signature { + + /** + * Returns the number of parameters in this signature, adding 1 for a receiver if requested. + * + * @param receiver true if 1 is to be added to the result for a receiver + * @return the number of parameters; + 1 iff {@code receiver == true} + */ + int getParameterCount(boolean receiver); + + /** + * Gets the parameter type at the specified position. + * + * @param index the index into the parameters, with {@code 0} indicating the first parameter + * @param accessingClass the context of the type lookup. If non-null, its class loader is used + * for resolving the type. If {@code null}, then the type returned is either + * unresolved or a resolved type whose resolution is context free (e.g., a primitive + * type or a type in a java.* package). + * @return the {@code index}'th parameter type + * @throws LinkageError if {@code accessingClass != null} and resolution fails + * + */ + JavaType getParameterType(int index, ResolvedJavaType accessingClass); + + /** + * Gets the parameter kind at the specified position. This is the same as calling + * {@link #getParameterType}. {@link JavaType#getKind getKind}. + * + * @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(); + } + + /** + * Gets the return type of this signature. + * + * @param accessingClass the context of the type lookup. If non-null, its class loader is used + * for resolving the type. If {@code null}, then the type returned is either + * unresolved or a resolved type whose resolution is context free (e.g., a primitive + * type or a type in a java.* package). + * @return the return type + * @throws LinkageError if {@code accessingClass != null} and resolution fails + */ + JavaType getReturnType(ResolvedJavaType accessingClass); + + /** + * Gets the return kind of this signature. This is the same as calling {@link #getReturnType}. + * {@link JavaType#getKind getKind}. + */ + default Kind getReturnKind() { + return getReturnType(null).getKind(); + } + + /** + * Gets the method + * descriptor corresponding to this signature. For example: + * + *

+     * (ILjava/lang/String;D)V
+     * 
+ * + * @return the signature as a string + */ + default String toMethodDescriptor() { + StringBuilder sb = new StringBuilder("("); + for (int i = 0; i < getParameterCount(false); ++i) { + sb.append(getParameterType(i, null).getName()); + } + sb.append(')').append(getReturnType(null).getName()); + return sb.toString(); + } + + default JavaType[] toParameterTypes(JavaType receiverType) { + int args = getParameterCount(false); + JavaType[] result; + int i = 0; + if (receiverType != null) { + result = new JavaType[args + 1]; + result[0] = receiverType; + i = 1; + } else { + result = new JavaType[args]; + } + for (int j = 0; j < args; j++) { + result[i + j] = getParameterType(j, null); + } + return result; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/TriState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/TriState.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,77 @@ +/* + * 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. + */ +package com.oracle.jvmci.meta; + +/** + * Represents a logic value that can be either {@link #TRUE}, {@link #FALSE}, or {@link #UNKNOWN}. + */ +public enum TriState { + TRUE, + FALSE, + UNKNOWN; + + public static TriState get(boolean value) { + return value ? TRUE : FALSE; + } + + /** + * This is optimistic about {@link #UNKNOWN} (it prefers known values over {@link #UNKNOWN}) and + * pesimistic about known (it perfers {@link #TRUE} over {@link #FALSE}). + */ + public static TriState merge(TriState a, TriState b) { + if (a == TRUE || b == TRUE) { + return TRUE; + } + if (a == FALSE || b == FALSE) { + return FALSE; + } + assert a == UNKNOWN && b == UNKNOWN; + return UNKNOWN; + } + + public boolean isTrue() { + return this == TRUE; + } + + public boolean isFalse() { + return this == FALSE; + } + + public boolean isUnknown() { + return this == UNKNOWN; + } + + public boolean isKnown() { + return this != UNKNOWN; + } + + public boolean toBoolean() { + if (isTrue()) { + return true; + } else if (isFalse()) { + return false; + } else { + throw new IllegalStateException("Cannot convert to boolean, TriState is in an unknown state"); + } + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/TrustedInterface.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/TrustedInterface.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.jvmci.meta; + +/** + * Interfaces extanding this interface should be trusted by the compiler. See + * {@link ResolvedJavaType#isTrustedInterfaceType()}. + * + */ +public interface TrustedInterface { + +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/VMConstant.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/VMConstant.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.jvmci.meta; + +public interface VMConstant extends Constant { +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Value.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Value.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,63 @@ +/* + * 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 com.oracle.jvmci.meta; + +/** + * Interface for values manipulated by the compiler. All values have a {@linkplain Kind kind} and + * are immutable. + */ +public interface Value extends KindProvider, TrustedInterface { + + AllocatableValue ILLEGAL = new AllocatableValue(LIRKind.Illegal) { + + @Override + public String toString() { + return "-"; + } + + @Override + public boolean equals(Object other) { + // Due to de-serialization this object may exist multiple times. So we compare classes + // instead of the individual objects. (This anonymous class has always the same meaning) + return other != null && this.getClass() == other.getClass(); + } + }; + + LIRKind getLIRKind(); + + /** + * Returns the platform specific kind used to store this value. + */ + PlatformKind getPlatformKind(); + + /** + * Checks if this value is identical to {@code other}. + * + * Warning: Use with caution! Usually equivalence {@link #equals(Object)} is sufficient and + * should be used. + */ + @ExcludeFromIdentityComparisonVerification + default boolean identityEquals(Value other) { + return this == other; + } +} diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/package-info.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/package-info.java Wed May 27 00:36:16 2015 +0200 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2009, 2011, 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 that defines the interface between a runtime and a Java application that wants to access meta information. The runtime + * provides an implementation of the {@link com.oracle.jvmci.meta.MetaAccessProvider} interface. + */ +package com.oracle.jvmci.meta; + diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.runtime/src/com/oracle/jvmci/runtime/JVMCIBackend.java --- a/graal/com.oracle.jvmci.runtime/src/com/oracle/jvmci/runtime/JVMCIBackend.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.runtime/src/com/oracle/jvmci/runtime/JVMCIBackend.java Wed May 27 00:36:16 2015 +0200 @@ -22,8 +22,10 @@ */ package com.oracle.jvmci.runtime; -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; +import com.oracle.jvmci.code.CodeCacheProvider; +import com.oracle.jvmci.code.TargetDescription; +import com.oracle.jvmci.meta.MetaAccessProvider; +import com.oracle.jvmci.meta.ConstantReflectionProvider; /** * A JVMCI backend encapsulates the capabilities needed by a Java based compiler for compiling and diff -r d12eaef9af72 -r 48c1ebd24120 graal/com.oracle.jvmci.runtime/src/com/oracle/jvmci/runtime/JVMCIRuntime.java --- a/graal/com.oracle.jvmci.runtime/src/com/oracle/jvmci/runtime/JVMCIRuntime.java Tue May 26 23:45:05 2015 +0200 +++ b/graal/com.oracle.jvmci.runtime/src/com/oracle/jvmci/runtime/JVMCIRuntime.java Wed May 27 00:36:16 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.jvmci.runtime; -import com.oracle.graal.api.code.*; +import com.oracle.jvmci.code.Architecture; /** * Interface for accessing the {@link JVMCI} APIs supported by the runtime. diff -r d12eaef9af72 -r 48c1ebd24120 mx/suite.py --- a/mx/suite.py Tue May 26 23:45:05 2015 +0200 +++ b/mx/suite.py Wed May 27 00:36:16 2015 +0200 @@ -155,7 +155,7 @@ "subDir" : "graal", "sourceDirs" : ["src"], "dependencies" : [ - "com.oracle.graal.api.code" + "com.oracle.jvmci.code" ], "checkstyle" : "com.oracle.graal.graph", "javaCompliance" : "1.8", @@ -251,7 +251,7 @@ "workingSets" : "API,Graal,Test", }, - "com.oracle.graal.api.meta" : { + "com.oracle.jvmci.meta" : { "subDir" : "graal", "sourceDirs" : ["src"], "checkstyle" : "com.oracle.graal.graph", @@ -259,10 +259,10 @@ "workingSets" : "API,Graal", }, - "com.oracle.graal.api.code" : { + "com.oracle.jvmci.code" : { "subDir" : "graal", "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.graal.api.meta"], + "dependencies" : ["com.oracle.jvmci.meta"], "checkstyle" : "com.oracle.graal.graph", "javaCompliance" : "1.8", "workingSets" : "API,Graal", @@ -271,7 +271,7 @@ "com.oracle.graal.api.replacements" : { "subDir" : "graal", "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.graal.api.meta"], + "dependencies" : ["com.oracle.jvmci.meta"], "checkstyle" : "com.oracle.graal.graph", "javaCompliance" : "1.8", "workingSets" : "API,Graal,Replacements", @@ -289,7 +289,7 @@ "com.oracle.graal.amd64" : { "subDir" : "graal", "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.graal.api.code"], + "dependencies" : ["com.oracle.jvmci.code"], "checkstyle" : "com.oracle.graal.graph", "javaCompliance" : "1.8", "workingSets" : "Graal,AMD64", @@ -298,7 +298,7 @@ "com.oracle.graal.sparc" : { "subDir" : "graal", "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.graal.api.code"], + "dependencies" : ["com.oracle.jvmci.code"], "checkstyle" : "com.oracle.graal.graph", "javaCompliance" : "1.8", "workingSets" : "Graal,SPARC", @@ -862,7 +862,7 @@ "sourceDirs" : ["src"], "dependencies" : [ "com.oracle.jvmci.common", - "com.oracle.graal.api.code", + "com.oracle.jvmci.code", "com.oracle.jvmci.options", "com.oracle.jvmci.debug", ], @@ -927,7 +927,7 @@ "com.oracle.graal.asm" : { "subDir" : "graal", "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.graal.api.code"], + "dependencies" : ["com.oracle.jvmci.code"], "checkstyle" : "com.oracle.graal.graph", "javaCompliance" : "1.8", "workingSets" : "Graal,Assembler", diff -r d12eaef9af72 -r 48c1ebd24120 src/share/vm/classfile/systemDictionary.hpp --- a/src/share/vm/classfile/systemDictionary.hpp Tue May 26 23:45:05 2015 +0200 +++ b/src/share/vm/classfile/systemDictionary.hpp Wed May 27 00:36:16 2015 +0200 @@ -215,43 +215,43 @@ GRAAL_ONLY(do_klass(HotSpotMetaspaceConstantImpl_klass, com_oracle_jvmci_hotspot_HotSpotMetaspaceConstantImpl, Graal)) \ GRAAL_ONLY(do_klass(HotSpotStackFrameReference_klass, com_oracle_jvmci_hotspot_HotSpotStackFrameReference, Graal)) \ GRAAL_ONLY(do_klass(CompilationTask_klass, com_oracle_graal_hotspot_CompilationTask, Graal)) \ - GRAAL_ONLY(do_klass(Assumptions_ConcreteMethod_klass, com_oracle_graal_api_meta_Assumptions_ConcreteMethod, Graal)) \ - GRAAL_ONLY(do_klass(Assumptions_NoFinalizableSubclass_klass, com_oracle_graal_api_meta_Assumptions_NoFinalizableSubclass, Graal))\ - GRAAL_ONLY(do_klass(Assumptions_ConcreteSubtype_klass, com_oracle_graal_api_meta_Assumptions_ConcreteSubtype, Graal)) \ - GRAAL_ONLY(do_klass(Assumptions_LeafType_klass, com_oracle_graal_api_meta_Assumptions_LeafType, Graal)) \ - GRAAL_ONLY(do_klass(Assumptions_CallSiteTargetValue_klass, com_oracle_graal_api_meta_Assumptions_CallSiteTargetValue, Graal)) \ - GRAAL_ONLY(do_klass(BytecodePosition_klass, com_oracle_graal_api_code_BytecodePosition, Graal)) \ - GRAAL_ONLY(do_klass(DebugInfo_klass, com_oracle_graal_api_code_DebugInfo, Graal)) \ - GRAAL_ONLY(do_klass(RegisterSaveLayout_klass, com_oracle_graal_api_code_RegisterSaveLayout, Graal)) \ - GRAAL_ONLY(do_klass(BytecodeFrame_klass, com_oracle_graal_api_code_BytecodeFrame, Graal)) \ - GRAAL_ONLY(do_klass(CompilationResult_klass, com_oracle_graal_api_code_CompilationResult, Graal)) \ - GRAAL_ONLY(do_klass(CompilationResult_Call_klass, com_oracle_graal_api_code_CompilationResult_Call, Graal)) \ - GRAAL_ONLY(do_klass(CompilationResult_ConstantReference_klass, com_oracle_graal_api_code_CompilationResult_ConstantReference, Graal)) \ - GRAAL_ONLY(do_klass(CompilationResult_DataPatch_klass, com_oracle_graal_api_code_CompilationResult_DataPatch, Graal)) \ - GRAAL_ONLY(do_klass(CompilationResult_DataSectionReference_klass, com_oracle_graal_api_code_CompilationResult_DataSectionReference, Graal)) \ - GRAAL_ONLY(do_klass(CompilationResult_ExceptionHandler_klass, com_oracle_graal_api_code_CompilationResult_ExceptionHandler, Graal))\ - GRAAL_ONLY(do_klass(CompilationResult_Mark_klass, com_oracle_graal_api_code_CompilationResult_Mark, Graal)) \ - GRAAL_ONLY(do_klass(CompilationResult_Infopoint_klass, com_oracle_graal_api_code_CompilationResult_Infopoint, Graal)) \ - GRAAL_ONLY(do_klass(CompilationResult_Site_klass, com_oracle_graal_api_code_CompilationResult_Site, Graal)) \ - GRAAL_ONLY(do_klass(InfopointReason_klass, com_oracle_graal_api_code_InfopointReason, Graal)) \ - GRAAL_ONLY(do_klass(InstalledCode_klass, com_oracle_graal_api_code_InstalledCode, Graal)) \ - GRAAL_ONLY(do_klass(code_Register_klass, com_oracle_graal_api_code_Register, Graal)) \ - GRAAL_ONLY(do_klass(RegisterValue_klass, com_oracle_graal_api_code_RegisterValue, Graal)) \ - GRAAL_ONLY(do_klass(RegisterCategory_klass, com_oracle_graal_api_code_Register_RegisterCategory, Graal)) \ - GRAAL_ONLY(do_klass(StackSlot_klass, com_oracle_graal_api_code_StackSlot, Graal)) \ - GRAAL_ONLY(do_klass(StackLockValue_klass, com_oracle_graal_api_code_StackLockValue, Graal)) \ - GRAAL_ONLY(do_klass(VirtualObject_klass, com_oracle_graal_api_code_VirtualObject, Graal)) \ - GRAAL_ONLY(do_klass(SpeculationLog_klass, com_oracle_graal_api_code_SpeculationLog, Graal)) \ - GRAAL_ONLY(do_klass(JavaConstant_klass, com_oracle_graal_api_meta_JavaConstant, Graal)) \ - GRAAL_ONLY(do_klass(PrimitiveConstant_klass, com_oracle_graal_api_meta_PrimitiveConstant, Graal)) \ - GRAAL_ONLY(do_klass(RawConstant_klass, com_oracle_graal_api_meta_RawConstant, Graal)) \ - GRAAL_ONLY(do_klass(NullConstant_klass, com_oracle_graal_api_meta_NullConstant, Graal)) \ - GRAAL_ONLY(do_klass(ExceptionHandler_klass, com_oracle_graal_api_meta_ExceptionHandler, Graal)) \ - GRAAL_ONLY(do_klass(Kind_klass, com_oracle_graal_api_meta_Kind, Graal)) \ - GRAAL_ONLY(do_klass(LIRKind_klass, com_oracle_graal_api_meta_LIRKind, Graal)) \ - GRAAL_ONLY(do_klass(JavaMethod_klass, com_oracle_graal_api_meta_JavaMethod, Graal)) \ - GRAAL_ONLY(do_klass(JavaType_klass, com_oracle_graal_api_meta_JavaType, Graal)) \ - GRAAL_ONLY(do_klass(AbstractValue_klass, com_oracle_graal_api_meta_AbstractValue, Graal)) \ + GRAAL_ONLY(do_klass(Assumptions_ConcreteMethod_klass, com_oracle_jvmci_meta_Assumptions_ConcreteMethod, Graal)) \ + GRAAL_ONLY(do_klass(Assumptions_NoFinalizableSubclass_klass, com_oracle_jvmci_meta_Assumptions_NoFinalizableSubclass, Graal))\ + GRAAL_ONLY(do_klass(Assumptions_ConcreteSubtype_klass, com_oracle_jvmci_meta_Assumptions_ConcreteSubtype, Graal)) \ + GRAAL_ONLY(do_klass(Assumptions_LeafType_klass, com_oracle_jvmci_meta_Assumptions_LeafType, Graal)) \ + GRAAL_ONLY(do_klass(Assumptions_CallSiteTargetValue_klass, com_oracle_jvmci_meta_Assumptions_CallSiteTargetValue, Graal)) \ + GRAAL_ONLY(do_klass(BytecodePosition_klass, com_oracle_jvmci_code_BytecodePosition, Graal)) \ + GRAAL_ONLY(do_klass(DebugInfo_klass, com_oracle_jvmci_code_DebugInfo, Graal)) \ + GRAAL_ONLY(do_klass(RegisterSaveLayout_klass, com_oracle_jvmci_code_RegisterSaveLayout, Graal)) \ + GRAAL_ONLY(do_klass(BytecodeFrame_klass, com_oracle_jvmci_code_BytecodeFrame, Graal)) \ + GRAAL_ONLY(do_klass(CompilationResult_klass, com_oracle_jvmci_code_CompilationResult, Graal)) \ + GRAAL_ONLY(do_klass(CompilationResult_Call_klass, com_oracle_jvmci_code_CompilationResult_Call, Graal)) \ + GRAAL_ONLY(do_klass(CompilationResult_ConstantReference_klass, com_oracle_jvmci_code_CompilationResult_ConstantReference, Graal)) \ + GRAAL_ONLY(do_klass(CompilationResult_DataPatch_klass, com_oracle_jvmci_code_CompilationResult_DataPatch, Graal)) \ + GRAAL_ONLY(do_klass(CompilationResult_DataSectionReference_klass, com_oracle_jvmci_code_CompilationResult_DataSectionReference, Graal)) \ + GRAAL_ONLY(do_klass(CompilationResult_ExceptionHandler_klass, com_oracle_jvmci_code_CompilationResult_ExceptionHandler, Graal))\ + GRAAL_ONLY(do_klass(CompilationResult_Mark_klass, com_oracle_jvmci_code_CompilationResult_Mark, Graal)) \ + GRAAL_ONLY(do_klass(CompilationResult_Infopoint_klass, com_oracle_jvmci_code_CompilationResult_Infopoint, Graal)) \ + GRAAL_ONLY(do_klass(CompilationResult_Site_klass, com_oracle_jvmci_code_CompilationResult_Site, Graal)) \ + GRAAL_ONLY(do_klass(InfopointReason_klass, com_oracle_jvmci_code_InfopointReason, Graal)) \ + GRAAL_ONLY(do_klass(InstalledCode_klass, com_oracle_jvmci_code_InstalledCode, Graal)) \ + GRAAL_ONLY(do_klass(code_Register_klass, com_oracle_jvmci_code_Register, Graal)) \ + GRAAL_ONLY(do_klass(RegisterValue_klass, com_oracle_jvmci_code_RegisterValue, Graal)) \ + GRAAL_ONLY(do_klass(RegisterCategory_klass, com_oracle_jvmci_code_Register_RegisterCategory, Graal)) \ + GRAAL_ONLY(do_klass(StackSlot_klass, com_oracle_jvmci_code_StackSlot, Graal)) \ + GRAAL_ONLY(do_klass(StackLockValue_klass, com_oracle_jvmci_code_StackLockValue, Graal)) \ + GRAAL_ONLY(do_klass(VirtualObject_klass, com_oracle_jvmci_code_VirtualObject, Graal)) \ + GRAAL_ONLY(do_klass(SpeculationLog_klass, com_oracle_jvmci_code_SpeculationLog, Graal)) \ + GRAAL_ONLY(do_klass(JavaConstant_klass, com_oracle_jvmci_meta_JavaConstant, Graal)) \ + GRAAL_ONLY(do_klass(PrimitiveConstant_klass, com_oracle_jvmci_meta_PrimitiveConstant, Graal)) \ + GRAAL_ONLY(do_klass(RawConstant_klass, com_oracle_jvmci_meta_RawConstant, Graal)) \ + GRAAL_ONLY(do_klass(NullConstant_klass, com_oracle_jvmci_meta_NullConstant, Graal)) \ + GRAAL_ONLY(do_klass(ExceptionHandler_klass, com_oracle_jvmci_meta_ExceptionHandler, Graal)) \ + GRAAL_ONLY(do_klass(Kind_klass, com_oracle_jvmci_meta_Kind, Graal)) \ + GRAAL_ONLY(do_klass(LIRKind_klass, com_oracle_jvmci_meta_LIRKind, Graal)) \ + GRAAL_ONLY(do_klass(JavaMethod_klass, com_oracle_jvmci_meta_JavaMethod, Graal)) \ + GRAAL_ONLY(do_klass(JavaType_klass, com_oracle_jvmci_meta_JavaType, Graal)) \ + GRAAL_ONLY(do_klass(AbstractValue_klass, com_oracle_jvmci_meta_AbstractValue, Graal)) \ /*end*/ diff -r d12eaef9af72 -r 48c1ebd24120 src/share/vm/classfile/vmSymbols.hpp --- a/src/share/vm/classfile/vmSymbols.hpp Tue May 26 23:45:05 2015 +0200 +++ b/src/share/vm/classfile/vmSymbols.hpp Wed May 27 00:36:16 2015 +0200 @@ -317,48 +317,47 @@ GRAAL_ONLY(template(com_oracle_jvmci_hotspot_HotSpotMetaspaceConstantImpl, "com/oracle/jvmci/hotspot/HotSpotMetaspaceConstantImpl")) \ GRAAL_ONLY(template(com_oracle_jvmci_hotspot_HotSpotStackFrameReference, "com/oracle/jvmci/hotspot/HotSpotStackFrameReference")) \ GRAAL_ONLY(template(com_oracle_graal_hotspot_CompilationTask, "com/oracle/graal/hotspot/CompilationTask")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_JavaConstant, "com/oracle/graal/api/meta/JavaConstant")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_PrimitiveConstant, "com/oracle/graal/api/meta/PrimitiveConstant")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_RawConstant, "com/oracle/graal/api/meta/RawConstant")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_NullConstant, "com/oracle/graal/api/meta/NullConstant")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_ExceptionHandler, "com/oracle/graal/api/meta/ExceptionHandler")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_JavaMethod, "com/oracle/graal/api/meta/JavaMethod")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_JavaType, "com/oracle/graal/api/meta/JavaType")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_Kind, "com/oracle/graal/api/meta/Kind")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_LIRKind, "com/oracle/graal/api/meta/LIRKind")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_AbstractValue, "com/oracle/graal/api/meta/AbstractValue")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_Assumptions_ConcreteSubtype, "com/oracle/graal/api/meta/Assumptions$ConcreteSubtype")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_Assumptions_LeafType, "com/oracle/graal/api/meta/Assumptions$LeafType")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_Assumptions_NoFinalizableSubclass, "com/oracle/graal/api/meta/Assumptions$NoFinalizableSubclass")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_Assumptions_ConcreteMethod, "com/oracle/graal/api/meta/Assumptions$ConcreteMethod")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_Assumptions_CallSiteTargetValue,"com/oracle/graal/api/meta/Assumptions$CallSiteTargetValue")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_CompilationResult, "com/oracle/graal/api/code/CompilationResult")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_CompilationResult_Call, "com/oracle/graal/api/code/CompilationResult$Call")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_CompilationResult_ConstantReference, "com/oracle/graal/api/code/CompilationResult$ConstantReference")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_CompilationResult_DataPatch, "com/oracle/graal/api/code/CompilationResult$DataPatch")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_CompilationResult_DataSectionReference, "com/oracle/graal/api/code/CompilationResult$DataSectionReference")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_CompilationResult_ExceptionHandler, "com/oracle/graal/api/code/CompilationResult$ExceptionHandler")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_CompilationResult_Mark, "com/oracle/graal/api/code/CompilationResult$Mark")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_CompilationResult_Infopoint, "com/oracle/graal/api/code/CompilationResult$Infopoint")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_CompilationResult_Site, "com/oracle/graal/api/code/CompilationResult$Site")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_InfopointReason, "com/oracle/graal/api/code/InfopointReason")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_InstalledCode, "com/oracle/graal/api/code/InstalledCode")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_BytecodeFrame, "com/oracle/graal/api/code/BytecodeFrame")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_BytecodePosition, "com/oracle/graal/api/code/BytecodePosition")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_DebugInfo, "com/oracle/graal/api/code/DebugInfo")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_Register, "com/oracle/graal/api/code/Register")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_RegisterValue, "com/oracle/graal/api/code/RegisterValue")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_Register_RegisterCategory, "com/oracle/graal/api/code/Register$RegisterCategory")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_StackSlot, "com/oracle/graal/api/code/StackSlot")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_StackLockValue, "com/oracle/graal/api/code/StackLockValue")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_VirtualObject, "com/oracle/graal/api/code/VirtualObject")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_RegisterSaveLayout, "com/oracle/graal/api/code/RegisterSaveLayout")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_InvalidInstalledCodeException, "com/oracle/graal/api/code/InvalidInstalledCodeException")) \ - GRAAL_ONLY(template(com_oracle_graal_api_code_SpeculationLog, "com/oracle/graal/api/code/SpeculationLog")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_JavaConstant, "com/oracle/jvmci/meta/JavaConstant")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_PrimitiveConstant, "com/oracle/jvmci/meta/PrimitiveConstant")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_RawConstant, "com/oracle/jvmci/meta/RawConstant")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_NullConstant, "com/oracle/jvmci/meta/NullConstant")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_ExceptionHandler, "com/oracle/jvmci/meta/ExceptionHandler")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_JavaMethod, "com/oracle/jvmci/meta/JavaMethod")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_JavaType, "com/oracle/jvmci/meta/JavaType")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_Kind, "com/oracle/jvmci/meta/Kind")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_LIRKind, "com/oracle/jvmci/meta/LIRKind")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_AbstractValue, "com/oracle/jvmci/meta/AbstractValue")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_Assumptions_ConcreteSubtype, "com/oracle/jvmci/meta/Assumptions$ConcreteSubtype")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_Assumptions_LeafType, "com/oracle/jvmci/meta/Assumptions$LeafType")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_Assumptions_NoFinalizableSubclass, "com/oracle/jvmci/meta/Assumptions$NoFinalizableSubclass")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_Assumptions_ConcreteMethod, "com/oracle/jvmci/meta/Assumptions$ConcreteMethod")) \ + GRAAL_ONLY(template(com_oracle_jvmci_meta_Assumptions_CallSiteTargetValue, "com/oracle/jvmci/meta/Assumptions$CallSiteTargetValue")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_CompilationResult, "com/oracle/jvmci/code/CompilationResult")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_CompilationResult_Call, "com/oracle/jvmci/code/CompilationResult$Call")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_CompilationResult_ConstantReference, "com/oracle/jvmci/code/CompilationResult$ConstantReference")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_CompilationResult_DataPatch, "com/oracle/jvmci/code/CompilationResult$DataPatch")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_CompilationResult_DataSectionReference, "com/oracle/jvmci/code/CompilationResult$DataSectionReference")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_CompilationResult_ExceptionHandler, "com/oracle/jvmci/code/CompilationResult$ExceptionHandler")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_CompilationResult_Mark, "com/oracle/jvmci/code/CompilationResult$Mark")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_CompilationResult_Infopoint, "com/oracle/jvmci/code/CompilationResult$Infopoint")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_CompilationResult_Site, "com/oracle/jvmci/code/CompilationResult$Site")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_InfopointReason, "com/oracle/jvmci/code/InfopointReason")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_InstalledCode, "com/oracle/jvmci/code/InstalledCode")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_BytecodeFrame, "com/oracle/jvmci/code/BytecodeFrame")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_BytecodePosition, "com/oracle/jvmci/code/BytecodePosition")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_DebugInfo, "com/oracle/jvmci/code/DebugInfo")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_Register, "com/oracle/jvmci/code/Register")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_RegisterValue, "com/oracle/jvmci/code/RegisterValue")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_Register_RegisterCategory, "com/oracle/jvmci/code/Register$RegisterCategory")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_StackSlot, "com/oracle/jvmci/code/StackSlot")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_StackLockValue, "com/oracle/jvmci/code/StackLockValue")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_VirtualObject, "com/oracle/jvmci/code/VirtualObject")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_RegisterSaveLayout, "com/oracle/jvmci/code/RegisterSaveLayout")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_InvalidInstalledCodeException, "com/oracle/jvmci/code/InvalidInstalledCodeException")) \ + GRAAL_ONLY(template(com_oracle_jvmci_code_SpeculationLog, "com/oracle/jvmci/code/SpeculationLog")) \ GRAAL_ONLY(template(compileMetaspaceMethod_name, "compileMetaspaceMethod")) \ GRAAL_ONLY(template(compileMetaspaceMethod_signature, "(JIJI)V")) \ - GRAAL_ONLY(template(graal_mirror_name, "graal_mirror")) \ - GRAAL_ONLY(template(com_oracle_jvmci_hotspot_Stable_signature, "Lcom/oracle/jvmci/hotspot/Stable;")) \ + GRAAL_ONLY(template(com_oracle_jvmci_hotspot_Stable_signature, "Lcom/oracle/jvmci/hotspot/Stable;")) \ \ /* common method and field names */ \ template(object_initializer_name, "") \ diff -r d12eaef9af72 -r 48c1ebd24120 src/share/vm/graal/graalCompilerToVM.cpp --- a/src/share/vm/graal/graalCompilerToVM.cpp Tue May 26 23:45:05 2015 +0200 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Wed May 27 00:36:16 2015 +0200 @@ -599,7 +599,7 @@ jlong nmethodValue = InstalledCode::address(hotspotInstalledCode); if (nmethodValue == 0L) { - THROW_(vmSymbols::com_oracle_graal_api_code_InvalidInstalledCodeException(), NULL); + THROW_(vmSymbols::com_oracle_jvmci_code_InvalidInstalledCodeException(), NULL); } nmethod* nm = (nmethod*) (address) nmethodValue; methodHandle mh = nm->method(); @@ -1032,16 +1032,16 @@ #define CC (char*) /*cast a literal from (const char*)*/ #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f)) -#define TYPE "Lcom/oracle/graal/api/meta/JavaType;" -#define METHOD "Lcom/oracle/graal/api/meta/JavaMethod;" -#define FIELD "Lcom/oracle/graal/api/meta/JavaField;" -#define SPECULATION_LOG "Lcom/oracle/graal/api/code/SpeculationLog;" +#define TYPE "Lcom/oracle/jvmci/meta/JavaType;" +#define METHOD "Lcom/oracle/jvmci/meta/JavaMethod;" +#define FIELD "Lcom/oracle/jvmci/meta/JavaField;" +#define SPECULATION_LOG "Lcom/oracle/jvmci/code/SpeculationLog;" #define STRING "Ljava/lang/String;" #define OBJECT "Ljava/lang/Object;" #define CLASS "Ljava/lang/Class;" #define STACK_TRACE_ELEMENT "Ljava/lang/StackTraceElement;" -#define INSTALLED_CODE "Lcom/oracle/graal/api/code/InstalledCode;" -#define RESOLVED_METHOD "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;" +#define INSTALLED_CODE "Lcom/oracle/jvmci/code/InstalledCode;" +#define RESOLVED_METHOD "Lcom/oracle/jvmci/meta/ResolvedJavaMethod;" #define HS_RESOLVED_METHOD "Lcom/oracle/jvmci/hotspot/HotSpotResolvedJavaMethod;" #define HS_COMPILED_CODE "Lcom/oracle/jvmci/hotspot/HotSpotCompiledCode;" #define HS_CONFIG "Lcom/oracle/jvmci/hotspot/HotSpotVMConfig;" diff -r d12eaef9af72 -r 48c1ebd24120 src/share/vm/graal/graalJavaAccess.hpp --- a/src/share/vm/graal/graalJavaAccess.hpp Tue May 26 23:45:05 2015 +0200 +++ b/src/share/vm/graal/graalJavaAccess.hpp Wed May 27 00:36:16 2015 +0200 @@ -68,20 +68,20 @@ boolean_field(HotSpotNmethod, isDefault) \ end_class \ start_class(HotSpotCompiledCode) \ - oop_field(HotSpotCompiledCode, comp, "Lcom/oracle/graal/api/code/CompilationResult;") \ - objArrayOop_field(HotSpotCompiledCode, sites, "[Lcom/oracle/graal/api/code/CompilationResult$Site;") \ - objArrayOop_field(HotSpotCompiledCode, exceptionHandlers, "[Lcom/oracle/graal/api/code/CompilationResult$ExceptionHandler;") \ - objArrayOop_field(HotSpotCompiledCode, comments, "[Lcom/oracle/jvmci/hotspot/HotSpotCompiledCode$Comment;") \ + oop_field(HotSpotCompiledCode, comp, "Lcom/oracle/jvmci/code/CompilationResult;") \ + objArrayOop_field(HotSpotCompiledCode, sites, "[Lcom/oracle/jvmci/code/CompilationResult$Site;") \ + objArrayOop_field(HotSpotCompiledCode, exceptionHandlers, "[Lcom/oracle/jvmci/code/CompilationResult$ExceptionHandler;") \ + objArrayOop_field(HotSpotCompiledCode, comments, "[Lcom/oracle/jvmci/hotspot/HotSpotCompiledCode$Comment;") \ typeArrayOop_field(HotSpotCompiledCode, dataSection, "[B") \ int_field(HotSpotCompiledCode, dataSectionAlignment) \ - objArrayOop_field(HotSpotCompiledCode, dataSectionPatches, "[Lcom/oracle/graal/api/code/CompilationResult$DataPatch;") \ + objArrayOop_field(HotSpotCompiledCode, dataSectionPatches, "[Lcom/oracle/jvmci/code/CompilationResult$DataPatch;") \ 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, "Lcom/oracle/jvmci/hotspot/HotSpotResolvedJavaMethod;") \ + oop_field(HotSpotCompiledNmethod, method, "Lcom/oracle/jvmci/hotspot/HotSpotResolvedJavaMethod;") \ oop_field(HotSpotCompiledNmethod, installationFailureMessage, "Ljava/lang/String;") \ int_field(HotSpotCompiledNmethod, entryBCI) \ int_field(HotSpotCompiledNmethod, id) \ @@ -95,24 +95,24 @@ int_field(CompilationResult, customStackAreaOffset) \ oop_field(CompilationResult, name, "Ljava/lang/String;") \ typeArrayOop_field(CompilationResult, targetCode, "[B") \ - objArrayOop_field(CompilationResult, assumptions, "[Lcom/oracle/graal/api/meta/Assumptions$Assumption;") \ - objArrayOop_field(CompilationResult, methods, "[Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ + objArrayOop_field(CompilationResult, assumptions, "[Lcom/oracle/jvmci/meta/Assumptions$Assumption;") \ + objArrayOop_field(CompilationResult, methods, "[Lcom/oracle/jvmci/meta/ResolvedJavaMethod;") \ int_field(CompilationResult, targetCodeSize) \ end_class \ start_class(Assumptions_NoFinalizableSubclass) \ - oop_field(Assumptions_NoFinalizableSubclass, receiverType, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \ + oop_field(Assumptions_NoFinalizableSubclass, receiverType, "Lcom/oracle/jvmci/meta/ResolvedJavaType;") \ end_class \ start_class(Assumptions_ConcreteSubtype) \ - oop_field(Assumptions_ConcreteSubtype, context, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \ - oop_field(Assumptions_ConcreteSubtype, subtype, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \ + oop_field(Assumptions_ConcreteSubtype, context, "Lcom/oracle/jvmci/meta/ResolvedJavaType;") \ + oop_field(Assumptions_ConcreteSubtype, subtype, "Lcom/oracle/jvmci/meta/ResolvedJavaType;") \ end_class \ start_class(Assumptions_LeafType) \ - oop_field(Assumptions_LeafType, context, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \ + oop_field(Assumptions_LeafType, context, "Lcom/oracle/jvmci/meta/ResolvedJavaType;") \ end_class \ start_class(Assumptions_ConcreteMethod) \ - oop_field(Assumptions_ConcreteMethod, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ - oop_field(Assumptions_ConcreteMethod, context, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \ - oop_field(Assumptions_ConcreteMethod, impl, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ + oop_field(Assumptions_ConcreteMethod, method, "Lcom/oracle/jvmci/meta/ResolvedJavaMethod;") \ + oop_field(Assumptions_ConcreteMethod, context, "Lcom/oracle/jvmci/meta/ResolvedJavaType;") \ + oop_field(Assumptions_ConcreteMethod, impl, "Lcom/oracle/jvmci/meta/ResolvedJavaMethod;") \ end_class \ start_class(Assumptions_CallSiteTargetValue) \ oop_field(Assumptions_CallSiteTargetValue, callSite, "Ljava/lang/invoke/CallSite;") \ @@ -122,30 +122,30 @@ int_field(CompilationResult_Site, pcOffset) \ end_class \ start_class(CompilationResult_Call) \ - oop_field(CompilationResult_Call, target, "Lcom/oracle/graal/api/meta/InvokeTarget;") \ - oop_field(CompilationResult_Call, debugInfo, "Lcom/oracle/graal/api/code/DebugInfo;") \ + oop_field(CompilationResult_Call, target, "Lcom/oracle/jvmci/meta/InvokeTarget;") \ + oop_field(CompilationResult_Call, debugInfo, "Lcom/oracle/jvmci/code/DebugInfo;") \ end_class \ start_class(CompilationResult_DataPatch) \ - oop_field(CompilationResult_DataPatch, reference, "Lcom/oracle/graal/api/code/CompilationResult$Reference;") \ + oop_field(CompilationResult_DataPatch, reference, "Lcom/oracle/jvmci/code/CompilationResult$Reference;") \ end_class \ start_class(CompilationResult_ConstantReference) \ - oop_field(CompilationResult_ConstantReference, constant, "Lcom/oracle/graal/api/meta/VMConstant;") \ + oop_field(CompilationResult_ConstantReference, constant, "Lcom/oracle/jvmci/meta/VMConstant;") \ end_class \ start_class(CompilationResult_DataSectionReference) \ int_field(CompilationResult_DataSectionReference, offset) \ end_class \ start_class(InfopointReason) \ - static_oop_field(InfopointReason, UNKNOWN, "Lcom/oracle/graal/api/code/InfopointReason;") \ - static_oop_field(InfopointReason, SAFEPOINT, "Lcom/oracle/graal/api/code/InfopointReason;") \ - static_oop_field(InfopointReason, CALL, "Lcom/oracle/graal/api/code/InfopointReason;") \ - static_oop_field(InfopointReason, IMPLICIT_EXCEPTION, "Lcom/oracle/graal/api/code/InfopointReason;") \ - static_oop_field(InfopointReason, METHOD_START, "Lcom/oracle/graal/api/code/InfopointReason;") \ - static_oop_field(InfopointReason, METHOD_END, "Lcom/oracle/graal/api/code/InfopointReason;") \ - static_oop_field(InfopointReason, LINE_NUMBER, "Lcom/oracle/graal/api/code/InfopointReason;") \ + static_oop_field(InfopointReason, UNKNOWN, "Lcom/oracle/jvmci/code/InfopointReason;") \ + static_oop_field(InfopointReason, SAFEPOINT, "Lcom/oracle/jvmci/code/InfopointReason;") \ + static_oop_field(InfopointReason, CALL, "Lcom/oracle/jvmci/code/InfopointReason;") \ + static_oop_field(InfopointReason, IMPLICIT_EXCEPTION, "Lcom/oracle/jvmci/code/InfopointReason;") \ + static_oop_field(InfopointReason, METHOD_START, "Lcom/oracle/jvmci/code/InfopointReason;") \ + static_oop_field(InfopointReason, METHOD_END, "Lcom/oracle/jvmci/code/InfopointReason;") \ + static_oop_field(InfopointReason, LINE_NUMBER, "Lcom/oracle/jvmci/code/InfopointReason;") \ end_class \ start_class(CompilationResult_Infopoint) \ - oop_field(CompilationResult_Infopoint, debugInfo, "Lcom/oracle/graal/api/code/DebugInfo;") \ - oop_field(CompilationResult_Infopoint, reason, "Lcom/oracle/graal/api/code/InfopointReason;") \ + oop_field(CompilationResult_Infopoint, debugInfo, "Lcom/oracle/jvmci/code/DebugInfo;") \ + oop_field(CompilationResult_Infopoint, reason, "Lcom/oracle/jvmci/code/InfopointReason;") \ end_class \ start_class(CompilationResult_ExceptionHandler) \ int_field(CompilationResult_ExceptionHandler, handlerPos) \ @@ -154,24 +154,24 @@ oop_field(CompilationResult_Mark, id, "Ljava/lang/Object;") \ end_class \ start_class(DebugInfo) \ - oop_field(DebugInfo, bytecodePosition, "Lcom/oracle/graal/api/code/BytecodePosition;") \ - oop_field(DebugInfo, referenceMap, "Lcom/oracle/graal/api/code/ReferenceMap;") \ - oop_field(DebugInfo, calleeSaveInfo, "Lcom/oracle/graal/api/code/RegisterSaveLayout;") \ - objArrayOop_field(DebugInfo, virtualObjectMapping, "[Lcom/oracle/graal/api/meta/Value;") \ + oop_field(DebugInfo, bytecodePosition, "Lcom/oracle/jvmci/code/BytecodePosition;") \ + oop_field(DebugInfo, referenceMap, "Lcom/oracle/jvmci/code/ReferenceMap;") \ + oop_field(DebugInfo, calleeSaveInfo, "Lcom/oracle/jvmci/code/RegisterSaveLayout;") \ + objArrayOop_field(DebugInfo, virtualObjectMapping, "[Lcom/oracle/jvmci/meta/Value;") \ end_class \ start_class(HotSpotReferenceMap) \ - oop_field(HotSpotReferenceMap, registerRefMap, "Lcom/oracle/jvmci/hotspot/HotSpotReferenceMap$HotSpotOopMap;") \ - oop_field(HotSpotReferenceMap, frameRefMap, "Lcom/oracle/jvmci/hotspot/HotSpotReferenceMap$HotSpotOopMap;") \ + oop_field(HotSpotReferenceMap, registerRefMap, "Lcom/oracle/jvmci/hotspot/HotSpotReferenceMap$HotSpotOopMap;") \ + oop_field(HotSpotReferenceMap, frameRefMap, "Lcom/oracle/jvmci/hotspot/HotSpotReferenceMap$HotSpotOopMap;") \ end_class \ start_class(RegisterSaveLayout) \ - objArrayOop_field(RegisterSaveLayout, registers, "[Lcom/oracle/graal/api/code/Register;") \ + objArrayOop_field(RegisterSaveLayout, registers, "[Lcom/oracle/jvmci/code/Register;") \ typeArrayOop_field(RegisterSaveLayout, slots, "[I") \ end_class \ start_class(HotSpotOopMap) \ typeArrayOop_field(HotSpotOopMap, words, "[J") \ end_class \ start_class(BytecodeFrame) \ - objArrayOop_field(BytecodeFrame, values, "[Lcom/oracle/graal/api/meta/Value;") \ + objArrayOop_field(BytecodeFrame, values, "[Lcom/oracle/jvmci/meta/Value;") \ int_field(BytecodeFrame, numLocals) \ int_field(BytecodeFrame, numStack) \ int_field(BytecodeFrame, numLocks) \ @@ -180,8 +180,8 @@ static_int_field(BytecodeFrame, BEFORE_BCI) \ end_class \ start_class(BytecodePosition) \ - oop_field(BytecodePosition, caller, "Lcom/oracle/graal/api/code/BytecodePosition;") \ - oop_field(BytecodePosition, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ + oop_field(BytecodePosition, caller, "Lcom/oracle/jvmci/code/BytecodePosition;") \ + oop_field(BytecodePosition, method, "Lcom/oracle/jvmci/meta/ResolvedJavaMethod;") \ int_field(BytecodePosition, bci) \ end_class \ start_class(JavaConstant) \ @@ -207,24 +207,24 @@ end_class \ start_class(Kind) \ char_field(Kind, typeChar) \ - static_oop_field(Kind, Boolean, "Lcom/oracle/graal/api/meta/Kind;"); \ - static_oop_field(Kind, Byte, "Lcom/oracle/graal/api/meta/Kind;"); \ - static_oop_field(Kind, Char, "Lcom/oracle/graal/api/meta/Kind;"); \ - static_oop_field(Kind, Short, "Lcom/oracle/graal/api/meta/Kind;"); \ - static_oop_field(Kind, Int, "Lcom/oracle/graal/api/meta/Kind;"); \ - static_oop_field(Kind, Long, "Lcom/oracle/graal/api/meta/Kind;"); \ + static_oop_field(Kind, Boolean, "Lcom/oracle/jvmci/meta/Kind;"); \ + static_oop_field(Kind, Byte, "Lcom/oracle/jvmci/meta/Kind;"); \ + static_oop_field(Kind, Char, "Lcom/oracle/jvmci/meta/Kind;"); \ + static_oop_field(Kind, Short, "Lcom/oracle/jvmci/meta/Kind;"); \ + static_oop_field(Kind, Int, "Lcom/oracle/jvmci/meta/Kind;"); \ + static_oop_field(Kind, Long, "Lcom/oracle/jvmci/meta/Kind;"); \ end_class \ start_class(LIRKind) \ - oop_field(LIRKind, platformKind, "Lcom/oracle/graal/api/meta/PlatformKind;") \ + oop_field(LIRKind, platformKind, "Lcom/oracle/jvmci/meta/PlatformKind;") \ int_field(LIRKind, referenceMask) \ end_class \ start_class(AbstractValue) \ - oop_field(AbstractValue, kind, "Lcom/oracle/graal/api/meta/Kind;") \ - oop_field(AbstractValue, lirKind, "Lcom/oracle/graal/api/meta/LIRKind;") \ - static_oop_field(AbstractValue, ILLEGAL, "Lcom/oracle/graal/api/meta/AllocatableValue;"); \ + oop_field(AbstractValue, kind, "Lcom/oracle/jvmci/meta/Kind;") \ + oop_field(AbstractValue, lirKind, "Lcom/oracle/jvmci/meta/LIRKind;") \ + static_oop_field(AbstractValue, ILLEGAL, "Lcom/oracle/jvmci/meta/AllocatableValue;"); \ end_class \ start_class(RegisterValue) \ - oop_field(RegisterValue, reg, "Lcom/oracle/graal/api/code/Register;") \ + oop_field(RegisterValue, reg, "Lcom/oracle/jvmci/code/Register;") \ end_class \ start_class(RegisterCategory) \ oop_field(RegisterCategory, name, "Ljava/lang/String;") \ @@ -234,7 +234,7 @@ start_class(code_Register) \ int_field(code_Register, number) \ int_field(code_Register, encoding) \ - oop_field(code_Register, registerCategory, "Lcom/oracle/graal/api/code/Register$RegisterCategory;") \ + oop_field(code_Register, registerCategory, "Lcom/oracle/jvmci/code/Register$RegisterCategory;") \ end_class \ start_class(StackSlot) \ int_field(StackSlot, offset) \ @@ -242,19 +242,19 @@ end_class \ start_class(VirtualObject) \ int_field(VirtualObject, id) \ - oop_field(VirtualObject, type, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \ - objArrayOop_field(VirtualObject, values, "[Lcom/oracle/graal/api/meta/Value;") \ + oop_field(VirtualObject, type, "Lcom/oracle/jvmci/meta/ResolvedJavaType;") \ + objArrayOop_field(VirtualObject, values, "[Lcom/oracle/jvmci/meta/Value;") \ end_class \ start_class(StackLockValue) \ - oop_field(StackLockValue, owner, "Lcom/oracle/graal/api/meta/Value;") \ - oop_field(StackLockValue, slot, "Lcom/oracle/graal/api/code/StackSlotValue;") \ + oop_field(StackLockValue, owner, "Lcom/oracle/jvmci/meta/Value;") \ + oop_field(StackLockValue, slot, "Lcom/oracle/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, "Lcom/oracle/jvmci/hotspot/CompilerToVM;") \ + oop_field(HotSpotStackFrameReference, compilerToVM, "Lcom/oracle/jvmci/hotspot/CompilerToVM;") \ long_field(HotSpotStackFrameReference, stackPointer) \ int_field(HotSpotStackFrameReference, frameNumber) \ int_field(HotSpotStackFrameReference, bci) \ diff -r d12eaef9af72 -r 48c1ebd24120 src/share/vm/runtime/javaCalls.cpp --- a/src/share/vm/runtime/javaCalls.cpp Tue May 26 23:45:05 2015 +0200 +++ b/src/share/vm/runtime/javaCalls.cpp Wed May 27 00:36:16 2015 +0200 @@ -424,7 +424,7 @@ ((JavaThread*) THREAD)->set_graal_alternate_call_target(nm->verified_entry_point()); entry_point = method->adapter()->get_i2c_entry(); } else { - THROW(vmSymbols::com_oracle_graal_api_code_InvalidInstalledCodeException()); + THROW(vmSymbols::com_oracle_jvmci_code_InvalidInstalledCodeException()); } } #endif