mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
pass small non-recursive tag unions via registers (like records)
This commit is contained in:
parent
68dc7108bf
commit
905dc8cd59
1 changed files with 2 additions and 20 deletions
|
@ -793,7 +793,7 @@ impl AArch64CallLoadArgs {
|
|||
sym,
|
||||
lambda_set.runtime_representation(),
|
||||
),
|
||||
LayoutRepr::Struct { .. } => {
|
||||
LayoutRepr::Struct { .. } | LayoutRepr::Union(UnionLayout::NonRecursive(_)) => {
|
||||
if stack_size <= 8 {
|
||||
self.load_arg_general_64bit(
|
||||
buf,
|
||||
|
@ -814,11 +814,6 @@ impl AArch64CallLoadArgs {
|
|||
unreachable!("covered by an earlier branch")
|
||||
}
|
||||
}
|
||||
LayoutRepr::Union(UnionLayout::NonRecursive(_)) => {
|
||||
// for now, just also store this on the stack
|
||||
storage_manager.complex_stack_arg(&sym, self.argument_offset, stack_size);
|
||||
self.argument_offset += stack_size as i32;
|
||||
}
|
||||
_ => {
|
||||
todo!(
|
||||
"Loading args with layout {:?}",
|
||||
|
@ -979,7 +974,7 @@ impl AArch64CallStoreArgs {
|
|||
sym,
|
||||
lambda_set.runtime_representation(),
|
||||
),
|
||||
LayoutRepr::Struct { .. } => {
|
||||
LayoutRepr::Struct { .. } | LayoutRepr::Union(UnionLayout::NonRecursive(_)) => {
|
||||
let stack_size = layout_interner.stack_size(in_layout);
|
||||
if stack_size <= 8 {
|
||||
self.store_arg_64bit(buf, storage_manager, sym);
|
||||
|
@ -989,19 +984,6 @@ impl AArch64CallStoreArgs {
|
|||
unreachable!("covered by earlier branch");
|
||||
}
|
||||
}
|
||||
LayoutRepr::Union(UnionLayout::NonRecursive(_)) => {
|
||||
let stack_offset = self.tmp_stack_offset;
|
||||
|
||||
let size = copy_symbol_to_stack_offset::<CC>(
|
||||
buf,
|
||||
storage_manager,
|
||||
sym,
|
||||
tmp_reg,
|
||||
stack_offset,
|
||||
);
|
||||
|
||||
self.tmp_stack_offset += size as i32;
|
||||
}
|
||||
_ => {
|
||||
todo!(
|
||||
"calling with arg type, {:?}",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue