Lowlevels: replace RefCountGetPtr with the more general GetPtrAsInt.

This commit is contained in:
Brian Carroll 2021-12-18 20:05:05 +00:00
parent a1d883600c
commit e847c924dd
7 changed files with 104 additions and 44 deletions

View file

@ -605,9 +605,10 @@ pub fn decode_low_level<'a>(
Not => code_builder.i32_eqz(),
Hash => return SpecializedHash,
ExpectTrue => return NotImplemented,
RefCountGetPtr => {
code_builder.i32_const(4);
code_builder.i32_sub();
PtrCast => {
// We don't need any instructions here, since we've already loaded the value.
// PtrCast just creates separate Symbols and Layouts for the argument and return value.
// This is used for pointer math in refcounting and for pointer equality
}
RefCountInc => return BuiltinCall(bitcode::UTILS_INCREF),
RefCountDec => return BuiltinCall(bitcode::UTILS_DECREF),