-
Notifications
You must be signed in to change notification settings - Fork 81
Add API: is_in_space() #137
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
Conversation
javadamiri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I see, is_in_space() is doing what it should do.
Yi and I had a discussion about the supported spaces in mmtk-NOGC, which we thought should be discussed in our meeting too.
Meanwhile, for nogc to work on V8, I added the support for the required spaces to the binding
|
The changes look good to me. Just one question: Why can't we use the SFTMap (https://github.com/mmtk/mmtk-core/blob/master/src/policy/space.rs#L99) to test which space a given object locates in? The SFTMap provides a direct mapping between memory address (chunks) to spaces. |
Good point. The pattern matching/switch is to figure out which space an object is supposed to be allocated into. However, with |
|
The reason that I am using switch is that the switching pattern is consistent with Performance-wise, I don't think there will be a big difference - both require comparing with each space. And both implementations need to be updated with the mutator refactoring work. |
I wasn't too concern about the performance. |
|
Accidentally closed the PR. Reopened. |
|
After a discussion with Steve on this (see #142), I feel we should redo the PR, basically with two changes:
I suggest we close this PR or put it on hold, and it will be included in another PR for #142. |
|
Closing this for now. This PR has been inactive for a while. |
Add an API:
pub fn is_in_space(mmtk, obj, allocator) -> bool. It checks if the object is located in a space with the given allocation type (allocation semantics). Its implementation should be consistent with thealloc()implementation for each plan (i.e. it should check whether an object is in a space in the same way as howalloc()maps allocation types to each space).Currently no VM binding is using it, so it is not covered in any tests. The V8 binding needs this API.