Skip to content

Commit

Permalink
Require ObjectReference to point inside object
Browse files Browse the repository at this point in the history
This makes changes for upstream API changes.

Upstream PR: mmtk/mmtk-core#1195
  • Loading branch information
wks committed Sep 5, 2024
1 parent 13659a7 commit d5c4767
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
9 changes: 5 additions & 4 deletions mmtk/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mmtk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ log = "*"
# - change branch
# - change repo name
# But other changes including adding/removing whitespaces in commented lines may break the CI.
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "56b2521d2b99848ee0613a0a5288fe6d81b754ba" }
mmtk = { git = "https://github.com/wks/mmtk-core.git", rev = "57a98749ff37093b355d7b2f496b8a67315e158b" }
# Uncomment the following and fix the path to mmtk-core to build locally
# mmtk = { path = "../repos/mmtk-core" }

Expand Down
6 changes: 3 additions & 3 deletions mmtk/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub extern "C" fn post_alloc(

#[no_mangle]
pub extern "C" fn will_never_move(object: ObjectReference) -> bool {
!object.is_movable::<V8>()
!object.is_movable()
}

#[no_mangle]
Expand Down Expand Up @@ -137,12 +137,12 @@ pub extern "C" fn scan_region(mmtk: &mut MMTK<V8>) {

#[no_mangle]
pub extern "C" fn is_live_object(object: ObjectReference) -> bool {
memory_manager::is_live_object::<V8>(object)
memory_manager::is_live_object(object)
}

#[no_mangle]
pub extern "C" fn is_in_mmtk_spaces(object: ObjectReference) -> bool {
memory_manager::is_in_mmtk_spaces::<V8>(object)
memory_manager::is_in_mmtk_spaces(object)
}

#[no_mangle]
Expand Down
9 changes: 0 additions & 9 deletions mmtk/src/object_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,6 @@ impl ObjectModel<V8> for VMObjectModel {
object.to_raw_address()
}

fn ref_to_address(object: ObjectReference) -> Address {
object.to_raw_address()
}

fn address_to_ref(address: Address) -> ObjectReference {
debug_assert!(!address.is_zero());
unsafe { ObjectReference::from_raw_address_unchecked(address) }
}

fn dump_object(object: ObjectReference) {
unsafe {
((*UPCALLS).dump_object)(object);
Expand Down

0 comments on commit d5c4767

Please sign in to comment.