nomen-lang 0.6.11 → 0.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +16 -6
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -20884,10 +20884,12 @@ function build_function_node$1(node, status) {
|
|
|
20884
20884
|
if (moved_param_save_slots.size > 0 && node.name !== "main") {
|
|
20885
20885
|
const need_guard = return_is_class;
|
|
20886
20886
|
const need_save = !!node.return_type?.name;
|
|
20887
|
+
const returns_fat_pair = node.return_type?.name === "string" && !node.return_type.is_array;
|
|
20887
20888
|
let return_save;
|
|
20888
20889
|
if (need_guard || need_save) {
|
|
20889
|
-
return_save = allocate_stack_space(status, 8);
|
|
20890
|
-
emit_asm(status, `
|
|
20890
|
+
return_save = allocate_stack_space(status, returns_fat_pair ? 16 : 8);
|
|
20891
|
+
if (returns_fat_pair) emit_asm(status, `stp x0, x1, [x29, #${return_save}]\n`);
|
|
20892
|
+
else emit_asm(status, `str x0, [x29, #${return_save}]\n`);
|
|
20891
20893
|
}
|
|
20892
20894
|
for (const [name, info] of moved_param_save_slots) {
|
|
20893
20895
|
if (moved_set?.has(name)) continue;
|
|
@@ -20913,7 +20915,10 @@ function build_function_node$1(node, status) {
|
|
|
20913
20915
|
emit_free(status);
|
|
20914
20916
|
if (need_guard) emit_asm(status, `${keep_prefix}_${name}:\n`);
|
|
20915
20917
|
}
|
|
20916
|
-
if (need_guard || need_save)
|
|
20918
|
+
if (need_guard || need_save) {
|
|
20919
|
+
if (returns_fat_pair) emit_asm(status, `ldp x0, x1, [x29, #${return_save}]\n`);
|
|
20920
|
+
else emit_asm(status, `ldr x0, [x29, #${return_save}]\n`);
|
|
20921
|
+
}
|
|
20917
20922
|
}
|
|
20918
20923
|
const total_stack = Math.ceil((status.stack_size || 0) / 16) * 16;
|
|
20919
20924
|
status.code = status.code.replace(`sub sp, sp, #${stack_placeholder}`, total_stack > 0 ? `sub sp, sp, #${total_stack}` : `// no stack needed`);
|
|
@@ -22306,11 +22311,13 @@ function build_struct_functions$1(node, status) {
|
|
|
22306
22311
|
if (moved_param_save_slots.size > 0) {
|
|
22307
22312
|
const ret_is_class = !!func.return_type?.name && !!status.structs.find((s) => s.name === func.return_type.name && s.is_class);
|
|
22308
22313
|
const need_save = !!func.return_type?.name;
|
|
22314
|
+
const returns_fat_pair = func.return_type?.name === "string" && !func.return_type.is_array;
|
|
22309
22315
|
const keep_prefix = `.Lkeep_mparam_${func_label.replace(/[^\w]/g, "_")}`;
|
|
22310
22316
|
let return_save;
|
|
22311
22317
|
if (ret_is_class || need_save) {
|
|
22312
|
-
return_save = allocate_stack_space(status, 8);
|
|
22313
|
-
emit_asm(status, `
|
|
22318
|
+
return_save = allocate_stack_space(status, returns_fat_pair ? 16 : 8);
|
|
22319
|
+
if (returns_fat_pair) emit_asm(status, `stp x0, x1, [x29, #${return_save}]\n`);
|
|
22320
|
+
else emit_asm(status, `str x0, [x29, #${return_save}]\n`);
|
|
22314
22321
|
}
|
|
22315
22322
|
for (const [name, info] of moved_param_save_slots) {
|
|
22316
22323
|
if (status.moved?.has(name) && !moved_before.has(name)) continue;
|
|
@@ -22336,7 +22343,10 @@ function build_struct_functions$1(node, status) {
|
|
|
22336
22343
|
emit_free(status);
|
|
22337
22344
|
if (ret_is_class) emit_asm(status, `${keep_prefix}_${name}:\n`);
|
|
22338
22345
|
}
|
|
22339
|
-
if (ret_is_class || need_save)
|
|
22346
|
+
if (ret_is_class || need_save) {
|
|
22347
|
+
if (returns_fat_pair) emit_asm(status, `ldp x0, x1, [x29, #${return_save}]\n`);
|
|
22348
|
+
else emit_asm(status, `ldr x0, [x29, #${return_save}]\n`);
|
|
22349
|
+
}
|
|
22340
22350
|
}
|
|
22341
22351
|
const total_stack = Math.ceil((status.stack_size || 0) / 16) * 16;
|
|
22342
22352
|
status.code = status.code.replace(`sub sp, sp, #${stack_placeholder}`, total_stack > 0 ? `sub sp, sp, #${total_stack}` : `// no stack needed`);
|