Skip to content
This repository has been archived by the owner on Aug 22, 2019. It is now read-only.

Support Truffle objects in globals #340

Merged
2 commits merged into from
Jul 20, 2016
Merged

Support Truffle objects in globals #340

2 commits merged into from
Jul 20, 2016

Conversation

chrisseaton
Copy link
Contributor

No description provided.

@chrisseaton
Copy link
Contributor Author

This works for Ruby code storing managed Ruby objects in global variables.

@chrisseaton chrisseaton force-pushed the truffle-objects-in-globals branch 26 times, most recently from a4aa144 to 6da1a68 Compare July 19, 2016 12:15
@chrisseaton chrisseaton assigned mrigger and ghost Jul 19, 2016
@chrisseaton
Copy link
Contributor Author

This is ready for initial review. Ignore the JRuby test failure for now.

Key comment:

https://github.com/graalvm/sulong/pull/340/files#diff-a39e5fc5437b3cb9251c567960163ba6R36

Problem I need to solve:

https://github.com/graalvm/sulong/pull/340/files#diff-ace6de25373f780bf4543873d50a681fR1051

@ghost
Copy link

ghost commented Jul 19, 2016

This will be useful for the 30 odd global variables in the R FFI, which I have been ignoring so far (or mapping to functions assuming they are read-only)

}

@SuppressWarnings("unused")
protected boolean isUninitialized(VirtualFrame frame, LLVMGlobalVariableStorage globalVariableStorage) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if it is a good idea to have isUninitialized, isInitialized, isNative and isManaged in the LLVMNode class, since the methods are not really related to it. I think one of the two options would work better:

  1. Directly call the guard, which would create a direct correspondence between the guard (e.g., globalVariableStorage.isInitialized) and initialize method (e.g., globalVariableStorage.initialize).
  2. Make a helper class for it, if you think that it is likely that we will replace the guard test in the future.

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 by putting them in a separate file and using @ImportStatic.

@mrigger
Copy link
Collaborator

mrigger commented Jul 19, 2016

Looks good! I noted a few things in inline comments.

@ghost ghost merged commit 4614d10 into master Jul 20, 2016
@chrisseaton chrisseaton deleted the truffle-objects-in-globals branch July 20, 2016 21:41
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants