diff --git a/core/alien/compiler/compiler.factor b/core/alien/compiler/compiler.factor index 51240a66d9..54348e47f9 100755 --- a/core/alien/compiler/compiler.factor +++ b/core/alien/compiler/compiler.factor @@ -5,7 +5,8 @@ hashtables kernel math namespaces sequences words inference.state inference.backend inference.dataflow system math.parser classes alien.arrays alien.c-types alien.structs alien.syntax cpu.architecture alien inspector quotations assocs -kernel.private threads continuations.private libc combinators ; +kernel.private threads continuations.private libc combinators +compiler.errors continuations ; IN: alien.compiler ! Common protocol for alien-invoke/alien-callback/alien-indirect @@ -207,9 +208,21 @@ M: alien-invoke-error summary swap alien-node-parameters parameter-sizes drop number>string 3append ; +TUPLE: no-such-library name ; + +M: no-such-library summary + drop "Library not found" ; + +: no-such-library ( name -- ) + \ no-such-library +linkage+ (inference-error) ; + : (alien-invoke-dlsym) ( node -- symbol dll ) dup alien-invoke-function - swap alien-invoke-library load-library ; + swap alien-invoke-library [ + load-library + ] [ + 2drop no-such-library + ] recover ; TUPLE: no-such-symbol ; @@ -217,7 +230,7 @@ M: no-such-symbol summary drop "Symbol not found" ; : no-such-symbol ( -- ) - \ no-such-symbol inference-error ; + \ no-such-symbol +linkage+ (inference-error) ; : alien-invoke-dlsym ( node -- symbol dll ) dup (alien-invoke-dlsym) 2dup dlsym [ diff --git a/core/bootstrap/image/image.factor b/core/bootstrap/image/image.factor index 7452e31cf8..7c12b3ea60 100755 --- a/core/bootstrap/image/image.factor +++ b/core/bootstrap/image/image.factor @@ -7,7 +7,7 @@ strings sbufs vectors words quotations assocs system layouts splitting growable classes tuples words.private io.binary io.files vocabs vocabs.loader source-files definitions debugger float-arrays quotations.private -combinators.private combinators ; +sequences.private combinators ; IN: bootstrap.image : my-arch ( -- arch ) @@ -136,7 +136,7 @@ SYMBOL: undefined-quot : here-as ( tag -- pointer ) here swap bitor ; : align-here ( -- ) - here 8 mod 4 = [ 0 emit ] when ; + here 8 mod 4 = [ heap-size drop 0 emit ] when ; : emit-fixnum ( n -- ) tag-fixnum emit ; @@ -177,6 +177,7 @@ GENERIC: ' ( obj -- ptr ) [ dup bignum-bits neg shift swap bignum-radix bitand ] [ ] unfold nip ; +USE: continuations : emit-bignum ( n -- ) dup 0 < [ 1 swap neg ] [ 0 swap ] if bignum>seq dup length 1+ emit-fixnum @@ -214,10 +215,6 @@ M: f ' : 1, 1 >bignum ' 1-offset fixup ; : -1, -1 >bignum ' -1-offset fixup ; -! Beginning of the image - -: begin-image ( -- ) emit-header t, 0, 1, -1, ; - ! Words : emit-word ( word -- ) @@ -385,7 +382,10 @@ M: curry ' : fixup-header ( -- ) heap-size data-heap-size-offset fixup ; -: end-image ( -- ) +: build-image ( -- image ) + 800000 image set + 20000 objects set + emit-header t, 0, 1, -1, "Serializing words..." print flush emit-words "Serializing JIT data..." print flush @@ -400,7 +400,8 @@ M: curry ' fixup-header "Image length: " write image get length . "Object cache size: " write objects get assoc-size . - \ word global delete-at ; + \ word global delete-at + image get ; ! Image output @@ -411,28 +412,23 @@ M: curry ' [ >le write ] curry each ] if ; -: write-image ( image filename -- ) - "Writing image to " write dup write "..." print flush +: write-image ( image -- ) + "Writing image to " write + architecture get boot-image-name resource-path + dup write "..." print flush [ (write-image) ] with-stream ; -: prepare-image ( -- ) - bootstrapping? on - load-help? off - 800000 image set - 20000 objects set ; - PRIVATE> : make-image ( arch -- ) - architecture [ - prepare-image - begin-image + [ + architecture set + bootstrapping? on + load-help? off "resource:/core/bootstrap/stage1.factor" run-file - end-image - image get - architecture get boot-image-name resource-path + build-image write-image - ] with-variable ; + ] with-scope ; : make-images ( -- ) images [ make-image ] each ; diff --git a/core/bootstrap/stage1.factor b/core/bootstrap/stage1.factor index cc328e9760..4f5bf6d69e 100755 --- a/core/bootstrap/stage1.factor +++ b/core/bootstrap/stage1.factor @@ -38,7 +38,7 @@ vocabs.loader system ; [ "resource:core/bootstrap/stage2.factor" - dup ?resource-path exists? [ + dup resource-exists? [ run-file ] [ "Cannot find " write write "." print diff --git a/core/classes/classes.factor b/core/classes/classes.factor index 151429bf69..345676e106 100755 --- a/core/classes/classes.factor +++ b/core/classes/classes.factor @@ -20,7 +20,9 @@ PREDICATE: class tuple-class : classes ( -- seq ) classclass ( n -- class ) builtins get nth ; +: type>class ( n -- class ) builtins get-global nth ; + +: bootstrap-type>class ( n -- class ) builtins get nth ; : predicate-word ( word -- predicate ) [ word-name "?" append ] keep word-vocabulary create ; diff --git a/core/combinators/combinators-docs.factor b/core/combinators/combinators-docs.factor old mode 100644 new mode 100755 index 4cea78bc97..d91c920def --- a/core/combinators/combinators-docs.factor +++ b/core/combinators/combinators-docs.factor @@ -1,6 +1,6 @@ USING: arrays help.markup help.syntax strings sbufs vectors kernel quotations generic generic.standard classes -math assocs sequences combinators.private ; +math assocs sequences sequences.private ; IN: combinators ARTICLE: "combinators-quot" "Quotation construction utilities" diff --git a/core/combinators/combinators.factor b/core/combinators/combinators.factor index f532f06293..0ba8b583be 100755 --- a/core/combinators/combinators.factor +++ b/core/combinators/combinators.factor @@ -4,12 +4,6 @@ IN: combinators USING: arrays sequences sequences.private math.private kernel kernel.private math assocs quotations vectors ; - - TUPLE: no-cond ; : no-cond ( -- * ) \ no-cond construct-empty throw ; diff --git a/core/compiler/compiler-tests.factor b/core/compiler/compiler-tests.factor deleted file mode 100755 index 7e4e79437d..0000000000 --- a/core/compiler/compiler-tests.factor +++ /dev/null @@ -1,7 +0,0 @@ -IN: temporary -USING: tools.browser tools.test kernel sequences vocabs ; - -"compiler.test" child-vocabs empty? [ - "compiler.test" load-children - "compiler.test" test -] when diff --git a/core/compiler/errors/errors-docs.factor b/core/compiler/errors/errors-docs.factor index 13fc0d3103..678face309 100755 --- a/core/compiler/errors/errors-docs.factor +++ b/core/compiler/errors/errors-docs.factor @@ -1,14 +1,15 @@ IN: compiler.errors USING: help.markup help.syntax vocabs.loader words io -quotations ; +quotations compiler.errors.private ; ARTICLE: "compiler-errors" "Compiler warnings and errors" -"The compiler saves compile warnings and errors in a global variable:" +"The compiler saves various notifications in a global variable:" { $subsection compiler-errors } -"The warnings and errors can be viewed later:" -{ $subsection :warnings } +"These notifications can be viewed later:" { $subsection :errors } -"Normally, all warnings and errors are displayed at the end of a batch compilation, such as a call to " { $link require } " or " { $link refresh-all } ". This can be controlled with a combinator:" +{ $subsection :warnings } +{ $subsection :linkage } +"Words such as " { $link require } " and " { $link refresh-all } " use a combinator which counts errors and prints a report at the end:" { $link with-compiler-errors } ; HELP: compiler-errors @@ -16,7 +17,7 @@ HELP: compiler-errors HELP: compiler-error { $values { "error" "an error" } { "word" word } } -{ $description "If inside a " { $link with-compiler-errors } ", saves the error for future persual via " { $link :errors } " and " { $link :warnings } ", otherwise ignores the error." } ; +{ $description "If inside a " { $link with-compiler-errors } ", saves the error for future persual via " { $link :errors } ", " { $link :warnings } " and " { $link :linkage } ". If not inside a " { $link with-compiler-errors } ", ignores the error." } ; HELP: compiler-error. { $values { "error" "an error" } { "word" word } } @@ -25,24 +26,18 @@ HELP: compiler-error. HELP: compiler-errors. { $values { "errors" "an assoc mapping words to errors" } } { $description "Prints a set of compiler errors to the " { $link stdio } " stream." } ; - -HELP: (:errors) -{ $values { "seq" "an alist" } } -{ $description "Outputs all serious compiler errors from the most recent compile." } ; - HELP: :errors { $description "Prints all serious compiler errors from the most recent compile to the " { $link stdio } " stream." } ; -HELP: (:warnings) -{ $values { "seq" "an alist" } } -{ $description "Outputs all ignorable compiler warnings from the most recent compile." } ; - HELP: :warnings { $description "Prints all ignorable compiler warnings from the most recent compile to the " { $link stdio } " stream." } ; -{ :errors (:errors) :warnings (:warnings) } related-words +HELP: :linkage +{ $description "Prints all C library interface linkage errors from the most recent compile to the " { $link stdio } " stream." } ; + +{ :errors :warnings } related-words HELP: with-compiler-errors { $values { "quot" quotation } } -{ $description "Calls the quotation and collects any compiler warnings and errors. Compiler warnings and errors are summarized at the end and can be viewed with " { $link :warnings } " and " { $link :errors } "." } +{ $description "Calls the quotation and collects any compiler warnings and errors. Compiler warnings and errors are summarized at the end and can be viewed with " { $link :errors } ", " { $link :warnings } ", and " { $link :linkage } "." } { $notes "Nested calls to " { $link with-compiler-errors } " are ignored, and only the outermost call collects warnings and errors." } ; diff --git a/core/compiler/errors/errors.factor b/core/compiler/errors/errors.factor index 363c13c478..b7b599e5a9 100755 --- a/core/compiler/errors/errors.factor +++ b/core/compiler/errors/errors.factor @@ -4,51 +4,66 @@ USING: kernel namespaces assocs prettyprint io sequences sorting continuations debugger math math.parser ; IN: compiler.errors +SYMBOL: +error+ +SYMBOL: +warning+ +SYMBOL: +linkage+ + +GENERIC: compiler-error-type ( error -- ? ) + +M: object compiler-error-type drop +error+ ; + +alist sort-keys [ swap compiler-error. ] assoc-each ; - -GENERIC: compiler-warning? ( error -- ? ) - -M: object compiler-warning? drop f ; - -: (:errors) ( -- assoc ) +: errors-of-type ( type -- assoc ) compiler-errors get-global - [ nip compiler-warning? not ] assoc-subset ; + swap [ >r nip compiler-error-type r> eq? ] curry + assoc-subset ; -: :errors (:errors) compiler-errors. ; +: compiler-errors. ( type -- ) + errors-of-type >alist sort-keys + [ swap compiler-error. ] assoc-each ; -: (:warnings) ( -- seq ) - compiler-errors get-global - [ nip compiler-warning? ] assoc-subset ; - -: :warnings (:warnings) compiler-errors. ; - -: (compiler-report) ( what assoc -- ) - length dup zero? [ 2drop ] [ +: (compiler-report) ( what type word -- ) + over errors-of-type assoc-empty? [ 3drop ] [ [ - ":" % over % " - print " % # " compiler " % % "." % + ":" % + % + " - print " % + errors-of-type assoc-size # + " " % + % + "." % ] "" make print ] if ; : compiler-report ( -- ) - "errors" (:errors) (compiler-report) - "warnings" (:warnings) (compiler-report) ; + "semantic errors" +error+ "errors" (compiler-report) + "semantic warnings" +warning+ "warnings" (compiler-report) + "linkage errors" +linkage+ "linkage" (compiler-report) ; + +PRIVATE> + +: compiler-error ( error word -- ) + with-compiler-errors? get [ + compiler-errors get pick + [ set-at ] [ delete-at drop ] if + ] [ 2drop ] if ; + +: :errors +error+ compiler-errors. ; + +: :warnings +warning+ compiler-errors. ; + +: :linkage +linkage+ compiler-errors. ; : with-compiler-errors ( quot -- ) with-compiler-errors? get "quiet" get or [ call ] [ diff --git a/core/compiler/test/curry/curry.factor b/core/compiler/test/curry/curry.factor deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/core/compiler/test/float/float.factor b/core/compiler/test/float/float.factor deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/core/compiler/test/intrinsics/intrinsics.factor b/core/compiler/test/intrinsics/intrinsics.factor deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/core/compiler/test/redefine/redefine-tests.factor b/core/compiler/test/redefine/redefine-tests.factor deleted file mode 100755 index 9eaf2d1263..0000000000 --- a/core/compiler/test/redefine/redefine-tests.factor +++ /dev/null @@ -1,287 +0,0 @@ -USING: compiler definitions generic assocs inference math -namespaces parser tools.test words kernel sequences arrays io -effects tools.test compiler.units inference.state ; -IN: temporary - -DEFER: x-1 -DEFER: x-2 - -[ [ f ] { } map>assoc modify-code-heap ] recompile-hook [ - "IN: temporary USE: math GENERIC: x-1 ( x -- y ) M: integer x-1 ;" eval - "IN: temporary : x-2 3 x-1 ;" eval - - [ t ] [ - { x-2 } compile - - \ x-2 word-xt - - { x-1 } compile - - \ x-2 word-xt = - ] unit-test -] with-variable - -DEFER: b -DEFER: c - -[ ] [ "IN: temporary : a 1 2 ; : b a a ;" eval ] unit-test - -[ 1 2 1 2 ] [ "USE: temporary b" eval ] unit-test - -{ 0 4 } [ b ] must-infer-as - -[ ] [ "IN: temporary : a 1 2 3 ;" eval ] unit-test - -[ 1 2 3 1 2 3 ] [ "USE: temporary b" eval ] unit-test - -{ 0 6 } [ b ] must-infer-as - -\ b word-xt "b-xt" set - -[ ] [ "IN: temporary : c b ;" eval ] unit-test - -[ t ] [ "b-xt" get \ b word-xt = ] unit-test - -\ c word-xt "c-xt" set - -[ ] [ "IN: temporary : a 1 2 4 ;" eval ] unit-test - -[ t ] [ "c-xt" get \ c word-xt = ] unit-test - -[ 1 2 4 1 2 4 ] [ "USE: temporary c" eval ] unit-test - -[ ] [ "IN: temporary : a 1 2 ;" eval ] unit-test - -{ 0 4 } [ c ] must-infer-as - -[ f ] [ "c-xt" get \ c word-xt = ] unit-test - -[ 1 2 1 2 ] [ "USE: temporary c" eval ] unit-test - -[ ] [ "IN: temporary : d 3 ; inline" eval ] unit-test - -[ ] [ "IN: temporary : e d d ;" eval ] unit-test - -[ 3 3 ] [ "USE: temporary e" eval ] unit-test - -[ ] [ "IN: temporary : d 4 ; inline" eval ] unit-test - -[ 4 4 ] [ "USE: temporary e" eval ] unit-test - -DEFER: x-3 - -[ ] [ "IN: temporary : x-3 3 ;" eval ] unit-test - -DEFER: x-4 - -[ ] [ "IN: temporary : x-4 x-3 ;" eval ] unit-test - -[ t ] [ \ x-4 compiled? ] unit-test - -[ ] [ "IN: temporary USE: sequences : x-3 { } [ ] each ;" eval ] unit-test - -[ f ] [ \ x-3 compiled? ] unit-test - -[ f ] [ \ x-4 compiled? ] unit-test - -[ ] [ "IN: temporary USING: kernel sequences ; : x-3 { } [ drop ] each ;" eval ] unit-test - -[ t ] [ \ x-3 compiled? ] unit-test - -[ t ] [ \ x-4 compiled? ] unit-test - -[ t ] [ \ x-3 "compiled-uses" word-prop >boolean ] unit-test - -DEFER: g-test-1 - -DEFER: g-test-3 - -[ ] [ "IN: temporary USE: math GENERIC: g-test-1 ( x -- y ) M: integer g-test-1 sq ;" eval ] unit-test - -[ ] [ "IN: temporary : g-test-2 ( -- y ) 3 g-test-1 ;" eval ] unit-test - -[ ] [ "IN: temporary : g-test-3 ( -- y ) g-test-2 ;" eval ] unit-test - -[ 25 ] [ 5 g-test-1 ] unit-test - -[ ] [ "IN: temporary USE: math GENERIC: g-test-1 ( x -- y ) M: integer g-test-1 ;" eval ] unit-test - -[ 5 ] [ 5 g-test-1 ] unit-test - -[ t ] [ - \ g-test-3 word-xt - - "IN: temporary USE: math GENERIC: g-test-1 ( x -- y ) M: integer g-test-1 3 + ;" eval - - \ g-test-3 word-xt = -] unit-test - -DEFER: g-test-5 - -[ ] [ "IN: temporary : g-test-4 ( -- y ) 3 g-test-1 ; inline" eval ] unit-test - -[ ] [ "IN: temporary : g-test-5 ( -- y ) g-test-4 ;" eval ] unit-test - -[ 6 ] [ g-test-5 ] unit-test - -[ ] [ "IN: temporary USE: math GENERIC: g-test-1 ( x -- y ) M: integer g-test-1 10 + ;" eval ] unit-test - -[ 13 ] [ g-test-5 ] unit-test - -DEFER: g-test-6 - -[ ] [ "IN: temporary USING: arrays kernel ; GENERIC: g-test-6 ( x -- y ) M: array g-test-6 drop 123 g-test-1 ;" eval ] unit-test - -DEFER: g-test-7 - -[ ] [ "IN: temporary : g-test-7 { } g-test-6 ;" eval ] unit-test - -[ 133 ] [ g-test-7 ] unit-test - -[ ] [ "IN: temporary USE: math GENERIC: g-test-1 ( x -- y ) M: integer g-test-1 15 + ;" eval ] unit-test - -[ 138 ] [ g-test-7 ] unit-test - -USE: macros - -DEFER: macro-test-3 - -[ ] [ "IN: temporary USING: macros math ; : macro-test-1 sq ;" eval ] unit-test - -[ ] [ "IN: temporary USING: macros arrays quotations ; MACRO: macro-test-2 ( n word -- quot ) >quotation ;" eval ] unit-test - -[ ] [ "IN: temporary : macro-test-3 2 \\ macro-test-1 macro-test-2 ;" eval ] unit-test - -[ 625 ] [ 5 macro-test-3 ] unit-test - -[ ] [ "IN: temporary USING: macros arrays quotations kernel math ; MACRO: macro-test-2 ( n word -- quot ) 2drop [ 3 + ] ;" eval ] unit-test - -[ 8 ] [ 5 macro-test-3 ] unit-test - -USE: hints - -DEFER: hints-test-2 - -[ ] [ "IN: temporary USING: math hints ; : hints-test-1 3 + ; HINTS: hints-test-1 fixnum ;" eval ] unit-test - -[ ] [ "IN: temporary : hints-test-2 5 hints-test-1 ;" eval ] unit-test - -[ 8 ] [ hints-test-2 ] unit-test - -[ ] [ "IN: temporary USE: math : hints-test-1 5 + ;" eval ] unit-test - -[ 10 ] [ hints-test-2 ] unit-test - -DEFER: inline-then-not-inline-test-1 -DEFER: inline-then-not-inline-test-2 - -[ ] [ "IN: temporary : inline-then-not-inline-test-1 1 2 3 ; inline" eval ] unit-test - -[ ] [ "IN: temporary : inline-then-not-inline-test-2 inline-then-not-inline-test-1 ;" eval ] unit-test - -[ 1 2 3 ] [ inline-then-not-inline-test-2 ] unit-test - -\ inline-then-not-inline-test-2 word-xt "a" set - -[ ] [ "IN: temporary : inline-then-not-inline-test-1 6 6 9 ;" eval ] unit-test - -[ f ] [ \ inline-then-not-inline-test-2 word-xt "a" get = ] unit-test - -[ 6 6 9 ] [ inline-then-not-inline-test-2 ] unit-test - -DEFER: generic-then-not-generic-test-1 -DEFER: generic-then-not-generic-test-2 - -[ ] [ "IN: temporary GENERIC: generic-then-not-generic-test-1 ( a -- b )" eval ] unit-test - -[ ] [ "IN: temporary USE: math M: integer generic-then-not-generic-test-1 sq ;" eval ] unit-test - -[ ] [ "IN: temporary : generic-then-not-generic-test-2 3 generic-then-not-generic-test-1 ;" eval ] unit-test - -[ 9 ] [ generic-then-not-generic-test-2 ] unit-test - -[ ] [ "IN: temporary USE: math : generic-then-not-generic-test-1 1 + ;" eval ] unit-test - -[ 4 ] [ generic-then-not-generic-test-2 ] unit-test - -DEFER: foldable-test-1 -DEFER: foldable-test-2 - -[ ] [ "IN: temporary : foldable-test-1 3 ; foldable" eval ] unit-test - -[ ] [ "IN: temporary : foldable-test-2 foldable-test-1 ;" eval ] unit-test - -[ +inlined+ ] [ \ foldable-test-2 \ foldable-test-1 compiled-usage at ] unit-test - -[ 3 ] [ foldable-test-2 ] unit-test - -[ ] [ "IN: temporary : foldable-test-1 4 ; foldable" eval ] unit-test - -[ 4 ] [ foldable-test-2 ] unit-test - -DEFER: flushable-test-2 - -[ ] [ "IN: temporary USE: kernel : flushable-test-1 drop 3 ; flushable" eval ] unit-test - -[ ] [ "IN: temporary USE: kernel : flushable-test-2 V{ } dup flushable-test-1 drop ;" eval ] unit-test - -[ V{ } ] [ flushable-test-2 ] unit-test - -[ ] [ "IN: temporary USING: kernel sequences ; : flushable-test-1 3 over push ;" eval ] unit-test - -[ V{ 3 } ] [ flushable-test-2 ] unit-test - -: ax ; -: bx ax ; -[ \ bx forget ] with-compilation-unit - -[ f ] [ \ bx \ ax compiled-usage key? ] unit-test - -DEFER: defer-redefine-test-2 - -[ ] [ "IN: temporary DEFER: defer-redefine-test-1" eval ] unit-test - -[ ] [ "IN: temporary : defer-redefine-test-2 defer-redefine-test-1 1 ;" eval ] unit-test - -[ defer-redefine-test-2 ] must-fail - -[ ] [ "IN: temporary : defer-redefine-test-1 2 ;" eval ] unit-test - -[ 2 1 ] [ defer-redefine-test-2 ] unit-test - -! Cross-referencing issue -: compiled-xref-a ; - -: compiled-xref-c ; inline - -GENERIC: compiled-xref-b ( a -- b ) - -TUPLE: c-1 ; - -M: c-1 compiled-xref-b compiled-xref-a compiled-xref-c ; - -TUPLE: c-2 ; - -M: c-2 compiled-xref-b drop 3 ; - -[ t ] [ - \ compiled-xref-a compiled-crossref get key? -] unit-test - -[ ] [ - [ - \ compiled-xref-a forget - ] with-compilation-unit -] unit-test - -[ f ] [ - \ compiled-xref-a compiled-crossref get key? -] unit-test - -[ ] [ - "IN: temporary : compiled-xref-c ; FORGET: { c-2 compiled-xref-b }" eval -] unit-test - -[ f ] [ - \ compiled-xref-a compiled-crossref get key? -] unit-test diff --git a/core/compiler/test/redefine/redefine.factor b/core/compiler/test/redefine/redefine.factor deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/core/compiler/test/simple/simple.factor b/core/compiler/test/simple/simple.factor deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/core/compiler/test/stack-trace/stack-trace.factor b/core/compiler/test/stack-trace/stack-trace.factor deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/core/compiler/test/templates-early/templates-early.factor b/core/compiler/test/templates-early/templates-early.factor deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/core/compiler/test/templates/templates.factor b/core/compiler/test/templates/templates.factor deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/core/compiler/test/tuples/tuples.factor b/core/compiler/test/tuples/tuples.factor deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/core/compiler/test/curry/curry-tests.factor b/core/compiler/tests/curry.factor similarity index 100% rename from core/compiler/test/curry/curry-tests.factor rename to core/compiler/tests/curry.factor diff --git a/core/compiler/test/float/float-tests.factor b/core/compiler/tests/float.factor similarity index 100% rename from core/compiler/test/float/float-tests.factor rename to core/compiler/tests/float.factor diff --git a/core/compiler/test/intrinsics/intrinsics-tests.factor b/core/compiler/tests/intrinsics.factor similarity index 99% rename from core/compiler/test/intrinsics/intrinsics-tests.factor rename to core/compiler/tests/intrinsics.factor index 679938b7f3..5dfe447443 100755 --- a/core/compiler/test/intrinsics/intrinsics-tests.factor +++ b/core/compiler/tests/intrinsics.factor @@ -4,7 +4,7 @@ math.private sequences strings tools.test words continuations sequences.private hashtables.private byte-arrays strings.private system random layouts vectors.private sbufs.private strings.private slots.private alien alien.accessors -alien.c-types alien.syntax namespaces libc combinators.private ; +alien.c-types alien.syntax namespaces libc sequences.private ; ! Make sure that intrinsic ops compile to correct code. [ ] [ 1 [ drop ] compile-call ] unit-test diff --git a/core/compiler/test/simple/simple-tests.factor b/core/compiler/tests/simple.factor similarity index 97% rename from core/compiler/test/simple/simple-tests.factor rename to core/compiler/tests/simple.factor index 3f4f6451a3..1ed43120d3 100755 --- a/core/compiler/test/simple/simple-tests.factor +++ b/core/compiler/tests/simple.factor @@ -1,6 +1,6 @@ USING: compiler tools.test kernel kernel.private -combinators.private math.private math combinators strings -alien arrays ; +sequences.private math.private math combinators strings +alien arrays memory ; IN: temporary ! Test empty word @@ -48,6 +48,8 @@ IN: temporary [ 4 1 3 ] [ 0 [ { [ bar 1 ] [ 3 1 ] } dispatch 3 ] compile-call ] unit-test [ 3 1 3 ] [ 1 [ { [ bar 1 ] [ 3 1 ] } dispatch 3 ] compile-call ] unit-test +[ 2 3 ] [ 1 [ { [ code-gc 1 ] [ code-gc 2 ] } dispatch 3 ] compile-call ] unit-test + ! Labels : recursive ( ? -- ) [ f recursive ] when ; inline diff --git a/core/compiler/test/stack-trace/stack-trace-tests.factor b/core/compiler/tests/stack-trace.factor similarity index 100% rename from core/compiler/test/stack-trace/stack-trace-tests.factor rename to core/compiler/tests/stack-trace.factor diff --git a/core/compiler/test/templates-early/templates-early-tests.factor b/core/compiler/tests/templates-early.factor similarity index 100% rename from core/compiler/test/templates-early/templates-early-tests.factor rename to core/compiler/tests/templates-early.factor diff --git a/core/compiler/test/templates/templates-tests.factor b/core/compiler/tests/templates.factor similarity index 98% rename from core/compiler/test/templates/templates-tests.factor rename to core/compiler/tests/templates.factor index 08e1c98729..74e5ab80a4 100755 --- a/core/compiler/test/templates/templates-tests.factor +++ b/core/compiler/tests/templates.factor @@ -2,7 +2,7 @@ USING: arrays compiler kernel kernel.private math hashtables.private math.private namespaces sequences sequences.private tools.test namespaces.private slots.private -combinators.private byte-arrays alien alien.accessors layouts +sequences.private byte-arrays alien alien.accessors layouts words definitions compiler.units ; IN: temporary diff --git a/core/compiler/test/tuples/tuples-tests.factor b/core/compiler/tests/tuples.factor similarity index 100% rename from core/compiler/test/tuples/tuples-tests.factor rename to core/compiler/tests/tuples.factor diff --git a/core/cpu/architecture/architecture.factor b/core/cpu/architecture/architecture.factor index 4da22ff38a..4bb10b23a2 100755 --- a/core/cpu/architecture/architecture.factor +++ b/core/cpu/architecture/architecture.factor @@ -60,9 +60,7 @@ HOOK: %jump-label compiler-backend ( label -- ) ! Test if vreg is 'f' or not HOOK: %jump-t compiler-backend ( label -- ) -HOOK: %call-dispatch compiler-backend ( -- label ) - -HOOK: %jump-dispatch compiler-backend ( -- ) +HOOK: %dispatch compiler-backend ( -- ) HOOK: %dispatch-label compiler-backend ( word -- ) diff --git a/core/cpu/ppc/architecture/architecture.factor b/core/cpu/ppc/architecture/architecture.factor index 7444c21a8c..1daf3ac622 100755 --- a/core/cpu/ppc/architecture/architecture.factor +++ b/core/cpu/ppc/architecture/architecture.factor @@ -111,20 +111,15 @@ M: ppc-backend %jump-label ( label -- ) B ; M: ppc-backend %jump-t ( label -- ) 0 "flag" operand f v>operand CMPI BNE ; -: (%dispatch) ( len -- ) - 0 11 LOAD32 rc-absolute-ppc-2/2 rel-here - "offset" operand "n" operand 1 SRAWI - 11 11 "offset" operand ADD - 11 dup rot cells LWZ ; - -M: ppc-backend %call-dispatch ( word-table# -- ) - [ 7 (%dispatch) (%call)