Move compile-call and related words only meant to be used for debugging to compiler.test
parent
892522f8bd
commit
f804c9c422
|
@ -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
|
||||
|
|
|
@ -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." } ;
|
||||
|
|
|
@ -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 ;
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Slava Pestov
|
|
@ -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 ;
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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 ;
|
||||
|
|
|
@ -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 ;
|
||||
|
|
|
@ -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 ( -- )
|
||||
|
|
|
@ -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 ;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ] [
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue