compiler.cfg.build-stack-frame: Fix test for win64

db4
Doug Coleman 2014-11-18 14:21:45 -08:00
parent 0fe5b2d90f
commit 46174ab748
1 changed files with 41 additions and 19 deletions

View File

@ -1,22 +1,44 @@
USING: accessors compiler.cfg compiler.cfg.build-stack-frame USING: accessors combinators.short-circuit compiler.cfg
compiler.cfg.instructions compiler.cfg.stack-frame kernel slots.syntax compiler.cfg.build-stack-frame compiler.cfg.instructions
compiler.cfg.stack-frame kernel layouts slots.syntax system
tools.test ; tools.test ;
IN: compiler.cfg.build-stack-frame.tests IN: compiler.cfg.build-stack-frame.tests
{ { [ os windows? ] [ cell-bits 64 = ] } 0&& [
! 91 8 align {
96 ! 91 8 align
! 91 8 align 16 + 96
112 ! 91 8 align 16 +
! 91 8 align 16 + 16 8 align + cell + 16 align 112
144 ! XXX: Calculation is wrong for Windows 64 (off by 32 bytes)
} [ ! 91 8 align 16 + 16 8 align + cell + 16 align
T{ stack-frame 176
{ params 91 } } [
{ allot-area-align 8 } T{ stack-frame
{ allot-area-size 10 } { params 91 }
{ spill-area-align 8 } { allot-area-align 8 }
{ spill-area-size 16 } { allot-area-size 10 }
} dup finalize-stack-frame { spill-area-align 8 }
slots[ allot-area-base spill-area-base total-size ] { spill-area-size 16 }
] unit-test } dup finalize-stack-frame
slots[ allot-area-base spill-area-base total-size ]
] unit-test
] [
{
! 91 8 align
96
! 91 8 align 16 +
112
! 91 8 align 16 + 16 8 align + cell + 16 align
144
} [
T{ stack-frame
{ params 91 }
{ allot-area-align 8 }
{ allot-area-size 10 }
{ spill-area-align 8 }
{ spill-area-size 16 }
} dup finalize-stack-frame
slots[ allot-area-base spill-area-base total-size ]
] unit-test
] if