File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/main/java/org/truffleruby/stdlib Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -82,22 +82,22 @@ public synchronized void enable() {
82
82
.build (),
83
83
eventContext -> new ExecutionEventNode () {
84
84
85
- @ CompilationFinal private boolean configured ;
86
- @ CompilationFinal private int lineNumber ;
85
+ @ CompilationFinal private int lineNumber = -2 ;
87
86
@ CompilationFinal private AtomicLongArray counters ;
88
87
89
88
@ Override
90
89
protected void onEnter (VirtualFrame frame ) {
91
- if (! configured ) {
90
+ if (lineNumber == - 2 ) { // not yet initialized
92
91
CompilerDirectives .transferToInterpreterAndInvalidate ();
93
92
final SourceSection sourceSection = eventContext .getInstrumentedSourceSection ();
94
93
95
94
if (getLineHasCode (sourceSection .getSource (), sourceSection .getStartLine ())) {
96
95
lineNumber = lineToIndex (sourceSection .getStartLine ());
97
96
counters = getCounters (sourceSection .getSource ());
97
+ } else {
98
+ lineNumber = -1 ;
98
99
}
99
-
100
- configured = true ;
100
+ assert lineNumber != -2 ;
101
101
}
102
102
103
103
if (counters != null ) {
You can’t perform that action at this time.
0 commit comments