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

Introduce VMSpace, and allow VMSpace to be set lazily #802

Merged
merged 25 commits into from
May 8, 2023

Conversation

qinsoon
Copy link
Member

@qinsoon qinsoon commented May 3, 2023

This PR allows users to set the start address and size for VM space, and also allows VM space to be initialised lazily.

  • Add VMSpace which wraps the normal ImmortalSpace. The policy is mostly the same as ImmortalSpace except that the space may be uninitialized and can be initialized later.
  • Add option vm_space_start and vm_space_size.
  • Modify the heap start constant for 32 bits, so JikesRVM's VM space does not overlap with our heap range.
  • Fix a subtraction overflow issue in align_allocation.

@qinsoon
Copy link
Member Author

qinsoon commented May 4, 2023

binding-refs
JIKESRVM_BINDING_REPO=qinsoon/mmtk-jikesrvm
JIKESRVM_BINDING_REF=set-vm-space-with-options
JULIA_BINDING_REPO=qinsoon/mmtk-julia
JULIA_BINDING_REF=use-mmtk-vm-space

@qinsoon qinsoon marked this pull request as ready for review May 4, 2023 06:08
@qinsoon qinsoon requested a review from wks May 4, 2023 06:08
src/plan/global.rs Show resolved Hide resolved
src/util/heap/layout/mod.rs Outdated Show resolved Hide resolved
src/policy/space.rs Outdated Show resolved Hide resolved
src/util/heap/layout/mod.rs Outdated Show resolved Hide resolved
@qinsoon qinsoon added the PR-testing Run binding tests for the pull request (deprecated: use PR-extended-testing instead) label May 5, 2023
Copy link
Collaborator

@wks wks left a comment

Choose a reason for hiding this comment

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

Only some minor suggestions.

src/util/alloc/allocator.rs Outdated Show resolved Hide resolved
Comment on lines 23 to 43
fn name(&self) -> &str {
self.space().name()
}
fn is_live(&self, object: ObjectReference) -> bool {
self.space().is_live(object)
}
fn is_reachable(&self, object: ObjectReference) -> bool {
self.space().is_reachable(object)
}
#[cfg(feature = "object_pinning")]
fn pin_object(&self, object: ObjectReference) -> bool {
self.space().pin_object(object)
}
#[cfg(feature = "object_pinning")]
fn unpin_object(&self, object: ObjectReference) -> bool {
self.space().unpin_object(object)
}
#[cfg(feature = "object_pinning")]
fn is_object_pinned(&self, object: ObjectReference) -> bool {
self.space().is_object_pinned(object)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this pattern (self.space().xxxx()) repeats, we may introduce the delegate crate: https://crates.io/crates/delegate

Copy link
Member Author

Choose a reason for hiding this comment

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

I made the changes as suggested, using the delegate crate. It works well.

src/policy/space.rs Show resolved Hide resolved
@qinsoon
Copy link
Member Author

qinsoon commented May 8, 2023

@wks Is the PR good to merge? Let me know if other changes are needed.

Copy link
Collaborator

@wks wks left a comment

Choose a reason for hiding this comment

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

LGTM, but I still added one minor comment.

src/policy/vmspace.rs Outdated Show resolved Hide resolved
@qinsoon qinsoon removed the PR-testing Run binding tests for the pull request (deprecated: use PR-extended-testing instead) label May 8, 2023
@qinsoon qinsoon merged commit e309f93 into mmtk:master May 8, 2023
qinsoon added a commit to mmtk/mmtk-jikesrvm that referenced this pull request May 8, 2023
Update to mmtk/mmtk-core#802: Setting VM space start and size by options
qinsoon added a commit to mmtk/mmtk-julia that referenced this pull request May 8, 2023
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.

2 participants