# HG changeset patch # User Thomas Wuerthinger # Date 1433286716 -7200 # Node ID 902a6399353b96a05c3da493ab46645eca39df48 # Parent 824fe31b25c67daf283f10bf7a60afa7ebd8af5b# Parent 2e8c01def9a5dfda74915988cb1fe91c24f66aaa Merge. diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,207 +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.amd64; - -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.jvmci.code.Register.RegisterCategory; - -/** - * Represents the AMD64 architecture. - */ -public class AMD64 extends Architecture { - - public static final RegisterCategory CPU = new RegisterCategory("CPU"); - - // @formatter:off - - // General purpose CPU registers - public static final Register rax = new Register(0, 0, "rax", CPU); - public static final Register rcx = new Register(1, 1, "rcx", CPU); - public static final Register rdx = new Register(2, 2, "rdx", CPU); - public static final Register rbx = new Register(3, 3, "rbx", CPU); - public static final Register rsp = new Register(4, 4, "rsp", CPU); - public static final Register rbp = new Register(5, 5, "rbp", CPU); - public static final Register rsi = new Register(6, 6, "rsi", CPU); - public static final Register rdi = new Register(7, 7, "rdi", CPU); - - public static final Register r8 = new Register(8, 8, "r8", CPU); - public static final Register r9 = new Register(9, 9, "r9", CPU); - public static final Register r10 = new Register(10, 10, "r10", CPU); - public static final Register r11 = new Register(11, 11, "r11", CPU); - public static final Register r12 = new Register(12, 12, "r12", CPU); - public static final Register r13 = new Register(13, 13, "r13", CPU); - public static final Register r14 = new Register(14, 14, "r14", CPU); - public static final Register r15 = new Register(15, 15, "r15", CPU); - - public static final Register[] cpuRegisters = { - rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, - r8, r9, r10, r11, r12, r13, r14, r15 - }; - - private static final int XMM_REFERENCE_MAP_SHIFT = 2; - - public static final RegisterCategory XMM = new RegisterCategory("XMM", cpuRegisters.length, XMM_REFERENCE_MAP_SHIFT); - - // XMM registers - public static final Register xmm0 = new Register(16, 0, "xmm0", XMM); - public static final Register xmm1 = new Register(17, 1, "xmm1", XMM); - public static final Register xmm2 = new Register(18, 2, "xmm2", XMM); - public static final Register xmm3 = new Register(19, 3, "xmm3", XMM); - public static final Register xmm4 = new Register(20, 4, "xmm4", XMM); - public static final Register xmm5 = new Register(21, 5, "xmm5", XMM); - public static final Register xmm6 = new Register(22, 6, "xmm6", XMM); - public static final Register xmm7 = new Register(23, 7, "xmm7", XMM); - - public static final Register xmm8 = new Register(24, 8, "xmm8", XMM); - public static final Register xmm9 = new Register(25, 9, "xmm9", XMM); - public static final Register xmm10 = new Register(26, 10, "xmm10", XMM); - public static final Register xmm11 = new Register(27, 11, "xmm11", XMM); - public static final Register xmm12 = new Register(28, 12, "xmm12", XMM); - public static final Register xmm13 = new Register(29, 13, "xmm13", XMM); - public static final Register xmm14 = new Register(30, 14, "xmm14", XMM); - public static final Register xmm15 = new Register(31, 15, "xmm15", XMM); - - public static final Register[] xmmRegisters = { - xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, - xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 - }; - - public static final Register[] cpuxmmRegisters = { - rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, - r8, r9, r10, r11, r12, r13, r14, r15, - xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, - xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 - }; - - /** - * Register used to construct an instruction-relative address. - */ - public static final Register rip = new Register(32, -1, "rip", SPECIAL); - - public static final Register[] allRegisters = { - rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, - r8, r9, r10, r11, r12, r13, r14, r15, - xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, - xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, - rip - }; - - // @formatter:on - - /** - * Basic set of CPU features mirroring what is returned from the cpuid instruction. - */ - public static enum CPUFeature { - SSE, - SSE2, - SSE3, - SSE4a, - SSE4_1, - SSE4_2, - SSSE3, - POPCNT, - LZCNT, - AVX, - AVX2, - ERMS, - AMD_3DNOW_PREFETCH, - AES, - BMI1 - } - - private final EnumSet features; - - /** - * Set of flags to control code emission. - */ - public static enum Flag { - UseCountLeadingZerosInstruction, - UseCountTrailingZerosInstruction - } - - private final EnumSet flags; - - public AMD64(EnumSet features, EnumSet flags) { - super("AMD64", 8, ByteOrder.LITTLE_ENDIAN, true, allRegisters, LOAD_STORE | STORE_STORE, 1, cpuRegisters.length + (xmmRegisters.length << XMM_REFERENCE_MAP_SHIFT), 8); - this.features = features; - this.flags = flags; - assert features.contains(CPUFeature.SSE2) : "minimum config for x64"; - } - - public EnumSet getFeatures() { - return features; - } - - public EnumSet getFlags() { - return flags; - } - - @Override - public boolean canStoreValue(RegisterCategory category, PlatformKind platformKind) { - if (!(platformKind instanceof Kind)) { - return false; - } - - Kind kind = (Kind) platformKind; - if (category.equals(CPU)) { - switch (kind) { - case Boolean: - case Byte: - case Char: - case Short: - case Int: - case Long: - case Object: - return true; - } - } else if (category.equals(XMM)) { - switch (kind) { - case Float: - case Double: - return true; - } - } - - return false; - } - - @Override - public PlatformKind getLargestStorableKind(RegisterCategory category) { - if (category.equals(CPU)) { - return Kind.Long; - } else if (category.equals(XMM)) { - return Kind.Double; - } else { - return Kind.Illegal; - } - } -} diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/BitOpsTest.java Wed Jun 03 01:11:56 2015 +0200 @@ -23,12 +23,15 @@ package com.oracle.graal.asm.amd64.test; +import com.oracle.jvmci.amd64.*; +import com.oracle.jvmci.amd64.AMD64.*; 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.*; @@ -40,8 +43,6 @@ import org.junit.*; -import com.oracle.graal.amd64.*; -import com.oracle.graal.amd64.AMD64.CPUFeature; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.test.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/IncrementDecrementMacroTest.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,12 +22,14 @@ */ package com.oracle.graal.asm.amd64.test; +import com.oracle.jvmci.amd64.*; 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.*; @@ -36,7 +38,6 @@ import org.junit.*; -import com.oracle.graal.amd64.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.test.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.asm.amd64.test/src/com/oracle/graal/asm/amd64/test/SimpleAssemblerTest.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.asm.amd64.test; +import com.oracle.jvmci.amd64.*; import com.oracle.jvmci.code.RegisterConfig; import com.oracle.jvmci.code.TargetDescription; import com.oracle.jvmci.code.Register; @@ -29,13 +30,13 @@ 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.*; import org.junit.*; -import com.oracle.graal.amd64.*; import com.oracle.jvmci.code.CompilationResult.DataSectionReference; import com.oracle.jvmci.code.DataSection.Data; import com.oracle.jvmci.code.DataSection.DataBuilder; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64Assembler.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,10 +22,13 @@ */ package com.oracle.graal.asm.amd64; +import com.oracle.jvmci.amd64.*; +import com.oracle.jvmci.amd64.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.jvmci.amd64.AMD64.*; import static com.oracle.jvmci.code.MemoryBarriers.*; import static com.oracle.graal.asm.NumUtil.*; import static com.oracle.graal.asm.amd64.AMD64AsmOptions.*; @@ -33,8 +36,6 @@ import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MOp.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize.*; -import com.oracle.graal.amd64.*; -import com.oracle.graal.amd64.AMD64.CPUFeature; import com.oracle.jvmci.code.Register.RegisterCategory; import com.oracle.graal.asm.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64MacroAssembler.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,14 +22,15 @@ */ package com.oracle.graal.asm.amd64; +import com.oracle.jvmci.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.asm.*; /** diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAddress.java Wed Jun 03 01:11:56 2015 +0200 @@ -24,10 +24,11 @@ import com.oracle.jvmci.code.AbstractAddress; import com.oracle.jvmci.code.Register; -import static com.oracle.graal.sparc.SPARC.*; + +import static com.oracle.jvmci.sparc.SPARC.*; -import com.oracle.graal.sparc.*; import com.oracle.jvmci.common.*; +import com.oracle.jvmci.sparc.*; public class SPARCAddress extends AbstractAddress { diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java Wed Jun 03 01:11:56 2015 +0200 @@ -27,19 +27,20 @@ import com.oracle.jvmci.code.Register; import com.oracle.jvmci.meta.Kind; import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.sparc.*; +import com.oracle.jvmci.sparc.SPARC.*; + 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.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.Op3s.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.Opfs.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; -import static com.oracle.graal.sparc.SPARC.*; +import static com.oracle.jvmci.sparc.SPARC.*; import static java.lang.String.*; import com.oracle.graal.asm.*; import com.oracle.graal.compiler.common.calc.*; -import com.oracle.graal.sparc.*; -import com.oracle.graal.sparc.SPARC.CPUFeature; import com.oracle.jvmci.common.*; /** diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCMacroAssembler.java Wed Jun 03 01:11:56 2015 +0200 @@ -26,9 +26,10 @@ 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 static com.oracle.jvmci.sparc.SPARC.*; import java.util.function.*; diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/AMD64AllocatorTest.java --- a/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/AMD64AllocatorTest.java Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/AMD64AllocatorTest.java Wed Jun 03 01:11:56 2015 +0200 @@ -27,8 +27,8 @@ import org.junit.*; -import com.oracle.graal.amd64.*; import com.oracle.graal.compiler.test.backend.*; +import com.oracle.jvmci.amd64.*; public class AMD64AllocatorTest extends AllocatorTest { diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/ConstantStackMoveTest.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,14 +22,15 @@ */ package com.oracle.graal.compiler.amd64.test; +import com.oracle.jvmci.amd64.*; 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.lir.framemap.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.jtt.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/StackStoreTest.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,16 +22,17 @@ */ package com.oracle.graal.compiler.amd64.test; +import com.oracle.jvmci.amd64.*; 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.lir.framemap.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.jtt.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64LIRGenerator.java Wed Jun 03 01:11:56 2015 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.compiler.amd64; +import com.oracle.jvmci.amd64.*; import com.oracle.jvmci.code.RegisterConfig; import com.oracle.jvmci.code.Register; import com.oracle.jvmci.code.ForeignCallLinkage; @@ -38,6 +39,7 @@ 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.*; @@ -49,7 +51,6 @@ import java.util.*; -import com.oracle.graal.amd64.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.AMD64Address.Scale; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeLIRBuilder.java Wed Jun 03 01:11:56 2015 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.compiler.amd64; +import com.oracle.jvmci.amd64.*; import com.oracle.jvmci.code.CallingConvention; import com.oracle.jvmci.meta.Kind; import com.oracle.jvmci.meta.JavaType; @@ -31,11 +32,11 @@ 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.asm.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MIOp; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64RMOp; diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.graal.compiler.sparc.test/src/com/oracle/graal/compiler/sparc/test/SPARCAllocatorTest.java --- a/graal/com.oracle.graal.compiler.sparc.test/src/com/oracle/graal/compiler/sparc/test/SPARCAllocatorTest.java Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.compiler.sparc.test/src/com/oracle/graal/compiler/sparc/test/SPARCAllocatorTest.java Wed Jun 03 01:11:56 2015 +0200 @@ -28,7 +28,7 @@ import org.junit.*; import com.oracle.graal.compiler.test.backend.*; -import com.oracle.graal.sparc.*; +import com.oracle.jvmci.sparc.*; public class SPARCAllocatorTest extends AllocatorTest { diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Wed Jun 03 01:11:56 2015 +0200 @@ -33,6 +33,9 @@ import com.oracle.jvmci.meta.PlatformKind; import com.oracle.jvmci.meta.Kind; import com.oracle.jvmci.meta.LIRKind; +import com.oracle.jvmci.sparc.*; +import com.oracle.jvmci.sparc.SPARC.*; + import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.sparc.SPARCArithmetic.*; import static com.oracle.graal.lir.sparc.SPARCBitManipulationOp.IntrinsicOpcode.*; @@ -71,8 +74,6 @@ import com.oracle.graal.lir.sparc.SPARCMove.SPARCStackMove; import com.oracle.graal.lir.sparc.SPARCMove.StackLoadAddressOp; import com.oracle.graal.phases.util.*; -import com.oracle.graal.sparc.*; -import com.oracle.graal.sparc.SPARC.CPUFeature; import com.oracle.jvmci.common.*; /** diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java Wed Jun 03 01:11:56 2015 +0200 @@ -29,7 +29,8 @@ 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 static com.oracle.jvmci.amd64.AMD64.*; import java.util.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64.test/src/com/oracle/graal/hotspot/amd64/test/DataPatchInConstantsTest.java Wed Jun 03 01:11:56 2015 +0200 @@ -25,12 +25,12 @@ 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.replacements.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.graph.*; @@ -45,6 +45,7 @@ import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; +import com.oracle.jvmci.amd64.*; import com.oracle.jvmci.hotspot.*; public class DataPatchInConstantsTest extends HotSpotGraalCompilerTest { diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64DeoptimizationStub.java Wed Jun 03 01:11:56 2015 +0200 @@ -25,12 +25,14 @@ 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 static com.oracle.jvmci.amd64.AMD64.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.jvmci.hotspot.*; +import com.oracle.jvmci.hotspot.amd64.*; final class AMD64DeoptimizationStub extends DeoptimizationStub { diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.amd64.*; import com.oracle.jvmci.code.CompilationResult; import com.oracle.jvmci.code.Register; import com.oracle.jvmci.code.RegisterConfig; @@ -30,7 +31,8 @@ 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.jvmci.amd64.AMD64.*; import static com.oracle.jvmci.code.CallingConvention.Type.*; import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.compiler.common.GraalOptions.*; @@ -38,7 +40,6 @@ import java.util.*; -import com.oracle.graal.amd64.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.ConditionFlag; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackendFactory.java Wed Jun 03 01:11:56 2015 +0200 @@ -26,7 +26,6 @@ import java.util.*; -import com.oracle.graal.amd64.*; import com.oracle.graal.api.replacements.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.hotspot.*; @@ -34,6 +33,7 @@ import com.oracle.graal.hotspot.word.*; import com.oracle.graal.phases.util.*; import com.oracle.graal.replacements.amd64.*; +import com.oracle.jvmci.amd64.*; import com.oracle.jvmci.code.*; import com.oracle.jvmci.hotspot.*; import com.oracle.jvmci.meta.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBytecodeLIRBuilder.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.amd64; -import static com.oracle.graal.amd64.AMD64.*; +import static com.oracle.jvmci.amd64.AMD64.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.lir.gen.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -23,7 +23,8 @@ package com.oracle.graal.hotspot.amd64; import com.oracle.jvmci.code.Register; -import static com.oracle.graal.amd64.AMD64.*; + +import static com.oracle.jvmci.amd64.AMD64.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotCounterOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -26,7 +26,8 @@ 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.jvmci.amd64.AMD64.*; import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.jvmci.common.JVMCIError.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotEnterUnpackFramesStackFrameOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -27,7 +27,8 @@ 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.jvmci.amd64.AMD64.*; import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotEpilogueOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,8 +22,8 @@ */ package com.oracle.graal.hotspot.amd64; -import static com.oracle.graal.amd64.AMD64.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; +import static com.oracle.jvmci.amd64.AMD64.*; import static com.oracle.jvmci.code.ValueUtil.*; import com.oracle.graal.asm.amd64.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java Wed Jun 03 01:11:56 2015 +0200 @@ -30,7 +30,8 @@ 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.jvmci.amd64.AMD64.*; import static com.oracle.jvmci.code.CallingConvention.Type.*; import static com.oracle.jvmci.meta.LocationIdentity.*; import static com.oracle.jvmci.meta.Value.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -24,7 +24,8 @@ import com.oracle.jvmci.code.Register; import com.oracle.jvmci.meta.AllocatableValue; -import static com.oracle.graal.amd64.AMD64.*; + +import static com.oracle.jvmci.amd64.AMD64.*; import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,15 +22,14 @@ */ package com.oracle.graal.hotspot.amd64; -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.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; +import static com.oracle.jvmci.amd64.AMD64.*; import java.util.*; -import com.oracle.graal.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MIOp; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; import com.oracle.graal.compiler.amd64.*; @@ -50,6 +49,7 @@ import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.framemap.*; import com.oracle.graal.lir.gen.*; +import com.oracle.jvmci.amd64.*; import com.oracle.jvmci.code.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.debug.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.amd64; -import static com.oracle.graal.amd64.AMD64.*; +import static com.oracle.jvmci.amd64.AMD64.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -24,7 +24,8 @@ import com.oracle.jvmci.code.Register; import com.oracle.jvmci.meta.AllocatableValue; -import static com.oracle.graal.amd64.AMD64.*; + +import static com.oracle.jvmci.amd64.AMD64.*; import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,12 +22,11 @@ */ package com.oracle.graal.hotspot.amd64; -import static com.oracle.graal.amd64.AMD64.*; import static com.oracle.graal.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; +import static com.oracle.jvmci.amd64.AMD64.*; import static com.oracle.jvmci.code.ValueUtil.*; -import com.oracle.graal.amd64.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64RMOp; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; @@ -50,6 +49,7 @@ import com.oracle.graal.nodes.calc.*; import com.oracle.graal.nodes.extended.*; import com.oracle.graal.nodes.memory.*; +import com.oracle.jvmci.amd64.*; import com.oracle.jvmci.code.*; import com.oracle.jvmci.debug.*; import com.oracle.jvmci.hotspot.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -23,7 +23,8 @@ package com.oracle.graal.hotspot.amd64; import com.oracle.jvmci.meta.AllocatableValue; -import static com.oracle.graal.amd64.AMD64.*; + +import static com.oracle.jvmci.amd64.AMD64.*; import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -24,7 +24,8 @@ import com.oracle.jvmci.code.Register; import com.oracle.jvmci.meta.AllocatableValue; -import static com.oracle.graal.amd64.AMD64.*; + +import static com.oracle.jvmci.amd64.AMD64.*; import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.amd64; -import static com.oracle.graal.amd64.AMD64.*; +import static com.oracle.jvmci.amd64.AMD64.*; import java.util.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,271 +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.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.jvmci.code.CallingConvention.Type; -import com.oracle.graal.compiler.common.*; -import com.oracle.jvmci.common.*; -import com.oracle.jvmci.hotspot.*; - -public class AMD64HotSpotRegisterConfig implements RegisterConfig { - - private final Architecture architecture; - - private final Register[] allocatable; - - private final int maxFrameSize; - - /** - * The same as {@link #allocatable}, except if parameter registers are removed with the - * {@link GraalOptions#RegisterPressure} option. The caller saved registers always include all - * parameter registers. - */ - private final Register[] callerSaved; - - private final boolean allAllocatableAreCallerSaved; - - private final RegisterAttributes[] attributesMap; - - public int getMaximumFrameSize() { - return maxFrameSize; - } - - @Override - public Register[] getAllocatableRegisters() { - return allocatable.clone(); - } - - public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { - ArrayList list = new ArrayList<>(); - for (Register reg : registers) { - if (architecture.canStoreValue(reg.getRegisterCategory(), kind)) { - list.add(reg); - } - } - - Register[] ret = list.toArray(new Register[list.size()]); - return ret; - } - - @Override - public RegisterAttributes[] getAttributesMap() { - return attributesMap.clone(); - } - - private final Register[] javaGeneralParameterRegisters; - private final Register[] nativeGeneralParameterRegisters; - private final Register[] xmmParameterRegisters = {xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7}; - - /* - * Some ABIs (e.g. Windows) require a so-called "home space", that is a save area on the stack - * to store the argument registers - */ - private final boolean needsNativeStackHomeSpace; - - private final CalleeSaveLayout csl; - - private static Register[] initAllocatable(boolean reserveForHeapBase) { - Register[] registers = null; - // @formatter:off - if (reserveForHeapBase) { - registers = new Register[] { - rax, rbx, rcx, rdx, /*rsp,*/ rbp, rsi, rdi, r8, r9, r10, r11, /*r12,*/ r13, r14, /*r15, */ - xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, - xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 - }; - } else { - registers = new Register[] { - rax, rbx, rcx, rdx, /*rsp,*/ rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, /*r15, */ - xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, - xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 - }; - } - // @formatter:on - return registers; - } - - public AMD64HotSpotRegisterConfig(Architecture architecture, HotSpotVMConfig config) { - this(architecture, config, initAllocatable(config.useCompressedOops)); - assert callerSaved.length == allocatable.length || RegisterPressure.getValue() != null; - } - - public AMD64HotSpotRegisterConfig(Architecture architecture, HotSpotVMConfig config, Register[] allocatable) { - this.architecture = architecture; - this.maxFrameSize = config.maxFrameSize; - - if (config.windowsOs) { - javaGeneralParameterRegisters = new Register[]{rdx, r8, r9, rdi, rsi, rcx}; - nativeGeneralParameterRegisters = new Register[]{rcx, rdx, r8, r9}; - this.needsNativeStackHomeSpace = true; - } else { - javaGeneralParameterRegisters = new Register[]{rsi, rdx, rcx, r8, r9, rdi}; - nativeGeneralParameterRegisters = new Register[]{rdi, rsi, rdx, rcx, r8, r9}; - this.needsNativeStackHomeSpace = false; - } - - csl = null; - this.allocatable = allocatable.clone(); - Set callerSaveSet = new HashSet<>(); - Collections.addAll(callerSaveSet, allocatable); - Collections.addAll(callerSaveSet, xmmParameterRegisters); - Collections.addAll(callerSaveSet, javaGeneralParameterRegisters); - Collections.addAll(callerSaveSet, nativeGeneralParameterRegisters); - callerSaved = callerSaveSet.toArray(new Register[callerSaveSet.size()]); - - allAllocatableAreCallerSaved = true; - attributesMap = RegisterAttributes.createMap(this, AMD64.allRegisters); - } - - @Override - public Register[] getCallerSaveRegisters() { - return callerSaved; - } - - @Override - public boolean areAllAllocatableRegistersCallerSaved() { - return allAllocatableAreCallerSaved; - } - - @Override - public Register getRegisterForRole(int index) { - throw new UnsupportedOperationException(); - } - - @Override - public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { - if (type == Type.NativeCall) { - return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); - } - // On x64, parameter locations are the same whether viewed - // from the caller or callee perspective - return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); - } - - public Register[] getCallingConventionRegisters(Type type, Kind kind) { - if (architecture.canStoreValue(XMM, kind)) { - return xmmParameterRegisters; - } - assert architecture.canStoreValue(CPU, kind); - return type == Type.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; - } - - private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) { - AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; - - int currentGeneral = 0; - int currentXMM = 0; - int currentStackOffset = type == Type.NativeCall && needsNativeStackHomeSpace ? generalParameterRegisters.length * target.wordSize : 0; - - for (int i = 0; i < parameterTypes.length; i++) { - final Kind kind = parameterTypes[i].getKind(); - - switch (kind) { - case Byte: - case Boolean: - case Short: - case Char: - case Int: - case Long: - case Object: - if (!stackOnly && currentGeneral < generalParameterRegisters.length) { - Register register = generalParameterRegisters[currentGeneral++]; - locations[i] = register.asValue(target.getLIRKind(kind)); - } - break; - case Float: - case Double: - if (!stackOnly && currentXMM < xmmParameterRegisters.length) { - Register register = xmmParameterRegisters[currentXMM++]; - locations[i] = register.asValue(target.getLIRKind(kind)); - } - break; - default: - throw JVMCIError.shouldNotReachHere(); - } - - if (locations[i] == null) { - locations[i] = StackSlot.get(target.getLIRKind(kind.getStackKind()), currentStackOffset, !type.out); - currentStackOffset += Math.max(target.getSizeInBytes(kind), target.wordSize); - } - } - - Kind returnKind = returnType == null ? Kind.Void : returnType.getKind(); - AllocatableValue returnLocation = returnKind == Kind.Void ? Value.ILLEGAL : getReturnRegister(returnKind).asValue(target.getLIRKind(returnKind.getStackKind())); - return new CallingConvention(currentStackOffset, returnLocation, locations); - } - - @Override - public Register getReturnRegister(Kind kind) { - switch (kind) { - case Boolean: - case Byte: - case Char: - case Short: - case Int: - case Long: - case Object: - return rax; - case Float: - case Double: - return xmm0; - case Void: - case Illegal: - return null; - default: - throw new UnsupportedOperationException("no return register for type " + kind); - } - } - - @Override - public Register getFrameRegister() { - return rsp; - } - - public CalleeSaveLayout getCalleeSaveLayout() { - return csl; - } - - @Override - public String toString() { - return String.format("Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" + "CallerSave: " + Arrays.toString(getCallerSaveRegisters()) + "%n"); - } -} diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotSafepointOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -30,9 +30,10 @@ 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 static com.oracle.jvmci.amd64.AMD64.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotUnwindOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,9 +22,9 @@ */ package com.oracle.graal.hotspot.amd64; -import static com.oracle.graal.amd64.AMD64.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; +import static com.oracle.jvmci.amd64.AMD64.*; import static com.oracle.jvmci.code.ValueUtil.*; import com.oracle.graal.asm.amd64.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -24,12 +24,12 @@ import com.oracle.jvmci.meta.Value; import com.oracle.jvmci.meta.ResolvedJavaMethod; -import com.oracle.graal.amd64.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.AMD64Call.DirectCallOp; import com.oracle.graal.lir.asm.*; import com.oracle.graal.nodes.CallTargetNode.InvokeKind; +import com.oracle.jvmci.amd64.*; import com.oracle.jvmci.hotspot.*; /** diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64IndirectCallOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,13 +22,14 @@ */ package com.oracle.graal.hotspot.amd64; +import com.oracle.jvmci.amd64.*; 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.asm.amd64.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.amd64.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64UncommonTrapStub.java Wed Jun 03 01:11:56 2015 +0200 @@ -25,12 +25,14 @@ 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 static com.oracle.jvmci.amd64.AMD64.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.stubs.*; import com.oracle.jvmci.hotspot.*; +import com.oracle.jvmci.hotspot.amd64.*; final class AMD64UncommonTrapStub extends UncommonTrapStub { diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +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.hotspot.amd64.jvmci; - -import static com.oracle.jvmci.hotspot.InitTimer.*; - -import java.util.*; - -import com.oracle.graal.amd64.*; -import com.oracle.graal.hotspot.*; -import com.oracle.graal.hotspot.amd64.*; -import com.oracle.jvmci.code.*; -import com.oracle.jvmci.hotspot.*; -import com.oracle.jvmci.meta.*; -import com.oracle.jvmci.runtime.*; -import com.oracle.jvmci.service.*; - -@ServiceProvider(HotSpotJVMCIBackendFactory.class) -public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { - - protected Architecture createArchitecture(HotSpotVMConfig config) { - return new AMD64(computeFeatures(config), computeFlags(config)); - } - - protected EnumSet computeFeatures(HotSpotVMConfig config) { - // Configure the feature set using the HotSpot flag settings. - EnumSet features = EnumSet.noneOf(AMD64.CPUFeature.class); - assert config.useSSE >= 2 : "minimum config for x64"; - features.add(AMD64.CPUFeature.SSE); - features.add(AMD64.CPUFeature.SSE2); - if ((config.x86CPUFeatures & config.cpuSSE3) != 0) { - features.add(AMD64.CPUFeature.SSE3); - } - if ((config.x86CPUFeatures & config.cpuSSSE3) != 0) { - features.add(AMD64.CPUFeature.SSSE3); - } - if ((config.x86CPUFeatures & config.cpuSSE4A) != 0) { - features.add(AMD64.CPUFeature.SSE4a); - } - if ((config.x86CPUFeatures & config.cpuSSE41) != 0) { - features.add(AMD64.CPUFeature.SSE4_1); - } - if ((config.x86CPUFeatures & config.cpuSSE42) != 0) { - features.add(AMD64.CPUFeature.SSE4_2); - } - if ((config.x86CPUFeatures & config.cpuAVX) != 0) { - features.add(AMD64.CPUFeature.AVX); - } - if ((config.x86CPUFeatures & config.cpuAVX2) != 0) { - features.add(AMD64.CPUFeature.AVX2); - } - if ((config.x86CPUFeatures & config.cpuERMS) != 0) { - features.add(AMD64.CPUFeature.ERMS); - } - if ((config.x86CPUFeatures & config.cpuLZCNT) != 0) { - features.add(AMD64.CPUFeature.LZCNT); - } - if ((config.x86CPUFeatures & config.cpuPOPCNT) != 0) { - features.add(AMD64.CPUFeature.POPCNT); - } - if ((config.x86CPUFeatures & config.cpuAES) != 0) { - features.add(AMD64.CPUFeature.AES); - } - if ((config.x86CPUFeatures & config.cpu3DNOWPREFETCH) != 0) { - features.add(AMD64.CPUFeature.AMD_3DNOW_PREFETCH); - } - if ((config.x86CPUFeatures & config.cpuBMI1) != 0) { - features.add(AMD64.CPUFeature.BMI1); - } - return features; - } - - protected EnumSet computeFlags(HotSpotVMConfig config) { - EnumSet flags = EnumSet.noneOf(AMD64.Flag.class); - if (config.useCountLeadingZerosInstruction) { - flags.add(AMD64.Flag.UseCountLeadingZerosInstruction); - } - if (config.useCountTrailingZerosInstruction) { - flags.add(AMD64.Flag.UseCountTrailingZerosInstruction); - } - return flags; - } - - protected TargetDescription createTarget(HotSpotVMConfig config) { - final int stackFrameAlignment = 16; - final int implicitNullCheckLimit = 4096; - final boolean inlineObjects = true; - return new HotSpotTargetDescription(createArchitecture(config), true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); - } - - protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntimeProvider runtime) { - return new HotSpotConstantReflectionProvider(runtime); - } - - protected RegisterConfig createRegisterConfig(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target) { - return new AMD64HotSpotRegisterConfig(target.arch, runtime.getConfig()); - } - - protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { - return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); - } - - protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntimeProvider runtime) { - return new HotSpotMetaAccessProvider(runtime); - } - - public String getArchitecture() { - return "AMD64"; - } - - @Override - public String toString() { - return getJVMCIRuntimeName() + ":" + getArchitecture(); - } - - public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { - - assert host == null; - TargetDescription target = createTarget(runtime.getConfig()); - - RegisterConfig regConfig; - HotSpotCodeCacheProvider codeCache; - ConstantReflectionProvider constantReflection; - HotSpotMetaAccessProvider metaAccess; - try (InitTimer t = timer("create providers")) { - try (InitTimer rt = timer("create MetaAccess provider")) { - metaAccess = createMetaAccess(runtime); - } - try (InitTimer rt = timer("create RegisterConfig")) { - regConfig = createRegisterConfig(runtime, target); - } - try (InitTimer rt = timer("create CodeCache provider")) { - codeCache = createCodeCache(runtime, target, regConfig); - } - try (InitTimer rt = timer("create ConstantReflection provider")) { - constantReflection = createConstantReflection(runtime); - } - } - try (InitTimer rt = timer("instantiate backend")) { - return createBackend(metaAccess, codeCache, constantReflection); - } - } - - protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection) { - return new JVMCIBackend(metaAccess, codeCache, constantReflection); - } - - public String getJVMCIRuntimeName() { - return "basic"; - } -} diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCDeoptimizationStub.java Wed Jun 03 01:11:56 2015 +0200 @@ -25,7 +25,9 @@ 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.jvmci.hotspot.sparc.*; + +import static com.oracle.jvmci.sparc.SPARC.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java Wed Jun 03 01:11:56 2015 +0200 @@ -29,6 +29,7 @@ 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.*; @@ -36,8 +37,8 @@ import static com.oracle.graal.asm.sparc.SPARCAssembler.CC.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag.*; import static com.oracle.graal.compiler.common.GraalOptions.*; -import static com.oracle.graal.sparc.SPARC.*; import static com.oracle.jvmci.common.UnsafeAccess.*; +import static com.oracle.jvmci.sparc.SPARC.*; import java.util.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackendFactory.java Wed Jun 03 01:11:56 2015 +0200 @@ -31,12 +31,12 @@ import com.oracle.graal.nodes.spi.*; import com.oracle.graal.phases.util.*; import com.oracle.graal.replacements.sparc.*; -import com.oracle.graal.sparc.*; import com.oracle.jvmci.code.*; import com.oracle.jvmci.hotspot.*; import com.oracle.jvmci.meta.*; import com.oracle.jvmci.runtime.*; import com.oracle.jvmci.service.*; +import com.oracle.jvmci.sparc.*; @ServiceProvider(HotSpotBackendFactory.class) public class SPARCHotSpotBackendFactory implements HotSpotBackendFactory { diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -26,8 +26,9 @@ 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 static com.oracle.jvmci.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -26,8 +26,9 @@ 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 static com.oracle.jvmci.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotEnterUnpackFramesStackFrameOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -24,9 +24,10 @@ import com.oracle.jvmci.code.Register; import com.oracle.jvmci.meta.AllocatableValue; + import static com.oracle.jvmci.code.ValueUtil.*; +import static com.oracle.jvmci.sparc.SPARC.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import static com.oracle.graal.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.hotspot.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java Wed Jun 03 01:11:56 2015 +0200 @@ -30,15 +30,16 @@ 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.jvmci.sparc.SPARC.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.hotspot.HotSpotBackend.Options.*; import static com.oracle.graal.hotspot.HotSpotForeignCallLinkage.*; import static com.oracle.graal.hotspot.HotSpotForeignCallLinkage.RegisterEffect.*; import static com.oracle.graal.hotspot.HotSpotForeignCallLinkage.Transition.*; import static com.oracle.graal.hotspot.HotSpotHostBackend.*; -import static com.oracle.graal.sparc.SPARC.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -24,9 +24,10 @@ import com.oracle.jvmci.code.Register; import com.oracle.jvmci.meta.AllocatableValue; + import static com.oracle.jvmci.code.ValueUtil.*; +import static com.oracle.jvmci.sparc.SPARC.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import static com.oracle.graal.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCAssembler.CC; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Wed Jun 03 01:11:56 2015 +0200 @@ -37,10 +37,12 @@ import com.oracle.jvmci.meta.LIRKind; import com.oracle.jvmci.meta.Value; import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.sparc.*; + import static com.oracle.jvmci.code.ValueUtil.*; +import static com.oracle.jvmci.sparc.SPARC.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; -import static com.oracle.graal.sparc.SPARC.*; import java.util.*; @@ -60,7 +62,6 @@ import com.oracle.graal.lir.sparc.SPARCMove.NullCheckOp; import com.oracle.graal.lir.sparc.SPARCMove.StoreConstantOp; import com.oracle.graal.lir.sparc.SPARCMove.StoreOp; -import com.oracle.graal.sparc.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.hotspot.*; import com.oracle.jvmci.hotspot.HotSpotVMConfig.CompressEncoding; diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.sparc.SPARC.*; +import static com.oracle.jvmci.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,7 +22,7 @@ */ package com.oracle.graal.hotspot.sparc; -import static com.oracle.graal.sparc.SPARC.*; +import static com.oracle.jvmci.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveUnpackFramesStackFrameOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -23,7 +23,8 @@ package com.oracle.graal.hotspot.sparc; import com.oracle.jvmci.code.Register; -import static com.oracle.graal.sparc.SPARC.*; + +import static com.oracle.jvmci.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.hotspot.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotMove.java Wed Jun 03 01:11:56 2015 +0200 @@ -28,6 +28,8 @@ import com.oracle.jvmci.meta.Kind; import com.oracle.jvmci.meta.Value; import com.oracle.jvmci.meta.AllocatableValue; +import com.oracle.jvmci.sparc.*; + import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; @@ -45,7 +47,6 @@ import com.oracle.graal.lir.StandardOp.MoveOp; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.sparc.*; -import com.oracle.graal.sparc.*; import com.oracle.jvmci.common.*; import com.oracle.jvmci.hotspot.*; import com.oracle.jvmci.hotspot.HotSpotVMConfig.CompressEncoding; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java Wed Jun 03 01:11:56 2015 +0200 @@ -32,9 +32,10 @@ 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.jvmci.sparc.SPARC.*; import static com.oracle.graal.hotspot.HotSpotBackend.*; -import static com.oracle.graal.sparc.SPARC.*; import com.oracle.graal.compiler.gen.*; import com.oracle.graal.compiler.sparc.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -24,9 +24,10 @@ import com.oracle.jvmci.code.Register; import com.oracle.jvmci.meta.AllocatableValue; + import static com.oracle.jvmci.code.ValueUtil.*; +import static com.oracle.jvmci.sparc.SPARC.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import static com.oracle.graal.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -24,9 +24,10 @@ import com.oracle.jvmci.code.Register; import com.oracle.jvmci.meta.AllocatableValue; + import static com.oracle.jvmci.code.ValueUtil.*; +import static com.oracle.jvmci.sparc.SPARC.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import static com.oracle.graal.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,301 +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.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.jvmci.code.CallingConvention.Type; -import com.oracle.graal.asm.*; -import com.oracle.graal.lir.framemap.*; -import com.oracle.graal.sparc.*; -import com.oracle.jvmci.common.*; -import com.oracle.jvmci.hotspot.*; - -public class SPARCHotSpotRegisterConfig implements RegisterConfig { - - private final Architecture architecture; - - private final Register[] allocatable; - - private final RegisterAttributes[] attributesMap; - - @Override - public Register[] getAllocatableRegisters() { - return allocatable.clone(); - } - - public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { - ArrayList list = new ArrayList<>(); - for (Register reg : registers) { - if (architecture.canStoreValue(reg.getRegisterCategory(), kind)) { - // Special treatment for double precision - // TODO: This is wasteful it uses only half of the registers as float. - if (kind == Kind.Double) { - if (reg.name.startsWith("d")) { - list.add(reg); - } - } else if (kind == Kind.Float) { - if (reg.name.startsWith("f")) { - list.add(reg); - } - } else { - list.add(reg); - } - } - } - - Register[] ret = list.toArray(new Register[list.size()]); - return ret; - } - - @Override - public RegisterAttributes[] getAttributesMap() { - return attributesMap.clone(); - } - - private final Register[] cpuCallerParameterRegisters = {o0, o1, o2, o3, o4, o5}; - private final Register[] cpuCalleeParameterRegisters = {i0, i1, i2, i3, i4, i5}; - - private final Register[] fpuParameterRegisters = {f0, f1, f2, f3, f4, f5, f6, f7}; - private final Register[] fpuDoubleParameterRegisters = {d0, null, d2, null, d4, null, d6, null}; - // @formatter:off - private final Register[] callerSaveRegisters = - {g1, g2, g3, g4, g5, g6, g7, - o0, o1, o2, o3, o4, o5, o7, - f0, f1, f2, f3, f4, f5, f6, f7, - f8, f9, f10, f11, f12, f13, f14, f15, - f16, f17, f18, f19, f20, f21, f22, f23, - f24, f25, f26, f27, f28, f29, f30, f31, - d32, d34, d36, d38, d40, d42, d44, d46, - d48, d50, d52, d54, d56, d58, d60, d62}; - // @formatter:on - - /** - * Registers saved by the callee. This lists all L and I registers which are saved in the - * register window. {@link FrameMap} uses this array to calculate the spill area size. - */ - private final Register[] calleeSaveRegisters = {l0, l1, l2, l3, l4, l5, l6, l7, i0, i1, i2, i3, i4, i5, i6, i7}; - - private final CalleeSaveLayout csl; - - private static Register[] initAllocatable(boolean reserveForHeapBase) { - Register[] registers = null; - if (reserveForHeapBase) { - // @formatter:off - registers = new Register[]{ - // TODO this is not complete - // o7 cannot be used as register because it is always overwritten on call - // and the current register handler would ignore this fact if the called - // method still does not modify registers, in fact o7 is modified by the Call instruction - // There would be some extra handlin necessary to be able to handle the o7 properly for local usage - o0, o1, o2, o3, o4, o5, /*o6, o7,*/ - l0, l1, l2, l3, l4, l5, l6, l7, - i0, i1, i2, i3, i4, i5, /*i6,*/ /*i7,*/ - //f0, f1, f2, f3, f4, f5, f6, f7, - f8, f9, f10, f11, f12, f13, f14, f15, - f16, f17, f18, f19, f20, f21, f22, f23, - f24, f25, f26, f27, f28, f29, f30, f31, - d32, d34, d36, d38, d40, d42, d44, d46, - d48, d50, d52, d54, d56, d58, d60, d62 - }; - // @formatter:on - } else { - // @formatter:off - registers = new Register[]{ - // TODO this is not complete - o0, o1, o2, o3, o4, o5, /*o6, o7,*/ - l0, l1, l2, l3, l4, l5, l6, l7, - i0, i1, i2, i3, i4, i5, /*i6,*/ /*i7,*/ -// f0, f1, f2, f3, f4, f5, f6, f7 - f8, f9, f10, f11, f12, f13, f14, f15, - f16, f17, f18, f19, f20, f21, f22, f23, - f24, f25, f26, f27, f28, f29, f30, f31, - d32, d34, d36, d38, d40, d42, d44, d46, - d48, d50, d52, d54, d56, d58, d60, d62 - }; - // @formatter:on - } - - return registers; - } - - public SPARCHotSpotRegisterConfig(TargetDescription target, HotSpotVMConfig config) { - this(target, initAllocatable(config.useCompressedOops)); - } - - public SPARCHotSpotRegisterConfig(TargetDescription target, Register[] allocatable) { - this.architecture = target.arch; - - csl = new CalleeSaveLayout(target, -1, -1, target.arch.getWordSize(), calleeSaveRegisters); - this.allocatable = allocatable.clone(); - attributesMap = RegisterAttributes.createMap(this, SPARC.allRegisters); - } - - @Override - public Register[] getCallerSaveRegisters() { - return callerSaveRegisters; - } - - @Override - public boolean areAllAllocatableRegistersCallerSaved() { - return false; - } - - @Override - public Register getRegisterForRole(int index) { - throw new UnsupportedOperationException(); - } - - @Override - public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { - if (type == Type.JavaCall || type == Type.NativeCall) { - return callingConvention(cpuCallerParameterRegisters, returnType, parameterTypes, type, target, stackOnly); - } - if (type == Type.JavaCallee) { - return callingConvention(cpuCalleeParameterRegisters, returnType, parameterTypes, type, target, stackOnly); - } - throw JVMCIError.shouldNotReachHere(); - } - - public Register[] getCallingConventionRegisters(Type type, Kind kind) { - if (architecture.canStoreValue(FPUs, kind) || architecture.canStoreValue(FPUd, kind)) { - return fpuParameterRegisters; - } - assert architecture.canStoreValue(CPU, kind); - return type == Type.JavaCallee ? cpuCalleeParameterRegisters : cpuCallerParameterRegisters; - } - - private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) { - AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; - - int currentGeneral = 0; - int currentFloating = 0; - int currentStackOffset = 0; - - for (int i = 0; i < parameterTypes.length; i++) { - final Kind kind = parameterTypes[i].getKind(); - - switch (kind) { - case Byte: - case Boolean: - case Short: - case Char: - case Int: - case Long: - case Object: - if (!stackOnly && currentGeneral < generalParameterRegisters.length) { - Register register = generalParameterRegisters[currentGeneral++]; - locations[i] = register.asValue(target.getLIRKind(kind)); - } - break; - case Double: - if (!stackOnly && currentFloating < fpuParameterRegisters.length) { - if (currentFloating % 2 != 0) { - // Make register number even to be a double reg - currentFloating++; - } - Register register = fpuDoubleParameterRegisters[currentFloating]; - currentFloating += 2; // Only every second is a double register - locations[i] = register.asValue(target.getLIRKind(kind)); - } - break; - case Float: - if (!stackOnly && currentFloating < fpuParameterRegisters.length) { - Register register = fpuParameterRegisters[currentFloating++]; - locations[i] = register.asValue(target.getLIRKind(kind)); - } - break; - default: - throw JVMCIError.shouldNotReachHere(); - } - - if (locations[i] == null) { - // Stack slot is always aligned to its size in bytes but minimum wordsize - int typeSize = SPARC.spillSlotSize(target, kind); - currentStackOffset = NumUtil.roundUp(currentStackOffset, typeSize); - locations[i] = StackSlot.get(target.getLIRKind(kind.getStackKind()), currentStackOffset, !type.out); - currentStackOffset += typeSize; - } - } - - Kind returnKind = returnType == null ? Kind.Void : returnType.getKind(); - AllocatableValue returnLocation = returnKind == Kind.Void ? Value.ILLEGAL : getReturnRegister(returnKind, type).asValue(target.getLIRKind(returnKind.getStackKind())); - return new CallingConvention(currentStackOffset, returnLocation, locations); - } - - @Override - public Register getReturnRegister(Kind kind) { - return getReturnRegister(kind, Type.JavaCallee); - } - - private static Register getReturnRegister(Kind kind, Type type) { - switch (kind) { - case Boolean: - case Byte: - case Char: - case Short: - case Int: - case Long: - case Object: - return type == Type.JavaCallee ? i0 : o0; - case Float: - return f0; - case Double: - return d0; - case Void: - case Illegal: - return null; - default: - throw new UnsupportedOperationException("no return register for type " + kind); - } - } - - @Override - public Register getFrameRegister() { - return sp; - } - - public CalleeSaveLayout getCalleeSaveLayout() { - return csl; - } - - @Override - public String toString() { - return String.format("Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" + "CallerSave: " + Arrays.toString(getCallerSaveRegisters()) + "%n"); - } -} diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotReturnOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -23,13 +23,14 @@ package com.oracle.graal.hotspot.sparc; import com.oracle.jvmci.meta.Value; +import com.oracle.jvmci.sparc.*; + import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.sparc.SPARCControlFlow.ReturnOp; -import com.oracle.graal.sparc.*; import com.oracle.jvmci.hotspot.*; /** diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotSafepointOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -27,7 +27,8 @@ 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 static com.oracle.jvmci.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Setx; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotUnwindOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -26,10 +26,11 @@ 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.jvmci.sparc.SPARC.*; 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.asm.sparc.*; import com.oracle.graal.hotspot.stubs.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -25,7 +25,8 @@ 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 static com.oracle.jvmci.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Setx; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCIndirectCallOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -25,9 +25,10 @@ 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.jvmci.sparc.SPARC.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import static com.oracle.graal.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCUncommonTrapStub.java Wed Jun 03 01:11:56 2015 +0200 @@ -25,7 +25,9 @@ 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.jvmci.hotspot.sparc.*; + +import static com.oracle.jvmci.sparc.SPARC.*; import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.meta.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +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.hotspot.sparc.jvmci; - -import static com.oracle.jvmci.hotspot.InitTimer.*; - -import java.util.*; - -import com.oracle.graal.hotspot.*; -import com.oracle.graal.hotspot.sparc.*; -import com.oracle.graal.sparc.*; -import com.oracle.graal.sparc.SPARC.CPUFeature; -import com.oracle.jvmci.code.*; -import com.oracle.jvmci.hotspot.*; -import com.oracle.jvmci.runtime.*; -import com.oracle.jvmci.service.*; - -@ServiceProvider(HotSpotJVMCIBackendFactory.class) -public class SPARCHotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { - - protected Architecture createArchitecture(HotSpotVMConfig config) { - return new SPARC(computeFeatures(config)); - } - - protected TargetDescription createTarget(HotSpotVMConfig config) { - final int stackFrameAlignment = 16; - final int implicitNullCheckLimit = 4096; - final boolean inlineObjects = true; - return new HotSpotTargetDescription(createArchitecture(config), true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); - } - - protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { - return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); - } - - protected EnumSet computeFeatures(HotSpotVMConfig config) { - EnumSet features = EnumSet.noneOf(CPUFeature.class); - if ((config.sparcFeatures & config.vis1Instructions) != 0) { - features.add(CPUFeature.VIS1); - } - if ((config.sparcFeatures & config.vis2Instructions) != 0) { - features.add(CPUFeature.VIS2); - } - if ((config.sparcFeatures & config.vis3Instructions) != 0) { - features.add(CPUFeature.VIS3); - } - if ((config.sparcFeatures & config.cbcondInstructions) != 0) { - features.add(CPUFeature.CBCOND); - } - return features; - } - - public String getArchitecture() { - return "SPARC"; - } - - @Override - public String toString() { - return getJVMCIRuntimeName() + ":" + getArchitecture(); - } - - public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { - assert host == null; - TargetDescription target = createTarget(runtime.getConfig()); - - HotSpotMetaAccessProvider metaAccess = new HotSpotMetaAccessProvider(runtime); - RegisterConfig regConfig = new SPARCHotSpotRegisterConfig(target, runtime.getConfig()); - HotSpotCodeCacheProvider codeCache = createCodeCache(runtime, target, regConfig); - HotSpotConstantReflectionProvider constantReflection = new HotSpotConstantReflectionProvider(runtime); - try (InitTimer rt = timer("instantiate backend")) { - return createBackend(metaAccess, codeCache, constantReflection); - } - } - - protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, HotSpotConstantReflectionProvider constantReflection) { - return new JVMCIBackend(metaAccess, codeCache, constantReflection); - } - - public String getJVMCIRuntimeName() { - return "basic"; - } -} diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +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.hotspot; - -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 { - - public HotSpotTargetDescription(Architecture arch, boolean isMP, int stackAlignment, int implicitNullCheckLimit, boolean inlineObjects) { - super(arch, isMP, stackAlignment, implicitNullCheckLimit, inlineObjects); - } - - @Override - public ReferenceMap createReferenceMap(boolean hasRegisters, int stackSlotCount) { - return new HotSpotReferenceMap(hasRegisters ? arch.getRegisterReferenceMapSize() : 0, stackSlotCount, this); - } -} diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,12 +22,13 @@ */ package com.oracle.graal.lir.amd64; +import com.oracle.jvmci.amd64.*; 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.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.ConditionFlag; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ArrayEqualsOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,19 +22,20 @@ */ package com.oracle.graal.lir.amd64; +import com.oracle.jvmci.amd64.*; +import com.oracle.jvmci.amd64.AMD64.*; 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.*; import java.lang.reflect.*; -import com.oracle.graal.amd64.*; -import com.oracle.graal.amd64.AMD64.CPUFeature; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Address.Scale; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Call.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.graal.lir.amd64; +import com.oracle.jvmci.amd64.*; import com.oracle.jvmci.code.Register; import com.oracle.jvmci.code.RegisterValue; import com.oracle.jvmci.code.ValueUtil; @@ -32,10 +33,10 @@ 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.asm.amd64.AMD64Assembler.ConditionFlag; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,15 +22,16 @@ */ package com.oracle.graal.lir.amd64; +import com.oracle.jvmci.amd64.*; 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.jvmci.code.CompilationResult.JumpTable; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,18 +22,19 @@ */ package com.oracle.graal.lir.amd64; +import com.oracle.jvmci.amd64.*; 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.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MIOp; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64MulDivOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,14 +22,15 @@ */ package com.oracle.graal.lir.amd64; +import com.oracle.jvmci.amd64.*; 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.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.AMD64MOp; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ShiftOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,11 +22,12 @@ */ package com.oracle.graal.lir.amd64; +import com.oracle.jvmci.amd64.*; 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.asm.amd64.AMD64Assembler.AMD64MOp; import com.oracle.graal.asm.amd64.AMD64Assembler.OperandSize; import com.oracle.graal.asm.amd64.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64SignExtendOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,13 +22,14 @@ */ package com.oracle.graal.lir.amd64; +import com.oracle.jvmci.amd64.*; 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.asm.amd64.AMD64Assembler.OperandSize; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java Wed Jun 03 01:11:56 2015 +0200 @@ -28,7 +28,11 @@ import com.oracle.jvmci.meta.Value; import com.oracle.jvmci.meta.AllocatableValue; import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.sparc.*; + import static com.oracle.jvmci.code.ValueUtil.*; +import static com.oracle.jvmci.sparc.SPARC.*; +import static com.oracle.jvmci.sparc.SPARC.CPUFeature.*; 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.*; @@ -36,8 +40,6 @@ import static com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.Opfs.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import static com.oracle.graal.sparc.SPARC.*; -import static com.oracle.graal.sparc.SPARC.CPUFeature.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.sparc.*; @@ -46,7 +48,6 @@ import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.gen.*; -import com.oracle.graal.sparc.*; import com.oracle.jvmci.common.*; public enum SPARCArithmetic { diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArrayEqualsOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -26,6 +26,8 @@ import com.oracle.jvmci.meta.LIRKind; import com.oracle.jvmci.meta.Value; import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.sparc.SPARC.*; + 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.*; @@ -33,9 +35,9 @@ import static com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.RCondition.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import static com.oracle.graal.sparc.SPARC.*; -import static com.oracle.graal.sparc.SPARC.CPUFeature.*; import static com.oracle.jvmci.common.UnsafeAccess.*; +import static com.oracle.jvmci.sparc.SPARC.*; +import static com.oracle.jvmci.sparc.SPARC.CPUFeature.*; import java.lang.reflect.*; @@ -46,7 +48,6 @@ import com.oracle.graal.lir.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.gen.*; -import com.oracle.graal.sparc.SPARC.CPUFeature; /** * Emits code which compares two arrays of the same length. diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCBitManipulationOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -27,10 +27,11 @@ 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.jvmci.sparc.SPARC.*; 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.asm.sparc.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCCall.java Wed Jun 03 01:11:56 2015 +0200 @@ -27,9 +27,10 @@ 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.jvmci.sparc.SPARC.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import static com.oracle.graal.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Sethix; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java Wed Jun 03 01:11:56 2015 +0200 @@ -26,14 +26,16 @@ import com.oracle.jvmci.meta.Kind; import com.oracle.jvmci.meta.Value; import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.sparc.SPARC.*; + import static com.oracle.jvmci.code.ValueUtil.*; +import static com.oracle.jvmci.sparc.SPARC.*; 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.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.CC.*; import static com.oracle.graal.asm.sparc.SPARCAssembler.ConditionFlag.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import static com.oracle.graal.sparc.SPARC.*; import java.util.*; @@ -50,7 +52,6 @@ import com.oracle.graal.lir.StandardOp.BlockEndOp; import com.oracle.graal.lir.SwitchStrategy.BaseSwitchClosure; import com.oracle.graal.lir.asm.*; -import com.oracle.graal.sparc.SPARC.CPUFeature; import com.oracle.jvmci.common.*; public class SPARCControlFlow { diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCFrameMap.java Wed Jun 03 01:11:56 2015 +0200 @@ -27,9 +27,9 @@ import com.oracle.jvmci.code.StackSlot; import com.oracle.jvmci.meta.LIRKind; import com.oracle.jvmci.meta.Kind; +import com.oracle.jvmci.sparc.*; import com.oracle.graal.asm.*; import com.oracle.graal.lir.framemap.*; -import com.oracle.graal.sparc.*; /** * SPARC specific frame map. diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java Wed Jun 03 01:11:56 2015 +0200 @@ -31,11 +31,14 @@ import com.oracle.jvmci.meta.Value; import com.oracle.jvmci.meta.AllocatableValue; import com.oracle.jvmci.meta.JavaConstant; +import com.oracle.jvmci.sparc.*; +import com.oracle.jvmci.sparc.SPARC.*; + import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.jvmci.meta.Kind.*; +import static com.oracle.jvmci.sparc.SPARC.*; 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.asm.sparc.*; import com.oracle.graal.asm.sparc.SPARCMacroAssembler.ScratchRegister; @@ -45,8 +48,6 @@ import com.oracle.graal.lir.StandardOp.MoveOp; import com.oracle.graal.lir.StandardOp.NullCheck; import com.oracle.graal.lir.asm.*; -import com.oracle.graal.sparc.*; -import com.oracle.graal.sparc.SPARC.CPUFeature; import com.oracle.jvmci.common.*; public class SPARCMove { diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCSaveRegistersOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -28,6 +28,8 @@ import com.oracle.jvmci.code.StackSlotValue; import com.oracle.jvmci.code.StackSlot; import com.oracle.jvmci.code.RegisterValue; +import com.oracle.jvmci.sparc.*; + import static com.oracle.jvmci.code.ValueUtil.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; @@ -38,7 +40,6 @@ import com.oracle.graal.lir.StandardOp.SaveRegistersOp; import com.oracle.graal.lir.asm.*; import com.oracle.graal.lir.framemap.*; -import com.oracle.graal.sparc.*; /** * Saves registers to stack slots. diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCTestOp.java Wed Jun 03 01:11:56 2015 +0200 @@ -23,9 +23,10 @@ package com.oracle.graal.lir.sparc; import com.oracle.jvmci.meta.Value; + import static com.oracle.jvmci.code.ValueUtil.*; +import static com.oracle.jvmci.sparc.SPARC.*; import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; -import static com.oracle.graal.sparc.SPARC.*; import com.oracle.graal.asm.sparc.*; import com.oracle.graal.lir.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.replacements.amd64/src/com/oracle/graal/replacements/amd64/AMD64GraphBuilderPlugins.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,15 +22,16 @@ */ package com.oracle.graal.replacements.amd64; +import com.oracle.jvmci.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.graphbuilderconf.*; import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.Plugins; import com.oracle.graal.graphbuilderconf.InvocationPlugin.Receiver; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,337 +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.sparc; - -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.jvmci.code.Register.RegisterCategory; - -/** - * Represents the SPARC architecture. - */ -public class SPARC extends Architecture { - - public static final RegisterCategory CPU = new RegisterCategory("CPU"); - - // General purpose registers - public static final Register r0 = new Register(0, 0, "g0", CPU); - public static final Register r1 = new Register(1, 1, "g1", CPU); - public static final Register r2 = new Register(2, 2, "g2", CPU); - public static final Register r3 = new Register(3, 3, "g3", CPU); - public static final Register r4 = new Register(4, 4, "g4", CPU); - public static final Register r5 = new Register(5, 5, "g5", CPU); - public static final Register r6 = new Register(6, 6, "g6", CPU); - public static final Register r7 = new Register(7, 7, "g7", CPU); - - public static final Register r8 = new Register(8, 8, "o0", CPU); - public static final Register r9 = new Register(9, 9, "o1", CPU); - public static final Register r10 = new Register(10, 10, "o2", CPU); - public static final Register r11 = new Register(11, 11, "o3", CPU); - public static final Register r12 = new Register(12, 12, "o4", CPU); - public static final Register r13 = new Register(13, 13, "o5", CPU); - public static final Register r14 = new Register(14, 14, "o6", CPU); - public static final Register r15 = new Register(15, 15, "o7", CPU); - - public static final Register r16 = new Register(16, 16, "l0", CPU); - public static final Register r17 = new Register(17, 17, "l1", CPU); - public static final Register r18 = new Register(18, 18, "l2", CPU); - public static final Register r19 = new Register(19, 19, "l3", CPU); - public static final Register r20 = new Register(20, 20, "l4", CPU); - public static final Register r21 = new Register(21, 21, "l5", CPU); - public static final Register r22 = new Register(22, 22, "l6", CPU); - public static final Register r23 = new Register(23, 23, "l7", CPU); - - public static final Register r24 = new Register(24, 24, "i0", CPU); - public static final Register r25 = new Register(25, 25, "i1", CPU); - public static final Register r26 = new Register(26, 26, "i2", CPU); - public static final Register r27 = new Register(27, 27, "i3", CPU); - public static final Register r28 = new Register(28, 28, "i4", CPU); - public static final Register r29 = new Register(29, 29, "i5", CPU); - public static final Register r30 = new Register(30, 30, "i6", CPU); - public static final Register r31 = new Register(31, 31, "i7", CPU); - - public static final Register g0 = r0; - public static final Register g1 = r1; - public static final Register g2 = r2; - public static final Register g3 = r3; - public static final Register g4 = r4; - public static final Register g5 = r5; - public static final Register g6 = r6; - public static final Register g7 = r7; - - public static final Register o0 = r8; - public static final Register o1 = r9; - public static final Register o2 = r10; - public static final Register o3 = r11; - public static final Register o4 = r12; - public static final Register o5 = r13; - public static final Register o6 = r14; - public static final Register o7 = r15; - - public static final Register l0 = r16; - public static final Register l1 = r17; - public static final Register l2 = r18; - public static final Register l3 = r19; - public static final Register l4 = r20; - public static final Register l5 = r21; - public static final Register l6 = r22; - public static final Register l7 = r23; - - public static final Register i0 = r24; - public static final Register i1 = r25; - public static final Register i2 = r26; - public static final Register i3 = r27; - public static final Register i4 = r28; - public static final Register i5 = r29; - public static final Register i6 = r30; - public static final Register i7 = r31; - - public static final Register sp = o6; - public static final Register fp = i6; - - // @formatter:off - public static final Register[] cpuRegisters = { - r0, r1, r2, r3, r4, r5, r6, r7, - r8, r9, r10, r11, r12, r13, r14, r15, - r16, r17, r18, r19, r20, r21, r22, r23, - r24, r25, r26, r27, r28, r29, r30, r31 - }; - // @formatter:on - - public static final RegisterCategory FPUs = new RegisterCategory("FPUs", cpuRegisters.length); - public static final RegisterCategory FPUd = new RegisterCategory("FPUd", cpuRegisters.length + 32); - - // Floating point registers - public static final Register f0 = new Register(32, 0, "f0", FPUs); - public static final Register f1 = new Register(33, 1, "f1", FPUs); - public static final Register f2 = new Register(34, 2, "f2", FPUs); - public static final Register f3 = new Register(35, 3, "f3", FPUs); - public static final Register f4 = new Register(36, 4, "f4", FPUs); - public static final Register f5 = new Register(37, 5, "f5", FPUs); - public static final Register f6 = new Register(38, 6, "f6", FPUs); - public static final Register f7 = new Register(39, 7, "f7", FPUs); - - public static final Register f8 = new Register(40, 8, "f8", FPUs); - public static final Register f9 = new Register(41, 9, "f9", FPUs); - public static final Register f10 = new Register(42, 10, "f10", FPUs); - public static final Register f11 = new Register(43, 11, "f11", FPUs); - public static final Register f12 = new Register(44, 12, "f12", FPUs); - public static final Register f13 = new Register(45, 13, "f13", FPUs); - public static final Register f14 = new Register(46, 14, "f14", FPUs); - public static final Register f15 = new Register(47, 15, "f15", FPUs); - - public static final Register f16 = new Register(48, 16, "f16", FPUs); - public static final Register f17 = new Register(49, 17, "f17", FPUs); - public static final Register f18 = new Register(50, 18, "f18", FPUs); - public static final Register f19 = new Register(51, 19, "f19", FPUs); - public static final Register f20 = new Register(52, 20, "f20", FPUs); - public static final Register f21 = new Register(53, 21, "f21", FPUs); - public static final Register f22 = new Register(54, 22, "f22", FPUs); - public static final Register f23 = new Register(55, 23, "f23", FPUs); - - public static final Register f24 = new Register(56, 24, "f24", FPUs); - public static final Register f25 = new Register(57, 25, "f25", FPUs); - public static final Register f26 = new Register(58, 26, "f26", FPUs); - public static final Register f27 = new Register(59, 27, "f27", FPUs); - public static final Register f28 = new Register(60, 28, "f28", FPUs); - public static final Register f29 = new Register(61, 29, "f29", FPUs); - public static final Register f30 = new Register(62, 30, "f30", FPUs); - public static final Register f31 = new Register(63, 31, "f31", FPUs); - - public static final Register d0 = new Register(32, getDoubleEncoding(0), "d0", FPUs); - public static final Register d2 = new Register(34, getDoubleEncoding(2), "d2", FPUs); - public static final Register d4 = new Register(36, getDoubleEncoding(4), "d4", FPUs); - public static final Register d6 = new Register(38, getDoubleEncoding(6), "d6", FPUs); - public static final Register d8 = new Register(40, getDoubleEncoding(8), "d8", FPUs); - public static final Register d10 = new Register(42, getDoubleEncoding(10), "d10", FPUs); - public static final Register d12 = new Register(44, getDoubleEncoding(12), "d12", FPUs); - public static final Register d14 = new Register(46, getDoubleEncoding(14), "d14", FPUs); - - public static final Register d16 = new Register(48, getDoubleEncoding(16), "d16", FPUs); - public static final Register d18 = new Register(50, getDoubleEncoding(18), "d18", FPUs); - public static final Register d20 = new Register(52, getDoubleEncoding(20), "d20", FPUs); - public static final Register d22 = new Register(54, getDoubleEncoding(22), "d22", FPUs); - public static final Register d24 = new Register(56, getDoubleEncoding(24), "d24", FPUs); - public static final Register d26 = new Register(58, getDoubleEncoding(26), "d26", FPUs); - public static final Register d28 = new Register(60, getDoubleEncoding(28), "d28", FPUs); - public static final Register d30 = new Register(62, getDoubleEncoding(28), "d28", FPUs); - - public static final Register d32 = new Register(64, getDoubleEncoding(32), "d32", FPUd); - public static final Register d34 = new Register(65, getDoubleEncoding(34), "d34", FPUd); - public static final Register d36 = new Register(66, getDoubleEncoding(36), "d36", FPUd); - public static final Register d38 = new Register(67, getDoubleEncoding(38), "d38", FPUd); - public static final Register d40 = new Register(68, getDoubleEncoding(40), "d40", FPUd); - public static final Register d42 = new Register(69, getDoubleEncoding(42), "d42", FPUd); - public static final Register d44 = new Register(70, getDoubleEncoding(44), "d44", FPUd); - public static final Register d46 = new Register(71, getDoubleEncoding(46), "d46", FPUd); - - public static final Register d48 = new Register(72, getDoubleEncoding(48), "d48", FPUd); - public static final Register d50 = new Register(73, getDoubleEncoding(50), "d50", FPUd); - public static final Register d52 = new Register(74, getDoubleEncoding(52), "d52", FPUd); - public static final Register d54 = new Register(75, getDoubleEncoding(54), "d54", FPUd); - public static final Register d56 = new Register(76, getDoubleEncoding(56), "d56", FPUd); - public static final Register d58 = new Register(77, getDoubleEncoding(58), "d58", FPUd); - public static final Register d60 = new Register(78, getDoubleEncoding(60), "d60", FPUd); - public static final Register d62 = new Register(79, getDoubleEncoding(62), "d62", FPUd); - - // @formatter:off - public static final Register[] fpuRegisters = { - f0, f1, f2, f3, f4, f5, f6, f7, - f8, f9, f10, f11, f12, f13, f14, f15, - f16, f17, f18, f19, f20, f21, f22, f23, - f24, f25, f26, f27, f28, f29, f30, f31, - d32, d34, d36, d38, d40, d42, d44, d46, - d48, d50, d52, d54, d56, d58, d60, d62 - }; - // @formatter:on - - // @formatter:off - public static final Register[] allRegisters = { - // CPU - r0, r1, r2, r3, r4, r5, r6, r7, - r8, r9, r10, r11, r12, r13, r14, r15, - r16, r17, r18, r19, r20, r21, r22, r23, - r24, r25, r26, r27, r28, r29, r30, r31, - // FPU - f0, f1, f2, f3, f4, f5, f6, f7, - f8, f9, f10, f11, f12, f13, f14, f15, - f16, f17, f18, f19, f20, f21, f22, f23, - f24, f25, f26, f27, f28, f29, f30, f31, - d32, d34, d36, d38, d40, d42, d44, d46, - d48, d50, d52, d54, d56, d58, d60, d62 - }; - // @formatter:on - - /** - * Stack bias for stack and frame pointer loads. - */ - public static final int STACK_BIAS = 0x7ff; - /** - * In fact there are 64 single floating point registers, 32 of them could be accessed. TODO: - * Improve handling of these float registers - */ - public static final int FLOAT_REGISTER_COUNT = 64; - - /** - * Alignment for valid memory access. - */ - public static final int MEMORY_ACCESS_ALIGN = 4; - - public final Set features; - - public SPARC(Set features) { - super("SPARC", 8, ByteOrder.BIG_ENDIAN, false, allRegisters, LOAD_STORE | STORE_STORE, 1, r31.encoding + FLOAT_REGISTER_COUNT + 1, 8); - this.features = features; - } - - @Override - public boolean canStoreValue(RegisterCategory category, PlatformKind lirKind) { - if (!(lirKind instanceof Kind)) { - return false; - } - - Kind kind = (Kind) lirKind; - if (category.equals(CPU)) { - switch (kind) { - case Boolean: - case Byte: - case Char: - case Short: - case Int: - case Long: - case Object: - return true; - } - } else if (category.equals(FPUs) && kind.equals(Kind.Float)) { - return true; - } else if (category.equals(FPUd) && kind.equals(Kind.Double)) { - return true; - } - return false; - } - - @Override - public PlatformKind getLargestStorableKind(RegisterCategory category) { - if (category.equals(CPU)) { - return Kind.Long; - } else if (category.equals(FPUs)) { - return Kind.Double; - } else { - return Kind.Illegal; - } - } - - public static int spillSlotSize(TargetDescription td, PlatformKind kind) { - return Math.max(td.getSizeInBytes(kind), MEMORY_ACCESS_ALIGN); - } - - public static int getDoubleEncoding(int reg) { - assert reg < 64 && ((reg & 1) == 0); - // ignore v8 assertion for now - return (reg & 0x1e) | ((reg & 0x20) >> 5); - } - - public static boolean isCPURegister(Register r) { - return r.getRegisterCategory().equals(CPU); - } - - public static boolean isCPURegister(Register... regs) { - for (Register reg : regs) { - if (!isCPURegister(reg)) { - return false; - } - } - return true; - } - - public static boolean isSingleFloatRegister(Register r) { - return r.name.startsWith("f"); - } - - public static boolean isDoubleFloatRegister(Register r) { - return r.name.startsWith("d"); - } - - public Set getFeatures() { - return features; - } - - public boolean hasFeature(CPUFeature feature) { - return features.contains(feature); - } - - public enum CPUFeature { - VIS1, - VIS2, - VIS3, - CBCOND - } -} diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot.amd64/src/com/oracle/graal/truffle/hotspot/amd64/AMD64OptimizedCallTargetInstrumentationFactory.java Wed Jun 03 01:11:56 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.truffle.hotspot.amd64; -import com.oracle.graal.amd64.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.amd64.*; import com.oracle.graal.asm.amd64.AMD64Assembler.ConditionFlag; @@ -31,6 +30,7 @@ import com.oracle.graal.lir.framemap.*; import com.oracle.graal.truffle.*; import com.oracle.graal.truffle.hotspot.*; +import com.oracle.jvmci.amd64.*; import com.oracle.jvmci.code.CallingConvention.Type; import com.oracle.jvmci.code.*; import com.oracle.jvmci.hotspot.*; diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot.sparc/src/com/oracle/graal/truffle/hotspot/sparc/SPARCOptimizedCallTargetInstumentationFactory.java Wed Jun 03 01:11:56 2015 +0200 @@ -26,9 +26,9 @@ 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 static com.oracle.jvmci.code.CallingConvention.Type.*; import static com.oracle.jvmci.meta.Kind.*; +import static com.oracle.jvmci.sparc.SPARC.CPUFeature.*; import com.oracle.graal.asm.*; import com.oracle.graal.asm.sparc.*; diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.jvmci.amd64/src/com/oracle/jvmci/amd64/AMD64.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.amd64/src/com/oracle/jvmci/amd64/AMD64.java Wed Jun 03 01:11:56 2015 +0200 @@ -0,0 +1,207 @@ +/* + * 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.amd64; + +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.jvmci.code.Register.RegisterCategory; + +/** + * Represents the AMD64 architecture. + */ +public class AMD64 extends Architecture { + + public static final RegisterCategory CPU = new RegisterCategory("CPU"); + + // @formatter:off + + // General purpose CPU registers + public static final Register rax = new Register(0, 0, "rax", CPU); + public static final Register rcx = new Register(1, 1, "rcx", CPU); + public static final Register rdx = new Register(2, 2, "rdx", CPU); + public static final Register rbx = new Register(3, 3, "rbx", CPU); + public static final Register rsp = new Register(4, 4, "rsp", CPU); + public static final Register rbp = new Register(5, 5, "rbp", CPU); + public static final Register rsi = new Register(6, 6, "rsi", CPU); + public static final Register rdi = new Register(7, 7, "rdi", CPU); + + public static final Register r8 = new Register(8, 8, "r8", CPU); + public static final Register r9 = new Register(9, 9, "r9", CPU); + public static final Register r10 = new Register(10, 10, "r10", CPU); + public static final Register r11 = new Register(11, 11, "r11", CPU); + public static final Register r12 = new Register(12, 12, "r12", CPU); + public static final Register r13 = new Register(13, 13, "r13", CPU); + public static final Register r14 = new Register(14, 14, "r14", CPU); + public static final Register r15 = new Register(15, 15, "r15", CPU); + + public static final Register[] cpuRegisters = { + rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, + r8, r9, r10, r11, r12, r13, r14, r15 + }; + + private static final int XMM_REFERENCE_MAP_SHIFT = 2; + + public static final RegisterCategory XMM = new RegisterCategory("XMM", cpuRegisters.length, XMM_REFERENCE_MAP_SHIFT); + + // XMM registers + public static final Register xmm0 = new Register(16, 0, "xmm0", XMM); + public static final Register xmm1 = new Register(17, 1, "xmm1", XMM); + public static final Register xmm2 = new Register(18, 2, "xmm2", XMM); + public static final Register xmm3 = new Register(19, 3, "xmm3", XMM); + public static final Register xmm4 = new Register(20, 4, "xmm4", XMM); + public static final Register xmm5 = new Register(21, 5, "xmm5", XMM); + public static final Register xmm6 = new Register(22, 6, "xmm6", XMM); + public static final Register xmm7 = new Register(23, 7, "xmm7", XMM); + + public static final Register xmm8 = new Register(24, 8, "xmm8", XMM); + public static final Register xmm9 = new Register(25, 9, "xmm9", XMM); + public static final Register xmm10 = new Register(26, 10, "xmm10", XMM); + public static final Register xmm11 = new Register(27, 11, "xmm11", XMM); + public static final Register xmm12 = new Register(28, 12, "xmm12", XMM); + public static final Register xmm13 = new Register(29, 13, "xmm13", XMM); + public static final Register xmm14 = new Register(30, 14, "xmm14", XMM); + public static final Register xmm15 = new Register(31, 15, "xmm15", XMM); + + public static final Register[] xmmRegisters = { + xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, + xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 + }; + + public static final Register[] cpuxmmRegisters = { + rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, + r8, r9, r10, r11, r12, r13, r14, r15, + xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, + xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 + }; + + /** + * Register used to construct an instruction-relative address. + */ + public static final Register rip = new Register(32, -1, "rip", SPECIAL); + + public static final Register[] allRegisters = { + rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, + r8, r9, r10, r11, r12, r13, r14, r15, + xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, + xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15, + rip + }; + + // @formatter:on + + /** + * Basic set of CPU features mirroring what is returned from the cpuid instruction. + */ + public static enum CPUFeature { + SSE, + SSE2, + SSE3, + SSE4a, + SSE4_1, + SSE4_2, + SSSE3, + POPCNT, + LZCNT, + AVX, + AVX2, + ERMS, + AMD_3DNOW_PREFETCH, + AES, + BMI1 + } + + private final EnumSet features; + + /** + * Set of flags to control code emission. + */ + public static enum Flag { + UseCountLeadingZerosInstruction, + UseCountTrailingZerosInstruction + } + + private final EnumSet flags; + + public AMD64(EnumSet features, EnumSet flags) { + super("AMD64", 8, ByteOrder.LITTLE_ENDIAN, true, allRegisters, LOAD_STORE | STORE_STORE, 1, cpuRegisters.length + (xmmRegisters.length << XMM_REFERENCE_MAP_SHIFT), 8); + this.features = features; + this.flags = flags; + assert features.contains(CPUFeature.SSE2) : "minimum config for x64"; + } + + public EnumSet getFeatures() { + return features; + } + + public EnumSet getFlags() { + return flags; + } + + @Override + public boolean canStoreValue(RegisterCategory category, PlatformKind platformKind) { + if (!(platformKind instanceof Kind)) { + return false; + } + + Kind kind = (Kind) platformKind; + if (category.equals(CPU)) { + switch (kind) { + case Boolean: + case Byte: + case Char: + case Short: + case Int: + case Long: + case Object: + return true; + } + } else if (category.equals(XMM)) { + switch (kind) { + case Float: + case Double: + return true; + } + } + + return false; + } + + @Override + public PlatformKind getLargestStorableKind(RegisterCategory category) { + if (category.equals(CPU)) { + return Kind.Long; + } else if (category.equals(XMM)) { + return Kind.Double; + } else { + return Kind.Illegal; + } + } +} diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.jvmci.hotspot.amd64/src/com/oracle/jvmci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.hotspot.amd64/src/com/oracle/jvmci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java Wed Jun 03 01:11:56 2015 +0200 @@ -0,0 +1,169 @@ +/* + * 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.hotspot.amd64; + +import static com.oracle.jvmci.hotspot.InitTimer.*; + +import java.util.*; + +import com.oracle.jvmci.amd64.*; +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.hotspot.*; +import com.oracle.jvmci.meta.*; +import com.oracle.jvmci.runtime.*; +import com.oracle.jvmci.service.*; + +@ServiceProvider(HotSpotJVMCIBackendFactory.class) +public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { + + protected Architecture createArchitecture(HotSpotVMConfig config) { + return new AMD64(computeFeatures(config), computeFlags(config)); + } + + protected EnumSet computeFeatures(HotSpotVMConfig config) { + // Configure the feature set using the HotSpot flag settings. + EnumSet features = EnumSet.noneOf(AMD64.CPUFeature.class); + assert config.useSSE >= 2 : "minimum config for x64"; + features.add(AMD64.CPUFeature.SSE); + features.add(AMD64.CPUFeature.SSE2); + if ((config.x86CPUFeatures & config.cpuSSE3) != 0) { + features.add(AMD64.CPUFeature.SSE3); + } + if ((config.x86CPUFeatures & config.cpuSSSE3) != 0) { + features.add(AMD64.CPUFeature.SSSE3); + } + if ((config.x86CPUFeatures & config.cpuSSE4A) != 0) { + features.add(AMD64.CPUFeature.SSE4a); + } + if ((config.x86CPUFeatures & config.cpuSSE41) != 0) { + features.add(AMD64.CPUFeature.SSE4_1); + } + if ((config.x86CPUFeatures & config.cpuSSE42) != 0) { + features.add(AMD64.CPUFeature.SSE4_2); + } + if ((config.x86CPUFeatures & config.cpuAVX) != 0) { + features.add(AMD64.CPUFeature.AVX); + } + if ((config.x86CPUFeatures & config.cpuAVX2) != 0) { + features.add(AMD64.CPUFeature.AVX2); + } + if ((config.x86CPUFeatures & config.cpuERMS) != 0) { + features.add(AMD64.CPUFeature.ERMS); + } + if ((config.x86CPUFeatures & config.cpuLZCNT) != 0) { + features.add(AMD64.CPUFeature.LZCNT); + } + if ((config.x86CPUFeatures & config.cpuPOPCNT) != 0) { + features.add(AMD64.CPUFeature.POPCNT); + } + if ((config.x86CPUFeatures & config.cpuAES) != 0) { + features.add(AMD64.CPUFeature.AES); + } + if ((config.x86CPUFeatures & config.cpu3DNOWPREFETCH) != 0) { + features.add(AMD64.CPUFeature.AMD_3DNOW_PREFETCH); + } + if ((config.x86CPUFeatures & config.cpuBMI1) != 0) { + features.add(AMD64.CPUFeature.BMI1); + } + return features; + } + + protected EnumSet computeFlags(HotSpotVMConfig config) { + EnumSet flags = EnumSet.noneOf(AMD64.Flag.class); + if (config.useCountLeadingZerosInstruction) { + flags.add(AMD64.Flag.UseCountLeadingZerosInstruction); + } + if (config.useCountTrailingZerosInstruction) { + flags.add(AMD64.Flag.UseCountTrailingZerosInstruction); + } + return flags; + } + + protected TargetDescription createTarget(HotSpotVMConfig config) { + final int stackFrameAlignment = 16; + final int implicitNullCheckLimit = 4096; + final boolean inlineObjects = true; + return new HotSpotTargetDescription(createArchitecture(config), true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); + } + + protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntimeProvider runtime) { + return new HotSpotConstantReflectionProvider(runtime); + } + + protected RegisterConfig createRegisterConfig(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target) { + return new AMD64HotSpotRegisterConfig(target.arch, runtime.getConfig()); + } + + protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { + return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); + } + + protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntimeProvider runtime) { + return new HotSpotMetaAccessProvider(runtime); + } + + public String getArchitecture() { + return "AMD64"; + } + + @Override + public String toString() { + return getJVMCIRuntimeName() + ":" + getArchitecture(); + } + + public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { + + assert host == null; + TargetDescription target = createTarget(runtime.getConfig()); + + RegisterConfig regConfig; + HotSpotCodeCacheProvider codeCache; + ConstantReflectionProvider constantReflection; + HotSpotMetaAccessProvider metaAccess; + try (InitTimer t = timer("create providers")) { + try (InitTimer rt = timer("create MetaAccess provider")) { + metaAccess = createMetaAccess(runtime); + } + try (InitTimer rt = timer("create RegisterConfig")) { + regConfig = createRegisterConfig(runtime, target); + } + try (InitTimer rt = timer("create CodeCache provider")) { + codeCache = createCodeCache(runtime, target, regConfig); + } + try (InitTimer rt = timer("create ConstantReflection provider")) { + constantReflection = createConstantReflection(runtime); + } + } + try (InitTimer rt = timer("instantiate backend")) { + return createBackend(metaAccess, codeCache, constantReflection); + } + } + + protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection) { + return new JVMCIBackend(metaAccess, codeCache, constantReflection); + } + + public String getJVMCIRuntimeName() { + return "basic"; + } +} diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.jvmci.hotspot.amd64/src/com/oracle/jvmci/hotspot/amd64/AMD64HotSpotRegisterConfig.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.hotspot.amd64/src/com/oracle/jvmci/hotspot/amd64/AMD64HotSpotRegisterConfig.java Wed Jun 03 01:11:56 2015 +0200 @@ -0,0 +1,268 @@ +/* + * 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.hotspot.amd64; + +import com.oracle.jvmci.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.jvmci.amd64.AMD64.*; + +import java.util.*; + +import com.oracle.jvmci.code.CallingConvention.Type; +import com.oracle.jvmci.common.*; +import com.oracle.jvmci.hotspot.*; + +public class AMD64HotSpotRegisterConfig implements RegisterConfig { + + private final Architecture architecture; + + private final Register[] allocatable; + + private final int maxFrameSize; + + /** + * The caller saved registers always include all parameter registers. + */ + private final Register[] callerSaved; + + private final boolean allAllocatableAreCallerSaved; + + private final RegisterAttributes[] attributesMap; + + public int getMaximumFrameSize() { + return maxFrameSize; + } + + @Override + public Register[] getAllocatableRegisters() { + return allocatable.clone(); + } + + public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { + ArrayList list = new ArrayList<>(); + for (Register reg : registers) { + if (architecture.canStoreValue(reg.getRegisterCategory(), kind)) { + list.add(reg); + } + } + + Register[] ret = list.toArray(new Register[list.size()]); + return ret; + } + + @Override + public RegisterAttributes[] getAttributesMap() { + return attributesMap.clone(); + } + + private final Register[] javaGeneralParameterRegisters; + private final Register[] nativeGeneralParameterRegisters; + private final Register[] xmmParameterRegisters = {xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7}; + + /* + * Some ABIs (e.g. Windows) require a so-called "home space", that is a save area on the stack + * to store the argument registers + */ + private final boolean needsNativeStackHomeSpace; + + private final CalleeSaveLayout csl; + + private static Register[] initAllocatable(boolean reserveForHeapBase) { + Register[] registers = null; + // @formatter:off + if (reserveForHeapBase) { + registers = new Register[] { + rax, rbx, rcx, rdx, /*rsp,*/ rbp, rsi, rdi, r8, r9, r10, r11, /*r12,*/ r13, r14, /*r15, */ + xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, + xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 + }; + } else { + registers = new Register[] { + rax, rbx, rcx, rdx, /*rsp,*/ rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, /*r15, */ + xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, + xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15 + }; + } + // @formatter:on + return registers; + } + + public AMD64HotSpotRegisterConfig(Architecture architecture, HotSpotVMConfig config) { + this(architecture, config, initAllocatable(config.useCompressedOops)); + assert callerSaved.length >= allocatable.length; + } + + public AMD64HotSpotRegisterConfig(Architecture architecture, HotSpotVMConfig config, Register[] allocatable) { + this.architecture = architecture; + this.maxFrameSize = config.maxFrameSize; + + if (config.windowsOs) { + javaGeneralParameterRegisters = new Register[]{rdx, r8, r9, rdi, rsi, rcx}; + nativeGeneralParameterRegisters = new Register[]{rcx, rdx, r8, r9}; + this.needsNativeStackHomeSpace = true; + } else { + javaGeneralParameterRegisters = new Register[]{rsi, rdx, rcx, r8, r9, rdi}; + nativeGeneralParameterRegisters = new Register[]{rdi, rsi, rdx, rcx, r8, r9}; + this.needsNativeStackHomeSpace = false; + } + + csl = null; + this.allocatable = allocatable.clone(); + Set callerSaveSet = new HashSet<>(); + Collections.addAll(callerSaveSet, allocatable); + Collections.addAll(callerSaveSet, xmmParameterRegisters); + Collections.addAll(callerSaveSet, javaGeneralParameterRegisters); + Collections.addAll(callerSaveSet, nativeGeneralParameterRegisters); + callerSaved = callerSaveSet.toArray(new Register[callerSaveSet.size()]); + + allAllocatableAreCallerSaved = true; + attributesMap = RegisterAttributes.createMap(this, AMD64.allRegisters); + } + + @Override + public Register[] getCallerSaveRegisters() { + return callerSaved; + } + + @Override + public boolean areAllAllocatableRegistersCallerSaved() { + return allAllocatableAreCallerSaved; + } + + @Override + public Register getRegisterForRole(int index) { + throw new UnsupportedOperationException(); + } + + @Override + public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { + if (type == Type.NativeCall) { + return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + } + // On x64, parameter locations are the same whether viewed + // from the caller or callee perspective + return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + } + + public Register[] getCallingConventionRegisters(Type type, Kind kind) { + if (architecture.canStoreValue(XMM, kind)) { + return xmmParameterRegisters; + } + assert architecture.canStoreValue(CPU, kind); + return type == Type.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; + } + + private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) { + AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; + + int currentGeneral = 0; + int currentXMM = 0; + int currentStackOffset = type == Type.NativeCall && needsNativeStackHomeSpace ? generalParameterRegisters.length * target.wordSize : 0; + + for (int i = 0; i < parameterTypes.length; i++) { + final Kind kind = parameterTypes[i].getKind(); + + switch (kind) { + case Byte: + case Boolean: + case Short: + case Char: + case Int: + case Long: + case Object: + if (!stackOnly && currentGeneral < generalParameterRegisters.length) { + Register register = generalParameterRegisters[currentGeneral++]; + locations[i] = register.asValue(target.getLIRKind(kind)); + } + break; + case Float: + case Double: + if (!stackOnly && currentXMM < xmmParameterRegisters.length) { + Register register = xmmParameterRegisters[currentXMM++]; + locations[i] = register.asValue(target.getLIRKind(kind)); + } + break; + default: + throw JVMCIError.shouldNotReachHere(); + } + + if (locations[i] == null) { + locations[i] = StackSlot.get(target.getLIRKind(kind.getStackKind()), currentStackOffset, !type.out); + currentStackOffset += Math.max(target.getSizeInBytes(kind), target.wordSize); + } + } + + Kind returnKind = returnType == null ? Kind.Void : returnType.getKind(); + AllocatableValue returnLocation = returnKind == Kind.Void ? Value.ILLEGAL : getReturnRegister(returnKind).asValue(target.getLIRKind(returnKind.getStackKind())); + return new CallingConvention(currentStackOffset, returnLocation, locations); + } + + @Override + public Register getReturnRegister(Kind kind) { + switch (kind) { + case Boolean: + case Byte: + case Char: + case Short: + case Int: + case Long: + case Object: + return rax; + case Float: + case Double: + return xmm0; + case Void: + case Illegal: + return null; + default: + throw new UnsupportedOperationException("no return register for type " + kind); + } + } + + @Override + public Register getFrameRegister() { + return rsp; + } + + public CalleeSaveLayout getCalleeSaveLayout() { + return csl; + } + + @Override + public String toString() { + return String.format("Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" + "CallerSave: " + Arrays.toString(getCallerSaveRegisters()) + "%n"); + } +} diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.jvmci.hotspot.sparc/src/com/oracle/jvmci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.hotspot.sparc/src/com/oracle/jvmci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java Wed Jun 03 01:11:56 2015 +0200 @@ -0,0 +1,100 @@ +/* + * 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.hotspot.sparc; + +import static com.oracle.jvmci.hotspot.InitTimer.*; + +import java.util.*; + +import com.oracle.jvmci.code.*; +import com.oracle.jvmci.hotspot.*; +import com.oracle.jvmci.runtime.*; +import com.oracle.jvmci.service.*; +import com.oracle.jvmci.sparc.*; +import com.oracle.jvmci.sparc.SPARC.CPUFeature; + +@ServiceProvider(HotSpotJVMCIBackendFactory.class) +public class SPARCHotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { + + protected Architecture createArchitecture(HotSpotVMConfig config) { + return new SPARC(computeFeatures(config)); + } + + protected TargetDescription createTarget(HotSpotVMConfig config) { + final int stackFrameAlignment = 16; + final int implicitNullCheckLimit = 4096; + final boolean inlineObjects = true; + return new HotSpotTargetDescription(createArchitecture(config), true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); + } + + protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { + return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); + } + + protected EnumSet computeFeatures(HotSpotVMConfig config) { + EnumSet features = EnumSet.noneOf(CPUFeature.class); + if ((config.sparcFeatures & config.vis1Instructions) != 0) { + features.add(CPUFeature.VIS1); + } + if ((config.sparcFeatures & config.vis2Instructions) != 0) { + features.add(CPUFeature.VIS2); + } + if ((config.sparcFeatures & config.vis3Instructions) != 0) { + features.add(CPUFeature.VIS3); + } + if ((config.sparcFeatures & config.cbcondInstructions) != 0) { + features.add(CPUFeature.CBCOND); + } + return features; + } + + public String getArchitecture() { + return "SPARC"; + } + + @Override + public String toString() { + return getJVMCIRuntimeName() + ":" + getArchitecture(); + } + + public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { + assert host == null; + TargetDescription target = createTarget(runtime.getConfig()); + + HotSpotMetaAccessProvider metaAccess = new HotSpotMetaAccessProvider(runtime); + RegisterConfig regConfig = new SPARCHotSpotRegisterConfig(target, runtime.getConfig()); + HotSpotCodeCacheProvider codeCache = createCodeCache(runtime, target, regConfig); + HotSpotConstantReflectionProvider constantReflection = new HotSpotConstantReflectionProvider(runtime); + try (InitTimer rt = timer("instantiate backend")) { + return createBackend(metaAccess, codeCache, constantReflection); + } + } + + protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, HotSpotConstantReflectionProvider constantReflection) { + return new JVMCIBackend(metaAccess, codeCache, constantReflection); + } + + public String getJVMCIRuntimeName() { + return "basic"; + } +} diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.jvmci.hotspot.sparc/src/com/oracle/jvmci/hotspot/sparc/SPARCHotSpotRegisterConfig.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.hotspot.sparc/src/com/oracle/jvmci/hotspot/sparc/SPARCHotSpotRegisterConfig.java Wed Jun 03 01:11:56 2015 +0200 @@ -0,0 +1,304 @@ +/* + * 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.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 com.oracle.jvmci.sparc.*; + +import static com.oracle.jvmci.sparc.SPARC.*; + +import java.util.*; + +import com.oracle.jvmci.code.CallingConvention.Type; +import com.oracle.jvmci.common.*; +import com.oracle.jvmci.hotspot.*; + +public class SPARCHotSpotRegisterConfig implements RegisterConfig { + + private final Architecture architecture; + + private final Register[] allocatable; + + private final RegisterAttributes[] attributesMap; + + @Override + public Register[] getAllocatableRegisters() { + return allocatable.clone(); + } + + public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { + ArrayList list = new ArrayList<>(); + for (Register reg : registers) { + if (architecture.canStoreValue(reg.getRegisterCategory(), kind)) { + // Special treatment for double precision + // TODO: This is wasteful it uses only half of the registers as float. + if (kind == Kind.Double) { + if (reg.name.startsWith("d")) { + list.add(reg); + } + } else if (kind == Kind.Float) { + if (reg.name.startsWith("f")) { + list.add(reg); + } + } else { + list.add(reg); + } + } + } + + Register[] ret = list.toArray(new Register[list.size()]); + return ret; + } + + @Override + public RegisterAttributes[] getAttributesMap() { + return attributesMap.clone(); + } + + private final Register[] cpuCallerParameterRegisters = {o0, o1, o2, o3, o4, o5}; + private final Register[] cpuCalleeParameterRegisters = {i0, i1, i2, i3, i4, i5}; + + private final Register[] fpuParameterRegisters = {f0, f1, f2, f3, f4, f5, f6, f7}; + private final Register[] fpuDoubleParameterRegisters = {d0, null, d2, null, d4, null, d6, null}; + // @formatter:off + private final Register[] callerSaveRegisters = + {g1, g2, g3, g4, g5, g6, g7, + o0, o1, o2, o3, o4, o5, o7, + f0, f1, f2, f3, f4, f5, f6, f7, + f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, + d32, d34, d36, d38, d40, d42, d44, d46, + d48, d50, d52, d54, d56, d58, d60, d62}; + // @formatter:on + + /** + * Registers saved by the callee. This lists all L and I registers which are saved in the + * register window. + */ + private final Register[] calleeSaveRegisters = {l0, l1, l2, l3, l4, l5, l6, l7, i0, i1, i2, i3, i4, i5, i6, i7}; + + private final CalleeSaveLayout csl; + + private static Register[] initAllocatable(boolean reserveForHeapBase) { + Register[] registers = null; + if (reserveForHeapBase) { + // @formatter:off + registers = new Register[]{ + // TODO this is not complete + // o7 cannot be used as register because it is always overwritten on call + // and the current register handler would ignore this fact if the called + // method still does not modify registers, in fact o7 is modified by the Call instruction + // There would be some extra handlin necessary to be able to handle the o7 properly for local usage + o0, o1, o2, o3, o4, o5, /*o6, o7,*/ + l0, l1, l2, l3, l4, l5, l6, l7, + i0, i1, i2, i3, i4, i5, /*i6,*/ /*i7,*/ + //f0, f1, f2, f3, f4, f5, f6, f7, + f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, + d32, d34, d36, d38, d40, d42, d44, d46, + d48, d50, d52, d54, d56, d58, d60, d62 + }; + // @formatter:on + } else { + // @formatter:off + registers = new Register[]{ + // TODO this is not complete + o0, o1, o2, o3, o4, o5, /*o6, o7,*/ + l0, l1, l2, l3, l4, l5, l6, l7, + i0, i1, i2, i3, i4, i5, /*i6,*/ /*i7,*/ +// f0, f1, f2, f3, f4, f5, f6, f7 + f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, + d32, d34, d36, d38, d40, d42, d44, d46, + d48, d50, d52, d54, d56, d58, d60, d62 + }; + // @formatter:on + } + + return registers; + } + + public SPARCHotSpotRegisterConfig(TargetDescription target, HotSpotVMConfig config) { + this(target, initAllocatable(config.useCompressedOops)); + } + + public SPARCHotSpotRegisterConfig(TargetDescription target, Register[] allocatable) { + this.architecture = target.arch; + + csl = new CalleeSaveLayout(target, -1, -1, target.arch.getWordSize(), calleeSaveRegisters); + this.allocatable = allocatable.clone(); + attributesMap = RegisterAttributes.createMap(this, SPARC.allRegisters); + } + + @Override + public Register[] getCallerSaveRegisters() { + return callerSaveRegisters; + } + + @Override + public boolean areAllAllocatableRegistersCallerSaved() { + return false; + } + + @Override + public Register getRegisterForRole(int index) { + throw new UnsupportedOperationException(); + } + + @Override + public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { + if (type == Type.JavaCall || type == Type.NativeCall) { + return callingConvention(cpuCallerParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + } + if (type == Type.JavaCallee) { + return callingConvention(cpuCalleeParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + } + throw JVMCIError.shouldNotReachHere(); + } + + public Register[] getCallingConventionRegisters(Type type, Kind kind) { + if (architecture.canStoreValue(FPUs, kind) || architecture.canStoreValue(FPUd, kind)) { + return fpuParameterRegisters; + } + assert architecture.canStoreValue(CPU, kind); + return type == Type.JavaCallee ? cpuCalleeParameterRegisters : cpuCallerParameterRegisters; + } + + private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) { + AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; + + int currentGeneral = 0; + int currentFloating = 0; + int currentStackOffset = 0; + + for (int i = 0; i < parameterTypes.length; i++) { + final Kind kind = parameterTypes[i].getKind(); + + switch (kind) { + case Byte: + case Boolean: + case Short: + case Char: + case Int: + case Long: + case Object: + if (!stackOnly && currentGeneral < generalParameterRegisters.length) { + Register register = generalParameterRegisters[currentGeneral++]; + locations[i] = register.asValue(target.getLIRKind(kind)); + } + break; + case Double: + if (!stackOnly && currentFloating < fpuParameterRegisters.length) { + if (currentFloating % 2 != 0) { + // Make register number even to be a double reg + currentFloating++; + } + Register register = fpuDoubleParameterRegisters[currentFloating]; + currentFloating += 2; // Only every second is a double register + locations[i] = register.asValue(target.getLIRKind(kind)); + } + break; + case Float: + if (!stackOnly && currentFloating < fpuParameterRegisters.length) { + Register register = fpuParameterRegisters[currentFloating++]; + locations[i] = register.asValue(target.getLIRKind(kind)); + } + break; + default: + throw JVMCIError.shouldNotReachHere(); + } + + if (locations[i] == null) { + // Stack slot is always aligned to its size in bytes but minimum wordsize + int typeSize = SPARC.spillSlotSize(target, kind); + currentStackOffset = roundUp(currentStackOffset, typeSize); + locations[i] = StackSlot.get(target.getLIRKind(kind.getStackKind()), currentStackOffset, !type.out); + currentStackOffset += typeSize; + } + } + + Kind returnKind = returnType == null ? Kind.Void : returnType.getKind(); + AllocatableValue returnLocation = returnKind == Kind.Void ? Value.ILLEGAL : getReturnRegister(returnKind, type).asValue(target.getLIRKind(returnKind.getStackKind())); + return new CallingConvention(currentStackOffset, returnLocation, locations); + } + + private static int roundUp(int number, int mod) { + return ((number + mod - 1) / mod) * mod; + } + + @Override + public Register getReturnRegister(Kind kind) { + return getReturnRegister(kind, Type.JavaCallee); + } + + private static Register getReturnRegister(Kind kind, Type type) { + switch (kind) { + case Boolean: + case Byte: + case Char: + case Short: + case Int: + case Long: + case Object: + return type == Type.JavaCallee ? i0 : o0; + case Float: + return f0; + case Double: + return d0; + case Void: + case Illegal: + return null; + default: + throw new UnsupportedOperationException("no return register for type " + kind); + } + } + + @Override + public Register getFrameRegister() { + return sp; + } + + public CalleeSaveLayout getCalleeSaveLayout() { + return csl; + } + + @Override + public String toString() { + return String.format("Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" + "CallerSave: " + Arrays.toString(getCallerSaveRegisters()) + "%n"); + } +} diff -r 824fe31b25c6 -r 902a6399353b 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 Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotJVMCIRuntime.java Wed Jun 03 01:11:56 2015 +0200 @@ -220,7 +220,12 @@ hostBackend = registerBackend(factory.createJVMCIBackend(this, null)); } - vmEventListener = Services.loadSingle(HotSpotVMEventListener.class, true); + HotSpotVMEventListener listener = Services.loadSingle(HotSpotVMEventListener.class, false); + if (listener == null) { + listener = new HotSpotVMEventListener() { + }; + } + vmEventListener = listener; } private JVMCIBackend registerBackend(JVMCIBackend backend) { diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotTargetDescription.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotTargetDescription.java Wed Jun 03 01:11:56 2015 +0200 @@ -0,0 +1,37 @@ +/* + * 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.hotspot; + +import com.oracle.jvmci.code.*; + +public class HotSpotTargetDescription extends TargetDescription { + + public HotSpotTargetDescription(Architecture arch, boolean isMP, int stackAlignment, int implicitNullCheckLimit, boolean inlineObjects) { + super(arch, isMP, stackAlignment, implicitNullCheckLimit, inlineObjects); + } + + @Override + public ReferenceMap createReferenceMap(boolean hasRegisters, int stackSlotCount) { + return new HotSpotReferenceMap(hasRegisters ? arch.getRegisterReferenceMapSize() : 0, stackSlotCount, this); + } +} diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotVMEventListener.java --- a/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotVMEventListener.java Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.jvmci.hotspot/src/com/oracle/jvmci/hotspot/HotSpotVMEventListener.java Wed Jun 03 01:11:56 2015 +0200 @@ -29,17 +29,25 @@ /** * Notifies this client that HotSpot is running in CompileTheWorld mode and the JVMCI compiler * should now perform its version of CompileTheWorld. + * + * @param metaspaceMethod + * @param entryBCI + * @param jvmciEnv + * @param id */ - void compileMetaspaceMethod(long metaspaceMethod, int entryBCI, long jvmciEnv, int id); + default void compileMetaspaceMethod(long metaspaceMethod, int entryBCI, long jvmciEnv, int id) { + } /** * Notifies this client that HotSpot is running in CompileTheWorld mode and the JVMCI compiler * should now perform its version of CompileTheWorld. */ - void notifyCompileTheWorld() throws Throwable; + default void notifyCompileTheWorld() throws Throwable { + } /** * Notifies this client that the VM is shutting down. */ - void notifyShutdown(); + default void notifyShutdown() { + } } diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.jvmci.service/src/com/oracle/jvmci/service/Services.java --- a/graal/com.oracle.jvmci.service/src/com/oracle/jvmci/service/Services.java Wed Jun 03 01:11:28 2015 +0200 +++ b/graal/com.oracle.jvmci.service/src/com/oracle/jvmci/service/Services.java Wed Jun 03 01:11:56 2015 +0200 @@ -34,10 +34,23 @@ */ public class Services { + /** + * Determines whether to suppress the {@link NoClassDefFoundError} raised if a service + * implementation class specified in a {@code /jvmci/services/*} file is missing. + */ + private static final boolean SuppressNoClassDefFoundError = Boolean.getBoolean("jvmci.service.suppressNoClassDefFoundError"); + private static final ClassValue> cache = new ClassValue>() { @Override protected List computeValue(Class type) { - return Arrays.asList(getServiceImpls(type)); + try { + return Arrays.asList(getServiceImpls(type)); + } catch (NoClassDefFoundError e) { + if (SuppressNoClassDefFoundError) { + return Collections.emptyList(); + } + throw e; + } } }; diff -r 824fe31b25c6 -r 902a6399353b graal/com.oracle.jvmci.sparc/src/com/oracle/jvmci/sparc/SPARC.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.jvmci.sparc/src/com/oracle/jvmci/sparc/SPARC.java Wed Jun 03 01:11:56 2015 +0200 @@ -0,0 +1,337 @@ +/* + * 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.sparc; + +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.jvmci.code.Register.RegisterCategory; + +/** + * Represents the SPARC architecture. + */ +public class SPARC extends Architecture { + + public static final RegisterCategory CPU = new RegisterCategory("CPU"); + + // General purpose registers + public static final Register r0 = new Register(0, 0, "g0", CPU); + public static final Register r1 = new Register(1, 1, "g1", CPU); + public static final Register r2 = new Register(2, 2, "g2", CPU); + public static final Register r3 = new Register(3, 3, "g3", CPU); + public static final Register r4 = new Register(4, 4, "g4", CPU); + public static final Register r5 = new Register(5, 5, "g5", CPU); + public static final Register r6 = new Register(6, 6, "g6", CPU); + public static final Register r7 = new Register(7, 7, "g7", CPU); + + public static final Register r8 = new Register(8, 8, "o0", CPU); + public static final Register r9 = new Register(9, 9, "o1", CPU); + public static final Register r10 = new Register(10, 10, "o2", CPU); + public static final Register r11 = new Register(11, 11, "o3", CPU); + public static final Register r12 = new Register(12, 12, "o4", CPU); + public static final Register r13 = new Register(13, 13, "o5", CPU); + public static final Register r14 = new Register(14, 14, "o6", CPU); + public static final Register r15 = new Register(15, 15, "o7", CPU); + + public static final Register r16 = new Register(16, 16, "l0", CPU); + public static final Register r17 = new Register(17, 17, "l1", CPU); + public static final Register r18 = new Register(18, 18, "l2", CPU); + public static final Register r19 = new Register(19, 19, "l3", CPU); + public static final Register r20 = new Register(20, 20, "l4", CPU); + public static final Register r21 = new Register(21, 21, "l5", CPU); + public static final Register r22 = new Register(22, 22, "l6", CPU); + public static final Register r23 = new Register(23, 23, "l7", CPU); + + public static final Register r24 = new Register(24, 24, "i0", CPU); + public static final Register r25 = new Register(25, 25, "i1", CPU); + public static final Register r26 = new Register(26, 26, "i2", CPU); + public static final Register r27 = new Register(27, 27, "i3", CPU); + public static final Register r28 = new Register(28, 28, "i4", CPU); + public static final Register r29 = new Register(29, 29, "i5", CPU); + public static final Register r30 = new Register(30, 30, "i6", CPU); + public static final Register r31 = new Register(31, 31, "i7", CPU); + + public static final Register g0 = r0; + public static final Register g1 = r1; + public static final Register g2 = r2; + public static final Register g3 = r3; + public static final Register g4 = r4; + public static final Register g5 = r5; + public static final Register g6 = r6; + public static final Register g7 = r7; + + public static final Register o0 = r8; + public static final Register o1 = r9; + public static final Register o2 = r10; + public static final Register o3 = r11; + public static final Register o4 = r12; + public static final Register o5 = r13; + public static final Register o6 = r14; + public static final Register o7 = r15; + + public static final Register l0 = r16; + public static final Register l1 = r17; + public static final Register l2 = r18; + public static final Register l3 = r19; + public static final Register l4 = r20; + public static final Register l5 = r21; + public static final Register l6 = r22; + public static final Register l7 = r23; + + public static final Register i0 = r24; + public static final Register i1 = r25; + public static final Register i2 = r26; + public static final Register i3 = r27; + public static final Register i4 = r28; + public static final Register i5 = r29; + public static final Register i6 = r30; + public static final Register i7 = r31; + + public static final Register sp = o6; + public static final Register fp = i6; + + // @formatter:off + public static final Register[] cpuRegisters = { + r0, r1, r2, r3, r4, r5, r6, r7, + r8, r9, r10, r11, r12, r13, r14, r15, + r16, r17, r18, r19, r20, r21, r22, r23, + r24, r25, r26, r27, r28, r29, r30, r31 + }; + // @formatter:on + + public static final RegisterCategory FPUs = new RegisterCategory("FPUs", cpuRegisters.length); + public static final RegisterCategory FPUd = new RegisterCategory("FPUd", cpuRegisters.length + 32); + + // Floating point registers + public static final Register f0 = new Register(32, 0, "f0", FPUs); + public static final Register f1 = new Register(33, 1, "f1", FPUs); + public static final Register f2 = new Register(34, 2, "f2", FPUs); + public static final Register f3 = new Register(35, 3, "f3", FPUs); + public static final Register f4 = new Register(36, 4, "f4", FPUs); + public static final Register f5 = new Register(37, 5, "f5", FPUs); + public static final Register f6 = new Register(38, 6, "f6", FPUs); + public static final Register f7 = new Register(39, 7, "f7", FPUs); + + public static final Register f8 = new Register(40, 8, "f8", FPUs); + public static final Register f9 = new Register(41, 9, "f9", FPUs); + public static final Register f10 = new Register(42, 10, "f10", FPUs); + public static final Register f11 = new Register(43, 11, "f11", FPUs); + public static final Register f12 = new Register(44, 12, "f12", FPUs); + public static final Register f13 = new Register(45, 13, "f13", FPUs); + public static final Register f14 = new Register(46, 14, "f14", FPUs); + public static final Register f15 = new Register(47, 15, "f15", FPUs); + + public static final Register f16 = new Register(48, 16, "f16", FPUs); + public static final Register f17 = new Register(49, 17, "f17", FPUs); + public static final Register f18 = new Register(50, 18, "f18", FPUs); + public static final Register f19 = new Register(51, 19, "f19", FPUs); + public static final Register f20 = new Register(52, 20, "f20", FPUs); + public static final Register f21 = new Register(53, 21, "f21", FPUs); + public static final Register f22 = new Register(54, 22, "f22", FPUs); + public static final Register f23 = new Register(55, 23, "f23", FPUs); + + public static final Register f24 = new Register(56, 24, "f24", FPUs); + public static final Register f25 = new Register(57, 25, "f25", FPUs); + public static final Register f26 = new Register(58, 26, "f26", FPUs); + public static final Register f27 = new Register(59, 27, "f27", FPUs); + public static final Register f28 = new Register(60, 28, "f28", FPUs); + public static final Register f29 = new Register(61, 29, "f29", FPUs); + public static final Register f30 = new Register(62, 30, "f30", FPUs); + public static final Register f31 = new Register(63, 31, "f31", FPUs); + + public static final Register d0 = new Register(32, getDoubleEncoding(0), "d0", FPUs); + public static final Register d2 = new Register(34, getDoubleEncoding(2), "d2", FPUs); + public static final Register d4 = new Register(36, getDoubleEncoding(4), "d4", FPUs); + public static final Register d6 = new Register(38, getDoubleEncoding(6), "d6", FPUs); + public static final Register d8 = new Register(40, getDoubleEncoding(8), "d8", FPUs); + public static final Register d10 = new Register(42, getDoubleEncoding(10), "d10", FPUs); + public static final Register d12 = new Register(44, getDoubleEncoding(12), "d12", FPUs); + public static final Register d14 = new Register(46, getDoubleEncoding(14), "d14", FPUs); + + public static final Register d16 = new Register(48, getDoubleEncoding(16), "d16", FPUs); + public static final Register d18 = new Register(50, getDoubleEncoding(18), "d18", FPUs); + public static final Register d20 = new Register(52, getDoubleEncoding(20), "d20", FPUs); + public static final Register d22 = new Register(54, getDoubleEncoding(22), "d22", FPUs); + public static final Register d24 = new Register(56, getDoubleEncoding(24), "d24", FPUs); + public static final Register d26 = new Register(58, getDoubleEncoding(26), "d26", FPUs); + public static final Register d28 = new Register(60, getDoubleEncoding(28), "d28", FPUs); + public static final Register d30 = new Register(62, getDoubleEncoding(28), "d28", FPUs); + + public static final Register d32 = new Register(64, getDoubleEncoding(32), "d32", FPUd); + public static final Register d34 = new Register(65, getDoubleEncoding(34), "d34", FPUd); + public static final Register d36 = new Register(66, getDoubleEncoding(36), "d36", FPUd); + public static final Register d38 = new Register(67, getDoubleEncoding(38), "d38", FPUd); + public static final Register d40 = new Register(68, getDoubleEncoding(40), "d40", FPUd); + public static final Register d42 = new Register(69, getDoubleEncoding(42), "d42", FPUd); + public static final Register d44 = new Register(70, getDoubleEncoding(44), "d44", FPUd); + public static final Register d46 = new Register(71, getDoubleEncoding(46), "d46", FPUd); + + public static final Register d48 = new Register(72, getDoubleEncoding(48), "d48", FPUd); + public static final Register d50 = new Register(73, getDoubleEncoding(50), "d50", FPUd); + public static final Register d52 = new Register(74, getDoubleEncoding(52), "d52", FPUd); + public static final Register d54 = new Register(75, getDoubleEncoding(54), "d54", FPUd); + public static final Register d56 = new Register(76, getDoubleEncoding(56), "d56", FPUd); + public static final Register d58 = new Register(77, getDoubleEncoding(58), "d58", FPUd); + public static final Register d60 = new Register(78, getDoubleEncoding(60), "d60", FPUd); + public static final Register d62 = new Register(79, getDoubleEncoding(62), "d62", FPUd); + + // @formatter:off + public static final Register[] fpuRegisters = { + f0, f1, f2, f3, f4, f5, f6, f7, + f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, + d32, d34, d36, d38, d40, d42, d44, d46, + d48, d50, d52, d54, d56, d58, d60, d62 + }; + // @formatter:on + + // @formatter:off + public static final Register[] allRegisters = { + // CPU + r0, r1, r2, r3, r4, r5, r6, r7, + r8, r9, r10, r11, r12, r13, r14, r15, + r16, r17, r18, r19, r20, r21, r22, r23, + r24, r25, r26, r27, r28, r29, r30, r31, + // FPU + f0, f1, f2, f3, f4, f5, f6, f7, + f8, f9, f10, f11, f12, f13, f14, f15, + f16, f17, f18, f19, f20, f21, f22, f23, + f24, f25, f26, f27, f28, f29, f30, f31, + d32, d34, d36, d38, d40, d42, d44, d46, + d48, d50, d52, d54, d56, d58, d60, d62 + }; + // @formatter:on + + /** + * Stack bias for stack and frame pointer loads. + */ + public static final int STACK_BIAS = 0x7ff; + /** + * In fact there are 64 single floating point registers, 32 of them could be accessed. TODO: + * Improve handling of these float registers + */ + public static final int FLOAT_REGISTER_COUNT = 64; + + /** + * Alignment for valid memory access. + */ + public static final int MEMORY_ACCESS_ALIGN = 4; + + public final Set features; + + public SPARC(Set features) { + super("SPARC", 8, ByteOrder.BIG_ENDIAN, false, allRegisters, LOAD_STORE | STORE_STORE, 1, r31.encoding + FLOAT_REGISTER_COUNT + 1, 8); + this.features = features; + } + + @Override + public boolean canStoreValue(RegisterCategory category, PlatformKind lirKind) { + if (!(lirKind instanceof Kind)) { + return false; + } + + Kind kind = (Kind) lirKind; + if (category.equals(CPU)) { + switch (kind) { + case Boolean: + case Byte: + case Char: + case Short: + case Int: + case Long: + case Object: + return true; + } + } else if (category.equals(FPUs) && kind.equals(Kind.Float)) { + return true; + } else if (category.equals(FPUd) && kind.equals(Kind.Double)) { + return true; + } + return false; + } + + @Override + public PlatformKind getLargestStorableKind(RegisterCategory category) { + if (category.equals(CPU)) { + return Kind.Long; + } else if (category.equals(FPUs)) { + return Kind.Double; + } else { + return Kind.Illegal; + } + } + + public static int spillSlotSize(TargetDescription td, PlatformKind kind) { + return Math.max(td.getSizeInBytes(kind), MEMORY_ACCESS_ALIGN); + } + + public static int getDoubleEncoding(int reg) { + assert reg < 64 && ((reg & 1) == 0); + // ignore v8 assertion for now + return (reg & 0x1e) | ((reg & 0x20) >> 5); + } + + public static boolean isCPURegister(Register r) { + return r.getRegisterCategory().equals(CPU); + } + + public static boolean isCPURegister(Register... regs) { + for (Register reg : regs) { + if (!isCPURegister(reg)) { + return false; + } + } + return true; + } + + public static boolean isSingleFloatRegister(Register r) { + return r.name.startsWith("f"); + } + + public static boolean isDoubleFloatRegister(Register r) { + return r.name.startsWith("d"); + } + + public Set getFeatures() { + return features; + } + + public boolean hasFeature(CPUFeature feature) { + return features.contains(feature); + } + + public enum CPUFeature { + VIS1, + VIS2, + VIS3, + CBCOND + } +} diff -r 824fe31b25c6 -r 902a6399353b mx/mx_graal.py --- a/mx/mx_graal.py Wed Jun 03 01:11:28 2015 +0200 +++ b/mx/mx_graal.py Wed Jun 03 01:11:56 2015 +0200 @@ -614,9 +614,9 @@ def _updateJVMCIFiles(jdkDir): jreJVMCIDir = join(jdkDir, 'jre', 'lib', 'jvmci') jvmciJars = [join(jreJVMCIDir, e) for e in os.listdir(jreJVMCIDir) if e.endswith('.jar')] - jreGraalServicesDir = join(jreJVMCIDir, 'services') - jreGraalOptionsDir = join(jreJVMCIDir, 'options') - _extractJVMCIFiles(_getJdkDeployedJars(jdkDir), jvmciJars, jreGraalServicesDir, jreGraalOptionsDir) + jreJVMCIServicesDir = join(jreJVMCIDir, 'services') + jreJVMCIOptionsDir = join(jreJVMCIDir, 'options') + _extractJVMCIFiles(_getJdkDeployedJars(jdkDir), jvmciJars, jreJVMCIServicesDir, jreJVMCIOptionsDir) def _patchGraalVersionConstant(dist): """ diff -r 824fe31b25c6 -r 902a6399353b mx/suite.py --- a/mx/suite.py Wed Jun 03 01:11:28 2015 +0200 +++ b/mx/suite.py Wed Jun 03 01:11:56 2015 +0200 @@ -153,12 +153,24 @@ }, "projects" : { + + # ------------- JVMCI ------------- + "com.oracle.jvmci.service" : { "subDir" : "graal", "sourceDirs" : ["src"], "checkstyle" : "com.oracle.graal.graph", "javaCompliance" : "1.8", - "workingSets" : "API,Graal", + "workingSets" : "API,JVMCI", + }, + + "com.oracle.jvmci.service.processor" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.jvmci.service"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,Codegen,HotSpot", }, "com.oracle.jvmci.common" : { @@ -169,6 +181,23 @@ "workingSets" : "API,JVMCI", }, + "com.oracle.jvmci.meta" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,JVMCI", + }, + + "com.oracle.jvmci.code" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.jvmci.meta"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "API,JVMCI", + }, + "com.oracle.jvmci.runtime" : { "subDir" : "graal", "sourceDirs" : ["src"], @@ -213,6 +242,141 @@ "workingSets" : "JVMCI", }, + "com.oracle.jvmci.hotspotvmconfig" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,HotSpot", + }, + + "com.oracle.jvmci.hotspotvmconfig.processor" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.jvmci.hotspotvmconfig", "com.oracle.jvmci.common"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,HotSpot,Codegen", + }, + + "com.oracle.jvmci.debug" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "checkstyle" : "com.oracle.graal.graph", + "dependencies" : [ + "com.oracle.jvmci.service", + ], + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,Debug", + }, + + "com.oracle.jvmci.debug.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "JUNIT", + "com.oracle.jvmci.debug", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,Debug,Test", + }, + + "com.oracle.jvmci.options" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.service", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI", + }, + + "com.oracle.jvmci.options.processor" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.options", + ], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,Codegen", + }, + + "com.oracle.jvmci.options.test" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.options", + "JUNIT", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : ["com.oracle.jvmci.options.processor"], + "javaCompliance" : "1.8", + "workingSets" : "JVMCI", + }, + + "com.oracle.jvmci.hotspot.jfr" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.hotspot", + "JFR", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "javaCompliance" : "1.8", + "profile" : "", + "workingSets" : "JVMCI,HotSpot", + }, + + "com.oracle.jvmci.amd64" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.jvmci.code"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,AMD64", + }, + + "com.oracle.jvmci.hotspot.amd64" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.amd64", + "com.oracle.jvmci.hotspot", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,HotSpot,AMD64", + }, + + "com.oracle.jvmci.sparc" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : ["com.oracle.jvmci.code"], + "checkstyle" : "com.oracle.graal.graph", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,SPARC", + }, + + "com.oracle.jvmci.hotspot.sparc" : { + "subDir" : "graal", + "sourceDirs" : ["src"], + "dependencies" : [ + "com.oracle.jvmci.sparc", + "com.oracle.jvmci.hotspot", + ], + "checkstyle" : "com.oracle.graal.graph", + "annotationProcessors" : ["com.oracle.jvmci.service.processor"], + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,HotSpot,SPARC", + }, + + # ------------- NFI ------------- + "com.oracle.nfi" : { "subDir" : "graal", "sourceDirs" : ["src"], @@ -233,6 +397,8 @@ "javaCompliance" : "1.7", }, + # ------------- Graal ------------- + "com.oracle.graal.api.collections" : { "subDir" : "graal", "sourceDirs" : ["src"], @@ -283,23 +449,6 @@ "workingSets" : "API,Graal,Test", }, - "com.oracle.jvmci.meta" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,JVMCI", - }, - - "com.oracle.jvmci.code" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.jvmci.meta"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "API,JVMCI", - }, - "com.oracle.graal.api.replacements" : { "subDir" : "graal", "sourceDirs" : ["src"], @@ -309,50 +458,6 @@ "workingSets" : "API,Graal,Replacements", }, - "com.oracle.jvmci.service.processor" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.jvmci.service"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Codegen,HotSpot", - }, - - "com.oracle.graal.amd64" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.jvmci.code"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,AMD64", - }, - - "com.oracle.graal.sparc" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.jvmci.code"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,SPARC", - }, - - "com.oracle.jvmci.hotspotvmconfig" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,HotSpot", - }, - - "com.oracle.jvmci.hotspotvmconfig.processor" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : ["com.oracle.jvmci.hotspotvmconfig", "com.oracle.jvmci.common"], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "Graal,HotSpot,Codegen", - }, - "com.oracle.graal.hotspot" : { "subDir" : "graal", "sourceDirs" : ["src"], @@ -371,24 +476,11 @@ "workingSets" : "Graal,HotSpot", }, - "com.oracle.jvmci.hotspot.jfr" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.hotspot", - "JFR", - ], - "checkstyle" : "com.oracle.graal.graph", - "annotationProcessors" : ["com.oracle.jvmci.service.processor"], - "javaCompliance" : "1.8", - "profile" : "", - "workingSets" : "JVMCI,HotSpot", - }, - "com.oracle.graal.hotspot.amd64" : { "subDir" : "graal", "sourceDirs" : ["src"], "dependencies" : [ + "com.oracle.jvmci.hotspot.amd64", "com.oracle.graal.compiler.amd64", "com.oracle.graal.hotspot", "com.oracle.graal.replacements.amd64", @@ -403,6 +495,7 @@ "subDir" : "graal", "sourceDirs" : ["src"], "dependencies" : [ + "com.oracle.jvmci.hotspot.sparc", "com.oracle.graal.compiler.sparc", "com.oracle.graal.replacements.sparc", ], @@ -436,41 +529,6 @@ "workingSets" : "Graal,HotSpot,AMD64,Test", }, - "com.oracle.jvmci.options" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.service", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI", - }, - - "com.oracle.jvmci.options.processor" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.options", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,Codegen", - }, - - "com.oracle.jvmci.options.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "com.oracle.jvmci.options", - "JUNIT", - ], - "checkstyle" : "com.oracle.graal.graph", - "annotationProcessors" : ["com.oracle.jvmci.options.processor"], - "javaCompliance" : "1.8", - "workingSets" : "JVMCI", - }, - "com.oracle.graal.nodeinfo" : { "subDir" : "graal", "sourceDirs" : ["src"], @@ -517,29 +575,6 @@ "workingSets" : "Graal,Graph,Test", }, - "com.oracle.jvmci.debug" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "checkstyle" : "com.oracle.graal.graph", - "dependencies" : [ - "com.oracle.jvmci.service", - ], - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,Debug", - }, - - "com.oracle.jvmci.debug.test" : { - "subDir" : "graal", - "sourceDirs" : ["src"], - "dependencies" : [ - "JUNIT", - "com.oracle.jvmci.debug", - ], - "checkstyle" : "com.oracle.graal.graph", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,Debug,Test", - }, - "com.oracle.graal.lir" : { "subDir" : "graal", "sourceDirs" : ["src"], @@ -794,7 +829,7 @@ "subDir" : "graal", "sourceDirs" : ["src"], "dependencies" : [ - "com.oracle.graal.amd64", + "com.oracle.jvmci.amd64", "com.oracle.graal.lir.jtt", ], "checkstyle" : "com.oracle.graal.graph", @@ -815,7 +850,7 @@ "subDir" : "graal", "sourceDirs" : ["src"], "dependencies" : [ - "com.oracle.graal.sparc", + "com.oracle.jvmci.sparc", "com.oracle.graal.compiler.test", ], "checkstyle" : "com.oracle.graal.graph", @@ -970,7 +1005,7 @@ "sourceDirs" : ["src"], "dependencies" : [ "com.oracle.graal.asm", - "com.oracle.graal.amd64", + "com.oracle.jvmci.amd64", ], "checkstyle" : "com.oracle.graal.graph", "javaCompliance" : "1.8", @@ -994,13 +1029,15 @@ "sourceDirs" : ["src"], "dependencies" : [ "com.oracle.graal.hotspot", - "com.oracle.graal.sparc", + "com.oracle.jvmci.sparc", ], "checkstyle" : "com.oracle.graal.graph", "javaCompliance" : "1.8", "workingSets" : "Graal,Assembler,SPARC", }, + # ------------- Truffle ------------- + "com.oracle.truffle.api" : { "subDir" : "graal", "sourceDirs" : ["src"], @@ -1179,6 +1216,8 @@ "workingSets" : "Truffle,SimpleLanguage,Tools", }, + # ------------- GraalTruffle ------------- + "com.oracle.graal.truffle" : { "subDir" : "graal", "sourceDirs" : ["src"], @@ -1281,7 +1320,8 @@ "subDir" : "graal", "sourcesPath" : "build/jvmci-hotspot.src.zip", "dependencies" : [ - "com.oracle.jvmci.hotspot", + "com.oracle.jvmci.hotspot.amd64", + "com.oracle.jvmci.hotspot.sparc", "com.oracle.jvmci.hotspot.jfr", ], "distDependencies" : [