Skip to content
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

Merged
merged 1 commit into from Oct 6, 2016

Conversation

chrisseaton
Copy link
Contributor

No description provided.

@chrisseaton chrisseaton self-assigned this Oct 6, 2016
}
return Truffle.getRuntime().iterateFrames(frameInstance -> {
Frame frame = frameInstance.getFrame(FrameAccess.READ_ONLY, true);
return RubyArguments.tryGetBlock(frame);
});
Copy link
Member

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);
Copy link
Member

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())));
Copy link
Member

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.

Copy link
Contributor Author

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());
Copy link
Member

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.

Copy link
Contributor Author

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 -> {
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@eregon
Copy link
Member

eregon commented Oct 6, 2016

All these cases sound great to me.

@eregon eregon merged commit 5b2e38a into truffle-head Oct 6, 2016
@eregon eregon deleted the lambdas branch October 6, 2016 14:17
@enebo enebo modified the milestone: truffle-dev Nov 9, 2016
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants