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] Implementing more of Array#pop. #2737

Merged
merged 1 commit into from
Mar 21, 2015

Conversation

bjfish
Copy link
Contributor

@bjfish bjfish commented Mar 20, 2015

No description provided.

@bjfish
Copy link
Contributor Author

bjfish commented Mar 20, 2015

@nirvdrum @chrisseaton Is this much code repetition normal to get things implemented right now?

@nirvdrum
Copy link
Contributor

Array is a bit odd in having so many specialized stores, but looking at what you have, a fair bit could be pushed to a private helper method.

@chrisseaton
Copy link
Contributor

Yeah - the duplication here is pretty bad. What I think we will do is allocate an interface that hides the type, inside each specialisation, and hand that to a helper method. With PE the interface will compile away and we should get the same code. However I'd rather do a little bit of repetitive messy code while we work through the specs, and then at the end step back and think about what to de-duplicate.


@Specialization(guards = "isFloat", rewriteOn = UnexpectedResultException.class)
public RubyArray popFloatInBoundsWithNum(VirtualFrame frame, RubyArray array, int num) throws UnexpectedResultException {
if(num < 0){
Copy link
Contributor

Choose a reason for hiding this comment

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

Really sorry to be so pedantic, but this should be if (num < 0) {, with the spaces in there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chrisseaton Fixed it at 412f0ad

chrisseaton added a commit that referenced this pull request Mar 21, 2015
[Truffle] Implementing more of Array#pop.
@chrisseaton chrisseaton merged commit 9adef06 into jruby:master Mar 21, 2015
@chrisseaton chrisseaton added this to the truffle-dev milestone Mar 21, 2015
@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.

4 participants