cpu.x86.32: commit 05ba77262a
only fixed the start-context-and-delete callframe leak on x86-64. Fix it on x86-32 and add a regression test
parent
8507bd1fce
commit
2abda04743
|
@ -253,10 +253,6 @@ IN: bootstrap.x86
|
||||||
: jit-switch-context ( reg -- )
|
: jit-switch-context ( reg -- )
|
||||||
-4 jit-scrub-return
|
-4 jit-scrub-return
|
||||||
|
|
||||||
! Save ds, rs registers
|
|
||||||
jit-load-vm
|
|
||||||
jit-save-context
|
|
||||||
|
|
||||||
! Make the new context the current one
|
! Make the new context the current one
|
||||||
ctx-reg swap MOV
|
ctx-reg swap MOV
|
||||||
vm-reg vm-context-offset [+] ctx-reg MOV
|
vm-reg vm-context-offset [+] ctx-reg MOV
|
||||||
|
@ -277,6 +273,10 @@ IN: bootstrap.x86
|
||||||
EDX ds-reg -4 [+] MOV
|
EDX ds-reg -4 [+] MOV
|
||||||
ds-reg 8 SUB
|
ds-reg 8 SUB
|
||||||
|
|
||||||
|
! Save ds, rs registers
|
||||||
|
jit-load-vm
|
||||||
|
jit-save-context
|
||||||
|
|
||||||
! Make the new context active
|
! Make the new context active
|
||||||
EAX jit-switch-context
|
EAX jit-switch-context
|
||||||
|
|
||||||
|
@ -311,6 +311,8 @@ IN: bootstrap.x86
|
||||||
jit-save-quot-and-param
|
jit-save-quot-and-param
|
||||||
|
|
||||||
! Make the new context active
|
! Make the new context active
|
||||||
|
jit-load-vm
|
||||||
|
jit-save-context
|
||||||
EAX jit-switch-context
|
EAX jit-switch-context
|
||||||
|
|
||||||
jit-push-param
|
jit-push-param
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: namespaces io tools.test threads kernel
|
USING: namespaces io tools.test threads threads.private kernel
|
||||||
concurrency.combinators concurrency.promises locals math
|
concurrency.combinators concurrency.promises locals math
|
||||||
words calendar sequences ;
|
words calendar sequences fry ;
|
||||||
IN: threads.tests
|
IN: threads.tests
|
||||||
|
|
||||||
3 "x" set
|
3 "x" set
|
||||||
|
@ -59,3 +59,21 @@ yield
|
||||||
|
|
||||||
! Test system traps inside threads
|
! Test system traps inside threads
|
||||||
[ ] [ [ dup ] in-thread yield ] unit-test
|
[ ] [ [ dup ] in-thread yield ] unit-test
|
||||||
|
|
||||||
|
! The start-context-and-delete primitive wasn't rewinding the
|
||||||
|
! callstack properly.
|
||||||
|
|
||||||
|
! This got fixed for x86-64 but the problem remained on x86-32.
|
||||||
|
|
||||||
|
! The unit test asserts that the callstack is empty from the
|
||||||
|
! quotation passed to start-context-and-delete.
|
||||||
|
|
||||||
|
[ { } ] [
|
||||||
|
<promise> [
|
||||||
|
'[
|
||||||
|
_ [
|
||||||
|
callstack swap fulfill stop
|
||||||
|
] start-context-and-delete
|
||||||
|
] in-thread
|
||||||
|
] [ ?promise callstack>array ] bi
|
||||||
|
] unit-test
|
||||||
|
|
Loading…
Reference in New Issue