Skip to content

Trace methods in CompInfo's TypeCollector impl #411

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

Merged
merged 5 commits into from
Jan 23, 2017

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Jan 20, 2017

Fixes #410

r? @emilio

@highfive
Copy link

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!

@fitzgen
Copy link
Member Author

fitzgen commented Jan 20, 2017

Added two more commits cleaning up more of the type tracing.

The only TODO left about type tracing is for CompInfo's vtable.

@fitzgen
Copy link
Member Author

fitzgen commented Jan 20, 2017

It isn't clear to me what needs to happen with regards to vtables here. It seems like they should already be handled via the base's tracing?

Copy link
Contributor

@emilio emilio left a comment

Choose a reason for hiding this comment

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

Looks great to me!

r=me with the comments addressed :)

types.insert(repr);
}
}
TypeKind::UnresolvedTypeRef(_, _, Some(id)) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

We could just mark UnresolvedTypeRef as unreachable I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I wasn't thinking... That invariant should definitely hold here.

// Module -> children edges are "weak", and we do not want to
// trace them. If we did, then whitelisting wouldn't work as
// expected: everything in every module would end up
// whitelisted.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is only true because we start tracing through the root module right? we should be able of making that exception? Anyway it's fine for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Its because we trace the parent_id to find the containing module, which will then end up tracing everything in the module, and the module's parent module which will end up tracing everything in that module, etc etc.

Copy link
Member Author

Choose a reason for hiding this comment

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

And also because of tracing the root module too, I suppose.

types.insert(method.signature);
}

// FIXME(emilio): VTable?
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I think every type that could potentially be used in the vtable would be caught by the bases or the methods, so you should be able to remove this comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will remove.

@bors-servo
Copy link

☔ The latest upstream changes (presumably #414) made this pull request unmergeable. Please resolve the merge conflicts.

@fitzgen fitzgen force-pushed the js-value-and-js-why-magic branch from 024b79c to 93dd68f Compare January 23, 2017 18:15
@fitzgen
Copy link
Member Author

fitzgen commented Jan 23, 2017

@bors-servo r=emilio

@bors-servo
Copy link

📌 Commit 93dd68f has been approved by emilio

@bors-servo
Copy link

⌛ Testing commit 93dd68f with merge 7b1480d...

bors-servo pushed a commit that referenced this pull request Jan 23, 2017
Trace methods in CompInfo's TypeCollector impl

Fixes #410

r? @emilio
@bors-servo
Copy link

☀️ Test successful - status-travis

@bors-servo bors-servo merged commit 93dd68f into rust-lang:master Jan 23, 2017
@fitzgen fitzgen deleted the js-value-and-js-why-magic branch January 23, 2017 21:00
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