Mercurial > hg > graal-jvmci-8
changeset 16313:151fe6b1e511
Merge
author | Stefan Anzinger <stefan.anzinger@gmail.com> |
---|---|
date | Fri, 30 May 2014 15:09:09 +0200 |
parents | b5f89908b9ba (diff) 73a0c8e14cd1 (current diff) |
children | f57cf459f5d3 |
files | graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/LIRBlock.java graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/LIRControlFlowGraph.java graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/LIRFrameStateBuilder.java graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/LIRLoop.java graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64MemoryPeephole.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/GraalOptions.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/UnsafeAccess.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/spi/LIRTypeTool.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/AbstractObjectStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/FloatStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IntegerStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ObjectStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/PrimitiveStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampFactory.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampProvider.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerationResult.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerationResultBase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/LIRGenLowerable.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/LIRGenResLowerable.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/FieldIntrospection.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/UnsafeAccess.java graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotMemoryPeephole.java graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/nodes/AtomicGetAndAddNode.java graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/nodes/LoweredAtomicGetAndAddNode.java graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotBackend.java graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerationResult.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotSymbol.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConstant.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMField.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMFlag.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMType.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/DefaultHotSpotLoweringProvider.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/AbstractMethodHandleNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/MethodHandleInvokeBasicNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/MethodHandleLinkToInterfaceNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/MethodHandleLinkToSpecialNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/MethodHandleLinkToStaticNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/MethodHandleLinkToVirtualNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/MethodHandleNode.java graal/com.oracle.graal.hotspotvmconfig/src/com/oracle/graal/hotspotvmconfig/HotSpotVMConstant.java graal/com.oracle.graal.hotspotvmconfig/src/com/oracle/graal/hotspotvmconfig/HotSpotVMField.java graal/com.oracle.graal.hotspotvmconfig/src/com/oracle/graal/hotspotvmconfig/HotSpotVMFlag.java graal/com.oracle.graal.hotspotvmconfig/src/com/oracle/graal/hotspotvmconfig/HotSpotVMType.java graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCControlFlow.java graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BinaryLogicNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BinaryOpLogicNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/cfg/BlocksToDoubles.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadExceptionObjectNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/ArithmeticLIRGenerator.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/MemoryArithmeticLIRLowerable.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/MemoryArithmeticLIRLowerer.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/FloatStamp.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IllegalStamp.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/IntegerStamp.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/ObjectStamp.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/PrimitiveStamp.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampProvider.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/VoidStamp.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/NodesToDoubles.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ReadEliminationPhase.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningPhase.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/inlining/InliningUtil.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/GraalOptions.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/ComputeInliningRelevanceClosure.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/ComputeProbabilityClosure.java graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalLongUnitTest.java graal/com.oracle.graal.test/src/com/oracle/graal/test/LongTest.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/ASTPrinter.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/DebugContext.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/DebugManager.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/DefaultDebugManager.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/KillException.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/debug/QuitException.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/impl/DefaultSourceSection.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/instrument/DefaultNodeInstrumenter.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/instrument/InstrumentationNode.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/instrument/InstrumentationProbeEvents.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/instrument/InstrumentationProbeNode.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/instrument/InstrumentationProxyNode.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/instrument/NodeInstrumenter.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/instrument/NodePhylum.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/instrument/PhylumMarked.java graal/com.oracle.truffle.api/src/com/oracle/truffle/api/source/SourceManager.java mx/JUnitWrapper.java mx/mx_graal.py mx/projects src/share/vm/graal/graalCompilerToVM.cpp test/baseline_whitelist.txt test/whitelist_baseline.txt |
diffstat | 11 files changed, 279 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java Thu May 29 11:20:10 2014 -0700 +++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java Fri May 30 15:09:09 2014 +0200 @@ -1278,10 +1278,18 @@ } } + /** + * Condition Codes to use for instruction + */ public enum CC { // @formatter:off - + /** + * Condition is considered as 32bit operation condition + */ Icc(0b00, "icc"), + /** + * Condition is considered as 64bit operation condition + */ Xcc(0b10, "xcc"), Ptrcc(getHostWordKind() == Kind.Long ? Xcc.getValue() : Icc.getValue(), "ptrcc"), Fcc0(0b00, "fcc0"), @@ -1402,6 +1410,9 @@ } } + /** + * Represents the <b>Address Space Identifier</b> defined in the SPARC architec + */ public enum Asi { // @formatter:off @@ -1906,6 +1917,9 @@ } } + /** + * Compare and Branch if Carry Clear ( Greater not C Than or Equal, Unsigned ) + */ public static class Cwbcc extends Fmt00e { public Cwbcc(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -1917,6 +1931,9 @@ } } + /** + * Compare and Branch if Carry Set (Less Than, Unsigned) + */ public static class Cwbcs extends Fmt00e { public Cwbcs(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -1928,6 +1945,9 @@ } } + /** + * Compare and Branch if Equal + */ public static class Cwbe extends Fmt00e { public Cwbe(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -1939,6 +1959,9 @@ } } + /** + * Compare and Branch if Greater + */ public static class Cwbg extends Fmt00e { public Cwbg(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -1950,6 +1973,9 @@ } } + /** + * Compare and Branch if Greater or Equal + */ public static class Cwbge extends Fmt00e { public Cwbge(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -1961,6 +1987,9 @@ } } + /** + * Compare and Branch if Greater Unsigned + */ public static class Cwbgu extends Fmt00e { public Cwbgu(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -1972,6 +2001,9 @@ } } + /** + * Compare and Branch if Less + */ public static class Cwbl extends Fmt00e { public Cwbl(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -1983,6 +2015,9 @@ } } + /** + * Compare and Branch if Less or Equal + */ public static class Cwble extends Fmt00e { public Cwble(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -1994,6 +2029,9 @@ } } + /** + * Compare and Branch if Less or Equal Unsigned + */ public static class Cwbleu extends Fmt00e { public Cwbleu(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -2005,6 +2043,9 @@ } } + /** + * Compare and Branch if Not Equal + */ public static class Cwbne extends Fmt00e { public Cwbne(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -2016,6 +2057,9 @@ } } + /** + * Compare and Branch if Negative + */ public static class Cwbneg extends Fmt00e { public Cwbneg(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -2027,6 +2071,9 @@ } } + /** + * Compare and Branch if Positive + */ public static class Cwbpos extends Fmt00e { public Cwbpos(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -2038,6 +2085,9 @@ } } + /** + * Compare and Branch if Overflow Clear + */ public static class Cwbvc extends Fmt00e { public Cwbvc(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -2049,6 +2099,9 @@ } } + /** + * Compare and Branch if Overflow Set + */ public static class Cwbvs extends Fmt00e { public Cwbvs(SPARCAssembler asm, Register src1, Register src2, int simm10) { @@ -2340,6 +2393,9 @@ } } + /** + * Floating-point multiply-add single (fused) + */ public static class Fmadds extends Fmt5a { public Fmadds(SPARCAssembler asm, Register src1, Register src2, Register src3, Register dst) { @@ -2347,6 +2403,9 @@ } } + /** + * Floating-point multiply-add double (fused) + */ public static class Fmaddd extends Fmt5a { public Fmaddd(SPARCAssembler asm, Register src1, Register src2, Register src3, Register dst) { @@ -2354,6 +2413,9 @@ } } + /** + * 16-bit partitioned average + */ public static class Fmean16 extends Fmt3p { public Fmean16(Register src1, Register src2, Register dst) { @@ -2565,6 +2627,9 @@ } } + /** + * Convert Double to 32-bit Integer + */ public static class Fdtoi extends Fmt3n { public Fdtoi(SPARCAssembler masm, Register src2, Register dst) { @@ -2572,6 +2637,9 @@ } } + /** + * Flush register windows + */ public static class Flushw extends Fmt10 { public Flushw() {
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java Thu May 29 11:20:10 2014 -0700 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java Fri May 30 15:09:09 2014 +0200 @@ -61,6 +61,10 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { + // Move the values up one level to be the input for the next call. + new SPARCMacroAssembler.Mov(asRegister(handlerInCallerPc), i2).emit(masm); + new SPARCMacroAssembler.Mov(asRegister(exception), i0).emit(masm); + new SPARCMacroAssembler.Mov(asRegister(exceptionPc), i1).emit(masm); leaveFrame(crb); // Restore SP from L7 if the exception PC is a method handle call site.
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotUnwindOp.java Thu May 29 11:20:10 2014 -0700 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotUnwindOp.java Fri May 30 15:09:09 2014 +0200 @@ -49,6 +49,9 @@ @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { + // This Frame is left but the called unwind (which is sibling) method needs the exception as + // input in i0 + new Mov(o0, i0).emit(masm); leaveFrame(crb); ForeignCallLinkage linkage = crb.foreignCalls.lookupForeignCall(UNWIND_EXCEPTION_TO_CALLER); @@ -59,7 +62,6 @@ // Get return address (is in o7 after leave). Register returnAddress = asRegister(cc.getArgument(1)); new Mov(o7, returnAddress).emit(masm); - Register scratch = g5; SPARCCall.indirectJmp(crb, masm, scratch, linkage); }
--- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lcmp.java Thu May 29 11:20:10 2014 -0700 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/bytecode/BC_lcmp.java Fri May 30 15:09:09 2014 +0200 @@ -49,4 +49,24 @@ runTest("test", -1L, 0L); } + /** + * Test with ugly numbers (which probably does not fit into one instruction + * + * @throws Throwable + */ + @Test + public void run3() throws Throwable { + runTest("test", 293521900824L, 97726785831L); + } + + /** + * Test with big numbers where it makes difference if the value is handled with 64 bits + * + * @throws Throwable + */ + @Test + public void run4() throws Throwable { + runTest("test", -1L, Long.MIN_VALUE); + } + }
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java Thu May 29 11:20:10 2014 -0700 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCArithmetic.java Fri May 30 15:09:09 2014 +0200 @@ -539,6 +539,17 @@ } else { switch (opcode) { case LREM: + new Sdivx(asLongReg(src1), asLongReg(src2), asLongReg(scratch1)).emit(masm); + exceptionOffset = masm.position(); + new Mulx(asLongReg(scratch1), asLongReg(src2), asLongReg(scratch2)).emit(masm); + new Sub(asLongReg(src1), asLongReg(scratch2), asLongReg(dst)).emit(masm); + break; + case IREM: + new Sdivx(asIntReg(src1), asIntReg(src2), asIntReg(scratch1)).emit(masm); + exceptionOffset = masm.position(); + new Mulx(asIntReg(scratch1), asIntReg(src2), asIntReg(scratch2)).emit(masm); + new Sub(asIntReg(src1), asIntReg(scratch2), asIntReg(dst)).emit(masm); + break; case LUREM: throw GraalInternalError.unimplemented(); default: @@ -560,6 +571,9 @@ case INEG: new Neg(asIntReg(src), asIntReg(dst)).emit(masm); break; + case LNEG: + new Neg(asLongReg(src), asLongReg(dst)).emit(masm); + break; case INOT: new Not(asIntReg(src), asIntReg(dst)).emit(masm); break;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCConstDataOp.java Fri May 30 15:09:09 2014 +0200 @@ -0,0 +1,49 @@ +package com.oracle.graal.lir.sparc; + +import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; + +import com.oracle.graal.api.code.CompilationResult.RawData; +import com.oracle.graal.api.code.*; +import com.oracle.graal.api.meta.*; +import com.oracle.graal.asm.sparc.*; +import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Nop; +import com.oracle.graal.lir.*; +import com.oracle.graal.lir.asm.*; +import com.oracle.graal.sparc.*; + +@Opcode("CONST_DATA") +public class SPARCConstDataOp extends SPARCLIRInstruction { + + @Def({REG}) private AllocatableValue dst; + private byte[] val; + + public SPARCConstDataOp(AllocatableValue dst, byte[] val) { + this.dst = dst; + this.val = val; + } + + @Override + public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { + RawData rawData = new RawData(val, 16); + // recordDataReferenceInCoe will fix up PC relative. Therefore + // the PC will be added later on to gather an absolute address + crb.recordDataReferenceInCode(rawData); + Register dstReg = ValueUtil.asLongReg(dst); + new SPARCAssembler.Sethi(0, dstReg).emit(masm); + + Nop nop = new SPARCMacroAssembler.Nop(); + nop.emit(masm); + nop.emit(masm); + nop.emit(masm); + nop.emit(masm); + nop.emit(masm); + nop.emit(masm); + new SPARCAssembler.Add(dstReg, 0, dstReg).emit(masm); + // TODO: Fix this issue with the pc relative addressing (This is just my first guess how to + // do this) + new SPARCAssembler.Sub(dstReg, 10 * 4, dstReg).emit(masm); + new SPARCAssembler.Rdpc(SPARC.g5).emit(masm); + new SPARCAssembler.Add(SPARC.g5, dstReg, dstReg).emit(masm); + } + +}
--- a/mx/JUnitWrapper.java Thu May 29 11:20:10 2014 -0700 +++ b/mx/JUnitWrapper.java Fri May 30 15:09:09 2014 +0200 @@ -27,6 +27,12 @@ * linux [depending on the settings]: ~2097k) * see http://msdn.microsoft.com/en-us/library/ms682425%28VS.85%29.aspx */ +import org.apache.tools.ant.*; +import org.apache.tools.ant.taskdefs.optional.junit.*; +import org.apache.tools.ant.taskdefs.optional.junit.FormatterElement.TypeAttribute; +import org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.*; +import org.apache.tools.ant.types.*; +import org.apache.tools.ant.types.selectors.*; import com.oracle.graal.test.*; import java.io.*; import java.util.*; @@ -34,19 +40,15 @@ public class JUnitWrapper { /** - * @param args - * args[0] is the path where to read the names of the testclasses. + * @param args args[0] is the path where to read the names of the testclasses. + * @throws Exception */ - public static void main(String[] args) { + public static void main(String[] args) throws Exception { if (args.length == 0) { System.err.printf("wrong usage. provide a filename\n"); System.exit(1); } ArrayList<String> tests = new ArrayList<String>(1000); - // add JUnit command line arguments - for (int i = 1; i < args.length; i++) { - tests.add(args[i]); - } BufferedReader br = null; try { br = new BufferedReader(new FileReader(args[0])); @@ -75,6 +77,69 @@ } else { System.out.printf("executing junit tests now... (%d test classes)\n", strargs.length); } - GraalJUnitCore.main(strargs); + + JUnitTask task = new JUnitTask(); + task.setCloneVm(true); + task.setProject(new Project()); + task.getProject().setSystemProperties(); + + task.getProject().setBasedir("."); + TypeAttribute ta = new TypeAttribute(); + ta.setValue("xml"); + FormatterElement fe = new FormatterElement(); + fe.setType(ta); + task.addFormatter(fe); + + File reportDir = new File("report"); + reportDir.mkdirs(); + File xmldir = new File(reportDir, "xml"); + xmldir.mkdirs(); + Set<String> ignore = new HashSet<>(); + ignore.add("com.oracle.truffle.api.dsl.test.BinaryNodeTest"); + ignore.add("com.oracle.truffle.api.dsl.test.ExecuteEvaluatedTest"); + ignore.add("com.oracle.truffle.api.test.FrameTest"); + ignore.add("com.oracle.truffle.api.dsl.test.UnsupportedSpecializationTest"); + ignore.add("com.oracle.truffle.sl.test.SLSimpleTestSuite"); + ignore.add("com.oracle.graal.compiler.test.ea.UnsafeEATest"); + ignore.add("com.oracle.graal.hotspot.test.HotSpotNmethodTest"); + ignore.add("com.oracle.graal.hotspot.test.WriteBarrierAdditionTest"); + ignore.add("com.oracle.graal.hotspot.test.CompressedOopTest"); + ignore.add("com.oracle.graal.compiler.test.deopt.MonitorDeoptTest"); // Probably CString problem + for (String name : tests) { + JUnitTest t = new JUnitTest(); + t.setName(name); + t.setTodir(xmldir); + if (new File(xmldir, "TEST-" + name + ".xml").exists() || ignore.contains(name) + ) { + System.out.println("Ignoring testclass " + name); + t.setIf("run.all"); + } + t.setFork(false); + t.setHaltonerror(false); + t.setHaltonfailure(false); + task.addTest(t); + } + SummaryAttribute sa = new SummaryAttribute(); + sa.setValue("withOutAndErr"); + task.setPrintsummary(sa); + task.setFork(false); + task.setShowOutput(true); + task.setOutputToFormatters(true); + task.setHaltonerror(false); + + task.execute(); + XMLResultAggregator report = new XMLResultAggregator(); + report.setProject(task.getProject()); + report.setTofile(new File(reportDir, "unittest-report-merged.xml").getPath()); + FileSet resultFileSet = new FileSet(); + resultFileSet.setDir(xmldir); + resultFileSet.setIncludes("*"); + report.addFileSet(resultFileSet); + report.execute(); + AggregateTransformer at = report.createReport(); + File htmlDir = new File(reportDir, "html"); + htmlDir.mkdirs(); + at.setTodir(htmlDir); + at.transform(); } }
--- a/mx/mx_graal.py Thu May 29 11:20:10 2014 -0700 +++ b/mx/mx_graal.py Fri May 30 15:09:09 2014 +0200 @@ -949,7 +949,7 @@ for t in tests: found = False for c, p in candidates.iteritems(): - if t in c: + if fnmatch.fnmatch(c, t): found = True classes.append(c) projs.add(p.name) @@ -979,7 +979,7 @@ if testfile is None: (_, testfile) = tempfile.mkstemp(".testclasses", "graal") os.close(_) - corecp = mx.classpath(['com.oracle.graal.test']) + corecp = mx.classpath(['com.oracle.graal.test', 'ant']) if not exists(javaClass) or getmtime(javaClass) < getmtime(javaSource): subprocess.check_call([mx.java().javac, '-cp', corecp, '-d', mxdir, javaSource])
--- a/mx/projects Thu May 29 11:20:10 2014 -0700 +++ b/mx/projects Fri May 30 15:09:09 2014 +0200 @@ -13,6 +13,18 @@ library@JUNIT@sourceSha1=28e0ad201304e4a4abf999ca0570b7cffc352c3c library@JUNIT@dependencies=HAMCREST +library@ANT@path=lib/ant-1.9.3.jar +library@ANT@urls=jar:http://tweedo.com/mirror/apache//ant/binaries/apache-ant-1.9.3-bin.zip!/apache-ant-1.9.3/lib/ant.jar +library@ANT@sha1=311ac248030ff4f9f27e55561fadf3e99c646abb + +library@ANT_JUNIT@path=lib/ant-junit-1.9.3.jar +library@ANT_JUNIT@urls=jar:http://tweedo.com/mirror/apache//ant/binaries/apache-ant-1.9.3-bin.zip!/apache-ant-1.9.3/lib/ant-junit.jar +library@ANT_JUNIT@sha1=d1cafa6f9f174a6ca335b257e3b15c485d2c054a + +library@ANT_JUNIT4@path=lib/ant-junit4-1.9.3.jar +library@ANT_JUNIT4@urls=jar:http://tweedo.com/mirror/apache//ant/binaries/apache-ant-1.9.3-bin.zip!/apache-ant-1.9.3/lib/ant-junit4.jar +library@ANT_JUNIT4@sha1=a5443743a5b0abe9a1b4e40524ce6dee285cb99c + library@HAMCREST@path=lib/hamcrest-core-1.3.jar library@HAMCREST@urls=http://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar library@HAMCREST@sha1=42a25dc3219429f0e5d060061f71acb49bf010a0 @@ -106,6 +118,9 @@ project@com.oracle.graal.api.runtime@javaCompliance=1.8 project@com.oracle.graal.api.runtime@workingSets=API,Graal +project@ant@dependencies=ANT,ANT_JUNIT,ANT_JUNIT4 +project@ant@javaCompliance=1.7 + # graal.api.test project@com.oracle.graal.api.test@subDir=graal project@com.oracle.graal.api.test@sourceDirs=src
--- a/src/cpu/sparc/vm/sharedRuntime_sparc.cpp Thu May 29 11:20:10 2014 -0700 +++ b/src/cpu/sparc/vm/sharedRuntime_sparc.cpp Fri May 30 15:09:09 2014 +0200 @@ -990,6 +990,19 @@ // Jump to the compiled code just as if compiled code was doing it. __ ld_ptr(G5_method, in_bytes(Method::from_compiled_offset()), G3); +#ifdef GRAAL + // check if this call should be routed towards a specific entry point + __ ld(Address(G2_thread, in_bytes(JavaThread::graal_alternate_call_target_offset())), G1); + __ cmp(G0, G1); + Label no_alternative_target; + __ br(Assembler::equal, false, Assembler::pn, no_alternative_target); + __ delayed()->nop(); + + __ ld_ptr(G2_thread, in_bytes(JavaThread::graal_alternate_call_target_offset()), G3); + __ st(G0, Address(G2_thread, in_bytes(JavaThread::graal_alternate_call_target_offset()))); + + __ bind(no_alternative_target); +#endif // 6243940 We might end up in handle_wrong_method if // the callee is deoptimized as we race thru here. If that
--- a/src/share/vm/graal/graalCompilerToVM.cpp Thu May 29 11:20:10 2014 -0700 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Fri May 30 15:09:09 2014 +0200 @@ -596,7 +596,23 @@ } else if (jap.get_ret_type() == T_OBJECT || jap.get_ret_type() == T_ARRAY) { return JNIHandles::make_local((oop) result.get_jobject()); } else { - oop o = java_lang_boxing_object::create(jap.get_ret_type(), (jvalue *) result.get_value_addr(), CHECK_NULL); + jvalue *value = (jvalue *) result.get_value_addr(); + // Narrow the value down if required (Important on big endian machines) + switch (jap.get_ret_type()) { + case T_BOOLEAN: + value->z = (jboolean) value->i; + break; + case T_BYTE: + value->b = (jbyte) value->i; + break; + case T_CHAR: + value->c = (jchar) value->i; + break; + case T_SHORT: + value->s = (jshort) value->i; + break; + } + oop o = java_lang_boxing_object::create(jap.get_ret_type(), value, CHECK_NULL); return JNIHandles::make_local(o); } C2V_END