introduce CutPoint heap tag so that they can be offset by call_continuation/1

This commit is contained in:
Mark
2023-06-29 12:14:06 -06:00
parent 83f352b95e
commit c36bd4dc07
7 changed files with 54 additions and 21 deletions

View File

@@ -15,7 +15,7 @@ macro_rules! char_as_cell {
macro_rules! fixnum_as_cell {
($n: expr) => {
HeapCellValue::from_bytes($n.into_bytes()) //HeapCellValueTag::Fixnum, $n.get_num() as u64)
HeapCellValue::from_bytes($n.into_bytes())
};
}
@@ -378,6 +378,21 @@ macro_rules! read_heap_cell_pat_body {
#[allow(unused_braces)]
$code
});
($cell:ident, CutPoint, $value:ident, $code:expr) => ({
let $value = Fixnum::from_bytes($cell.into_bytes());
#[allow(unused_braces)]
$code
});
($cell:ident, Fixnum | CutPoint, $value:ident, $code:expr) => ({
let $value = Fixnum::from_bytes($cell.into_bytes());
#[allow(unused_braces)]
$code
});
($cell:ident, CutPoint | Fixnum, $value:ident, $code:expr) => ({
let $value = Fixnum::from_bytes($cell.into_bytes());
#[allow(unused_braces)]
$code
});
($cell:ident, Char, $value:ident, $code:expr) => ({
let $value = unsafe { char::from_u32_unchecked($cell.get_value() as u32) };
#[allow(unused_braces)]