-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Truffle] Global replace anonymous classes with lambdas. #4208
Conversation
} | ||
return Truffle.getRuntime().iterateFrames(frameInstance -> { | ||
Frame frame = frameInstance.getFrame(FrameAccess.READ_ONLY, true); | ||
return RubyArguments.tryGetBlock(frame); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iterateFrames
finally looks nice!
} | ||
|
||
}; | ||
return () -> iterateKeyValues(firstInSequence); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so Iterable
is just () -> Iterator
, that makes a lot more sense!
return new BaseEventEventNode(context, eventContext, traceFunc, context.getCoreStrings().LINE.createInstance()); | ||
} | ||
})); | ||
instruments.add(instrumenter.attachFactory(SourceSectionFilter.newBuilder().tagIs(LineTag.class).build(), eventContext -> new BaseEventEventNode(context, eventContext, traceFunc, context.getCoreStrings().LINE.createInstance()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines got a bit long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
return (FinalizerReference) finalizerQueue.remove(); | ||
} | ||
}); | ||
FinalizerReference finalizerReference = context.getThreadManager().runUntilResult(null, () -> (FinalizerReference) finalizerQueue.remove()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nicer to move the cast outside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
public void handle(Signal arg0) { | ||
// Just ignore the signal. | ||
} | ||
SignalHandler IGNORE_HANDLER = arg0 -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be named signal
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
All these cases sound great to me. |
No description provided.