# HG changeset patch # User Doug Simon # Date 1373900015 -7200 # Node ID dd7a8807378bee296b6b0691f2133054238449f5 # Parent 59d2d6a30d2943b6c9140ad0ef6135f4aa0b6d96 cannot omit frame for compiled methods that make a foreign call (GRAAL-362) diff -r 59d2d6a30d29 -r dd7a8807378b graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Mon Jul 15 16:24:15 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Mon Jul 15 16:53:35 2013 +0200 @@ -70,6 +70,11 @@ private ValueNode lastInstructionPrinted; // Debugging only /** + * Records whether the code being generated makes at least one foreign call. + */ + private boolean hasForeignCall; + + /** * Checks whether the supplied constant can be used without loading it into a register for store * operations, i.e., on the right hand side of a memory access. * @@ -116,6 +121,13 @@ } /** + * Determines whether the code being generated makes at least one foreign call. + */ + public boolean hasForeignCall() { + return hasForeignCall; + } + + /** * Returns the operand that has been previously initialized by * {@link #setResult(ValueNode, Value)} with the result of an instruction. * @@ -601,6 +613,7 @@ emitMove(loc, arg); argLocations[i] = loc; } + this.hasForeignCall = true; emitForeignCall(linkage, linkageCc.getReturn(), argLocations, linkage.getTemporaries(), state); if (isLegal(linkageCc.getReturn())) { diff -r 59d2d6a30d29 -r dd7a8807378b 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 Mon Jul 15 16:24:15 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotBackend.java Mon Jul 15 16:53:35 2013 +0200 @@ -153,11 +153,13 @@ // - has no spill slots or other slots allocated during register allocation // - has no callee-saved registers // - has no incoming arguments passed on the stack - // - has no instructions with debug info + // - has no deoptimization points + // - makes no foreign calls (which require an aligned stack) AMD64HotSpotLIRGenerator gen = (AMD64HotSpotLIRGenerator) lirGen; FrameMap frameMap = gen.frameMap; LIR lir = gen.lir; - boolean omitFrame = CanOmitFrame.getValue() && !frameMap.frameNeedsAllocating() && !lir.hasArgInCallerFrame(); + assert gen.deoptimizationRescueSlot == null || frameMap.frameNeedsAllocating() : "method that can deoptimize must have a frame"; + boolean omitFrame = CanOmitFrame.getValue() && !frameMap.frameNeedsAllocating() && !lir.hasArgInCallerFrame() && !gen.hasForeignCall(); Stub stub = gen.getStub(); AbstractAssembler masm = createAssembler(frameMap);