diff --git a/basis/calendar/calendar-docs.factor b/basis/calendar/calendar-docs.factor index 8cb1e751b2..b774e79b8b 100644 --- a/basis/calendar/calendar-docs.factor +++ b/basis/calendar/calendar-docs.factor @@ -32,7 +32,7 @@ HELP: month-names { $warning "Do not use this array for looking up a month name directly. Use month-name instead." } ; HELP: month-name -{ $values { "n" integer } { "string" string } } +{ $values { "obj" { $or integer timestamp } } { "string" string } } { $description "Looks up the month name and returns it as a string. January has an index of 1 instead of zero." } ; HELP: month-abbreviations @@ -46,11 +46,11 @@ HELP: month-abbreviation HELP: day-names -{ $values { "array" array } } +{ $values { "value" array } } { $description "Returns an array with the English names of the days of the week." } ; HELP: day-name -{ $values { "n" integer } { "string" string } } +{ $values { "obj" { $or integer timestamp } } { "string" string } } { $description "Looks up the day name and returns it as a string." } ; HELP: day-abbreviations2 diff --git a/basis/quoted-printable/quoted-printable-tests.factor b/basis/quoted-printable/quoted-printable-tests.factor index 5825ebe252..2a3239c72f 100644 --- a/basis/quoted-printable/quoted-printable-tests.factor +++ b/basis/quoted-printable/quoted-printable-tests.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2009 Daniel Ehrenberg ! See http://factorcode.org/license.txt for BSD license. USING: tools.test quoted-printable io.encodings.string -sequences splitting kernel ; +sequences splitting kernel io.encodings.8-bit.latin2 ; IN: quoted-printable.tests [ """José was the diff --git a/basis/tools/deploy/deploy-tests.factor b/basis/tools/deploy/deploy-tests.factor index 784b034665..9244f06b4e 100644 --- a/basis/tools/deploy/deploy-tests.factor +++ b/basis/tools/deploy/deploy-tests.factor @@ -5,32 +5,32 @@ io.launcher arrays namespaces continuations layouts accessors urls math.parser io.directories tools.deploy.test ; IN: tools.deploy.tests -[ t ] [ "hello-world" shake-and-bake 500000 small-enough? ] unit-test +[ ] [ "hello-world" shake-and-bake 500000 small-enough? ] unit-test -[ t ] [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test +[ ] [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test -[ t ] [ "hello-ui" shake-and-bake 1300000 small-enough? ] unit-test +[ ] [ "hello-ui" shake-and-bake 1300000 small-enough? ] unit-test [ "staging.math-threads-compiler-ui.image" ] [ "hello-ui" deploy-config [ bootstrap-profile staging-image-name file-name ] bind ] unit-test -[ t ] [ "maze" shake-and-bake 1200000 small-enough? ] unit-test +[ ] [ "maze" shake-and-bake 1200000 small-enough? ] unit-test -[ t ] [ "tetris" shake-and-bake 1500000 small-enough? ] unit-test +[ ] [ "tetris" shake-and-bake 1500000 small-enough? ] unit-test -[ t ] [ "spheres" shake-and-bake 1500000 small-enough? ] unit-test +[ ] [ "spheres" shake-and-bake 1500000 small-enough? ] unit-test -[ t ] [ "terrain" shake-and-bake 1700000 small-enough? ] unit-test +[ ] [ "terrain" shake-and-bake 1700000 small-enough? ] unit-test -[ t ] [ "bunny" shake-and-bake 2500000 small-enough? ] unit-test +[ ] [ "bunny" shake-and-bake 2500000 small-enough? ] unit-test os macosx? [ - [ t ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test + [ ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test ] when -[ t ] [ "benchmark.regex-dna" shake-and-bake 900000 small-enough? ] unit-test +[ ] [ "benchmark.regex-dna" shake-and-bake 900000 small-enough? ] unit-test { "tools.deploy.test.1" diff --git a/basis/tools/deploy/test/test.factor b/basis/tools/deploy/test/test.factor index c799ec615e..d8414baba7 100755 --- a/basis/tools/deploy/test/test.factor +++ b/basis/tools/deploy/test/test.factor @@ -10,14 +10,16 @@ IN: tools.deploy.test dup deploy-config make-deploy-image ] with-directory ; -: small-enough? ( n -- ? ) +ERROR: image-too-big actual-size max-size ; + +: small-enough? ( n -- ) [ "test.image" temp-file file-info size>> ] [ cell 4 / * cpu ppc? [ 100000 + ] when os windows? [ 150000 + ] when ] bi* - <= ; + 2dup <= [ 2drop ] [ image-too-big ] if ; : deploy-test-command ( -- args ) os macosx? diff --git a/basis/tools/profiler/profiler-tests.factor b/basis/tools/profiler/profiler-tests.factor index 7f44a6138c..6e5177fbae 100644 --- a/basis/tools/profiler/profiler-tests.factor +++ b/basis/tools/profiler/profiler-tests.factor @@ -60,7 +60,7 @@ IN: tools.profiler.tests [ [ gensym execute ] profile ] [ T{ undefined } = ] must-fail-with -: crash-bug-1 ( -- x ) "hi" "bye" ; +: crash-bug-1 ( -- x ) "hi" ; : crash-bug-2 ( -- ) 100000 [ crash-bug-1 drop ] times ; [ ] [ [ crash-bug-2 ] profile ] unit-test diff --git a/core/bootstrap/primitives.factor b/core/bootstrap/primitives.factor index 97c66530a0..ae668ed54f 100644 --- a/core/bootstrap/primitives.factor +++ b/core/bootstrap/primitives.factor @@ -55,6 +55,8 @@ num-types get f builtins set bootstrapping? on +[ + ! Create some empty vocabs where the below primitives and ! classes will go { @@ -524,3 +526,5 @@ tuple ! Bump build number "build" "kernel" create build 1 + [ ] curry (( -- n )) define-declared + +] with-compilation-unit diff --git a/core/bootstrap/stage1.factor b/core/bootstrap/stage1.factor index 1a2cdf6a70..88434cef55 100644 --- a/core/bootstrap/stage1.factor +++ b/core/bootstrap/stage1.factor @@ -14,7 +14,8 @@ IN: bootstrap.stage1 load-help? off { "resource:core" } vocab-roots set -! Create a boot quotation for the target +! Create a boot quotation for the target by collecting all top-level +! forms into a quotation, surrounded by some boilerplate. [ [ ! Rehash hashtables first, since bootstrap.image creates diff --git a/core/classes/algebra/algebra-tests.factor b/core/classes/algebra/algebra-tests.factor index e2f4d4305f..c016b0169b 100644 --- a/core/classes/algebra/algebra-tests.factor +++ b/core/classes/algebra/algebra-tests.factor @@ -39,6 +39,9 @@ INTERSECTION: generic-class generic class ; UNION: union-with-one-member a ; +MIXIN: mixin-with-one-member +INSTANCE: union-with-one-member mixin-with-one-member + ! class<= [ t ] [ \ fixnum \ integer class<= ] unit-test [ t ] [ \ fixnum \ fixnum class<= ] unit-test @@ -176,6 +179,22 @@ UNION: union-with-one-member a ; [ f ] [ sa sb classes-intersect? ] unit-test +[ t ] [ a union-with-one-member classes-intersect? ] unit-test +[ f ] [ fixnum union-with-one-member classes-intersect? ] unit-test +[ t ] [ object union-with-one-member classes-intersect? ] unit-test + +[ t ] [ union-with-one-member a classes-intersect? ] unit-test +[ f ] [ union-with-one-member fixnum classes-intersect? ] unit-test +[ t ] [ union-with-one-member object classes-intersect? ] unit-test + +[ t ] [ a mixin-with-one-member classes-intersect? ] unit-test +[ f ] [ fixnum mixin-with-one-member classes-intersect? ] unit-test +[ t ] [ object mixin-with-one-member classes-intersect? ] unit-test + +[ t ] [ mixin-with-one-member a classes-intersect? ] unit-test +[ f ] [ mixin-with-one-member fixnum classes-intersect? ] unit-test +[ t ] [ mixin-with-one-member object classes-intersect? ] unit-test + ! class= [ t ] [ null class-not object class= ] unit-test diff --git a/core/classes/algebra/algebra.factor b/core/classes/algebra/algebra.factor index c08239849f..e98470cd83 100755 --- a/core/classes/algebra/algebra.factor +++ b/core/classes/algebra/algebra.factor @@ -36,8 +36,8 @@ GENERIC: (flatten-class) ( class -- ) : normalize-class ( class -- class' ) { - { [ dup members ] [ members ] } - { [ dup participants ] [ participants ] } + { [ dup members ] [ members normalize-class ] } + { [ dup participants ] [ participants normalize-class ] } [ ] } cond ; diff --git a/core/hashtables/hashtables.factor b/core/hashtables/hashtables.factor index 9faf587b51..e31ed925d1 100644 --- a/core/hashtables/hashtables.factor +++ b/core/hashtables/hashtables.factor @@ -115,9 +115,7 @@ M: hashtable assoc-size ( hash -- n ) [ count>> ] [ deleted>> ] bi - ; inline : rehash ( hash -- ) - dup >alist [ - dup clear-assoc - ] dip (rehash) ; + dup >alist [ dup clear-assoc ] dip (rehash) ; M: hashtable set-at ( value key hash -- ) dup ?grow-hash diff --git a/core/memory/memory-tests.factor b/core/memory/memory-tests.factor index 8ecf673b8a..45e6090e77 100755 --- a/core/memory/memory-tests.factor +++ b/core/memory/memory-tests.factor @@ -31,4 +31,4 @@ TUPLE: testing x y z ; 2 [ [ [ 3 throw ] instances ] must-fail ] times ! Bug found on Windows build box, having too many words in the image breaks 'become' -[ ] [ 100000 [ f f ] replicate { } { } become drop ] unit-test +[ ] [ 100000 [ f ] replicate { } { } become drop ] unit-test diff --git a/core/words/words-docs.factor b/core/words/words-docs.factor index d88761db1f..a13bfb0740 100644 --- a/core/words/words-docs.factor +++ b/core/words/words-docs.factor @@ -238,7 +238,8 @@ $low-level-note HELP: ( name vocab -- word ) { $values { "name" string } { "vocab" string } { "word" word } } -{ $description "Allocates an uninterned word with the specified name and vocabulary, and a blank word property hashtable. User code should call " { $link gensym } " to create uninterned words and " { $link create } " to create interned words." } ; +{ $description "Allocates an uninterned word with the specified name and vocabulary, and a blank word property hashtable. User code should call " { $link gensym } " to create uninterned words and " { $link create } " to create interned words." } +{ $notes "This word must be called from inside " { $link with-compilation-unit } "." } ; HELP: gensym { $values { "word" word } } @@ -279,12 +280,14 @@ HELP: check-create HELP: create { $values { "name" string } { "vocab" string } { "word" word } } -{ $description "Creates a new word. If the vocabulary already contains a word with the requested name, outputs the existing word. The vocabulary must exist already; if it does not, you must call " { $link create-vocab } " first." } ; +{ $description "Creates a new word. If the vocabulary already contains a word with the requested name, outputs the existing word. The vocabulary must exist already; if it does not, you must call " { $link create-vocab } " first." } +{ $notes "This word must be called from inside " { $link with-compilation-unit } ". Parsing words should call " { $link create-in } " instead of this word." } ; HELP: constructor-word { $values { "name" string } { "vocab" string } { "word" word } } { $description "Creates a new word, surrounding " { $snippet "name" } " in angle brackets." } -{ $examples { $example "USING: prettyprint words ;" "\"salmon\" \"scratchpad\" constructor-word ." "" } } ; +{ $notes "This word must be called from inside " { $link with-compilation-unit } "." } +{ $examples { $example "USING: compiler.units prettyprint words ;" "[ \"salmon\" \"scratchpad\" constructor-word ] with-compilation-unit ." "" } } ; { POSTPONE: FORGET: forget forget* forget-vocab } related-words diff --git a/core/words/words-tests.factor b/core/words/words-tests.factor index fec9c14830..cb4ecb1e06 100755 --- a/core/words/words-tests.factor +++ b/core/words/words-tests.factor @@ -25,7 +25,8 @@ DEFER: plist-test \ plist-test "sample-property" word-prop ] unit-test -"create-test" "scratchpad" create { 1 2 } "testing" set-word-prop +[ ] [ [ "create-test" "scratchpad" create { 1 2 } "testing" set-word-prop ] with-compilation-unit ] unit-test + [ { 1 2 } ] [ "create-test" "scratchpad" lookup "testing" word-prop ] unit-test @@ -33,7 +34,7 @@ DEFER: plist-test [ [ t ] [ \ array? "array?" "arrays" lookup = ] unit-test - [ ] [ "test-scope" "scratchpad" create drop ] unit-test + [ ] [ [ "test-scope" "scratchpad" create drop ] with-compilation-unit ] unit-test ] with-scope [ "test-scope" ] [ @@ -67,7 +68,7 @@ FORGET: another-forgotten DEFER: x [ x ] [ undefined? ] must-fail-with -[ ] [ "no-loc" "words.tests" create drop ] unit-test +[ ] [ [ "no-loc" "words.tests" create drop ] with-compilation-unit ] unit-test [ f ] [ "no-loc" "words.tests" lookup where ] unit-test [ ] [ "IN: words.tests : no-loc-2 ( -- ) ;" eval( -- ) ] unit-test diff --git a/extra/multi-methods/tests/definitions.factor b/extra/multi-methods/tests/definitions.factor index a483a492b3..b0ab2c1bc3 100644 --- a/extra/multi-methods/tests/definitions.factor +++ b/extra/multi-methods/tests/definitions.factor @@ -6,14 +6,14 @@ DEFER: fake \ fake H{ } clone "multi-methods" set-word-prop << (( -- )) \ fake set-stack-effect >> -[ "fake-{ }" ] [ { } \ fake method-word-name ] unit-test - -[ H{ { "multi-method-generic" fake } { "multi-method-specializer" { } } } ] -[ { } \ fake method-word-props ] unit-test - -[ t ] [ { } \ fake method-body? ] unit-test - [ + [ "fake-{ }" ] [ { } \ fake method-word-name ] unit-test + + [ H{ { "multi-method-generic" fake } { "multi-method-specializer" { } } } ] + [ { } \ fake method-word-props ] unit-test + + [ t ] [ { } \ fake method-body? ] unit-test + [ { } [ ] ] [ \ fake methods prepare-methods [ sort-methods ] dip ] unit-test [ t ] [ { } \ fake multi-dispatch-quot callable? ] unit-test diff --git a/vm/full_collector.cpp b/vm/full_collector.cpp index 4edb23cf73..188ab55efc 100644 --- a/vm/full_collector.cpp +++ b/vm/full_collector.cpp @@ -127,7 +127,11 @@ void factor_vm::collect_full(bool trace_contexts_p) collect_mark_impl(trace_contexts_p); collect_sweep_impl(); if(data->low_memory_p()) + { + current_gc->op = collect_compact_op; + current_gc->event->op = collect_compact_op; collect_compact_impl(trace_contexts_p); + } else update_code_heap_words_and_literals(); }