more cleanups

cvs
Slava Pestov 2005-08-22 20:01:13 +00:00
parent 4ce519c9f9
commit 388d7b2d85
9 changed files with 24 additions and 55 deletions

View File

@ -62,8 +62,6 @@
- flushing optimization
- compile-byte/cell: instantiating aliens
- changing a word to be 'inline' after it was already defined doesn't
work properly
- inference needs to be more robust with heavily recursive code
- fix fixnum<< and /i overflow on PowerPC
- simplifier:
@ -80,7 +78,7 @@
+ kernel:
- split, group: return vectors
- split: return vectors
- specialized arrays
- clear special word props when redefining words
- there is a problem with hashcodes of words and bootstrapping

View File

@ -11,6 +11,13 @@ sequences io vectors words ;
! The make-list form creates a boot quotation
[
[
[ hashtable? ] instances
[ dup hash-size 1 max swap set-bucket-count ] each
boot
] %
{
"/version.factor"
@ -71,8 +78,6 @@ sequences io vectors words ;
"/library/generic/generic.factor"
"/library/generic/standard-combination.factor"
"/library/generic/slots.factor"
"/library/generic/object.factor"
"/library/generic/null.factor"
"/library/generic/math-combination.factor"
"/library/generic/predicate.factor"
"/library/generic/union.factor"
@ -128,16 +133,7 @@ sequences io vectors words ;
"/library/bootstrap/init.factor"
} [ dup print parse-resource % ] each
[
boot
"Rehashing hash tables..." print
[ hashtable? ] instances
[ dup hash-size 1 max swap set-bucket-count ] each
"/library/bootstrap/boot-stage2.factor" run-resource
] %
[ "/library/bootstrap/boot-stage2.factor" run-resource ] %
] make-list
vocabularies get [

View File

@ -8,11 +8,6 @@
! generate the minimal image, and writing the cons cells, words,
! strings etc to the image file in the CFactor object memory
! format.
!
! What is a bootstrap image? It basically contains enough code
! to parse a source file. See platform/native/boot.factor --
! It initializes the core interpreter services, and proceeds to
! run platform/native/boot-stage2.factor.
IN: image
USING: errors generic hashtables kernel lists
@ -25,9 +20,6 @@ SYMBOL: image
! Object cache
SYMBOL: objects
! Boot quotation, set by boot.factor
SYMBOL: boot-quot
! Image output format
SYMBOL: big-endian
SYMBOL: 64-bits
@ -258,8 +250,7 @@ M: hashtable ' ( hashtable -- pointer )
] make-hash '
global-offset fixup ;
: boot, ( quot -- )
boot-quot get swap append ' boot-quot-offset fixup ;
: boot, ( quot -- ) ' boot-quot-offset fixup ;
: heap-size image get length header-size - cell * ;
@ -304,8 +295,8 @@ M: hashtable ' ( hashtable -- pointer )
: make-image ( name -- )
#! Make a bootstrap image.
[
boot-quot off
"/library/bootstrap/boot-stage1.factor" run-resource
namespace global [ "foobar" set ] bind
] with-image
swap write-image ;

View File

@ -239,11 +239,19 @@ FORGET: set-stack-effect
define-slots
register-builtin ;
! Hack
{{ [[ { } null ]] }} typemap set
<namespace> typemap set
num-types empty-vector builtins set
! Catch-all metaclass for providing a default method.
object num-types >vector "types" set-word-prop
object [ drop t ] "predicate" set-word-prop
object object define-class
! Null metaclass with no instances.
null { } "types" set-word-prop
null [ drop f ] "predicate" set-word-prop
null null define-class
"fixnum" "math" create 0 "fixnum?" "math" create { } define-builtin
"fixnum" "math" create 0 "math-priority" set-word-prop
"fixnum" "math" create ">fixnum" [ "math" ] search unit "coercer" set-word-prop

View File

@ -140,5 +140,3 @@ M: generic definer drop \ G: ;
: define-class ( class metaclass -- )
dupd "metaclass" set-word-prop
dup types [ - ] sort typemap get set-hash ;
typemap get [ <namespace> typemap set ] unless

View File

@ -1,9 +0,0 @@
! Copyright (C) 2004, 2005 Slava Pestov.
! See http://factor.sf.net/license.txt for BSD license.
IN: generic
USING: kernel words ;
! Null metaclass with no instances.
null { } "types" set-word-prop
null [ drop f ] "predicate" set-word-prop
null null define-class

View File

@ -1,9 +0,0 @@
! Copyright (C) 2004, 2005 Slava Pestov.
! See http://factor.sf.net/license.txt for BSD license.
IN: generic
USING: kernel lists math sequences vectors words ;
! Catch-all metaclass for providing a default method.
object num-types >vector "types" set-word-prop
object [ drop t ] "predicate" set-word-prop
object object define-class

View File

@ -5,8 +5,6 @@ namespaces sequences vectors words ;
: error-method ( picker word -- method )
[ swap % literalize , \ no-method , ] make-list ;
DEFER: delegate
: empty-method ( picker word -- method )
over [ dup ] = [
[

View File

@ -85,9 +85,7 @@ M: word (uncrossref) drop ;
! word does when invoked.
: define ( word primitive parameter -- )
pick uncrossref
pick set-word-def
swap set-word-primitive ;
pick uncrossref pick set-word-def swap set-word-primitive ;
GENERIC: definer ( word -- word )
#! Return the parsing word that defined this word.
@ -121,7 +119,7 @@ M: compound definer drop \ : ;
: reset-generic ( word -- )
#! Make a word no longer be generic.
{ "methods" "combination" "picker" } reset-props ;
{ "methods" "combination" } reset-props ;
: define-compound ( word def -- )
over reset-generic (define-compound) ;