Fix bootstrap for a different cell size

db4
Slava Pestov 2008-01-26 23:47:52 -04:00
parent 30eae6b77a
commit 952f6ca363
7 changed files with 20 additions and 25 deletions

View File

@ -427,32 +427,22 @@ M: curry '
"Writing image to " write dup write "..." print flush "Writing image to " write dup write "..." print flush
<file-writer> [ (write-image) ] with-stream ; <file-writer> [ (write-image) ] with-stream ;
: prepare-profile ( arch -- ) : prepare-image ( -- )
"resource:core/bootstrap/layouts/layouts.factor" run-file
"resource:core/cpu/" swap {
{ "x86.32" "x86/32" }
{ "x86.64" "x86/64" }
{ "linux-ppc" "ppc/linux" }
{ "macosx-ppc" "ppc/macosx" }
{ "arm" "arm" }
} at "/bootstrap.factor" 3append ?resource-path run-file ;
: prepare-image ( arch -- )
dup architecture set prepare-profile
bootstrapping? on bootstrapping? on
load-help? off load-help? off
800000 <vector> image set 20000 <hashtable> objects set ; 800000 <vector> image set
20000 <hashtable> objects set ;
PRIVATE> PRIVATE>
: make-image ( arch -- ) : make-image ( arch -- )
[ architecture [
prepare-image prepare-image
begin-image begin-image
"resource:/core/bootstrap/stage1.factor" run-file "resource:/core/bootstrap/stage1.factor" run-file
end-image end-image
image get image-name write-image image get image-name write-image
] with-scope ; ] with-variable ;
: my-arch ( -- arch ) : my-arch ( -- arch )
cpu dup "ppc" = [ os "-" rot 3append ] when ; cpu dup "ppc" = [ os "-" rot 3append ] when ;
@ -460,7 +450,7 @@ PRIVATE>
: make-images ( -- ) : make-images ( -- )
{ {
"x86.32" "x86.32"
! "x86.64" "x86.64"
"linux-ppc" "macosx-ppc" "linux-ppc" "macosx-ppc"
! "arm" ! "arm"
} [ make-image ] each ; } [ make-image ] each ;

View File

@ -54,6 +54,7 @@ IN: bootstrap.stage2
] each ] each
] when ] when
] with-compiler-errors ] with-compiler-errors
:errors
f error set-global f error set-global
f error-continuation set-global f error-continuation set-global

View File

@ -44,7 +44,7 @@ IN: compiler
: compile-loop ( assoc -- ) : compile-loop ( assoc -- )
dup assoc-empty? [ drop ] [ dup assoc-empty? [ drop ] [
dup delete-any (compile) dup delete-any drop (compile)
yield yield
compile-loop compile-loop
] if ; ] if ;

7
core/cpu/ppc/linux/bootstrap.factor Normal file → Executable file
View File

@ -1,9 +1,10 @@
! Copyright (C) 2007 Slava Pestov. ! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: parser layouts system ; USING: parser layouts system kernel ;
IN: bootstrap.ppc IN: bootstrap.ppc
: c-area-size 10 bootstrap-cells ; : c-area-size 10 bootstrap-cells ;
: lr-save bootstrap-cell ; : lr-save bootstrap-cell ;
"resource:core/cpu/ppc/bootstrap.factor" run-file << "resource:core/cpu/ppc/bootstrap.factor" parse-file parsed >>
call

7
core/cpu/ppc/macosx/bootstrap.factor Normal file → Executable file
View File

@ -1,9 +1,10 @@
! Copyright (C) 2007 Slava Pestov. ! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: parser layouts system ; USING: parser layouts system kernel ;
IN: bootstrap.ppc IN: bootstrap.ppc
: c-area-size 14 bootstrap-cells ; : c-area-size 14 bootstrap-cells ;
: lr-save 2 bootstrap-cells ; : lr-save 2 bootstrap-cells ;
"resource:core/cpu/ppc/bootstrap.factor" run-file << "resource:core/cpu/ppc/bootstrap.factor" parse-file parsed >>
call

View File

@ -14,4 +14,5 @@ IN: bootstrap.x86
: fixnum>slot@ arg0 1 SAR ; : fixnum>slot@ arg0 1 SAR ;
: rex-length 0 ; : rex-length 0 ;
"resource:core/cpu/x86/bootstrap.factor" run-file << "resource:core/cpu/x86/bootstrap.factor" parse-file parsed >>
call

3
core/cpu/x86/64/bootstrap.factor Normal file → Executable file
View File

@ -14,4 +14,5 @@ IN: bootstrap.x86
: fixnum>slot@ ; : fixnum>slot@ ;
: rex-length 1 ; : rex-length 1 ;
"resource:core/cpu/x86/bootstrap.factor" run-file << "resource:core/cpu/x86/bootstrap.factor" parse-file parsed >>
call