diff graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java @ 9693:d04944441454

cleaned up and simplified runtime call mechanisms
author Doug Simon <doug.simon@oracle.com>
date Tue, 14 May 2013 21:33:37 +0200
parents 0c17815817a4
children f7bd4594cbbf
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java	Mon May 13 23:15:53 2013 +0200
+++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java	Tue May 14 21:33:37 2013 +0200
@@ -211,12 +211,12 @@
     @Override
     public Variable emitCall(RuntimeCallTarget callTarget, CallingConvention callCc, DeoptimizingNode info, Value... args) {
         Stub stub = getStub();
-        boolean isCRuntimeCall = ((HotSpotRuntimeCallTarget) callTarget).isCRuntimeCall();
-        assert !isCRuntimeCall || stub != null : "direct call to C runtime can only be made from compiled stubs, not from " + graph;
+        boolean destroysRegisters = ((HotSpotRuntimeCallTarget) callTarget).destroysRegisters();
+        assert !destroysRegisters || stub != null : "foreign call that destroys registers can only be made from compiled stub, not from " + graph;
 
         AMD64SaveRegistersOp save = null;
         StackSlot[] savedRegisterLocations = null;
-        if (isCRuntimeCall) {
+        if (destroysRegisters) {
             if (stub.preservesRegisters()) {
                 Register[] savedRegisters = frameMap.registerConfig.getAllocatableRegisters();
                 savedRegisterLocations = new StackSlot[savedRegisters.length];
@@ -233,7 +233,7 @@
 
         Variable result = super.emitCall(callTarget, callCc, info, args);
 
-        if (isCRuntimeCall) {
+        if (destroysRegisters) {
             append(new AMD64HotSpotCRuntimeCallEpilogueOp());
             if (stub.preservesRegisters()) {
                 assert !calleeSaveInfo.containsKey(currentRuntimeCallInfo);