# HG changeset patch # User Lukas Stadler # Date 1370423373 -7200 # Node ID c65bad5126b035c4b66d5cd11fea514cad599e02 # Parent 17e31cfaf03727e12d97fac0afe2090d6544480f pull HotSpotForeignCallLinkage.isLeaf into ForeignCallLinkage and rename to canDeoptimize diff -r 17e31cfaf037 -r c65bad5126b0 graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ForeignCallLinkage.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ForeignCallLinkage.java Wed Jun 05 11:48:53 2013 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ForeignCallLinkage.java Wed Jun 05 11:09:33 2013 +0200 @@ -55,4 +55,11 @@ * this target */ boolean destroysRegisters(); + + /** + * Determines if this is call to a function that does not deoptimize, and therefore also does + * not lock, GC or throw exceptions. That is, the thread's execution state during the call is + * never inspected by another thread. + */ + boolean canDeoptimize(); } diff -r 17e31cfaf037 -r c65bad5126b0 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 05 11:48:53 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Wed Jun 05 11:09:33 2013 +0200 @@ -211,8 +211,7 @@ @Override public Variable emitForeignCall(ForeignCallLinkage linkage, DeoptimizingNode info, Value... args) { Stub stub = getStub(); - HotSpotForeignCallLinkage hsLinkage = (HotSpotForeignCallLinkage) linkage; - boolean destroysRegisters = hsLinkage.destroysRegisters(); + boolean destroysRegisters = linkage.destroysRegisters(); AMD64SaveRegistersOp save = null; StackSlot[] savedRegisterLocations = null; @@ -234,7 +233,7 @@ Variable result; - if (!hsLinkage.isLeaf()) { + if (linkage.canDeoptimize()) { assert info != null; append(new AMD64HotSpotCRuntimeCallPrologueOp()); result = super.emitForeignCall(linkage, info, args); diff -r 17e31cfaf037 -r c65bad5126b0 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotForeignCallLinkage.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotForeignCallLinkage.java Wed Jun 05 11:48:53 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotForeignCallLinkage.java Wed Jun 05 11:09:33 2013 +0200 @@ -107,7 +107,7 @@ * @param effect specifies if the call destroys or preserves all registers (apart from * temporaries which are always destroyed) * @param ccType calling convention type - * @param transition specifies if this is a {@linkplain #isLeaf() leaf} call + * @param transition specifies if this is a {@linkplain #canDeoptimize() leaf} call * @param reexecutable specifies if the call can be re-executed without (meaningful) side * effects. Deoptimization will not return to a point before a call that cannot be * re-executed. @@ -235,11 +235,8 @@ return effect == DESTROYS_REGISTERS; } - /** - * Determines if this is call to a function that does not lock, GC or throw exceptions. That is, - * the thread's execution state during the call is never inspected by another thread. - */ - public boolean isLeaf() { - return transition == Transition.LEAF; + @Override + public boolean canDeoptimize() { + return transition != Transition.LEAF; } } diff -r 17e31cfaf037 -r c65bad5126b0 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Wed Jun 05 11:48:53 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Wed Jun 05 11:09:33 2013 +0200 @@ -1004,7 +1004,7 @@ } public boolean canDeoptimize(ForeignCallDescriptor descriptor) { - return !foreignCalls.get(descriptor).isLeaf(); + return foreignCalls.get(descriptor).canDeoptimize(); } public LocationIdentity[] getKilledLocations(ForeignCallDescriptor descriptor) {