Skip to content

Commit

Permalink
Remove NULL ObjectReference
Browse files Browse the repository at this point in the history
  • Loading branch information
wks committed Apr 24, 2024
1 parent 72aebdb commit b74e44f
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 = "6aa75cd72247d12b9568dc321c46feca6572a512" }
# 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 b74e44f

Please sign in to comment.