Skip to content

Commit

Permalink
Sulong: adding more TruffleBoundary.
Browse files Browse the repository at this point in the history
  • Loading branch information
Palez committed Feb 3, 2021
1 parent 59ae6de commit 684d67a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
package com.oracle.truffle.llvm.runtime.nodes.api;

import com.oracle.truffle.api.CompilerAsserts;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.dsl.CachedContext;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.instrumentation.InstrumentableNode;
Expand Down Expand Up @@ -130,10 +131,15 @@ boolean hasScope(@SuppressWarnings("unused") Frame frame) {

@ExportMessage
public Object getScope(Frame frame, @SuppressWarnings("unused") boolean nodeEnter, @CachedContext(LLVMLanguage.class) LLVMContext ctx) {
if (ctx.getEnv().getOptions().get(SulongEngineOption.LL_DEBUG)) {
if (isLLDebugEnabled(ctx)) {
return LLVMDebuggerScopeFactory.newCreateIRLevelScope(this, frame, ctx);
} else {
return LLVMDebuggerScopeFactory.newCreateSourceLevelScope(this, frame, ctx);
}
}

@CompilerDirectives.TruffleBoundary
private boolean isLLDebugEnabled(LLVMContext ctx){
return ctx.getEnv().getOptions().get(SulongEngineOption.LL_DEBUG);
}
}

0 comments on commit 684d67a

Please sign in to comment.