]> gitweb.factorcode.org Git - factor.git/commitdiff
Move compile-call and related words only meant to be used for debugging to compiler...
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 22 Jan 2010 11:39:56 +0000 (00:39 +1300)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 22 Jan 2010 11:39:56 +0000 (00:39 +1300)
17 files changed:
basis/cocoa/cocoa-tests.factor
basis/compiler/compiler-docs.factor
basis/compiler/compiler.factor
basis/compiler/test/authors.txt [new file with mode: 0644]
basis/compiler/test/test.factor [new file with mode: 0644]
basis/compiler/tests/codegen.factor
basis/compiler/tests/curry.factor
basis/compiler/tests/float.factor
basis/compiler/tests/intrinsics.factor
basis/compiler/tests/optimizer.factor
basis/compiler/tests/simple.factor
basis/compiler/tests/tuples.factor
basis/math/floats/env/env-tests.factor
basis/math/vectors/conversion/conversion-tests.factor
basis/math/vectors/simd/simd-tests.factor
basis/tools/profiler/profiler-tests.factor
basis/tools/time/time-tests.factor

index 892d5ea38d2be1a0bd80f7c310bbc5ed2690baca..f35d151ad4bf939a0e2e22418d9c76bb038b4024 100644 (file)
@@ -1,5 +1,5 @@
 USING: cocoa cocoa.messages cocoa.subclassing cocoa.types
-compiler kernel namespaces cocoa.classes cocoa.runtime
+compiler.test kernel namespaces cocoa.classes cocoa.runtime
 tools.test memory compiler.units math core-graphics.types ;
 FROM: alien.c-types => int void ;
 IN: cocoa.tests
index f59d4fb027389b14a4e5c7c6fcb0ac955652d9e5..42d4edcc109b2a2fe1fac1436d5aef69e965e374 100644 (file)
@@ -16,11 +16,7 @@ ARTICLE: "compiler-usage" "Calling the optimizing compiler"
     disable-optimizer
     enable-optimizer
 }
-"Removing a word's optimized definition:"
-{ $subsections decompile }
-"Compiling a single quotation:"
-{ $subsections compile-call }
-"Higher-level words can be found in " { $link "compilation-units" } "." ;
+"More words can be found in " { $link "compilation-units" } "." ;
 
 ARTICLE: "compiler-impl" "Compiler implementation"
 "The " { $vocab-link "compiler" } "vocabulary, in addition to providing the user-visible words of the compiler, implements the main compilation loop."
@@ -72,8 +68,3 @@ HELP: compile-word
 HELP: optimizing-compiler
 { $description "Singleton class implementing " { $link recompile } " to call the optimizing compiler." }
 { $notes "This is an internal word, and user code should call " { $link compile } " instead." } ;
-
-HELP: compile-call
-{ $values { "quot" quotation } }
-{ $description "Compiles and runs a quotation." }
-{ $notes "This word is used by compiler unit tests to test compilation of small pieces of code." } ;
index 2375d8575d39f847359d837c951abea0df04157a..bf9b049127e8727f6a997782849ff7589e20a87a 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2004, 2009 Slava Pestov.
+! Copyright (C) 2004, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors kernel namespaces arrays sequences io words fry
 continuations vocabs assocs dlists definitions math graphs generic
@@ -181,14 +181,6 @@ t compile-dependencies? set-global
 : compile-loop ( deque -- )
     [ compile-word yield-hook get call( -- ) ] slurp-deque ;
 
-: decompile ( word -- )
-    dup def>> 2array 1array modify-code-heap ;
-
-: compile-call ( quot -- )
-    [ dup infer define-temp ] with-compilation-unit execute ;
-
-\ compile-call t "no-compile" set-word-prop
-
 SINGLETON: optimizing-compiler
 
 M: optimizing-compiler recompile ( words -- alist )
@@ -220,6 +212,3 @@ M: optimizing-compiler process-forgotten-words
 
 : disable-optimizer ( -- )
     f compiler-impl set-global ;
-
-: recompile-all ( -- )
-    all-words compile ;
diff --git a/basis/compiler/test/authors.txt b/basis/compiler/test/authors.txt
new file mode 100644 (file)
index 0000000..d4f5d6b
--- /dev/null
@@ -0,0 +1 @@
+Slava Pestov
\ No newline at end of file
diff --git a/basis/compiler/test/test.factor b/basis/compiler/test/test.factor
new file mode 100644 (file)
index 0000000..66e3f39
--- /dev/null
@@ -0,0 +1,19 @@
+! Copyright (C) 2010 Slava Pestov.
+! See http://factorcode.org/license.txt for BSD license.
+USING: accessors arrays compiler.units kernel stack-checker
+sequences vocabs words tools.test tools.test.private ;
+IN: compiler.test
+
+: decompile ( word -- )
+    dup def>> 2array 1array modify-code-heap ;
+
+: recompile-all ( -- )
+    all-words compile ;
+
+: compile-call ( quot -- )
+    [ dup infer define-temp ] with-compilation-unit execute ;
+
+\ compile-call t "no-compile" set-word-prop
+
+: compiler-test ( name -- )
+    "resource:basis/compiler/tests/" ".factor" surround run-test-file ;
index cff685eaf6e7066d059a0704561a15c1c1ed7c93..288940e660e82a747dfaf32fee49a88de95d207e 100644 (file)
@@ -1,4 +1,4 @@
-USING: generalizations accessors arrays compiler kernel
+USING: generalizations accessors arrays compiler.test kernel
 kernel.private math hashtables.private math.private namespaces
 sequences tools.test namespaces.private slots.private
 sequences.private byte-arrays alien alien.accessors layouts
