Skip to content

Commit 48e8600

Browse files
committed
Avoid running cal_push and cal_pop on startup
1 parent aeb4871 commit 48e8600

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

source/backends/arm64.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ class BackendARM64 : CompilerBackend {
262262
output ~= "sub x20, sp, #4096\n"; // 512 cells
263263
output ~= "mov x19, x20\n";
264264

265+
// jump to main
266+
output ~= "b __calmain\n";
267+
265268
// create functions for interop
266269
if (exportSymbols) {
267270
output ~= "
@@ -275,9 +278,6 @@ class BackendARM64 : CompilerBackend {
275278
ret
276279
";
277280
}
278-
279-
// jump to main
280-
output ~= "b __calmain\n";
281281
}
282282

283283
override void End() {

source/backends/x86_64.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,9 @@ class BackendX86_64 : CompilerBackend {
290290
// copy static array constants
291291
output ~= "call __copy_arrays\n";
292292

293+
// jump to main
294+
output ~= "jmp __calmain\n";
295+
293296
// create functions for interop
294297
if (exportSymbols) {
295298
output ~= "
@@ -304,9 +307,6 @@ class BackendX86_64 : CompilerBackend {
304307
ret
305308
";
306309
}
307-
308-
// jump to main
309-
output ~= "jmp __calmain\n";
310310
}
311311

312312
override void End() {

0 commit comments

Comments
 (0)