1 ! Copyright (C) 2004, 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien alien.strings arrays byte-arrays generic hashtables
4 hashtables.private io io.encodings.ascii kernel math
5 math.private math.order namespaces make parser sequences strings
6 vectors words quotations assocs layouts classes classes.private
7 classes.builtin classes.singleton classes.tuple
8 classes.tuple.private kernel.private vocabs vocabs.loader
9 source-files definitions slots classes.union
10 classes.intersection classes.predicate compiler.units
11 bootstrap.image.private io.files accessors combinators ;
12 IN: bootstrap.primitives
14 "Creating primitives and basic runtime structures..." print flush
16 H{ } clone sub-primitives set
18 "vocab:bootstrap/syntax.factor" parse-file
21 { "windows-x86.32" "x86/32/windows" }
22 { "windows-x86.64" "x86/64/windows" }
23 { "unix-x86.32" "x86/32/unix" }
24 { "unix-x86.64" "x86/64/unix" }
25 { "linux-ppc.32" "ppc/32/linux" }
26 { "linux-ppc.64" "ppc/64/linux" }
27 } ?at [ "Bad architecture: " prepend throw ] unless
28 "vocab:cpu/" "/bootstrap.factor" surround parse-file
30 "vocab:bootstrap/layouts/layouts.factor" parse-file
32 ! Now we have ( syntax-quot arch-quot layouts-quot ) on the stack
34 ! Bring up a bare cross-compiling vocabulary.
35 "syntax" lookup-vocab vocab-words bootstrap-syntax set
37 H{ } clone dictionary set
38 H{ } clone root-cache set
39 H{ } clone source-files set
40 H{ } clone update-map set
41 H{ } clone implementors-map set
50 ! Vocabulary for slot accessors
51 "accessors" create-vocab drop
53 ! After we execute bootstrap/layouts
54 num-types get f <array> builtins set
60 ! Create some empty vocabs where the below primitives and
71 "classes.tuple.private"
74 "continuations.private"
76 "generic.single.private"
105 "tools.dispatch.private"
106 "tools.memory.private"
107 "tools.profiler.counting.private"
108 "tools.profiler.sampling.private"
114 } [ create-vocab drop ] each
117 : lookup-type-number ( word -- n )
118 [ target-word ] with-global type-number ;
120 : register-builtin ( class -- )
121 [ dup lookup-type-number "type" set-word-prop ]
122 [ dup "type" word-prop builtins get set-nth ]
123 [ f f f builtin-class define-class ]
126 : prepare-slots ( slots -- slots' )
127 [ [ dup pair? [ first2 create ] when ] map ] map ;
129 : define-builtin-slots ( class slots -- )
130 prepare-slots make-slots 1 finalize-slots
131 [ "slots" set-word-prop ] [ define-accessors ] 2bi ;
133 : define-builtin-predicate ( class -- )
134 dup class>type [ eq? ] curry [ tag ] prepend define-predicate ;
136 : define-builtin ( symbol slotspec -- )
137 [ [ define-builtin-predicate ] keep ] dip define-builtin-slots ;
139 "fixnum" "math" create register-builtin
140 "bignum" "math" create register-builtin
141 "tuple" "kernel" create register-builtin
142 "float" "math" create register-builtin
143 "f" "syntax" lookup-word register-builtin
144 "array" "arrays" create register-builtin
145 "wrapper" "kernel" create register-builtin
146 "callstack" "kernel" create register-builtin
147 "string" "strings" create register-builtin
148 "quotation" "quotations" create register-builtin
149 "dll" "alien" create register-builtin
150 "alien" "alien" create register-builtin
151 "word" "words" create register-builtin
152 "byte-array" "byte-arrays" create register-builtin
154 ! We need this before defining c-ptr below
155 "f" "syntax" lookup-word { } define-builtin
157 "f" "syntax" create [ not ] "predicate" set-word-prop
158 "f?" "syntax" vocab-words delete-at
160 "t" "syntax" lookup-word define-singleton-class
163 "c-ptr" "alien" create [
164 "alien" "alien" lookup-word ,
165 "f" "syntax" lookup-word ,
166 "byte-array" "byte-arrays" lookup-word ,
167 ] { } make define-union-class
169 ! A predicate class used for declarations
170 "array-capacity" "sequences.private" create
171 "fixnum" "math" lookup-word
174 bootstrap-max-array-capacity <fake-bignum> [ fixnum<= ] curry ,
177 define-predicate-class
179 "array-capacity" "sequences.private" lookup-word
180 [ >fixnum ] bootstrap-max-array-capacity <fake-bignum> [ fixnum-bitand ] curry append
181 "coercer" set-word-prop
183 ! Catch-all class for providing a default method.
184 "object" "kernel" create
185 [ f f { } intersection-class define-class ]
186 [ [ drop t ] "predicate" set-word-prop ]
189 "object?" "kernel" vocab-words delete-at
191 ! Empty class with no instances
192 "null" "kernel" create
193 [ f { } f union-class define-class ]
194 [ [ drop f ] "predicate" set-word-prop ]
197 "null?" "kernel" vocab-words delete-at
199 "fixnum" "math" create { } define-builtin
200 "fixnum" "math" create ">fixnum" "math" create 1quotation "coercer" set-word-prop
202 "bignum" "math" create { } define-builtin
203 "bignum" "math" create ">bignum" "math" create 1quotation "coercer" set-word-prop
205 "float" "math" create { } define-builtin
206 "float" "math" create ">float" "math" create 1quotation "coercer" set-word-prop
208 "array" "arrays" create {
209 { "length" { "array-capacity" "sequences.private" } read-only }
212 "wrapper" "kernel" create {
213 { "wrapped" read-only }
216 "string" "strings" create {
217 { "length" { "array-capacity" "sequences.private" } read-only }
221 "quotation" "quotations" create {
222 { "array" { "array" "arrays" } read-only }
227 "dll" "alien" create {
228 { "path" { "byte-array" "byte-arrays" } read-only }
231 "alien" "alien" create {
232 { "underlying" { "c-ptr" "alien" } read-only }
236 "word" "words" create {
237 { "hashcode" { "fixnum" "math" } }
240 { "def" { "quotation" "quotations" } initial: [ ] }
244 { "counter" { "fixnum" "math" } }
245 { "sub-primitive" read-only }
248 "byte-array" "byte-arrays" create {
249 { "length" { "array-capacity" "sequences.private" } read-only }
252 "callstack" "kernel" create { } define-builtin
254 "tuple" "kernel" create
255 [ { } define-builtin ]
256 [ define-tuple-layout ]
259 ! Create special tombstone values
260 "tombstone" "hashtables.private" create
262 { "state" } define-tuple-class
264 "((empty))" "hashtables.private" create
265 "tombstone" "hashtables.private" lookup-word f
266 2array >tuple 1quotation ( -- value ) define-inline
268 "((tombstone))" "hashtables.private" create
269 "tombstone" "hashtables.private" lookup-word t
270 2array >tuple 1quotation ( -- value ) define-inline
273 "curry" "kernel" create
278 } prepare-slots define-tuple-class
280 "curry" "kernel" lookup-word
282 [ f "inline" set-word-prop ]
287 callable instance-check-quot %
293 ( obj quot -- curry ) define-declared
295 "compose" "kernel" create
298 { "first" read-only }
299 { "second" read-only }
300 } prepare-slots define-tuple-class
302 "compose" "kernel" lookup-word
304 [ f "inline" set-word-prop ]
309 callable instance-check-quot [ dip ] curry %
310 callable instance-check-quot %
316 ( quot1 quot2 -- compose ) define-declared
318 ! Sub-primitive words
319 : make-sub-primitive ( word vocab effect -- )
322 dup t "primitive" set-word-prop
324 ] dip define-declared ;
327 { "mega-cache-lookup" "generic.single.private" ( methods index cache -- ) }
328 { "inline-cache-miss" "generic.single.private" ( generic methods index cache -- ) }
329 { "inline-cache-miss-tail" "generic.single.private" ( generic methods index cache -- ) }
330 { "drop" "kernel" ( x -- ) }
331 { "2drop" "kernel" ( x y -- ) }
332 { "3drop" "kernel" ( x y z -- ) }
333 { "dup" "kernel" ( x -- x x ) }
334 { "2dup" "kernel" ( x y -- x y x y ) }
335 { "3dup" "kernel" ( x y z -- x y z x y z ) }
336 { "rot" "kernel" ( x y z -- y z x ) }
337 { "-rot" "kernel" ( x y z -- z x y ) }
338 { "dupd" "kernel" ( x y -- x x y ) }
339 { "swapd" "kernel" ( x y z -- y x z ) }
340 { "nip" "kernel" ( x y -- y ) }
341 { "2nip" "kernel" ( x y z -- z ) }
342 { "over" "kernel" ( x y -- x y x ) }
343 { "pick" "kernel" ( x y z -- x y z x ) }
344 { "swap" "kernel" ( x y -- y x ) }
345 { "eq?" "kernel" ( obj1 obj2 -- ? ) }
346 { "tag" "kernel.private" ( object -- n ) }
347 { "(execute)" "kernel.private" ( word -- ) }
348 { "(call)" "kernel.private" ( quot -- ) }
349 { "fpu-state" "kernel.private" ( -- ) }
350 { "set-fpu-state" "kernel.private" ( -- ) }
351 { "signal-handler" "kernel.private" ( -- ) }
352 { "leaf-signal-handler" "kernel.private" ( -- ) }
353 { "ffi-signal-handler" "kernel.private" ( -- ) }
354 { "ffi-leaf-signal-handler" "kernel.private" ( -- ) }
355 { "unwind-native-frames" "kernel.private" ( -- ) }
356 { "set-callstack" "kernel.private" ( callstack -- * ) }
357 { "lazy-jit-compile" "kernel.private" ( -- ) }
358 { "c-to-factor" "kernel.private" ( -- ) }
359 { "slot" "slots.private" ( obj m -- value ) }
360 { "get-local" "locals.backend" ( n -- obj ) }
361 { "load-local" "locals.backend" ( obj -- ) }
362 { "drop-locals" "locals.backend" ( n -- ) }
363 { "both-fixnums?" "math.private" ( x y -- ? ) }
364 { "fixnum+fast" "math.private" ( x y -- z ) }
365 { "fixnum-fast" "math.private" ( x y -- z ) }
366 { "fixnum*fast" "math.private" ( x y -- z ) }
367 { "fixnum-bitand" "math.private" ( x y -- z ) }
368 { "fixnum-bitor" "math.private" ( x y -- z ) }
369 { "fixnum-bitxor" "math.private" ( x y -- z ) }
370 { "fixnum-bitnot" "math.private" ( x -- y ) }
371 { "fixnum-mod" "math.private" ( x y -- z ) }
372 { "fixnum-shift-fast" "math.private" ( x y -- z ) }
373 { "fixnum/i-fast" "math.private" ( x y -- z ) }
374 { "fixnum/mod-fast" "math.private" ( x y -- z w ) }
375 { "fixnum+" "math.private" ( x y -- z ) }
376 { "fixnum-" "math.private" ( x y -- z ) }
377 { "fixnum*" "math.private" ( x y -- z ) }
378 { "fixnum<" "math.private" ( x y -- ? ) }
379 { "fixnum<=" "math.private" ( x y -- z ) }
380 { "fixnum>" "math.private" ( x y -- ? ) }
381 { "fixnum>=" "math.private" ( x y -- ? ) }
382 { "string-nth-fast" "strings.private" ( n string -- ch ) }
383 { "(set-context)" "threads.private" ( obj context -- obj' ) }
384 { "(set-context-and-delete)" "threads.private" ( obj context -- * ) }
385 { "(start-context)" "threads.private" ( obj quot -- obj' ) }
386 { "(start-context-and-delete)" "threads.private" ( obj quot -- * ) }
387 } [ first3 make-sub-primitive ] each
390 : make-primitive ( word vocab function effect -- )
395 dup t "primitive" set-word-prop
397 ascii string>alien [ do-primitive ] curry
398 ] dip define-declared ;
401 { "<callback>" "alien" "primitive_callback" ( return-rewind word -- alien ) }
402 { "<displaced-alien>" "alien" "primitive_displaced_alien" ( displacement c-ptr -- alien ) }
403 { "alien-address" "alien" "primitive_alien_address" ( c-ptr -- addr ) }
404 { "alien-cell" "alien.accessors" "primitive_alien_cell" ( c-ptr n -- value ) }
405 { "alien-double" "alien.accessors" "primitive_alien_double" ( c-ptr n -- value ) }
406 { "alien-float" "alien.accessors" "primitive_alien_float" ( c-ptr n -- value ) }
407 { "alien-signed-1" "alien.accessors" "primitive_alien_signed_1" ( c-ptr n -- value ) }
408 { "alien-signed-2" "alien.accessors" "primitive_alien_signed_2" ( c-ptr n -- value ) }
409 { "alien-signed-4" "alien.accessors" "primitive_alien_signed_4" ( c-ptr n -- value ) }
410 { "alien-signed-8" "alien.accessors" "primitive_alien_signed_8" ( c-ptr n -- value ) }
411 { "alien-signed-cell" "alien.accessors" "primitive_alien_signed_cell" ( c-ptr n -- value ) }
412 { "alien-unsigned-1" "alien.accessors" "primitive_alien_unsigned_1" ( c-ptr n -- value ) }
413 { "alien-unsigned-2" "alien.accessors" "primitive_alien_unsigned_2" ( c-ptr n -- value ) }
414 { "alien-unsigned-4" "alien.accessors" "primitive_alien_unsigned_4" ( c-ptr n -- value ) }
415 { "alien-unsigned-8" "alien.accessors" "primitive_alien_unsigned_8" ( c-ptr n -- value ) }
416 { "alien-unsigned-cell" "alien.accessors" "primitive_alien_unsigned_cell" ( c-ptr n -- value ) }
417 { "set-alien-cell" "alien.accessors" "primitive_set_alien_cell" ( value c-ptr n -- ) }
418 { "set-alien-double" "alien.accessors" "primitive_set_alien_double" ( value c-ptr n -- ) }
419 { "set-alien-float" "alien.accessors" "primitive_set_alien_float" ( value c-ptr n -- ) }
420 { "set-alien-signed-1" "alien.accessors" "primitive_set_alien_signed_1" ( value c-ptr n -- ) }
421 { "set-alien-signed-2" "alien.accessors" "primitive_set_alien_signed_2" ( value c-ptr n -- ) }
422 { "set-alien-signed-4" "alien.accessors" "primitive_set_alien_signed_4" ( value c-ptr n -- ) }
423 { "set-alien-signed-8" "alien.accessors" "primitive_set_alien_signed_8" ( value c-ptr n -- ) }
424 { "set-alien-signed-cell" "alien.accessors" "primitive_set_alien_signed_cell" ( value c-ptr n -- ) }
425 { "set-alien-unsigned-1" "alien.accessors" "primitive_set_alien_unsigned_1" ( value c-ptr n -- ) }
426 { "set-alien-unsigned-2" "alien.accessors" "primitive_set_alien_unsigned_2" ( value c-ptr n -- ) }
427 { "set-alien-unsigned-4" "alien.accessors" "primitive_set_alien_unsigned_4" ( value c-ptr n -- ) }
428 { "set-alien-unsigned-8" "alien.accessors" "primitive_set_alien_unsigned_8" ( value c-ptr n -- ) }
429 { "set-alien-unsigned-cell" "alien.accessors" "primitive_set_alien_unsigned_cell" ( value c-ptr n -- ) }
430 { "(dlopen)" "alien.libraries" "primitive_dlopen" ( path -- dll ) }
431 { "(dlsym)" "alien.libraries" "primitive_dlsym" ( name dll -- alien ) }
432 { "(dlsym-raw)" "alien.libraries" "primitive_dlsym_raw" ( name dll -- alien ) }
433 { "dlclose" "alien.libraries" "primitive_dlclose" ( dll -- ) }
434 { "dll-valid?" "alien.libraries" "primitive_dll_validp" ( dll -- ? ) }
435 { "current-callback" "alien.private" "primitive_current_callback" ( -- n ) }
436 { "<array>" "arrays" "primitive_array" ( n elt -- array ) }
437 { "resize-array" "arrays" "primitive_resize_array" ( n array -- new-array ) }
438 { "(byte-array)" "byte-arrays" "primitive_uninitialized_byte_array" ( n -- byte-array ) }
439 { "<byte-array>" "byte-arrays" "primitive_byte_array" ( n -- byte-array ) }
440 { "resize-byte-array" "byte-arrays" "primitive_resize_byte_array" ( n byte-array -- new-byte-array ) }
441 { "<tuple-boa>" "classes.tuple.private" "primitive_tuple_boa" ( slots... layout -- tuple ) }
442 { "<tuple>" "classes.tuple.private" "primitive_tuple" ( layout -- tuple ) }
443 { "modify-code-heap" "compiler.units" "primitive_modify_code_heap" ( alist update-existing? reset-pics? -- ) }
444 { "lookup-method" "generic.single.private" "primitive_lookup_method" ( object methods -- method ) }
445 { "mega-cache-miss" "generic.single.private" "primitive_mega_cache_miss" ( methods index cache -- method ) }
446 { "(exists?)" "io.files.private" "primitive_existsp" ( path -- ? ) }
447 { "(fopen)" "io.streams.c" "primitive_fopen" ( path mode -- alien ) }
448 { "fclose" "io.streams.c" "primitive_fclose" ( alien -- ) }
449 { "fflush" "io.streams.c" "primitive_fflush" ( alien -- ) }
450 { "fgetc" "io.streams.c" "primitive_fgetc" ( alien -- byte/f ) }
451 { "fputc" "io.streams.c" "primitive_fputc" ( byte alien -- ) }
452 { "fread-unsafe" "io.streams.c" "primitive_fread" ( n buf alien -- count ) }
453 { "fseek" "io.streams.c" "primitive_fseek" ( alien offset whence -- ) }
454 { "ftell" "io.streams.c" "primitive_ftell" ( alien -- n ) }
455 { "fwrite" "io.streams.c" "primitive_fwrite" ( data length alien -- ) }
456 { "(clone)" "kernel" "primitive_clone" ( obj -- newobj ) }
457 { "<wrapper>" "kernel" "primitive_wrapper" ( obj -- wrapper ) }
458 { "callstack" "kernel" "primitive_callstack" ( -- callstack ) }
459 { "callstack>array" "kernel" "primitive_callstack_to_array" ( callstack -- array ) }
460 { "datastack" "kernel" "primitive_datastack" ( -- array ) }
461 { "die" "kernel" "primitive_die" ( -- ) }
462 { "retainstack" "kernel" "primitive_retainstack" ( -- array ) }
463 { "(identity-hashcode)" "kernel.private" "primitive_identity_hashcode" ( obj -- code ) }
464 { "become" "kernel.private" "primitive_become" ( old new -- ) }
465 { "callstack-bounds" "kernel.private" "primitive_callstack_bounds" ( -- start end ) }
466 { "check-datastack" "kernel.private" "primitive_check_datastack" ( array in# out# -- ? ) }
467 { "compute-identity-hashcode" "kernel.private" "primitive_compute_identity_hashcode" ( obj -- ) }
468 { "context-object" "kernel.private" "primitive_context_object" ( n -- obj ) }
469 { "innermost-frame-executing" "kernel.private" "primitive_innermost_stack_frame_executing" ( callstack -- obj ) }
470 { "innermost-frame-scan" "kernel.private" "primitive_innermost_stack_frame_scan" ( callstack -- n ) }
471 { "set-context-object" "kernel.private" "primitive_set_context_object" ( obj n -- ) }
472 { "set-datastack" "kernel.private" "primitive_set_datastack" ( array -- ) }
473 { "set-innermost-frame-quot" "kernel.private" "primitive_set_innermost_stack_frame_quot" ( n callstack -- ) }
474 { "set-retainstack" "kernel.private" "primitive_set_retainstack" ( array -- ) }
475 { "set-special-object" "kernel.private" "primitive_set_special_object" ( obj n -- ) }
476 { "special-object" "kernel.private" "primitive_special_object" ( n -- obj ) }
477 { "strip-stack-traces" "kernel.private" "primitive_strip_stack_traces" ( -- ) }
478 { "unimplemented" "kernel.private" "primitive_unimplemented" ( -- * ) }
479 { "load-locals" "locals.backend" "primitive_load_locals" ( ... n -- ) }
480 { "bits>double" "math" "primitive_bits_double" ( n -- x ) }
481 { "bits>float" "math" "primitive_bits_float" ( n -- x ) }
482 { "double>bits" "math" "primitive_double_bits" ( x -- n ) }
483 { "float>bits" "math" "primitive_float_bits" ( x -- n ) }
484 { "(format-float)" "math.parser.private" "primitive_format_float" ( n format -- byte-array ) }
485 { "bignum*" "math.private" "primitive_bignum_multiply" ( x y -- z ) }
486 { "bignum+" "math.private" "primitive_bignum_add" ( x y -- z ) }
487 { "bignum-" "math.private" "primitive_bignum_subtract" ( x y -- z ) }
488 { "bignum-bit?" "math.private" "primitive_bignum_bitp" ( n x -- ? ) }
489 { "bignum-bitand" "math.private" "primitive_bignum_and" ( x y -- z ) }
490 { "bignum-bitnot" "math.private" "primitive_bignum_not" ( x -- y ) }
491 { "bignum-bitor" "math.private" "primitive_bignum_or" ( x y -- z ) }
492 { "bignum-bitxor" "math.private" "primitive_bignum_xor" ( x y -- z ) }
493 { "bignum-log2" "math.private" "primitive_bignum_log2" ( x -- n ) }
494 { "bignum-mod" "math.private" "primitive_bignum_mod" ( x y -- z ) }
495 { "bignum-shift" "math.private" "primitive_bignum_shift" ( x y -- z ) }
496 { "bignum/i" "math.private" "primitive_bignum_divint" ( x y -- z ) }
497 { "bignum/mod" "math.private" "primitive_bignum_divmod" ( x y -- z w ) }
498 { "bignum<" "math.private" "primitive_bignum_less" ( x y -- ? ) }
499 { "bignum<=" "math.private" "primitive_bignum_lesseq" ( x y -- ? ) }
500 { "bignum=" "math.private" "primitive_bignum_eq" ( x y -- ? ) }
501 { "bignum>" "math.private" "primitive_bignum_greater" ( x y -- ? ) }
502 { "bignum>=" "math.private" "primitive_bignum_greatereq" ( x y -- ? ) }
503 { "bignum>fixnum" "math.private" "primitive_bignum_to_fixnum" ( x -- y ) }
504 { "fixnum-shift" "math.private" "primitive_fixnum_shift" ( x y -- z ) }
505 { "fixnum/i" "math.private" "primitive_fixnum_divint" ( x y -- z ) }
506 { "fixnum/mod" "math.private" "primitive_fixnum_divmod" ( x y -- z w ) }
507 { "fixnum>bignum" "math.private" "primitive_fixnum_to_bignum" ( x -- y ) }
508 { "fixnum>float" "math.private" "primitive_fixnum_to_float" ( x -- y ) }
509 { "float*" "math.private" "primitive_float_multiply" ( x y -- z ) }
510 { "float+" "math.private" "primitive_float_add" ( x y -- z ) }
511 { "float-" "math.private" "primitive_float_subtract" ( x y -- z ) }
512 { "float-u<" "math.private" "primitive_float_less" ( x y -- ? ) }
513 { "float-u<=" "math.private" "primitive_float_lesseq" ( x y -- ? ) }
514 { "float-u>" "math.private" "primitive_float_greater" ( x y -- ? ) }
515 { "float-u>=" "math.private" "primitive_float_greatereq" ( x y -- ? ) }
516 { "float/f" "math.private" "primitive_float_divfloat" ( x y -- z ) }
517 { "float<" "math.private" "primitive_float_less" ( x y -- ? ) }
518 { "float<=" "math.private" "primitive_float_lesseq" ( x y -- ? ) }
519 { "float=" "math.private" "primitive_float_eq" ( x y -- ? ) }
520 { "float>" "math.private" "primitive_float_greater" ( x y -- ? ) }
521 { "float>=" "math.private" "primitive_float_greatereq" ( x y -- ? ) }
522 { "float>bignum" "math.private" "primitive_float_to_bignum" ( x -- y ) }
523 { "float>fixnum" "math.private" "primitive_float_to_fixnum" ( x -- y ) }
524 { "all-instances" "memory" "primitive_all_instances" ( -- array ) }
525 { "(code-blocks)" "tools.memory.private" "primitive_code_blocks" ( -- array ) }
526 { "(code-room)" "tools.memory.private" "primitive_code_room" ( -- code-room ) }
527 { "compact-gc" "memory" "primitive_compact_gc" ( -- ) }
528 { "(data-room)" "tools.memory.private" "primitive_data_room" ( -- data-room ) }
529 { "disable-gc-events" "tools.memory.private" "primitive_disable_gc_events" ( -- events ) }
530 { "enable-gc-events" "tools.memory.private" "primitive_enable_gc_events" ( -- ) }
531 { "gc" "memory" "primitive_full_gc" ( -- ) }
532 { "minor-gc" "memory" "primitive_minor_gc" ( -- ) }
533 { "size" "memory" "primitive_size" ( obj -- n ) }
534 { "(save-image)" "memory.private" "primitive_save_image" ( path1 path2 -- ) }
535 { "(save-image-and-exit)" "memory.private" "primitive_save_image_and_exit" ( path1 path2 -- ) }
536 { "jit-compile" "quotations" "primitive_jit_compile" ( quot -- ) }
537 { "quot-compiled?" "quotations" "primitive_quot_compiled_p" ( quot -- ? ) }
538 { "quotation-code" "quotations" "primitive_quotation_code" ( quot -- start end ) }
539 { "array>quotation" "quotations.private" "primitive_array_to_quotation" ( array -- quot ) }
540 { "set-slot" "slots.private" "primitive_set_slot" ( value obj n -- ) }
541 { "<string>" "strings" "primitive_string" ( n ch -- string ) }
542 { "resize-string" "strings" "primitive_resize_string" ( n str -- newstr ) }
543 { "set-string-nth-fast" "strings.private" "primitive_set_string_nth_fast" ( ch n string -- ) }
544 { "(exit)" "system" "primitive_exit" ( n -- * ) }
545 { "nano-count" "system" "primitive_nano_count" ( -- ns ) }
546 { "(sleep)" "threads.private" "primitive_sleep" ( nanos -- ) }
547 { "callstack-for" "threads.private" "primitive_callstack_for" ( context -- array ) }
548 { "context-object-for" "threads.private" "primitive_context_object_for" ( n context -- obj ) }
549 { "datastack-for" "threads.private" "primitive_datastack_for" ( context -- array ) }
550 { "retainstack-for" "threads.private" "primitive_retainstack_for" ( context -- array ) }
551 { "dispatch-stats" "tools.dispatch.private" "primitive_dispatch_stats" ( -- stats ) }
552 { "reset-dispatch-stats" "tools.dispatch.private" "primitive_reset_dispatch_stats" ( -- ) }
553 { "profiling" "tools.profiler.counting.private" "primitive_counting_profiler" ( ? -- ) }
554 { "optimized?" "words" "primitive_optimized_p" ( word -- ? ) }
555 { "word-code" "words" "primitive_word_code" ( word -- start end ) }
556 { "(word)" "words.private" "primitive_word" ( name vocab hashcode -- word ) }
557 { "profiling" "tools.profiler.sampling.private" "primitive_sampling_profiler" ( ? -- ) }
558 { "(get-samples)" "tools.profiler.sampling.private" "primitive_get_samples" ( -- samples/f ) }
559 { "(clear-samples)" "tools.profiler.sampling.private" "primitive_clear_samples" ( -- ) }
560 } [ first4 make-primitive ] each
563 "build" "kernel" create build 1 + [ ] curry ( -- n ) define-declared
565 ] with-compilation-unit