Commit d33e8fd8 authored by Bernd Paysan's avatar Bernd Paysan

New interpret/compile: ported to cross compiler

parent e55c87d2
Pipeline #670 passed with stage
in 8 minutes and 34 seconds
......@@ -3108,13 +3108,15 @@ End-Struct vtable-struct
:noname ( ghost -- ) vttemplate >vtcompile, ! ; IS gset-optimizer
: gset-to ( ghost -- ) vttemplate >vtto ! ;
: gset-defer@ ( ghost -- ) vttemplate >vtdefer@ ! ;
: gset->int ( ghost -- ) vttemplate >vt>int ! ;
: gset->comp ( ghost -- ) vttemplate >vt>comp ! ;
:noname ( ghost -- ) vttemplate >vtextra ! ; is gset-extra
: set-optimizer ( xt -- ) xt>ghost vttemplate >vtcompile, ! ;
: set-to ( xt -- ) xt>ghost vttemplate >vtto ! ;
: set-defer@ ( xt -- ) xt>ghost vttemplate >vtdefer@ ! ;
: set->comp ( xt -- ) xt>ghost vttemplate >comp ! ;
: set-optimizer ( xt -- ) xt>ghost gset-optimizer ;
: set-to ( xt -- ) xt>ghost gset-to ;
: set-defer@ ( xt -- ) xt>ghost gset-defer@ ;
: set->int ( xt -- ) xt>ghost gset->int ;
: set->comp ( xt -- ) xt>ghost gset->comp ;
: vt: ( -- xt colon-sys )
:noname postpone vt-template, postpone vt-populate ;
......@@ -3140,16 +3142,19 @@ ghost :dodefer drop
>in @ skip? IF 2drop EXIT THEN >in !
(THeader ( S xt ghost )
2dup swap xt>ghost swap copy-execution-semantics
[G'] a>int vttemplate >vt>int !
[G'] a>comp vttemplate >vt>comp !
[G'] s-to vttemplate >vtto !
[G'] a>int gset->int
[G'] a>comp gset->comp
[G'] s-to gset-to
over resolve [G'] :dodefer (doer,) T A, H ;
: interpret/compile: ( xt1 xt2 "name" -- )
(THeader <res> over >magic ! there swap >link !
[G'] :dodefer (doer,)
swap T A, A, H [ T has? ec H ] [IF] alias-mask flag! [THEN]
vt-populate
[G'] i/c>int vttemplate >vt>int !
[G'] no-to gset-to
[G'] no-defer@ gset-defer@
[G'] a>int gset->int
[G'] i/c>comp vttemplate >vt>comp ! ;
: opt: ( -- colon-sys ) gstart-xt set-optimizer ;
......
......@@ -761,8 +761,8 @@ defer 0-adjust-locals-size ( -- )
\ for cross-compiler's interpret/compile:
: i/c>int ( nt -- xt ) @ ;
: i/c>comp ( nt -- xt1 xt2 ) cell+ @ ['] execute ;
: i/c>comp ( nt -- xt1 xt2 )
>body cell+ @ ['] execute ;
\ \ Search list handling: reveal words, recursive 23feb93py
......
......@@ -364,12 +364,9 @@ comp' sliteral drop alias postpone-sliteral
\ new interpret/compile:
: interpret/compile>comp ( nt -- xt1 xt2 )
>body cell+ @ ['] execute ;
: interpret/compile: ( interp-xt comp-xt "name" -- ) \ gforth
swap alias ,
['] interpret/compile>comp set->comp
['] i/c>comp set->comp
['] no-to set-to
['] no-defer@ set-defer@ ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment