Skip to content

Commit 529e061

Browse files
committed
Add DynASM definition for our frame_nr
1 parent 246c941 commit 529e061

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/jit/emit_x64.dasc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ const unsigned int MVM_jit_num_globals(void) {
277277
| callp &MVM_exception_throw_adhoc;
278278
|.endmacro
279279

280+
|.define FRAME_NR, dword [rbp+0x20]
281+
280282
/* A function prologue is always the same in x86 / x64, because
281283
* we do not provide variable arguments, instead arguments are provided
282284
* via a frame. All JIT entry points receive a prologue. */
@@ -300,7 +302,7 @@ void MVM_jit_emit_prologue(MVMThreadContext *tc, MVMJitGraph *jg,
300302
| mov [rbp-0x18], WORK;
301303
/* store the current frame number for cheap comparisons */
302304
| mov TMP6d, dword TC:ARG1->current_frame_nr;
303-
| mov dword [rbp-0x20], TMP6d;
305+
| mov FRAME_NR, TMP6d;
304306
/* setup special frame variables */
305307
| mov TC, ARG1;
306308
| mov CU, ARG2;
@@ -2407,7 +2409,7 @@ void MVM_jit_emit_control(MVMThreadContext *tc, MVMJitGraph *jg,
24072409
/* This relies on the fact that MVM_JIT_THROWISH_PRE has already
24082410
* assigned the jit entry label */
24092411
| mov eax, dword TC->current_frame_nr;
2410-
| cmp eax, dword [rbp-0x20];
2412+
| cmp eax, FRAME_NR;
24112413
| je >9;
24122414
| mov RV, 1;
24132415
| jmp ->out;
@@ -2434,7 +2436,7 @@ void MVM_jit_emit_control(MVMThreadContext *tc, MVMJitGraph *jg,
24342436
else if (ctrl->type == MVM_JIT_CONTROL_THROWISH_POST) {
24352437
/* check if our current frame is the same as it was */
24362438
| mov TMP1d, dword TC->current_frame_nr;
2437-
| cmp TMP1d, dword [rbp-0x20];
2439+
| cmp TMP1d, FRAME_NR;
24382440
| jne >8;
24392441
/* if it is, we may still be in a goto-handler, so in that
24402442
* case the throwing machinery should have ensured that

0 commit comments

Comments
 (0)