Skip to content

Commit a62c3c0

Browse files
REPL debugger naturally inherits the state from EnsoContext
1 parent 4902f6e commit a62c3c0

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

engine/runtime-instrument-repl-debugger/src/main/java/org/enso/interpreter/instrument/repl/debugger/ReplDebuggerInstrument.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
import org.enso.interpreter.runtime.callable.CallerInfo;
4242
import org.enso.interpreter.runtime.callable.function.Function;
4343
import org.enso.interpreter.runtime.data.text.Text;
44-
import org.enso.interpreter.runtime.state.State;
4544
import org.enso.interpreter.runtime.warning.WarningsLibrary;
4645
import org.enso.interpreter.runtime.warning.WithWarnings;
4746
import org.graalvm.options.OptionDescriptor;
@@ -131,7 +130,6 @@ private static class ReplExecutionEventNodeImpl extends ExecutionEventNode
131130
private @Child ToJavaStringNode toJavaStringNode = ToJavaStringNode.build();
132131

133132
private ReplExecutionEventNodeState nodeState;
134-
private State monadicState;
135133

136134
private EventContext eventContext;
137135
private DebuggerMessageHandler handler;
@@ -250,8 +248,6 @@ protected void onEnter(VirtualFrame frame) {
250248
if (atExit == null) {
251249
CallerInfo lastScope = Function.ArgumentsHelper.getCallerInfo(frame.getArguments());
252250
Object lastReturn = EnsoContext.get(this).getNothing();
253-
// Note [Safe Access to State in the Debugger Instrument]
254-
monadicState = null; // Function.ArgumentsHelper.getState(frame.getArguments());
255251
nodeState = new ReplExecutionEventNodeState(lastReturn, lastScope);
256252
startSessionImpl();
257253
}
@@ -264,12 +260,6 @@ public void onReturnValue(VirtualFrame frame, Object result) {
264260
}
265261
}
266262

267-
/* Note [Safe Access to State in the Debugger Instrument]
268-
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
269-
* This is safe to do as we ensure that the instrument's `onEnter` is always called as the
270-
* first instruction of the function that it's observing.
271-
*/
272-
273263
/**
274264
* Called by Truffle whenever an unwind {@see {@link EventContext#createUnwind(Object)}} was
275265
* thrown in the course of REPL execution.
@@ -292,8 +282,6 @@ private void startSession(RootNode root, VirtualFrame frame, Object toReturn) {
292282
new CallerInfo(frame.materialize(), enso.getLocalScope(), enso.getModuleScope());
293283
}
294284
if (lastScope != null) {
295-
// Note [Safe Access to State in the Debugger Instrument]
296-
monadicState = EnsoContext.get(root).currentState();
297285
nodeState = new ReplExecutionEventNodeState(toReturn, lastScope);
298286
startSessionImpl();
299287
}

0 commit comments

Comments
 (0)