mirror of
https://github.com/DaanVandenBosch/phantasmal-world.git
synced 2025-04-05 15:28:29 +08:00
Added RegTupRef argument support for the argument stack.
This commit is contained in:
parent
fbd4df4b58
commit
6b2a61bc4f
@ -1078,16 +1078,22 @@ class Thread {
|
|||||||
this.io.warning("Argument stack: Argument type mismatch", srcloc);
|
this.io.warning("Argument stack: Argument type mismatch", srcloc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const arg_slot_offset = i * ARG_STACK_SLOT_SIZE;
|
||||||
switch (param.type.kind) {
|
switch (param.type.kind) {
|
||||||
case Kind.Byte:
|
case Kind.Byte:
|
||||||
args.push(this.arg_stack.u8_at(i * ARG_STACK_SLOT_SIZE));
|
args.push(this.arg_stack.u8_at(arg_slot_offset));
|
||||||
break;
|
break;
|
||||||
case Kind.Word:
|
case Kind.Word:
|
||||||
args.push(this.arg_stack.u16_at(i * ARG_STACK_SLOT_SIZE));
|
args.push(this.arg_stack.u16_at(arg_slot_offset));
|
||||||
break;
|
break;
|
||||||
case Kind.DWord:
|
case Kind.DWord:
|
||||||
case Kind.String:
|
case Kind.String:
|
||||||
args.push(this.arg_stack.u32_at(i * ARG_STACK_SLOT_SIZE));
|
args.push(this.arg_stack.u32_at(arg_slot_offset));
|
||||||
|
break;
|
||||||
|
case Kind.RegTupRef:
|
||||||
|
if (param.type.register_tuples.length > 0) {
|
||||||
|
args.push(this.arg_stack.u8_at(arg_slot_offset));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error(
|
throw new Error(
|
||||||
|
Loading…
Reference in New Issue
Block a user