[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] [PATCH 6/6] jit: Fix the alignment of the function
From: |
Paolo Bonzini |
Subject: |
Re: [Help-smalltalk] [PATCH 6/6] jit: Fix the alignment of the function now that I understand it |
Date: |
Thu, 09 Jan 2014 19:11:36 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9 |
Il 09/01/2014 19:09, Holger Hans Peter Freyther ha scritto:
> For the pointer we return it needs to look like a valid OOP. The
> trick that was used to align the code to make that true. Otherwise
> empty_context_stack will set a DUMMY_NATIVE_IP and we will resume
> at the ipOffset (e.g. the beginning of a loop) and not after the
> interrupt check.
>
> This fixes something like this:
>
> a := nil. p := [a := 3] newProcess.
> [p isTerminated] whileFalse: [p singleStep; suspend]
>
> 2014-01-09 Holger Hans Peter Freyther <address@hidden>
>
> * xlat.c: Align the label correctly.
> ---
> libgst/ChangeLog | 4 ++++
> libgst/xlat.c | 4 ++--
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/libgst/ChangeLog b/libgst/ChangeLog
> index 05bc54b..528b6ae 100644
> --- a/libgst/ChangeLog
> +++ b/libgst/ChangeLog
> @@ -1,3 +1,7 @@
> +2014-01-09 Holger Hans Peter Freyther <address@hidden>
> +
> + * xlat.c: Align the label correctly.
> +
> 2013-12-23 Holger Hans Peter Freyther <address@hidden>
>
> * xlat.c: Change emitted code in emit_interrupt_check.
> diff --git a/libgst/xlat.c b/libgst/xlat.c
> index 9f45b33..260c7f6 100644
> --- a/libgst/xlat.c
> +++ b/libgst/xlat.c
> @@ -2502,8 +2502,6 @@ emit_interrupt_check (int restartReg, int ipOffset)
> {
> jit_insn *jmp, *restart = NULL;
>
> - jit_align (2);
> -
> jit_ldi_i (JIT_R2, &_gst_except_flag);
> jmp = jit_beqi_i (jit_forward (), JIT_R2, 0);
>
> @@ -2514,6 +2512,8 @@ emit_interrupt_check (int restartReg, int ipOffset)
> jit_sti_ul (&ip, JIT_R2);
> }
>
> + jit_align (2);
> +
> /* Where to restart?*/
> if (restartReg == JIT_NOREG)
> restart = jit_movi_p (JIT_RET, jit_forward());
>
Squash this in the previous patch, and we're good to go! :)
Paolo
- [Help-smalltalk] [PATCH 1/6] libgst: Do not flush the cache twice when adding a new method, Holger Hans Peter Freyther, 2014/01/09
- [Help-smalltalk] [PATCH 3/6] libgst: Fix the indication of VMpr_Process_singleStepWaitingOn, Holger Hans Peter Freyther, 2014/01/09
- [Help-smalltalk] [PATCH 6/6] jit: Fix the alignment of the function now that I understand it, Holger Hans Peter Freyther, 2014/01/09
- Re: [Help-smalltalk] [PATCH 6/6] jit: Fix the alignment of the function now that I understand it,
Paolo Bonzini <=
- [Help-smalltalk] [PATCH 2/6] libgst: Do not make a suspended process runnable again., Holger Hans Peter Freyther, 2014/01/09
- [Help-smalltalk] [PATCH 4/6] jit: Update _gst_ip correctly when the method_prologue is left, Holger Hans Peter Freyther, 2014/01/09
- [Help-smalltalk] [PATCH 5/6] jit: Resume the method _after_ the interrupt check, Holger Hans Peter Freyther, 2014/01/09