changeset 16314:f57cf459f5d3

[SPARC] Adding deoptimization handler foreign call LoadDataAddressOp emitting now absolute addresses. (May be improved in future) Removing epilogue baseclass/block end marking interface from LeaveCurrentStackFrameOp and LeaveDeoptimizedStackFrameOp to conform with the assertion in com.oracle.graal.lir.LIR.verifyBlock Implement LIRGenerator.emitDeoptimizationFetchUnrollInfoCall for SPARC Removing my changes for JUnit reporting from testrunner.
author Stefan Anzinger <stefan.anzinger@gmail.com>
date Sat, 31 May 2014 00:30:26 +0200
parents 151fe6b1e511
children b955d649fca8
files 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/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.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.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/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/SPARCMove.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/BinaryOpLogicNode.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 mx/JUnitWrapper.java mx/mx_graal.py mx/projects test/whitelist_baseline.txt
diffstat 8 files changed, 37 insertions(+), 94 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java	Fri May 30 15:09:09 2014 +0200
+++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java	Sat May 31 00:30:26 2014 +0200
@@ -61,6 +61,7 @@
         register(new HotSpotForeignCallLinkage(EXCEPTION_HANDLER, 0L, PRESERVES_REGISTERS, LEAF_NOFP, outgoingExceptionCc, incomingExceptionCc, NOT_REEXECUTABLE, ANY_LOCATION));
         register(new HotSpotForeignCallLinkage(EXCEPTION_HANDLER_IN_CALLER, JUMP_ADDRESS, PRESERVES_REGISTERS, LEAF_NOFP, outgoingExceptionCc, incomingExceptionCc, NOT_REEXECUTABLE, ANY_LOCATION));
 
+        link(new SPARCDeoptimizationStub(providers, target, registerStubCall(DEOPTIMIZATION_HANDLER, REEXECUTABLE, LEAF, NO_LOCATIONS)));
         link(new SPARCDeoptimizationStub(providers, target, registerStubCall(UNCOMMON_TRAP_HANDLER, REEXECUTABLE, LEAF, NO_LOCATIONS)));
 
         super.initialize(providers, config);
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java	Fri May 30 15:09:09 2014 +0200
+++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java	Sat May 31 00:30:26 2014 +0200
@@ -290,6 +290,19 @@
         return result;
     }
 
+    @Override
+    public Value emitDeoptimizationFetchUnrollInfoCall(SaveRegistersOp saveRegisterOp) {
+        ForeignCallLinkage linkage = getForeignCalls().lookupForeignCall(FETCH_UNROLL_INFO);
+
+        Register threadRegister = getProviders().getRegisters().getThreadRegister();
+        Register stackPointerRegister = getProviders().getRegisters().getStackPointerRegister();
+        append(new SPARCHotSpotCRuntimeCallPrologueOp(config.threadLastJavaSpOffset(), threadRegister, stackPointerRegister));
+        Variable result = super.emitForeignCall(linkage, null, threadRegister.asValue(Kind.Long));
+        append(new SPARCHotSpotCRuntimeCallEpilogueOp(config.threadLastJavaSpOffset(), config.threadLastJavaPcOffset(), config.threadJavaFrameAnchorFlagsOffset(), threadRegister));
+
+        return result;
+    }
+
     public void emitNullCheck(Value address, LIRFrameState state) {
         assert address.getKind() == Kind.Object : address + " - " + address.getKind() + " not an object!";
         append(new NullCheckOp(load(address), state));
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java	Fri May 30 15:09:09 2014 +0200
+++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java	Sat May 31 00:30:26 2014 +0200
@@ -28,12 +28,13 @@
 import com.oracle.graal.asm.sparc.SPARCMacroAssembler.*;
 import com.oracle.graal.lir.*;
 import com.oracle.graal.lir.asm.*;
+import com.oracle.graal.lir.sparc.*;
 
 /**
  * Pops the current frame off the stack.
  */
 @Opcode("LEAVE_CURRENT_STACK_FRAME")
-final class SPARCHotSpotLeaveCurrentStackFrameOp extends SPARCHotSpotEpilogueOp {
+final class SPARCHotSpotLeaveCurrentStackFrameOp extends SPARCLIRInstruction {
 
     @Override
     public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
@@ -44,6 +45,6 @@
         new Mov(o3, i3).emit(masm);
         new Mov(o4, i4).emit(masm);
 
-        leaveFrame(crb);
+        crb.frameContext.leave(crb);
     }
 }
--- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java	Fri May 30 15:09:09 2014 +0200
+++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java	Sat May 31 00:30:26 2014 +0200
@@ -28,12 +28,13 @@
 import com.oracle.graal.asm.sparc.*;
 import com.oracle.graal.lir.*;
 import com.oracle.graal.lir.asm.*;
+import com.oracle.graal.lir.sparc.*;
 
 /**
  * Pops the current frame off the stack including the return address.
  */
 @Opcode("LEAVE_DEOPTIMIZED_STACK_FRAME")
-final class SPARCHotSpotLeaveDeoptimizedStackFrameOp extends SPARCHotSpotEpilogueOp {
+final class SPARCHotSpotLeaveDeoptimizedStackFrameOp extends SPARCLIRInstruction {
 
     @Override
     public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
--- a/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java	Fri May 30 15:09:09 2014 +0200
+++ b/graal/com.oracle.graal.lir.sparc/src/com/oracle/graal/lir/sparc/SPARCMove.java	Sat May 31 00:30:26 2014 +0200
@@ -37,6 +37,7 @@
 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.*;
 
 public class SPARCMove {
 
@@ -207,7 +208,13 @@
             SPARCAddress addr = (SPARCAddress) crb.recordDataReferenceInCode(rawData);
             assert addr == masm.getPlaceholder();
             final boolean forceRelocatable = true;
-            new Setx(0, asRegister(result), forceRelocatable).emit(masm);
+            Register dstReg = asRegister(result);
+            new Setx(0, dstReg, forceRelocatable).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	Fri May 30 15:09:09 2014 +0200
+++ b/mx/JUnitWrapper.java	Sat May 31 00:30:26 2014 +0200
@@ -27,12 +27,6 @@
  * 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.*;
@@ -40,15 +34,19 @@
 public class JUnitWrapper {
 
     /**
-     * @param args args[0] is the path where to read the names of the testclasses.
-     * @throws Exception
+     * @param args
+     *            args[0] is the path where to read the names of the testclasses.
      */
-    public static void main(String[] args) throws Exception {
+    public static void main(String[] args) {
         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]));
@@ -77,69 +75,6 @@
         } else {
             System.out.printf("executing junit tests now... (%d test classes)\n", strargs.length);
         }
-
-        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();
+        GraalJUnitCore.main(strargs);
     }
 }
--- a/mx/mx_graal.py	Fri May 30 15:09:09 2014 +0200
+++ b/mx/mx_graal.py	Sat May 31 00:30:26 2014 +0200
@@ -949,7 +949,7 @@
         for t in tests:
             found = False
             for c, p in candidates.iteritems():
-                if fnmatch.fnmatch(c, t):
+                if t in c:
                     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', 'ant'])
+    corecp = mx.classpath(['com.oracle.graal.test'])
 
     if not exists(javaClass) or getmtime(javaClass) < getmtime(javaSource):
         subprocess.check_call([mx.java().javac, '-cp', corecp, '-d', mxdir, javaSource])
--- a/mx/projects	Fri May 30 15:09:09 2014 +0200
+++ b/mx/projects	Sat May 31 00:30:26 2014 +0200
@@ -13,18 +13,6 @@
 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
@@ -118,9 +106,6 @@
 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