bootstrap.image: rename image -> bootstrapping-image
							parent
							
								
									dfc5be9e43
								
							
						
					
					
						commit
						80601662a3
					
				| 
						 | 
					@ -144,7 +144,7 @@ SYMBOL: sub-primitives
 | 
				
			||||||
    sub-primitives get set-at ;
 | 
					    sub-primitives get set-at ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
! The image being constructed; a vector of word-size integers
 | 
					! The image being constructed; a vector of word-size integers
 | 
				
			||||||
SYMBOL: image
 | 
					SYMBOL: bootstrapping-image
 | 
				
			||||||
 | 
					
 | 
				
			||||||
! Image output format
 | 
					! Image output format
 | 
				
			||||||
SYMBOL: big-endian
 | 
					SYMBOL: big-endian
 | 
				
			||||||
| 
						 | 
					@ -215,7 +215,7 @@ SPECIAL-OBJECT: undefined-quot 65
 | 
				
			||||||
: special-object-offset ( symbol -- n )
 | 
					: special-object-offset ( symbol -- n )
 | 
				
			||||||
    special-objects get at header-size + ;
 | 
					    special-objects get at header-size + ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: emit ( cell -- ) image get push ;
 | 
					: emit ( cell -- ) bootstrapping-image get push ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: emit-64 ( cell -- )
 | 
					: emit-64 ( cell -- )
 | 
				
			||||||
    bootstrap-cell 8 = [
 | 
					    bootstrap-cell 8 = [
 | 
				
			||||||
| 
						 | 
					@ -224,12 +224,12 @@ SPECIAL-OBJECT: undefined-quot 65
 | 
				
			||||||
        d>w/w big-endian get [ swap ] unless emit emit
 | 
					        d>w/w big-endian get [ swap ] unless emit emit
 | 
				
			||||||
    ] if ;
 | 
					    ] if ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: emit-seq ( seq -- ) image get push-all ;
 | 
					: emit-seq ( seq -- ) bootstrapping-image get push-all ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: fixup ( value offset -- ) image get set-nth ;
 | 
					: fixup ( value offset -- ) bootstrapping-image get set-nth ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: heap-size ( -- size )
 | 
					: heap-size ( -- size )
 | 
				
			||||||
    image get length header-size - special-objects-size -
 | 
					    bootstrapping-image get length header-size - special-objects-size -
 | 
				
			||||||
    bootstrap-cells ;
 | 
					    bootstrap-cells ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: here ( -- size ) heap-size data-base + ;
 | 
					: here ( -- size ) heap-size data-base + ;
 | 
				
			||||||
| 
						 | 
					@ -370,7 +370,7 @@ ERROR: not-in-image vocabulary word ;
 | 
				
			||||||
    [ ] [ [ vocabulary>> ] [ name>> ] bi not-in-image ] ?if ;
 | 
					    [ ] [ [ vocabulary>> ] [ name>> ] bi not-in-image ] ?if ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: fixup-words ( -- )
 | 
					: fixup-words ( -- )
 | 
				
			||||||
    image get [ dup word? [ fixup-word ] when ] map! drop ;
 | 
					    bootstrapping-image get [ dup word? [ fixup-word ] when ] map! drop ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
M: word ' ;
 | 
					M: word ' ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -549,7 +549,7 @@ M: quotation '
 | 
				
			||||||
    ] with-compilation-unit ;
 | 
					    ] with-compilation-unit ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
: build-image ( -- image )
 | 
					: build-image ( -- image )
 | 
				
			||||||
    600,000 <vector> image set
 | 
					    600,000 <vector> bootstrapping-image set
 | 
				
			||||||
    60,000 <hashtable> objects set
 | 
					    60,000 <hashtable> objects set
 | 
				
			||||||
    emit-image-header t, 0, 1, -1,
 | 
					    emit-image-header t, 0, 1, -1,
 | 
				
			||||||
    "Building generic words..." print flush
 | 
					    "Building generic words..." print flush
 | 
				
			||||||
| 
						 | 
					@ -566,10 +566,10 @@ M: quotation '
 | 
				
			||||||
    fixup-words
 | 
					    fixup-words
 | 
				
			||||||
    "Performing header fixups..." print flush
 | 
					    "Performing header fixups..." print flush
 | 
				
			||||||
    fixup-header
 | 
					    fixup-header
 | 
				
			||||||
    "Image length: " write image get length .
 | 
					    "Image length: " write bootstrapping-image get length .
 | 
				
			||||||
    "Object cache size: " write objects get assoc-size .
 | 
					    "Object cache size: " write objects get assoc-size .
 | 
				
			||||||
    \ last-word global delete-at
 | 
					    \ last-word global delete-at
 | 
				
			||||||
    image get ;
 | 
					    bootstrapping-image get ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
! Image output
 | 
					! Image output
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue