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

ObjectSpace specs #3299

Merged
merged 11 commits into from
Sep 1, 2015
Merged

ObjectSpace specs #3299

merged 11 commits into from
Sep 1, 2015

Conversation

chrisseaton
Copy link
Contributor

@eregon please review

@chrisseaton chrisseaton self-assigned this Aug 31, 2015
@chrisseaton chrisseaton added this to the truffle-dev milestone Aug 31, 2015
@@ -115,9 +129,23 @@ private void visitObject(DynamicObject object, ObjectGraphVisitor visitor) throw

// Visit all properties

for (Property property : object.getShape().getProperties()) {
for (Property property : object.getShape().getPropertyListInternal(false)) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need this change with the one below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes - getProperties() doesn't return HiddenKeys - took me ages to figure this out.

Copy link
Member

Choose a reason for hiding this comment

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

Which HiddenKey do we want to traverse? Before they were fields and only traversed if they were explicitly in visitObjectGraphChildren, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want to visit all fields, whether they're instance variables or they're internal fields (like store in Array) to find all objects. Things like store are currently HiddenKey so that they aren't mistaken for instance variables.

Copy link
Member

Choose a reason for hiding this comment

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

Right, sounds good and less error-prone

@eregon
Copy link
Member

eregon commented Sep 1, 2015

Nice specs! Please address my comments.

visitObject(context.getCoreLibrary().getGlobalVariablesObject(), visitor);
// We only visit the global variables and other global state from the root thread

if (thread == context.getThreadManager().getRootThread()) {
Copy link
Member

Choose a reason for hiding this comment

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

This will run for all fibers of the main thread. One way to only run for the initial Fiber is to compare with the root fiber of the main thread.

Copy link
Member

Choose a reason for hiding this comment

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

Or more simply since any of the thread could do this, the caller of visitRoots could be chosen to lookup these ones.

chrisseaton added a commit that referenced this pull request Sep 1, 2015
@chrisseaton chrisseaton merged commit 4425d99 into master Sep 1, 2015
@chrisseaton chrisseaton deleted the objectspace-specs branch September 1, 2015 12:34
@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