Skip to content

Commit

Permalink
Remove NULL ObjectReference (#84)
Browse files Browse the repository at this point in the history
Parent PR: mmtk/mmtk-core#1064

---------

Co-authored-by: mmtkgc-bot <mmtkgc.bot@gmail.com>
  • Loading branch information
wks and mmtkgc-bot committed Apr 27, 2024
1 parent 72aebdb commit 6a90d22
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
31 changes: 16 additions & 15 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 = "e79e94e744660c486d5471f252ff05c4248bcea9" }
mmtk = { git = "https://github.com/mmtk/mmtk-core.git", rev = "a02803b4104519ff2289234101a2dd8ceedd1bc7" }
# Uncomment the following and fix the path to mmtk-core to build locally
# mmtk = { path = "../repos/mmtk-core" }

Expand Down
3 changes: 2 additions & 1 deletion mmtk/src/object_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ impl ObjectModel<V8> for VMObjectModel {
}

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

fn dump_object(object: ObjectReference) {
Expand Down
5 changes: 4 additions & 1 deletion mmtk/src/reference_glue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ impl ReferenceGlue<V8> for VMReferenceGlue {
fn set_referent(_reff: ObjectReference, _referent: ObjectReference) {
unimplemented!()
}
fn get_referent(_object: ObjectReference) -> ObjectReference {
fn get_referent(_object: ObjectReference) -> Option<ObjectReference> {
unimplemented!()
}
fn enqueue_references(_references: &[ObjectReference], _tls: VMWorkerThread) {
unimplemented!()
}
fn clear_referent(_new_reference: ObjectReference) {
unimplemented!()
}
}

0 comments on commit 6a90d22

Please sign in to comment.