factor: PRIMITIVE: -> PRIMITIVE: ;
find . -type f -name '*.factor' -exec sed -i '' 's/\(PRIMITIVE:.* (.*)\)/\1 ;/g' {} +locals-and-roots
parent
7018cad3de
commit
cca9402fe6
|
@ -2,29 +2,29 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
in: alien.accessors
|
in: alien.accessors
|
||||||
|
|
||||||
PRIMITIVE: alien-cell ( c-ptr n -- value )
|
PRIMITIVE: alien-cell ( c-ptr n -- value ) ;
|
||||||
PRIMITIVE: alien-double ( c-ptr n -- value )
|
PRIMITIVE: alien-double ( c-ptr n -- value ) ;
|
||||||
PRIMITIVE: alien-float ( c-ptr n -- value )
|
PRIMITIVE: alien-float ( c-ptr n -- value ) ;
|
||||||
PRIMITIVE: alien-signed-1 ( c-ptr n -- value )
|
PRIMITIVE: alien-signed-1 ( c-ptr n -- value ) ;
|
||||||
PRIMITIVE: alien-signed-2 ( c-ptr n -- value )
|
PRIMITIVE: alien-signed-2 ( c-ptr n -- value ) ;
|
||||||
PRIMITIVE: alien-signed-4 ( c-ptr n -- value )
|
PRIMITIVE: alien-signed-4 ( c-ptr n -- value ) ;
|
||||||
PRIMITIVE: alien-signed-8 ( c-ptr n -- value )
|
PRIMITIVE: alien-signed-8 ( c-ptr n -- value ) ;
|
||||||
PRIMITIVE: alien-signed-cell ( c-ptr n -- value )
|
PRIMITIVE: alien-signed-cell ( c-ptr n -- value ) ;
|
||||||
PRIMITIVE: alien-unsigned-1 ( c-ptr n -- value )
|
PRIMITIVE: alien-unsigned-1 ( c-ptr n -- value ) ;
|
||||||
PRIMITIVE: alien-unsigned-2 ( c-ptr n -- value )
|
PRIMITIVE: alien-unsigned-2 ( c-ptr n -- value ) ;
|
||||||
PRIMITIVE: alien-unsigned-4 ( c-ptr n -- value )
|
PRIMITIVE: alien-unsigned-4 ( c-ptr n -- value ) ;
|
||||||
PRIMITIVE: alien-unsigned-8 ( c-ptr n -- value )
|
PRIMITIVE: alien-unsigned-8 ( c-ptr n -- value ) ;
|
||||||
PRIMITIVE: alien-unsigned-cell ( c-ptr n -- value )
|
PRIMITIVE: alien-unsigned-cell ( c-ptr n -- value ) ;
|
||||||
PRIMITIVE: set-alien-cell ( value c-ptr n -- )
|
PRIMITIVE: set-alien-cell ( value c-ptr n -- ) ;
|
||||||
PRIMITIVE: set-alien-double ( value c-ptr n -- )
|
PRIMITIVE: set-alien-double ( value c-ptr n -- ) ;
|
||||||
PRIMITIVE: set-alien-float ( value c-ptr n -- )
|
PRIMITIVE: set-alien-float ( value c-ptr n -- ) ;
|
||||||
PRIMITIVE: set-alien-signed-1 ( value c-ptr n -- )
|
PRIMITIVE: set-alien-signed-1 ( value c-ptr n -- ) ;
|
||||||
PRIMITIVE: set-alien-signed-2 ( value c-ptr n -- )
|
PRIMITIVE: set-alien-signed-2 ( value c-ptr n -- ) ;
|
||||||
PRIMITIVE: set-alien-signed-4 ( value c-ptr n -- )
|
PRIMITIVE: set-alien-signed-4 ( value c-ptr n -- ) ;
|
||||||
PRIMITIVE: set-alien-signed-8 ( value c-ptr n -- )
|
PRIMITIVE: set-alien-signed-8 ( value c-ptr n -- ) ;
|
||||||
PRIMITIVE: set-alien-signed-cell ( value c-ptr n -- )
|
PRIMITIVE: set-alien-signed-cell ( value c-ptr n -- ) ;
|
||||||
PRIMITIVE: set-alien-unsigned-1 ( value c-ptr n -- )
|
PRIMITIVE: set-alien-unsigned-1 ( value c-ptr n -- ) ;
|
||||||
PRIMITIVE: set-alien-unsigned-2 ( value c-ptr n -- )
|
PRIMITIVE: set-alien-unsigned-2 ( value c-ptr n -- ) ;
|
||||||
PRIMITIVE: set-alien-unsigned-4 ( value c-ptr n -- )
|
PRIMITIVE: set-alien-unsigned-4 ( value c-ptr n -- ) ;
|
||||||
PRIMITIVE: set-alien-unsigned-8 ( value c-ptr n -- )
|
PRIMITIVE: set-alien-unsigned-8 ( value c-ptr n -- ) ;
|
||||||
PRIMITIVE: set-alien-unsigned-cell ( value c-ptr n -- )
|
PRIMITIVE: set-alien-unsigned-cell ( value c-ptr n -- ) ;
|
||||||
|
|
|
@ -8,13 +8,13 @@ in: alien
|
||||||
BUILTIN: alien { underlying c-ptr read-only initial: f } expired ;
|
BUILTIN: alien { underlying c-ptr read-only initial: f } expired ;
|
||||||
BUILTIN: dll { path byte-array read-only initial: B{ } } ;
|
BUILTIN: dll { path byte-array read-only initial: B{ } } ;
|
||||||
|
|
||||||
PRIMITIVE: <callback> ( word return-rewind -- alien )
|
PRIMITIVE: <callback> ( word return-rewind -- alien ) ;
|
||||||
PRIMITIVE: <displaced-alien> ( displacement c-ptr -- alien )
|
PRIMITIVE: <displaced-alien> ( displacement c-ptr -- alien ) ;
|
||||||
PRIMITIVE: alien-address ( c-ptr -- addr )
|
PRIMITIVE: alien-address ( c-ptr -- addr ) ;
|
||||||
PRIMITIVE: free-callback ( alien -- )
|
PRIMITIVE: free-callback ( alien -- ) ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: current-callback ( -- n )
|
PRIMITIVE: current-callback ( -- n ) ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
PREDICATE: pinned-alien < alien underlying>> not ;
|
PREDICATE: pinned-alien < alien underlying>> not ;
|
||||||
|
|
|
@ -5,11 +5,11 @@ io.backend kernel namespaces destructors sequences strings
|
||||||
system io.pathnames fry combinators vocabs ;
|
system io.pathnames fry combinators vocabs ;
|
||||||
in: alien.libraries
|
in: alien.libraries
|
||||||
|
|
||||||
PRIMITIVE: dll-valid? ( dll -- ? )
|
PRIMITIVE: dll-valid? ( dll -- ? ) ;
|
||||||
PRIMITIVE: (dlopen) ( path -- dll )
|
PRIMITIVE: (dlopen) ( path -- dll ) ;
|
||||||
PRIMITIVE: (dlsym) ( name dll -- alien )
|
PRIMITIVE: (dlsym) ( name dll -- alien ) ;
|
||||||
PRIMITIVE: dlclose ( dll -- )
|
PRIMITIVE: dlclose ( dll -- ) ;
|
||||||
PRIMITIVE: (dlsym-raw) ( name dll -- alien )
|
PRIMITIVE: (dlsym-raw) ( name dll -- alien ) ;
|
||||||
|
|
||||||
: dlopen ( path -- dll ) native-string>alien (dlopen) ;
|
: dlopen ( path -- dll ) native-string>alien (dlopen) ;
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ in: arrays
|
||||||
|
|
||||||
BUILTIN: array { length array-capacity read-only initial: 0 } ;
|
BUILTIN: array { length array-capacity read-only initial: 0 } ;
|
||||||
|
|
||||||
PRIMITIVE: <array> ( n elt -- array )
|
PRIMITIVE: <array> ( n elt -- array ) ;
|
||||||
PRIMITIVE: resize-array ( n array -- new-array )
|
PRIMITIVE: resize-array ( n array -- new-array ) ;
|
||||||
|
|
||||||
M: array clone (clone) ; inline
|
M: array clone (clone) ; inline
|
||||||
M: array length length>> ; inline
|
M: array length length>> ; inline
|
||||||
|
|
|
@ -7,9 +7,9 @@ in: byte-arrays
|
||||||
BUILTIN: byte-array
|
BUILTIN: byte-array
|
||||||
{ length array-capacity read-only initial: 0 } ;
|
{ length array-capacity read-only initial: 0 } ;
|
||||||
|
|
||||||
PRIMITIVE: (byte-array) ( n -- byte-array )
|
PRIMITIVE: (byte-array) ( n -- byte-array ) ;
|
||||||
PRIMITIVE: <byte-array> ( n -- byte-array )
|
PRIMITIVE: <byte-array> ( n -- byte-array ) ;
|
||||||
PRIMITIVE: resize-byte-array ( n byte-array -- new-byte-array )
|
PRIMITIVE: resize-byte-array ( n byte-array -- new-byte-array ) ;
|
||||||
|
|
||||||
M: byte-array clone (clone) ; inline
|
M: byte-array clone (clone) ; inline
|
||||||
M: byte-array clone-like
|
M: byte-array clone-like
|
||||||
|
|
|
@ -8,8 +8,8 @@ sequences sequences.private slots slots.private strings words ;
|
||||||
in: classes.tuple
|
in: classes.tuple
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: <tuple> ( layout -- tuple )
|
PRIMITIVE: <tuple> ( layout -- tuple ) ;
|
||||||
PRIMITIVE: <tuple-boa> ( slots... layout -- tuple )
|
PRIMITIVE: <tuple-boa> ( slots... layout -- tuple ) ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
PREDICATE: tuple-class < class
|
PREDICATE: tuple-class < class
|
||||||
|
|
|
@ -6,7 +6,7 @@ hash-sets init kernel kernel.private math namespaces sequences
|
||||||
sets source-files.errors vocabs words ;
|
sets source-files.errors vocabs words ;
|
||||||
in: compiler.units
|
in: compiler.units
|
||||||
|
|
||||||
PRIMITIVE: modify-code-heap ( alist update-existing? reset-pics? -- )
|
PRIMITIVE: modify-code-heap ( alist update-existing? reset-pics? -- ) ;
|
||||||
|
|
||||||
symbol: old-definitions
|
symbol: old-definitions
|
||||||
symbol: new-definitions
|
symbol: new-definitions
|
||||||
|
|
|
@ -7,11 +7,11 @@ sequences words ;
|
||||||
in: generic.single
|
in: generic.single
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: inline-cache-miss ( generic methods index cache -- )
|
PRIMITIVE: inline-cache-miss ( generic methods index cache -- ) ;
|
||||||
PRIMITIVE: inline-cache-miss-tail ( generic methods index cache -- )
|
PRIMITIVE: inline-cache-miss-tail ( generic methods index cache -- ) ;
|
||||||
PRIMITIVE: lookup-method ( object methods -- method )
|
PRIMITIVE: lookup-method ( object methods -- method ) ;
|
||||||
PRIMITIVE: mega-cache-lookup ( methods index cache -- )
|
PRIMITIVE: mega-cache-lookup ( methods index cache -- ) ;
|
||||||
PRIMITIVE: mega-cache-miss ( methods index cache -- method )
|
PRIMITIVE: mega-cache-miss ( methods index cache -- method ) ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
ERROR: no-method object generic ;
|
ERROR: no-method object generic ;
|
||||||
|
|
|
@ -6,7 +6,7 @@ kernel kernel.private namespaces sequences splitting system ;
|
||||||
in: io.files
|
in: io.files
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: (exists?) ( path -- ? )
|
PRIMITIVE: (exists?) ( path -- ? ) ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
symbol: +retry+ ! just try the operation again without blocking
|
symbol: +retry+ ! just try the operation again without blocking
|
||||||
|
|
|
@ -5,15 +5,15 @@ destructors io io.backend io.encodings.utf8 io.files kernel
|
||||||
kernel.private math sequences threads.private ;
|
kernel.private math sequences threads.private ;
|
||||||
in: io.streams.c
|
in: io.streams.c
|
||||||
|
|
||||||
PRIMITIVE: (fopen) ( path mode -- alien )
|
PRIMITIVE: (fopen) ( path mode -- alien ) ;
|
||||||
PRIMITIVE: fclose ( alien -- )
|
PRIMITIVE: fclose ( alien -- ) ;
|
||||||
PRIMITIVE: fflush ( alien -- )
|
PRIMITIVE: fflush ( alien -- ) ;
|
||||||
PRIMITIVE: fgetc ( alien -- byte/f )
|
PRIMITIVE: fgetc ( alien -- byte/f ) ;
|
||||||
PRIMITIVE: fputc ( byte alien -- )
|
PRIMITIVE: fputc ( byte alien -- ) ;
|
||||||
PRIMITIVE: fread-unsafe ( n buf alien -- count )
|
PRIMITIVE: fread-unsafe ( n buf alien -- count ) ;
|
||||||
PRIMITIVE: fseek ( alien offset whence -- )
|
PRIMITIVE: fseek ( alien offset whence -- ) ;
|
||||||
PRIMITIVE: ftell ( alien -- n )
|
PRIMITIVE: ftell ( alien -- n ) ;
|
||||||
PRIMITIVE: fwrite ( data length alien -- )
|
PRIMITIVE: fwrite ( data length alien -- ) ;
|
||||||
|
|
||||||
TUPLE: c-stream < disposable handle ;
|
TUPLE: c-stream < disposable handle ;
|
||||||
|
|
||||||
|
|
|
@ -7,58 +7,58 @@ BUILTIN: callstack ;
|
||||||
BUILTIN: tuple ;
|
BUILTIN: tuple ;
|
||||||
BUILTIN: wrapper { wrapped read-only } ;
|
BUILTIN: wrapper { wrapped read-only } ;
|
||||||
|
|
||||||
PRIMITIVE: -rot ( x y z -- z x y )
|
PRIMITIVE: -rot ( x y z -- z x y ) ;
|
||||||
PRIMITIVE: dup ( x -- x x )
|
PRIMITIVE: dup ( x -- x x ) ;
|
||||||
PRIMITIVE: dupd ( x y -- x x y )
|
PRIMITIVE: dupd ( x y -- x x y ) ;
|
||||||
PRIMITIVE: drop ( x -- )
|
PRIMITIVE: drop ( x -- ) ;
|
||||||
PRIMITIVE: nip ( x y -- y )
|
PRIMITIVE: nip ( x y -- y ) ;
|
||||||
PRIMITIVE: over ( x y -- x y x )
|
PRIMITIVE: over ( x y -- x y x ) ;
|
||||||
PRIMITIVE: pick ( x y z -- x y z x )
|
PRIMITIVE: pick ( x y z -- x y z x ) ;
|
||||||
PRIMITIVE: rot ( x y z -- y z x )
|
PRIMITIVE: rot ( x y z -- y z x ) ;
|
||||||
PRIMITIVE: swap ( x y -- y x )
|
PRIMITIVE: swap ( x y -- y x ) ;
|
||||||
PRIMITIVE: swapd ( x y z -- y x z )
|
PRIMITIVE: swapd ( x y z -- y x z ) ;
|
||||||
PRIMITIVE: 2drop ( x y -- )
|
PRIMITIVE: 2drop ( x y -- ) ;
|
||||||
PRIMITIVE: 2dup ( x y -- x y x y )
|
PRIMITIVE: 2dup ( x y -- x y x y ) ;
|
||||||
PRIMITIVE: 2nip ( x y z -- z )
|
PRIMITIVE: 2nip ( x y z -- z ) ;
|
||||||
PRIMITIVE: 3drop ( x y z -- )
|
PRIMITIVE: 3drop ( x y z -- ) ;
|
||||||
PRIMITIVE: 3dup ( x y z -- x y z x y z )
|
PRIMITIVE: 3dup ( x y z -- x y z x y z ) ;
|
||||||
PRIMITIVE: 4drop ( w x y z -- )
|
PRIMITIVE: 4drop ( w x y z -- ) ;
|
||||||
PRIMITIVE: 4dup ( w x y z -- w x y z w x y z )
|
PRIMITIVE: 4dup ( w x y z -- w x y z w x y z ) ;
|
||||||
|
|
||||||
PRIMITIVE: (clone) ( obj -- newobj )
|
PRIMITIVE: (clone) ( obj -- newobj ) ;
|
||||||
PRIMITIVE: eq? ( obj1 obj2 -- ? )
|
PRIMITIVE: eq? ( obj1 obj2 -- ? ) ;
|
||||||
PRIMITIVE: <wrapper> ( obj -- wrapper )
|
PRIMITIVE: <wrapper> ( obj -- wrapper ) ;
|
||||||
PRIMITIVE: die ( -- )
|
PRIMITIVE: die ( -- ) ;
|
||||||
PRIMITIVE: callstack>array ( callstack -- array )
|
PRIMITIVE: callstack>array ( callstack -- array ) ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: (call) ( quot -- )
|
PRIMITIVE: (call) ( quot -- ) ;
|
||||||
PRIMITIVE: (execute) ( word -- )
|
PRIMITIVE: (execute) ( word -- ) ;
|
||||||
PRIMITIVE: (identity-hashcode) ( obj -- code )
|
PRIMITIVE: (identity-hashcode) ( obj -- code ) ;
|
||||||
PRIMITIVE: become ( old new -- )
|
PRIMITIVE: become ( old new -- ) ;
|
||||||
PRIMITIVE: c-to-factor ( -- )
|
PRIMITIVE: c-to-factor ( -- ) ;
|
||||||
PRIMITIVE: callstack-bounds ( -- start end )
|
PRIMITIVE: callstack-bounds ( -- start end ) ;
|
||||||
PRIMITIVE: check-datastack ( array in# out# -- ? )
|
PRIMITIVE: check-datastack ( array in# out# -- ? ) ;
|
||||||
PRIMITIVE: compute-identity-hashcode ( obj -- )
|
PRIMITIVE: compute-identity-hashcode ( obj -- ) ;
|
||||||
PRIMITIVE: context-object ( n -- obj )
|
PRIMITIVE: context-object ( n -- obj ) ;
|
||||||
PRIMITIVE: fpu-state ( -- )
|
PRIMITIVE: fpu-state ( -- ) ;
|
||||||
PRIMITIVE: innermost-frame-executing ( callstack -- obj )
|
PRIMITIVE: innermost-frame-executing ( callstack -- obj ) ;
|
||||||
PRIMITIVE: innermost-frame-scan ( callstack -- n )
|
PRIMITIVE: innermost-frame-scan ( callstack -- n ) ;
|
||||||
PRIMITIVE: lazy-jit-compile ( -- )
|
PRIMITIVE: lazy-jit-compile ( -- ) ;
|
||||||
PRIMITIVE: leaf-signal-handler ( -- )
|
PRIMITIVE: leaf-signal-handler ( -- ) ;
|
||||||
PRIMITIVE: set-callstack ( callstack -- * )
|
PRIMITIVE: set-callstack ( callstack -- * ) ;
|
||||||
PRIMITIVE: set-context-object ( obj n -- )
|
PRIMITIVE: set-context-object ( obj n -- ) ;
|
||||||
PRIMITIVE: set-datastack ( array -- )
|
PRIMITIVE: set-datastack ( array -- ) ;
|
||||||
PRIMITIVE: set-fpu-state ( -- )
|
PRIMITIVE: set-fpu-state ( -- ) ;
|
||||||
PRIMITIVE: set-innermost-frame-quotation ( n callstack -- )
|
PRIMITIVE: set-innermost-frame-quotation ( n callstack -- ) ;
|
||||||
PRIMITIVE: set-retainstack ( array -- )
|
PRIMITIVE: set-retainstack ( array -- ) ;
|
||||||
PRIMITIVE: set-special-object ( obj n -- )
|
PRIMITIVE: set-special-object ( obj n -- ) ;
|
||||||
PRIMITIVE: signal-handler ( -- )
|
PRIMITIVE: signal-handler ( -- ) ;
|
||||||
PRIMITIVE: special-object ( n -- obj )
|
PRIMITIVE: special-object ( n -- obj ) ;
|
||||||
PRIMITIVE: strip-stack-traces ( -- )
|
PRIMITIVE: strip-stack-traces ( -- ) ;
|
||||||
PRIMITIVE: tag ( object -- n )
|
PRIMITIVE: tag ( object -- n ) ;
|
||||||
PRIMITIVE: unimplemented ( -- * )
|
PRIMITIVE: unimplemented ( -- * ) ;
|
||||||
PRIMITIVE: unwind-native-frames ( -- )
|
PRIMITIVE: unwind-native-frames ( -- ) ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
DEFER: dip
|
DEFER: dip
|
||||||
|
@ -453,9 +453,9 @@ CONSTANT: ERROR-FP-TRAP 17
|
||||||
CONSTANT: ERROR-INTERRUPT 18
|
CONSTANT: ERROR-INTERRUPT 18
|
||||||
CONSTANT: ERROR-CALLBACK-SPACE-OVERFLOW 19
|
CONSTANT: ERROR-CALLBACK-SPACE-OVERFLOW 19
|
||||||
|
|
||||||
PRIMITIVE: callstack-for ( context -- array )
|
PRIMITIVE: callstack-for ( context -- array ) ;
|
||||||
PRIMITIVE: retainstack-for ( context -- array )
|
PRIMITIVE: retainstack-for ( context -- array ) ;
|
||||||
PRIMITIVE: datastack-for ( context -- array )
|
PRIMITIVE: datastack-for ( context -- array ) ;
|
||||||
|
|
||||||
: context ( -- context )
|
: context ( -- context )
|
||||||
CONTEXT-OBJ-CONTEXT context-object ; inline
|
CONTEXT-OBJ-CONTEXT context-object ; inline
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
USING: slots.private ;
|
USING: slots.private ;
|
||||||
in: locals.backend
|
in: locals.backend
|
||||||
|
|
||||||
PRIMITIVE: drop-locals ( n -- )
|
PRIMITIVE: drop-locals ( n -- ) ;
|
||||||
PRIMITIVE: get-local ( n -- obj )
|
PRIMITIVE: get-local ( n -- obj ) ;
|
||||||
PRIMITIVE: load-local ( obj -- )
|
PRIMITIVE: load-local ( obj -- ) ;
|
||||||
PRIMITIVE: load-locals ( ... n -- )
|
PRIMITIVE: load-locals ( ... n -- ) ;
|
||||||
|
|
||||||
: local-value ( box -- value ) 2 slot ; inline
|
: local-value ( box -- value ) 2 slot ; inline
|
||||||
|
|
||||||
|
|
|
@ -7,72 +7,72 @@ BUILTIN: fixnum ;
|
||||||
BUILTIN: bignum ;
|
BUILTIN: bignum ;
|
||||||
BUILTIN: float ;
|
BUILTIN: float ;
|
||||||
|
|
||||||
PRIMITIVE: bits>double ( n -- x )
|
PRIMITIVE: bits>double ( n -- x ) ;
|
||||||
PRIMITIVE: bits>float ( n -- x )
|
PRIMITIVE: bits>float ( n -- x ) ;
|
||||||
PRIMITIVE: double>bits ( x -- n )
|
PRIMITIVE: double>bits ( x -- n ) ;
|
||||||
PRIMITIVE: float>bits ( x -- n )
|
PRIMITIVE: float>bits ( x -- n ) ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: bignum* ( x y -- z )
|
PRIMITIVE: bignum* ( x y -- z ) ;
|
||||||
PRIMITIVE: bignum+ ( x y -- z )
|
PRIMITIVE: bignum+ ( x y -- z ) ;
|
||||||
PRIMITIVE: bignum- ( x y -- z )
|
PRIMITIVE: bignum- ( x y -- z ) ;
|
||||||
PRIMITIVE: bignum-bit? ( x n -- ? )
|
PRIMITIVE: bignum-bit? ( x n -- ? ) ;
|
||||||
PRIMITIVE: bignum-bitand ( x y -- z )
|
PRIMITIVE: bignum-bitand ( x y -- z ) ;
|
||||||
PRIMITIVE: bignum-bitnot ( x -- y )
|
PRIMITIVE: bignum-bitnot ( x -- y ) ;
|
||||||
PRIMITIVE: bignum-bitor ( x y -- z )
|
PRIMITIVE: bignum-bitor ( x y -- z ) ;
|
||||||
PRIMITIVE: bignum-bitxor ( x y -- z )
|
PRIMITIVE: bignum-bitxor ( x y -- z ) ;
|
||||||
PRIMITIVE: bignum-gcd ( x y -- z )
|
PRIMITIVE: bignum-gcd ( x y -- z ) ;
|
||||||
PRIMITIVE: bignum-log2 ( x -- n )
|
PRIMITIVE: bignum-log2 ( x -- n ) ;
|
||||||
PRIMITIVE: bignum-mod ( x y -- z )
|
PRIMITIVE: bignum-mod ( x y -- z ) ;
|
||||||
PRIMITIVE: bignum-shift ( x y -- z )
|
PRIMITIVE: bignum-shift ( x y -- z ) ;
|
||||||
PRIMITIVE: bignum/i ( x y -- z )
|
PRIMITIVE: bignum/i ( x y -- z ) ;
|
||||||
PRIMITIVE: bignum/mod ( x y -- z w )
|
PRIMITIVE: bignum/mod ( x y -- z w ) ;
|
||||||
PRIMITIVE: bignum< ( x y -- ? )
|
PRIMITIVE: bignum< ( x y -- ? ) ;
|
||||||
PRIMITIVE: bignum<= ( x y -- ? )
|
PRIMITIVE: bignum<= ( x y -- ? ) ;
|
||||||
PRIMITIVE: bignum= ( x y -- ? )
|
PRIMITIVE: bignum= ( x y -- ? ) ;
|
||||||
PRIMITIVE: bignum> ( x y -- ? )
|
PRIMITIVE: bignum> ( x y -- ? ) ;
|
||||||
PRIMITIVE: bignum>= ( x y -- ? )
|
PRIMITIVE: bignum>= ( x y -- ? ) ;
|
||||||
PRIMITIVE: bignum>fixnum ( x -- y )
|
PRIMITIVE: bignum>fixnum ( x -- y ) ;
|
||||||
PRIMITIVE: bignum>fixnum-strict ( x -- y )
|
PRIMITIVE: bignum>fixnum-strict ( x -- y ) ;
|
||||||
PRIMITIVE: both-fixnums? ( x y -- ? )
|
PRIMITIVE: both-fixnums? ( x y -- ? ) ;
|
||||||
PRIMITIVE: fixnum* ( x y -- z )
|
PRIMITIVE: fixnum* ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum*fast ( x y -- z )
|
PRIMITIVE: fixnum*fast ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum+ ( x y -- z )
|
PRIMITIVE: fixnum+ ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum+fast ( x y -- z )
|
PRIMITIVE: fixnum+fast ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum- ( x y -- z )
|
PRIMITIVE: fixnum- ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum-bitand ( x y -- z )
|
PRIMITIVE: fixnum-bitand ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum-bitnot ( x -- y )
|
PRIMITIVE: fixnum-bitnot ( x -- y ) ;
|
||||||
PRIMITIVE: fixnum-bitor ( x y -- z )
|
PRIMITIVE: fixnum-bitor ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum-bitxor ( x y -- z )
|
PRIMITIVE: fixnum-bitxor ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum-fast ( x y -- z )
|
PRIMITIVE: fixnum-fast ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum-mod ( x y -- z )
|
PRIMITIVE: fixnum-mod ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum-shift ( x y -- z )
|
PRIMITIVE: fixnum-shift ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum-shift-fast ( x y -- z )
|
PRIMITIVE: fixnum-shift-fast ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum/i ( x y -- z )
|
PRIMITIVE: fixnum/i ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum/i-fast ( x y -- z )
|
PRIMITIVE: fixnum/i-fast ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum/mod ( x y -- z w )
|
PRIMITIVE: fixnum/mod ( x y -- z w ) ;
|
||||||
PRIMITIVE: fixnum/mod-fast ( x y -- z w )
|
PRIMITIVE: fixnum/mod-fast ( x y -- z w ) ;
|
||||||
PRIMITIVE: fixnum< ( x y -- ? )
|
PRIMITIVE: fixnum< ( x y -- ? ) ;
|
||||||
PRIMITIVE: fixnum<= ( x y -- z )
|
PRIMITIVE: fixnum<= ( x y -- z ) ;
|
||||||
PRIMITIVE: fixnum> ( x y -- ? )
|
PRIMITIVE: fixnum> ( x y -- ? ) ;
|
||||||
PRIMITIVE: fixnum>= ( x y -- ? )
|
PRIMITIVE: fixnum>= ( x y -- ? ) ;
|
||||||
PRIMITIVE: fixnum>bignum ( x -- y )
|
PRIMITIVE: fixnum>bignum ( x -- y ) ;
|
||||||
PRIMITIVE: fixnum>float ( x -- y )
|
PRIMITIVE: fixnum>float ( x -- y ) ;
|
||||||
PRIMITIVE: float* ( x y -- z )
|
PRIMITIVE: float* ( x y -- z ) ;
|
||||||
PRIMITIVE: float+ ( x y -- z )
|
PRIMITIVE: float+ ( x y -- z ) ;
|
||||||
PRIMITIVE: float- ( x y -- z )
|
PRIMITIVE: float- ( x y -- z ) ;
|
||||||
PRIMITIVE: float-u< ( x y -- ? )
|
PRIMITIVE: float-u< ( x y -- ? ) ;
|
||||||
PRIMITIVE: float-u<= ( x y -- ? )
|
PRIMITIVE: float-u<= ( x y -- ? ) ;
|
||||||
PRIMITIVE: float-u> ( x y -- ? )
|
PRIMITIVE: float-u> ( x y -- ? ) ;
|
||||||
PRIMITIVE: float-u>= ( x y -- ? )
|
PRIMITIVE: float-u>= ( x y -- ? ) ;
|
||||||
PRIMITIVE: float/f ( x y -- z )
|
PRIMITIVE: float/f ( x y -- z ) ;
|
||||||
PRIMITIVE: float< ( x y -- ? )
|
PRIMITIVE: float< ( x y -- ? ) ;
|
||||||
PRIMITIVE: float<= ( x y -- ? )
|
PRIMITIVE: float<= ( x y -- ? ) ;
|
||||||
PRIMITIVE: float= ( x y -- ? )
|
PRIMITIVE: float= ( x y -- ? ) ;
|
||||||
PRIMITIVE: float> ( x y -- ? )
|
PRIMITIVE: float> ( x y -- ? ) ;
|
||||||
PRIMITIVE: float>= ( x y -- ? )
|
PRIMITIVE: float>= ( x y -- ? ) ;
|
||||||
PRIMITIVE: float>bignum ( x -- y )
|
PRIMITIVE: float>bignum ( x -- y ) ;
|
||||||
PRIMITIVE: float>fixnum ( x -- y )
|
PRIMITIVE: float>fixnum ( x -- y ) ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
GENERIC: >fixnum ( x -- n ) foldable
|
GENERIC: >fixnum ( x -- n ) foldable
|
||||||
|
|
|
@ -6,7 +6,7 @@ strings strings.private ;
|
||||||
in: math.parser
|
in: math.parser
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: (format-float) ( n fill width precision format locale -- byte-array )
|
PRIMITIVE: (format-float) ( n fill width precision format locale -- byte-array ) ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
: digit> ( ch -- n )
|
: digit> ( ch -- n )
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
USING: alien.strings io.backend kernel sequences system ;
|
USING: alien.strings io.backend kernel sequences system ;
|
||||||
in: memory
|
in: memory
|
||||||
|
|
||||||
PRIMITIVE: all-instances ( -- array )
|
PRIMITIVE: all-instances ( -- array ) ;
|
||||||
PRIMITIVE: compact-gc ( -- )
|
PRIMITIVE: compact-gc ( -- ) ;
|
||||||
PRIMITIVE: gc ( -- )
|
PRIMITIVE: gc ( -- ) ;
|
||||||
PRIMITIVE: minor-gc ( -- )
|
PRIMITIVE: minor-gc ( -- ) ;
|
||||||
PRIMITIVE: size ( obj -- n )
|
PRIMITIVE: size ( obj -- n ) ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: (save-image) ( path1 path2 then-die? -- )
|
PRIMITIVE: (save-image) ( path1 path2 then-die? -- ) ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
: instances ( quot -- seq )
|
: instances ( quot -- seq )
|
||||||
|
|
|
@ -9,12 +9,12 @@ BUILTIN: quotation
|
||||||
cached-effect
|
cached-effect
|
||||||
cache-counter ;
|
cache-counter ;
|
||||||
|
|
||||||
PRIMITIVE: jit-compile ( quot -- )
|
PRIMITIVE: jit-compile ( quot -- ) ;
|
||||||
PRIMITIVE: quotation-code ( quot -- start end )
|
PRIMITIVE: quotation-code ( quot -- start end ) ;
|
||||||
PRIMITIVE: quotation-compiled? ( quot -- ? )
|
PRIMITIVE: quotation-compiled? ( quot -- ? ) ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: array>quotation ( array -- quot )
|
PRIMITIVE: array>quotation ( array -- quot ) ;
|
||||||
|
|
||||||
: uncurry ( curry -- obj quot )
|
: uncurry ( curry -- obj quot )
|
||||||
{ curry } declare dup 2 slot swap 3 slot ; inline
|
{ curry } declare dup 2 slot swap 3 slot ; inline
|
||||||
|
|
|
@ -8,8 +8,8 @@ slots.private strings words ;
|
||||||
in: slots
|
in: slots
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: set-slot ( value obj n -- )
|
PRIMITIVE: set-slot ( value obj n -- ) ;
|
||||||
PRIMITIVE: slot ( obj m -- value )
|
PRIMITIVE: slot ( obj m -- value ) ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
TUPLE: slot-spec name offset class initial read-only ;
|
TUPLE: slot-spec name offset class initial read-only ;
|
||||||
|
|
|
@ -7,12 +7,12 @@ in: strings
|
||||||
|
|
||||||
BUILTIN: string { length array-capacity read-only initial: 0 } aux ;
|
BUILTIN: string { length array-capacity read-only initial: 0 } aux ;
|
||||||
|
|
||||||
PRIMITIVE: <string> ( n ch -- string )
|
PRIMITIVE: <string> ( n ch -- string ) ;
|
||||||
PRIMITIVE: resize-string ( n str -- newstr )
|
PRIMITIVE: resize-string ( n str -- newstr ) ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: set-string-nth-fast ( ch n string -- )
|
PRIMITIVE: set-string-nth-fast ( ch n string -- ) ;
|
||||||
PRIMITIVE: string-nth-fast ( n string -- ch )
|
PRIMITIVE: string-nth-fast ( n string -- ch ) ;
|
||||||
|
|
||||||
: string-hashcode ( str -- n ) 3 slot ; inline
|
: string-hashcode ( str -- n ) 3 slot ; inline
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ in: bootstrap.syntax
|
||||||
|
|
||||||
"PRIMITIVE:" [
|
"PRIMITIVE:" [
|
||||||
current-vocab name>>
|
current-vocab name>>
|
||||||
scan-word scan-effect ensure-primitive
|
scan-word scan-effect ";" expect ensure-primitive
|
||||||
] define-core-syntax
|
] define-core-syntax
|
||||||
|
|
||||||
"CS{" [
|
"CS{" [
|
||||||
|
|
|
@ -4,8 +4,8 @@ USING: assocs continuations init io kernel kernel.private make
|
||||||
math math.parser namespaces sequences ;
|
math math.parser namespaces sequences ;
|
||||||
in: system
|
in: system
|
||||||
|
|
||||||
PRIMITIVE: (exit) ( n -- * )
|
PRIMITIVE: (exit) ( n -- * ) ;
|
||||||
PRIMITIVE: nano-count ( -- ns )
|
PRIMITIVE: nano-count ( -- ns ) ;
|
||||||
|
|
||||||
SINGLETONS: x86.32 x86.64 arm ppc.32 ppc.64 ;
|
SINGLETONS: x86.32 x86.64 arm ppc.32 ppc.64 ;
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,11 @@ BUILTIN: word
|
||||||
{ def quotation initial: [ ] } props pic-def pic-tail-def
|
{ def quotation initial: [ ] } props pic-def pic-tail-def
|
||||||
{ sub-primitive read-only } ;
|
{ sub-primitive read-only } ;
|
||||||
|
|
||||||
PRIMITIVE: word-code ( word -- start end )
|
PRIMITIVE: word-code ( word -- start end ) ;
|
||||||
PRIMITIVE: word-optimized? ( word -- ? )
|
PRIMITIVE: word-optimized? ( word -- ? ) ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: (word) ( name vocab hashcode -- word )
|
PRIMITIVE: (word) ( name vocab hashcode -- word ) ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
! Need a dummy word here because BUILTIN: word is not a real word
|
! Need a dummy word here because BUILTIN: word is not a real word
|
||||||
|
|
|
@ -8,13 +8,13 @@ quotations sequences strings system ;
|
||||||
IN: threads
|
IN: threads
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: (set-context) ( obj context -- obj' )
|
PRIMITIVE: (set-context) ( obj context -- obj' ) ;
|
||||||
PRIMITIVE: (set-context-and-delete) ( obj context -- * )
|
PRIMITIVE: (set-context-and-delete) ( obj context -- * ) ;
|
||||||
PRIMITIVE: (sleep) ( nanos -- )
|
PRIMITIVE: (sleep) ( nanos -- ) ;
|
||||||
PRIMITIVE: (start-context) ( obj quot -- obj' )
|
PRIMITIVE: (start-context) ( obj quot -- obj' ) ;
|
||||||
PRIMITIVE: (start-context-and-delete) ( obj quot -- * )
|
PRIMITIVE: (start-context-and-delete) ( obj quot -- * ) ;
|
||||||
|
|
||||||
PRIMITIVE: context-object-for ( n context -- obj )
|
PRIMITIVE: context-object-for ( n context -- obj ) ;
|
||||||
|
|
||||||
! Wrap sub-primitives; we don't want them inlined into callers
|
! Wrap sub-primitives; we don't want them inlined into callers
|
||||||
! since their behavior depends on what frames are on the callstack
|
! since their behavior depends on what frames are on the callstack
|
||||||
|
|
|
@ -5,8 +5,8 @@ vm tools.dispatch.private ;
|
||||||
IN: tools.dispatch
|
IN: tools.dispatch
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: dispatch-stats ( -- stats )
|
PRIMITIVE: dispatch-stats ( -- stats ) ;
|
||||||
PRIMITIVE: reset-dispatch-stats ( -- )
|
PRIMITIVE: reset-dispatch-stats ( -- ) ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
SYMBOL: last-dispatch-stats
|
SYMBOL: last-dispatch-stats
|
||||||
|
|
|
@ -9,12 +9,12 @@ splitting strings system vm words hints hashtables ;
|
||||||
IN: tools.memory
|
IN: tools.memory
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: (callback-room) ( -- allocator-room )
|
PRIMITIVE: (callback-room) ( -- allocator-room ) ;
|
||||||
PRIMITIVE: (code-blocks) ( -- array )
|
PRIMITIVE: (code-blocks) ( -- array ) ;
|
||||||
PRIMITIVE: (code-room) ( -- allocator-room )
|
PRIMITIVE: (code-room) ( -- allocator-room ) ;
|
||||||
PRIMITIVE: (data-room) ( -- data-room )
|
PRIMITIVE: (data-room) ( -- data-room ) ;
|
||||||
PRIMITIVE: disable-gc-events ( -- events )
|
PRIMITIVE: disable-gc-events ( -- events ) ;
|
||||||
PRIMITIVE: enable-gc-events ( -- )
|
PRIMITIVE: enable-gc-events ( -- ) ;
|
||||||
|
|
||||||
: commas ( n -- str )
|
: commas ( n -- str )
|
||||||
dup 0 < [ neg commas "-" prepend ] [
|
dup 0 < [ neg commas "-" prepend ] [
|
||||||
|
|
|
@ -7,8 +7,8 @@ sequences sequences.generalizations sets sorting ;
|
||||||
IN: tools.profiler.sampling
|
IN: tools.profiler.sampling
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
PRIMITIVE: (get-samples) ( -- samples/f )
|
PRIMITIVE: (get-samples) ( -- samples/f ) ;
|
||||||
PRIMITIVE: profiling ( ? -- )
|
PRIMITIVE: profiling ( ? -- ) ;
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
SYMBOL: samples-per-second
|
SYMBOL: samples-per-second
|
||||||
|
|
Loading…
Reference in New Issue