bigger tag size fixes

This commit is contained in:
Folkert 2021-07-24 13:36:06 +02:00
parent 2b84fd0009
commit 768c59f45d
4 changed files with 16 additions and 3 deletions

View file

@ -245,6 +245,11 @@ fn jit_to_ast_help<'a>(
Builtin::Int16 => { Builtin::Int16 => {
*(ptr.add(offset as usize) as *const i16) as i64 *(ptr.add(offset as usize) as *const i16) as i64
} }
Builtin::Int64 => {
// used by non-recursive tag unions at the
// moment, remove if that is no longer the case
*(ptr.add(offset as usize) as *const i64) as i64
}
_ => unreachable!("invalid tag id layout"), _ => unreachable!("invalid tag id layout"),
}; };

View file

@ -129,7 +129,6 @@ pub fn list_prepend<'a, 'ctx, 'env>(
elem_layout: &Layout<'a>, elem_layout: &Layout<'a>,
) -> BasicValueEnum<'ctx> { ) -> BasicValueEnum<'ctx> {
let builder = env.builder; let builder = env.builder;
let ctx = env.context;
// Load the usize length from the wrapper. // Load the usize length from the wrapper.
let len = list_len(builder, original_wrapper); let len = list_len(builder, original_wrapper);

View file

@ -170,7 +170,16 @@ impl<'a> UnionLayout<'a> {
pub fn tag_id_builtin(&self) -> Builtin<'a> { pub fn tag_id_builtin(&self) -> Builtin<'a> {
match self { match self {
UnionLayout::NonRecursive(tags) | UnionLayout::Recursive(tags) => { UnionLayout::NonRecursive(_tags) => {
// let union_size = tags.len();
// Self::tag_id_builtin_help(union_size)
// The quicksort-benchmarks version of Quicksort.roc segfaults when
// this number is not I64. There must be some dependence on that fact
// somewhere in the code, I have not found where that is yet...
Builtin::Int64
}
UnionLayout::Recursive(tags) => {
let union_size = tags.len(); let union_size = tags.len();
Self::tag_id_builtin_help(union_size) Self::tag_id_builtin_help(union_size)

View file

@ -37,7 +37,7 @@ fn hash_record() {
fn hash_result() { fn hash_result() {
assert_evals_to!( assert_evals_to!(
"Dict.hashTestOnly 0 (List.get [ 0x1 ] 0) ", "Dict.hashTestOnly 0 (List.get [ 0x1 ] 0) ",
6707068610910845221, 2878521786781103245,
u64 u64
); );
} }