USING: accessors compiler cpu.architecture vocabs.loader system
sequences namespaces parser kernel kernel.private classes
classes.private arrays hashtables vectors classes.tuple sbufs
-inference.dataflow hashtables.private sequences.private math
-classes.tuple.private growable namespaces.private assocs words
-generator command-line vocabs io io.encodings.string
-prettyprint libc compiler.units math.order ;
+hashtables.private sequences.private math classes.tuple.private
+growable namespaces.private assocs words command-line vocabs io
+io.encodings.string prettyprint libc compiler.units math.order
+compiler.tree.builder compiler.tree.optimizer ;
IN: bootstrap.compiler
! Don't bring this in when deploying, since it will store a
malloc calloc free memcpy
} compile-uncompiled
+{
+ build-tree optimize-tree
+} compile-uncompiled
+
vocabs [ words compile-uncompiled "." write flush ] each
" done" print flush
! Copyright (C) 2006, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types alien.strings alien.compiler
-arrays assocs combinators compiler inference.transforms kernel
+USING: alien alien.c-types alien.strings
+arrays assocs combinators compiler kernel
math namespaces parser prettyprint prettyprint.sections
quotations sequences strings words cocoa.runtime io macros
memoize debugger io.encodings.ascii effects ;
-USING: kernel sequences math inference accessors macros
+USING: kernel sequences math stack-checker accessors macros
combinators.short-circuit ;
IN: combinators.short-circuit.smart
-USING: generator help.markup help.syntax words io parser
+USING: compiler.generator help.markup help.syntax words io parser
assocs words.private sequences compiler.units ;
IN: compiler
! Copyright (C) 2004, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: kernel namespaces arrays sequences io inference.backend
-inference.state generator debugger words compiler.units
-continuations vocabs assocs alien.compiler dlists optimizer
-definitions math compiler.errors threads graphs generic
-inference combinators dequeues search-dequeues ;
+USING: kernel namespaces arrays sequences io debugger words
+compiler.units continuations vocabs assocs dlists definitions
+math compiler.errors threads graphs generic combinators dequeues
+search-dequeues ;
IN: compiler
SYMBOL: +failed+
IN: compiler.tests
-USING: words kernel inference alien.strings tools.test ;
+USING: words kernel stack-checker alien.strings tools.test ;
[ ] [ \ if redefined [ string>alien ] infer. ] unit-test
! Testing templates machinery without compiling anything
IN: compiler.tests
-USING: compiler generator generator.registers
+USING: compiler compiler.generator compiler.generator.registers
generator.registers.private tools.test namespaces sequences
words kernel math effects definitions compiler.units accessors
cpu.architecture ;
-! Copyright (C) 2005, 2007 Slava Pestov.
+! Copyright (C) 2005, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.c-types cpu.ppc.assembler cpu.architecture generic
kernel kernel.private math memory namespaces sequences words
-assocs generator generator.registers generator.fixup system
-layouts classes words.private alien combinators
-compiler.constants math.order ;
+assocs compiler.generator compiler.generator.registers
+compiler.generator.fixup system layouts classes words.private
+alien combinators compiler.constants math.order ;
IN: cpu.ppc.architecture
! PowerPC register assignments
! Copyright (C) 2005, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: generator.fixup kernel namespaces words io.binary math
-math.order cpu.ppc.assembler.backend ;
+USING: compiler.generator.fixup kernel namespaces words
+io.binary math math.order cpu.ppc.assembler.backend ;
IN: cpu.ppc.assembler
! See the Motorola or IBM documentation for details. The opcode
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: generator.fixup kernel namespaces sequences
+USING: compiler.generator.fixup kernel namespaces sequences
words math math.bitfields io.binary parser lexer ;
IN: cpu.ppc.assembler.backend
! Copyright (C) 2007, 2008 Slava Pestov.\r
! See http://factorcode.org/license.txt for BSD license.\r
USING: bootstrap.image.private kernel kernel.private namespaces\r
-system cpu.ppc.assembler generator.fixup compiler.units\r
+system cpu.ppc.assembler compiler.generator.fixup compiler.units\r
compiler.constants math math.private layouts words words.private\r
vocabs slots.private ;\r
IN: bootstrap.ppc\r
cpu.ppc.assembler cpu.ppc.architecture cpu.ppc.allot
cpu.architecture kernel kernel.private math math.private
namespaces sequences words generic quotations byte-arrays
-hashtables hashtables.private generator generator.registers
-generator.fixup sequences.private sbufs vectors system layouts
-math.floats.private classes slots.private combinators
-compiler.constants optimizer.allot ;
+hashtables hashtables.private compiler.generator
+compiler.generator.registers generator.fixup sequences.private
+sbufs vectors system layouts math.floats.private classes
+slots.private combinators compiler.constants ;
IN: cpu.ppc.intrinsics
: %slot-literal-known-tag
USING: alien.c-types arrays cpu.x86.assembler
cpu.x86.architecture cpu.x86.intrinsics cpu.x86.allot
cpu.architecture kernel kernel.private math namespaces sequences
-generator.registers generator.fixup generator system layouts
-alien.compiler combinators command-line
-compiler compiler.units io vocabs.loader accessors init ;
+compiler.generator.registers compiler.generator.fixup
+compiler.generator system layouts alien.compiler combinators
+command-line compiler compiler.units io vocabs.loader accessors
+init ;
IN: cpu.x86.32
! We implement the FFI for Linux, OS X and Windows all at once.
USING: accessors alien.c-types arrays cpu.x86.assembler
cpu.x86.architecture cpu.x86.intrinsics cpu.x86.sse2
cpu.x86.allot cpu.architecture kernel kernel.private math
-namespaces sequences generator.registers generator.fixup system
-layouts alien alien.accessors alien.compiler alien.structs slots
-splitting assocs ;
+namespaces sequences compiler.generator.registers
+compiler.generator.fixup system layouts alien alien.accessors
+alien.structs slots splitting assocs ;
IN: cpu.x86.64
M: x86.64 ds-reg R14 ;
-! Copyright (C) 2006, 2007 Slava Pestov.
+! Copyright (C) 2006, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel cpu.architecture cpu.x86.assembler
-cpu.x86.architecture kernel.private namespaces math
-sequences generic arrays generator generator.fixup
-generator.registers system layouts alien ;
+cpu.x86.architecture kernel.private namespaces math sequences
+generic arrays compiler.generator compiler.generator.fixup
+compiler.generator.registers system layouts alien ;
IN: cpu.x86.allot
: allot-reg ( -- reg )
! Copyright (C) 2005, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types alien.compiler arrays
-cpu.x86.assembler cpu.x86.assembler.private cpu.architecture
-kernel kernel.private math memory namespaces sequences words
-generator generator.registers generator.fixup system layouts
-combinators compiler.constants math.order ;
+USING: alien alien.c-types arrays cpu.x86.assembler
+cpu.x86.assembler.private cpu.architecture kernel kernel.private
+math memory namespaces sequences words generator
+compiler.generator.registers compiler.generator.fixup system
+layouts combinators compiler.constants math.order ;
IN: cpu.x86.architecture
HOOK: ds-reg cpu ( -- reg )
! Copyright (C) 2005, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: arrays generator.fixup io.binary kernel
+USING: arrays compiler.generator.fixup io.binary kernel
combinators kernel.private math namespaces sequences
words system layouts math.order accessors
cpu.x86.assembler.syntax ;
! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: bootstrap.image.private kernel kernel.private namespaces
-system cpu.x86.assembler layouts compiler.units math math.private
-generator.fixup compiler.constants vocabs slots.private words
-words.private ;
+system cpu.x86.assembler layouts compiler.units math
+math.private compiler.generator.fixup compiler.constants vocabs
+slots.private words words.private ;
IN: bootstrap.x86
big-endian off
cpu.x86.allot cpu.x86.architecture cpu.architecture kernel
kernel.private math math.private namespaces quotations sequences
words generic byte-arrays hashtables hashtables.private
-generator generator.registers generator.fixup sequences.private
-sbufs sbufs.private vectors vectors.private layouts system
-strings.private slots.private compiler.constants optimizer.allot ;
+compiler.generator compiler.generator.registers
+compiler.generator.fixup sequences.private sbufs sbufs.private
+vectors vectors.private layouts system strings.private
+slots.private compiler.constants ;
IN: cpu.x86.intrinsics
! Type checks
-! Copyright (C) 2005, 2007 Slava Pestov.
+! Copyright (C) 2005, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.accessors arrays cpu.x86.assembler
cpu.x86.architecture cpu.x86.intrinsics generic kernel
kernel.private math math.private memory namespaces sequences
-words generator generator.registers cpu.architecture
-math.floats.private layouts quotations ;
+words compiler.generator compiler.generator.registers
+cpu.architecture math.floats.private layouts quotations ;
IN: cpu.x86.sse2
: define-float-op ( word op -- )
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: math kernel slots.private inference.known-words
-inference.backend sequences effects words ;
+USING: math kernel slots.private sequences effects words ;
IN: locals.backend
: load-locals ( n -- )
: drop-locals ( n -- )
dup zero? [ drop ] [ r> drop 1- drop-locals ] if ;
-
-\ load-locals [
- pop-literal nip
- [ dup reverse <effect> infer-shuffle ]
- [ infer->r ]
- bi
-] "infer" set-word-prop
-
-\ get-local [
- pop-literal nip
- [ infer-r> ]
- [ dup 0 prefix <effect> infer-shuffle ]
- [ infer->r ]
- tri
-] "infer" set-word-prop
-
-\ drop-locals [
- pop-literal nip
- [ infer-r> ]
- [ { } <effect> infer-shuffle ] bi
-] "infer" set-word-prop
-
-<<
-{ load-locals get-local drop-locals }
-[ t "no-compile" set-word-prop ] each
->>
! Copyright (C) 2007, 2008 Slava Pestov, Eduardo Cavazos.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel namespaces sequences sequences.private assocs math
-inference.transforms parser words quotations debugger macros
-arrays macros splitting combinators prettyprint.backend
-definitions prettyprint hashtables prettyprint.sections sets
-sequences.private effects effects.parser generic generic.parser
-compiler.units accessors locals.backend memoize lexer ;
+parser words quotations debugger macros arrays macros splitting
+combinators prettyprint.backend definitions prettyprint
+hashtables prettyprint.sections sets sequences.private effects
+effects.parser generic generic.parser compiler.units accessors
+locals.backend memoize lexer ;
IN: locals
! Inspired by
[ \ see-test see ] with-string-writer =
] unit-test
-[ ] [ "USING: macros inference kernel ; IN: hanging-macro MACRO: c ( quot -- ) infer drop [ ] ; : a ( -- ) [ a ] c ;" eval ] unit-test
+[ ] [ "USING: macros stack-checker kernel ; IN: hanging-macro MACRO: c ( quot -- ) infer drop [ ] ; : a ( -- ) [ a ] c ;" eval ] unit-test
! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: parser kernel sequences words effects
-inference.transforms combinators assocs definitions quotations
-namespaces memoize ;
+stack-checker.transforms combinators assocs definitions
+quotations namespaces memoize ;
IN: macros
: real-macro-effect ( word -- effect' )
! Copyright (C) 2007, 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays kernel math sequences words
-namespaces inference.transforms ;
+namespaces stack-checker.transforms ;
IN: math.bitfields
GENERIC: (bitfield) ( value accum shift -- newaccum )
-IN: optimizer.math.partial.tests
+IN: math.partial-dispatch.tests
USING: math.partial-dispatch tools.test math kernel sequences ;
[ t ] [ \ + integer fixnum math-both-known? ] unit-test
: pprint ( obj -- ) [ pprint* ] with-pprint ;
-: . ( obj -- )
- H{
- { length-limit 1000 }
- { nesting-limit 10 }
- } clone [ pprint ] bind nl ;
+: . ( obj -- ) pprint nl ;
: pprint-use ( obj -- ) [ pprint* ] with-use ;
: callstack. ( callstack -- )
callstack>array 2 <groups> [
remove-breakpoints
- 2 nesting-limit [ . ] with-variable
+ 3 nesting-limit [ . ] with-variable
] assoc-each ;
: .c ( -- ) callstack callstack. ;
sequences.private destructors combinators eval ;
IN: stack-checker.tests
-: short-effect ( effect -- pair )
- [ in>> length ] [ out>> length ] bi 2array ;
-
-: must-infer-as ( effect quot -- )
- >r 1quotation r> [ infer short-effect ] curry unit-test ;
-
-: must-infer ( word/quot -- )
- dup word? [ 1quotation ] when
- [ infer drop ] curry [ ] swap unit-test ;
-
\ infer. must-infer
{ 0 2 } [ 2 "Hello" ] must-infer-as
! See http://factorcode.org/license.txt for BSD license.
USING: io.files io words alien kernel math.parser alien.syntax
io.launcher system assocs arrays sequences namespaces qualified
-system math generator.fixup io.encodings.ascii accessors
-generic tr ;
+system math compiler.generator.fixup io.encodings.ascii
+accessors generic tr ;
IN: tools.disassembler
: in-file ( -- path ) "gdb-in.txt" temp-file ;
USING: accessors namespaces arrays prettyprint sequences kernel
vectors quotations words parser assocs combinators continuations
debugger io io.styles io.files vocabs vocabs.loader source-files
-compiler.units summary inference effects tools.vocabs ;
+compiler.units summary stack-checker effects tools.vocabs ;
IN: tools.test
SYMBOL: failures
USING: continuations definitions ui.tools.browser
ui.tools.interactor ui.tools.listener ui.tools.profiler
ui.tools.search ui.tools.traceback ui.tools.workspace generic
-help.topics inference summary inspector io.files io.styles kernel
-namespaces parser prettyprint quotations tools.annotations
-editors tools.profiler tools.test tools.time tools.walker
-ui.commands ui.gadgets.editors ui.gestures ui.operations
-ui.tools.deploy vocabs vocabs.loader words sequences
-tools.vocabs classes compiler.units accessors ;
+help.topics stack-checker summary inspector io.files io.styles
+kernel namespaces parser prettyprint quotations
+tools.annotations editors tools.profiler tools.test tools.time
+tools.walker ui.commands ui.gadgets.editors ui.gestures
+ui.operations ui.tools.deploy vocabs vocabs.loader words
+sequences tools.vocabs classes compiler.units accessors ;
IN: ui.tools.operations
V{ } clone operations set-global
USING: alien alien.c-types alien.syntax kernel libc structs sequences
continuations byte-arrays strings
math namespaces system combinators vocabs.loader qualified
- accessors inference macros locals generalizations
+ accessors stack-checker macros locals generalizations
unix.types debugger io prettyprint ;
IN: unix