# HG changeset patch # User twisti # Date 1400757587 -7200 # Node ID 399aa56c636645f6400ac69ae8666f077cae62f1 # Parent babe4565c3714a3d3683680400878b80eb028974 HSAIL: fix for -UseHSAILDeoptimization Contributed-by: Eric Caspole diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/AtomicIntGetAndAddTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/AtomicIntGetAndAddTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/AtomicIntGetAndAddTest.java Thu May 22 13:19:47 2014 +0200 @@ -45,6 +45,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/AtomicIntGetAndSetTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/AtomicIntGetAndSetTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/AtomicIntGetAndSetTest.java Thu May 22 13:19:47 2014 +0200 @@ -45,6 +45,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/AtomicLongGetAndAddTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/AtomicLongGetAndAddTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/AtomicLongGetAndAddTest.java Thu May 22 13:19:47 2014 +0200 @@ -45,6 +45,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/AtomicLongGetAndSetTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/AtomicLongGetAndSetTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/AtomicLongGetAndSetTest.java Thu May 22 13:19:47 2014 +0200 @@ -45,6 +45,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntAddAndGetGidTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntAddAndGetGidTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntAddAndGetGidTest.java Thu May 22 13:19:47 2014 +0200 @@ -47,6 +47,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntAddAndGetTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntAddAndGetTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntAddAndGetTest.java Thu May 22 13:19:47 2014 +0200 @@ -44,6 +44,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntDecAndGetTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntDecAndGetTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntDecAndGetTest.java Thu May 22 13:19:47 2014 +0200 @@ -44,6 +44,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntGetAndAddTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntGetAndAddTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntGetAndAddTest.java Thu May 22 13:19:47 2014 +0200 @@ -44,6 +44,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntGetAndDecTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntGetAndDecTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntGetAndDecTest.java Thu May 22 13:19:47 2014 +0200 @@ -44,6 +44,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntGetAndIncTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntGetAndIncTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntGetAndIncTest.java Thu May 22 13:19:47 2014 +0200 @@ -44,6 +44,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntIncAndGetTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntIncAndGetTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicIntIncAndGetTest.java Thu May 22 13:19:47 2014 +0200 @@ -44,6 +44,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicLongAddAndGetTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicLongAddAndGetTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicLongAddAndGetTest.java Thu May 22 13:19:47 2014 +0200 @@ -46,6 +46,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicLongGetAndAddTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicLongGetAndAddTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicLongGetAndAddTest.java Thu May 22 13:19:47 2014 +0200 @@ -44,6 +44,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicLongGetAndIncTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicLongGetAndIncTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicLongGetAndIncTest.java Thu May 22 13:19:47 2014 +0200 @@ -44,6 +44,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicLongIncAndGetTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicLongIncAndGetTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/AtomicLongIncAndGetTest.java Thu May 22 13:19:47 2014 +0200 @@ -44,6 +44,11 @@ } @Override + protected boolean supportsRequiredCapabilities() { + return (canDeoptimize()); + } + + @Override public void runTest() { setupArrays(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ForEachToGraalTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ForEachToGraalTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/ForEachToGraalTest.java Thu May 22 13:19:47 2014 +0200 @@ -23,12 +23,13 @@ package com.oracle.graal.compiler.hsail.test.lambda; -import java.util.stream.IntStream; - +import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; import static org.junit.Assert.*; -import org.junit.Test; -import java.util.Arrays; -import java.util.ArrayList; + +import java.util.*; +import java.util.stream.*; + +import org.junit.*; /** * Several tests for the Sumatra APIs. @@ -266,6 +267,10 @@ // Graal throws NYI @Test public void testForEachIntRangeNoCapturesUseEscapingNew() { + if (runtime().getConfig().useHSAILDeoptimization == false) { + return; + } + MyPoint[] dest = new MyPoint[size]; IntStream range = IntStream.range(0, dest.length).parallel(); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/VecmathNBodyDeoptTest.java --- a/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/VecmathNBodyDeoptTest.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.compiler.hsail.test/src/com/oracle/graal/compiler/hsail/test/lambda/VecmathNBodyDeoptTest.java Thu May 22 13:19:47 2014 +0200 @@ -122,7 +122,7 @@ @Override protected boolean supportsRequiredCapabilities() { - return (canHandleDeoptVirtualObjects()); + return (canHandleDeoptVirtualObjects() && canDeoptimize()); } @Test diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java --- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotBackend.java Thu May 22 13:19:47 2014 +0200 @@ -489,6 +489,10 @@ boolean useHSAILDeoptimization = config.useHSAILDeoptimization; boolean useHSAILSafepoints = config.useHSAILSafepoints; + if ((useHSAILSafepoints == true) && (useHSAILDeoptimization == false)) { + Debug.log("+UseHSAILSafepoints requires +UseHSAILDeoptimization"); + } + // see what graph nodes we have to see if we are using the thread register // if not, we don't have to emit the code that sets that up // maybe there is a better way to do this? diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java Thu May 22 13:19:47 2014 +0200 @@ -180,7 +180,7 @@ * We need 64-bit and 32-bit scratch registers for the codegen $s0 can be live at this block. */ private void emitDeoptimizeInner(Value actionAndReason, LIRFrameState lirFrameState, String emitName) { - DeoptimizeOp deopt = new DeoptimizeOp(actionAndReason, lirFrameState, emitName, getMetaAccess()); + DeoptimizeOp deopt = new DeoptimizeOp(actionAndReason, lirFrameState, emitName, config.useHSAILDeoptimization, getMetaAccess()); ((HSAILHotSpotLIRGenerationResult) getResult()).addDeopt(deopt); append(deopt); } diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotNodeLIRBuilder.java --- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotNodeLIRBuilder.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotNodeLIRBuilder.java Thu May 22 13:19:47 2014 +0200 @@ -104,7 +104,7 @@ @Override public void visitSafepointNode(SafepointNode i) { HotSpotVMConfig config = getGen().config; - if (config.useHSAILSafepoints == true) { + if ((config.useHSAILSafepoints == true) && (config.useHSAILDeoptimization == true)) { LIRFrameState info = state(i); HSAILHotSpotSafepointOp safepoint = new HSAILHotSpotSafepointOp(info, config, this); ((HSAILHotSpotLIRGenerationResult) getGen().getResult()).addDeopt(safepoint); diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotSafepointOp.java --- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotSafepointOp.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotSafepointOp.java Thu May 22 13:19:47 2014 +0200 @@ -41,49 +41,54 @@ @State protected LIRFrameState frameState; protected int codeBufferPos = -1; final int offsetToNoticeSafepoints; + final HotSpotVMConfig config; public HSAILHotSpotSafepointOp(LIRFrameState state, HotSpotVMConfig config, NodeLIRBuilderTool tool) { actionAndReason = tool.getLIRGeneratorTool().getMetaAccess().encodeDeoptActionAndReason(DeoptimizationAction.None, DeoptimizationReason.None, 0); frameState = state; offsetToNoticeSafepoints = config.hsailNoticeSafepointsOffset; + this.config = config; } @Override public void emitCode(CompilationResultBuilder crb, HSAILAssembler masm) { + if (config.useHSAILDeoptimization) { + // get a unique codeBuffer position + // when we save our state, we will save this as well (it can be used as a key to get the + // debugInfo) + codeBufferPos = masm.position(); - // get a unique codeBuffer position - // when we save our state, we will save this as well (it can be used as a key to get the - // debugInfo) - codeBufferPos = masm.position(); + masm.emitComment(" /* HSAIL safepoint bci=" + frameState.debugInfo().getBytecodePosition().getBCI() + ", frameState=" + frameState + " */"); + String afterSafepointLabel = "@LAfterSafepoint_at_pos_" + codeBufferPos; - masm.emitComment(" /* HSAIL safepoint bci=" + frameState.debugInfo().getBytecodePosition().getBCI() + ", frameState=" + frameState + " */"); - String afterSafepointLabel = "@LAfterSafepoint_at_pos_" + codeBufferPos; + AllocatableValue scratch64 = HSAIL.d16.asValue(Kind.Object); + AllocatableValue spAddrReg = HSAIL.d17.asValue(Kind.Object); + AllocatableValue scratch32 = HSAIL.s34.asValue(Kind.Int); + masm.emitLoadKernelArg(scratch64, masm.getDeoptInfoName(), "u64"); - AllocatableValue scratch64 = HSAIL.d16.asValue(Kind.Object); - AllocatableValue spAddrReg = HSAIL.d17.asValue(Kind.Object); - AllocatableValue scratch32 = HSAIL.s34.asValue(Kind.Int); - masm.emitLoadKernelArg(scratch64, masm.getDeoptInfoName(), "u64"); + // Build address of noticeSafepoints field + HSAILAddress noticeSafepointsAddr = new HSAILAddressValue(Kind.Object, scratch64, offsetToNoticeSafepoints).toAddress(); + masm.emitLoad(Kind.Object, spAddrReg, noticeSafepointsAddr); - // Build address of noticeSafepoints field - HSAILAddress noticeSafepointsAddr = new HSAILAddressValue(Kind.Object, scratch64, offsetToNoticeSafepoints).toAddress(); - masm.emitLoad(Kind.Object, spAddrReg, noticeSafepointsAddr); - - // Load int value from that field - HSAILAddress noticeSafepointsIntAddr = new HSAILAddressValue(Kind.Int, spAddrReg, 0).toAddress(); - masm.emitLoadAcquire(scratch32, noticeSafepointsIntAddr); - masm.emitCompare(Kind.Int, scratch32, Constant.forInt(0), "eq", false, false); - masm.cbr(afterSafepointLabel); + // Load int value from that field + HSAILAddress noticeSafepointsIntAddr = new HSAILAddressValue(Kind.Int, spAddrReg, 0).toAddress(); + masm.emitLoadAcquire(scratch32, noticeSafepointsIntAddr); + masm.emitCompare(Kind.Int, scratch32, Constant.forInt(0), "eq", false, false); + masm.cbr(afterSafepointLabel); - AllocatableValue actionAndReasonReg = HSAIL.actionAndReasonReg.asValue(Kind.Int); - AllocatableValue codeBufferOffsetReg = HSAIL.codeBufferOffsetReg.asValue(Kind.Int); - masm.emitMov(Kind.Int, actionAndReasonReg, actionAndReason); - masm.emitMov(Kind.Int, codeBufferOffsetReg, Constant.forInt(codeBufferPos)); - masm.emitJumpToLabelName(masm.getDeoptLabelName()); + AllocatableValue actionAndReasonReg = HSAIL.actionAndReasonReg.asValue(Kind.Int); + AllocatableValue codeBufferOffsetReg = HSAIL.codeBufferOffsetReg.asValue(Kind.Int); + masm.emitMov(Kind.Int, actionAndReasonReg, actionAndReason); + masm.emitMov(Kind.Int, codeBufferOffsetReg, Constant.forInt(codeBufferPos)); + masm.emitJumpToLabelName(masm.getDeoptLabelName()); - masm.emitString0(afterSafepointLabel + ":\n"); + masm.emitString0(afterSafepointLabel + ":\n"); - // now record the debuginfo - crb.recordInfopoint(codeBufferPos, frameState, InfopointReason.SAFEPOINT); + // now record the debuginfo + crb.recordInfopoint(codeBufferPos, frameState, InfopointReason.SAFEPOINT); + } else { + masm.emitComment("/* HSAIL safepoint would have been here. */"); + } } public LIRFrameState getFrameState() { @@ -93,4 +98,4 @@ public int getCodeBufferPos() { return codeBufferPos; } -} \ No newline at end of file +} diff -r babe4565c371 -r 399aa56c6366 graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILControlFlow.java --- a/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILControlFlow.java Thu May 22 12:41:53 2014 +0200 +++ b/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILControlFlow.java Thu May 22 13:19:47 2014 +0200 @@ -141,13 +141,15 @@ protected MetaAccessProvider metaAccessProvider; protected String emitName; protected int codeBufferPos = -1; + private final boolean emitInfopoint; - public DeoptimizeOp(Value actionAndReason, LIRFrameState frameState, String emitName, MetaAccessProvider metaAccessProvider) { + public DeoptimizeOp(Value actionAndReason, LIRFrameState frameState, String emitName, boolean emitInfopoint, MetaAccessProvider metaAccessProvider) { super(Value.ILLEGAL); // return with no ret value this.actionAndReason = actionAndReason; this.frameState = frameState; this.emitName = emitName; this.metaAccessProvider = metaAccessProvider; + this.emitInfopoint = emitInfopoint; } @Override @@ -181,8 +183,12 @@ masm.emitMov(Kind.Int, codeBufferOffsetReg, Constant.forInt(codeBufferPos)); masm.emitJumpToLabelName(masm.getDeoptLabelName()); - // now record the debuginfo - crb.recordInfopoint(codeBufferPos, frameState, InfopointReason.IMPLICIT_EXCEPTION); + // Now record the debuginfo. If HSAIL deoptimization is off, + // no debuginfo is emitted and the kernel will return without + // a deoptimization. + if (emitInfopoint) { + crb.recordInfopoint(codeBufferPos, frameState, InfopointReason.IMPLICIT_EXCEPTION); + } } public LIRFrameState getFrameState() {