From 6cdf4de4eb699b1b2dedf563325fdfa98e9885c4 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Thu, 28 Jan 2010 17:30:35 +1300 Subject: [PATCH] Fix and clean up stage1 bootstrap --- basis/bootstrap/image/image.factor | 9 ++++++++- core/bootstrap/primitives.factor | 23 ++++++++++++----------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/basis/bootstrap/image/image.factor b/basis/bootstrap/image/image.factor index 90b4c3ae6f..941b4149fa 100644 --- a/basis/bootstrap/image/image.factor +++ b/basis/bootstrap/image/image.factor @@ -554,12 +554,19 @@ M: quotation ' : fixup-header ( -- ) heap-size data-heap-size-offset fixup ; +: build-generics ( -- ) + [ + all-words + [ generic? ] filter + [ make-generic ] each + ] with-compilation-unit ; + : build-image ( -- image ) 800000 image set 20000 objects set emit-image-header t, 0, 1, -1, "Building generic words..." print flush - remake-generics + build-generics "Serializing words..." print flush emit-words "Serializing JIT data..." print flush diff --git a/core/bootstrap/primitives.factor b/core/bootstrap/primitives.factor index 7b9f8e9cc8..67107c8c9a 100644 --- a/core/bootstrap/primitives.factor +++ b/core/bootstrap/primitives.factor @@ -31,30 +31,31 @@ architecture get { ! Now we have ( syntax-quot arch-quot layouts-quot ) on the stack ! Bring up a bare cross-compiling vocabulary. -"syntax" vocab vocab-words bootstrap-syntax set { - dictionary - new-classes - changed-definitions changed-generics changed-effects - outdated-generics forgotten-definitions - root-cache source-files update-map implementors-map -} [ H{ } clone swap set ] each +"syntax" vocab vocab-words bootstrap-syntax set + +H{ } clone dictionary set +H{ } clone root-cache set +H{ } clone source-files set +H{ } clone update-map set +H{ } clone implementors-map set init-caches -! Vocabulary for slot accessors -"accessors" create-vocab drop - bootstrapping? on call( -- ) call( -- ) -call( -- ) + +! Vocabulary for slot accessors +"accessors" create-vocab drop ! After we execute bootstrap/layouts num-types get f builtins set [ +call( -- ) + ! Create some empty vocabs where the below primitives and ! classes will go {