index b541e19f34bf6c904ad30db38bb56843b604677f..ddbd9ba6463fefb49bcb5874660e89d9254b6744 100644 (file)
@@ -1,5 +1,5 @@
 USING: tools.test quotations math kernel sequences
-assocs namespaces make compiler.units compiler ;
+assocs namespaces make compiler.units compiler.test ;
 IN: compiler.tests.curry
 
 [ 3 ] [ 5 [ [ 2 - ] curry call ] compile-call ] unit-test
index 632a560c0df9834f7a27f854678f0115be408d73..0d4e30279e3d65fe656c58d8045e79794bea5e94 100644 (file)
@@ -1,5 +1,6 @@
-USING: compiler.units compiler kernel kernel.private memory math
-math.private tools.test math.floats.private math.order fry ;
+USING: compiler.units compiler.test kernel kernel.private memory
+math math.private tools.test math.floats.private math.order fry
+;
 IN: compiler.tests.float
 
 [ 5.0 ] [ [ 5.0 ] compile-call gc gc gc ] unit-test
index 1c066f26a336c866e419ddf1bfdba4a6ba0a9d40..53017ff45231449876c4e7346372d6149b32e6f6 100644 (file)
@@ -4,7 +4,7 @@ strings tools.test words continuations sequences.private
 hashtables.private byte-arrays system random layouts vectors
 sbufs strings.private slots.private alien math.order
 alien.accessors alien.c-types alien.data alien.syntax alien.strings
-namespaces libc io.encodings.ascii classes compiler ;
+namespaces libc io.encodings.ascii classes compiler.test ;
 FROM: math => float ;
 IN: compiler.tests.intrinsics
 
index 865cd639a356583633aa93018d5eac11356a63b2..fe67cbbc37bb33a9d60aade18bdfd3a074ba9e29 100644 (file)
@@ -4,7 +4,7 @@ sbufs strings tools.test vectors words sequences.private
 quotations classes classes.algebra classes.tuple.private
 continuations growable namespaces hints alien.accessors
 compiler.tree.builder compiler.tree.optimizer sequences.deep
-compiler definitions generic.single shuffle math.order ;
+compiler.test definitions generic.single shuffle math.order ;
 IN: compiler.tests.optimizer
 
 GENERIC: xyz ( obj -- obj )
index a86d5b8c520d98977b31f5f44d4a26288001011a..df67cadd78c5d4f849943381815414ab8b5e24db 100644 (file)
@@ -1,4 +1,4 @@
-USING: compiler compiler.units tools.test kernel kernel.private
+USING: compiler.test compiler.units tools.test kernel kernel.private
 sequences.private math.private math combinators strings alien
 arrays memory vocabs parser eval quotations compiler.errors
 definitions ;
index 3d6301249f41ee44be25b1eb97f9e08450b4f94d..978c27768fc69855f742cc0f6e843126c5bcbe98 100644 (file)
@@ -1,4 +1,4 @@
-USING: kernel tools.test compiler.units compiler ;
+USING: kernel tools.test compiler.units compiler.test ;
 IN: compiler.tests.tuples
 
 TUPLE: color red green blue ;
index 3c21b0cf3eab2f4f489b126bbd5fec2f7b8e3e89..89aa1bd394bbf41d3a3b7cf776f4138c02ea9488 100644 (file)
@@ -1,7 +1,7 @@
 USING: kernel math math.floats.env math.floats.env.private
 math.functions math.libm sequences tools.test locals
-compiler.units kernel.private fry compiler math.private words
-system ;
+compiler.units kernel.private fry compiler.test math.private
+words system ;
 IN: math.floats.env.tests
 
 : set-default-fp-env ( -- )
index c91bdb369e015fd41dd7cd7e2a3cd7f150a508fa..d46f062d9cdce38a9a55bfd5c52098776d8f84a1 100644 (file)
@@ -1,5 +1,5 @@
 ! (c)Joe Groff bsd license
-USING: accessors arrays compiler continuations generalizations
+USING: accessors arrays compiler.test continuations generalizations
 kernel kernel.private locals math.vectors.conversion math.vectors.simd
 sequences stack-checker tools.test ;
 FROM: alien.c-types => char uchar short ushort int uint longlong ulonglong float double ;
index 342c565dcebe16590a4ac58b76835b3dd3616ef5..1d19c76dc1ac871e2d64a90d9fff72a12dd5cc9a 100644 (file)
@@ -1,4 +1,4 @@
-USING: accessors arrays classes compiler compiler.tree.debugger
+USING: accessors arrays classes compiler.test compiler.tree.debugger
 effects fry io kernel kernel.private math math.functions
 math.private math.vectors math.vectors.simd
 math.vectors.simd.private prettyprint random sequences system
index 8f3260d649bfbe40ebe9cd7eac11f0f1077c4da4..1a8ff824d6dad422b3acc796b6c9ff2d7aca4602 100644 (file)
@@ -1,6 +1,6 @@
 USING: accessors tools.profiler tools.test kernel memory math
 threads alien alien.c-types tools.profiler.private sequences
-compiler compiler.units words ;
+compiler.test compiler.units words ;
 IN: tools.profiler.tests
 
 [ t ] [
index 00c774663caa685e691ee8002f62077a9872021d..3df61cbd3680950f5dba23ffefa2fed3c79493f6 100644 (file)
@@ -1,4 +1,4 @@
 IN: tools.time.tests
-USING: tools.time tools.test compiler ;
+USING: tools.time tools.test compiler.test ;
 
 [ ] [ [ [ ] time ] compile-call ] unit-test