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#{uniq,uniq!} #2758

Merged
merged 1 commit into from Mar 25, 2015

Conversation

bjfish
Copy link
Contributor

@bjfish bjfish commented Mar 25, 2015

No description provided.

@chrisseaton
Copy link
Contributor

Could you express uniq in terms of uniq! in Ruby code, or vice-versa? Was one of them in Java already because some specialisation is exercised in benchmarks? If so could the other one be done in Ruby?

@bjfish
Copy link
Contributor Author

bjfish commented Mar 25, 2015

@chrisseaton it looks like uniq could be:

  def uniq(&block)
    dup.uniq!(&block) or dup
  end

I'll give this a try.

I previously tried the ruby uniq! and it didn't work as is right now. Probably some issue in IdentityMap.

It looks like the benchmarks use uniq in some places but it was never compiled because this was marked as notDesignedForCompilation();.

@bjfish
Copy link
Contributor Author

bjfish commented Mar 25, 2015

@chrisseaton uniq worked in ruby in terms of uniq!. I've updated the PR.

@chrisseaton
Copy link
Contributor

Try the whole thing as Rubinius if you can - it's quite a lot of Java code. You can look at what the benchmarks do by just searching in the lib/benchmarks directory - they don't use stdlib so it's all in there.

@bjfish
Copy link
Contributor Author

bjfish commented Mar 25, 2015

@chrisseaton I've updated this with the Rubinius verision with 2 added lines to modify the array.store

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

None yet

3 participants