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] Added a new internal method for taking ownership of an array store from another array. #3936

Merged
merged 3 commits into from
May 31, 2016

Conversation

nirvdrum
Copy link
Contributor

This is intended to be a faster version of Array#replace when we know that the source array won't be used anywhere else.

While escape analysis may very well catch some of these, I don't think it would catch all of them (e.g., the mergesort! case). And this will work in the interpreter as well.

@jruby/truffle

…y store from another array.

This is intended to be a faster version of Array#replace when we know that the source array won't be used anywhere else.
@nirvdrum nirvdrum added this to the truffle-dev milestone May 27, 2016
@chrisseaton
Copy link
Contributor

Can you write a quick couple of specs for this in spec/truffle/specs/truffle/array.

@pitr-ch
Copy link
Member

pitr-ch commented May 28, 2016

👍

@eregon
Copy link
Member

eregon commented May 30, 2016

Just a nitpick on the name: store is also the name of the field for the backing Java array. Maybe call this storage?
For the full name I like steal_storage and also become as suggested by Chris.
swap might be an interesting way to model this too, with the added semantics of exchanging the storages.

@nirvdrum
Copy link
Contributor Author

Fair enough. I named it with "store" to make it clear that you're updating that field. This is an internal operation.

@nirvdrum nirvdrum merged commit cd02e9f into master May 31, 2016
@nirvdrum nirvdrum deleted the truffle-array-store-replacement branch May 31, 2016 15:05
public class TruffleArrayNodes {

@CoreMethod(names = "steal_storage", onSingleton = true, required = 2)
public abstract static class TakeOwnershipOfStoreNode extends CoreMethodArrayArgumentsNode {
Copy link
Member

Choose a reason for hiding this comment

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

(the name of the node should also be updated)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I obviously missed that.

@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

5 participants