Implement Phase 6 Box reference operations in MIR/VM - RefNew/RefGet/RefSet/WeakNew/WeakLoad/Barrier*

Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-13 09:45:22 +00:00
parent 65ce7a5f8c
commit 84d2aac8da
9 changed files with 416 additions and 4 deletions

View File

@ -318,6 +318,35 @@ impl MirPrinter {
MirInstruction::Safepoint => {
"safepoint".to_string()
},
// Phase 6: Box reference operations
MirInstruction::RefNew { dst, box_val } => {
format!("{} = ref_new {}", dst, box_val)
},
MirInstruction::RefGet { dst, reference, field } => {
format!("{} = ref_get {}.{}", dst, reference, field)
},
MirInstruction::RefSet { reference, field, value } => {
format!("ref_set {}.{} = {}", reference, field, value)
},
MirInstruction::WeakNew { dst, box_val } => {
format!("{} = weak_new {}", dst, box_val)
},
MirInstruction::WeakLoad { dst, weak_ref } => {
format!("{} = weak_load {}", dst, weak_ref)
},
MirInstruction::BarrierRead { ptr } => {
format!("barrier_read {}", ptr)
},
MirInstruction::BarrierWrite { ptr } => {
format!("barrier_write {}", ptr)
},
}
}