File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed
src/main/java/org/truffleruby Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,15 @@ protected Object ofCaller() {
33
33
/* When you use this method you're asking for the binding of the caller at the call site. When we get into
34
34
* this method, that is then the binding of the caller of the caller. */
35
35
36
- final Memo < Integer > frameCount = new Memo <>( 0 ) ;
36
+ final int [] frameCount = new int []{ 0 } ;
37
37
final Memo <SourceSection > sourceSection = new Memo <>(null );
38
38
39
39
final MaterializedFrame frame = Truffle .getRuntime ().iterateFrames (frameInstance -> {
40
- if (frameCount . get () == 2 ) {
40
+ if (frameCount [ 0 ] == 2 ) {
41
41
sourceSection .set (frameInstance .getCallNode ().getEncapsulatingSourceSection ());
42
42
return frameInstance .getFrame (FrameAccess .MATERIALIZE ).materialize ();
43
43
} else {
44
- frameCount . set ( frameCount . get () + 1 ) ;
44
+ frameCount [ 0 ] += 1 ;
45
45
return null ;
46
46
}
47
47
});
Original file line number Diff line number Diff line change 25
25
import org .truffleruby .builtins .CoreMethodArrayArgumentsNode ;
26
26
import org .truffleruby .builtins .CoreMethodNode ;
27
27
import org .truffleruby .builtins .CoreModule ;
28
- import org .truffleruby .collections .Memo ;
29
28
import org .truffleruby .core .array .RubyArray ;
30
29
import org .truffleruby .core .encoding .Encodings ;
31
30
import org .truffleruby .core .rope .CodeRange ;
@@ -267,13 +266,13 @@ public abstract static class SourceOfCallerNode extends CoreMethodArrayArguments
267
266
@ TruffleBoundary
268
267
@ Specialization
269
268
protected Object sourceOfCaller () {
270
- final Memo < Integer > frameCount = new Memo <>( 0 ) ;
269
+ final int [] frameCount = new int []{ 0 } ;
271
270
272
271
final Source source = Truffle .getRuntime ().iterateFrames (frameInstance -> {
273
- if (frameCount . get () == 2 ) {
272
+ if (frameCount [ 0 ] == 2 ) {
274
273
return frameInstance .getCallNode ().getEncapsulatingSourceSection ().getSource ();
275
274
} else {
276
- frameCount . set ( frameCount . get () + 1 ) ;
275
+ frameCount [ 0 ] += 1 ;
277
276
return null ;
278
277
}
279
278
});
You can’t perform that action at this time.
0 commit comments