stack-checker: split off stack-checker.dependencies from stack-checker.state
parent
cb6552ae6e
commit
cd2e226afa
|
@ -5,7 +5,8 @@ continuations vocabs assocs dlists definitions math graphs generic
|
||||||
generic.single combinators deques search-deques macros
|
generic.single combinators deques search-deques macros
|
||||||
source-files.errors combinators.short-circuit
|
source-files.errors combinators.short-circuit
|
||||||
|
|
||||||
stack-checker stack-checker.state stack-checker.inlining stack-checker.errors
|
stack-checker stack-checker.dependencies stack-checker.inlining
|
||||||
|
stack-checker.errors
|
||||||
|
|
||||||
compiler.errors compiler.units compiler.utilities
|
compiler.errors compiler.units compiler.utilities
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: assocs classes.algebra compiler.units definitions graphs
|
USING: assocs classes.algebra compiler.units definitions graphs
|
||||||
grouping kernel namespaces sequences words stack-checker.state ;
|
grouping kernel namespaces sequences words
|
||||||
|
stack-checker.dependencies ;
|
||||||
IN: compiler.crossref
|
IN: compiler.crossref
|
||||||
|
|
||||||
SYMBOL: compiled-crossref
|
SYMBOL: compiled-crossref
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
USING: kernel accessors sequences combinators fry
|
USING: kernel accessors sequences combinators fry
|
||||||
classes.algebra namespaces assocs words math math.private
|
classes.algebra namespaces assocs words math math.private
|
||||||
math.partial-dispatch math.intervals classes classes.tuple
|
math.partial-dispatch math.intervals classes classes.tuple
|
||||||
classes.tuple.private layouts definitions stack-checker.state
|
classes.tuple.private layouts definitions stack-checker.dependencies
|
||||||
stack-checker.branches
|
stack-checker.branches
|
||||||
compiler.utilities
|
compiler.utilities
|
||||||
compiler.tree
|
compiler.tree
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel accessors words assocs sequences arrays namespaces
|
USING: kernel accessors words assocs sequences arrays namespaces
|
||||||
fry locals definitions classes classes.algebra generic
|
fry locals definitions classes classes.algebra generic
|
||||||
stack-checker.state
|
stack-checker.dependencies
|
||||||
stack-checker.backend
|
stack-checker.backend
|
||||||
compiler.tree
|
compiler.tree
|
||||||
compiler.tree.propagation.info
|
compiler.tree.propagation.info
|
||||||
|
|
|
@ -8,7 +8,7 @@ classes.algebra combinators generic.math splitting fry locals
|
||||||
classes.tuple alien.accessors classes.tuple.private
|
classes.tuple alien.accessors classes.tuple.private
|
||||||
slots.private definitions strings.private vectors hashtables
|
slots.private definitions strings.private vectors hashtables
|
||||||
generic quotations alien
|
generic quotations alien
|
||||||
stack-checker.state
|
stack-checker.dependencies
|
||||||
compiler.tree.comparisons
|
compiler.tree.comparisons
|
||||||
compiler.tree.propagation.info
|
compiler.tree.propagation.info
|
||||||
compiler.tree.propagation.nodes
|
compiler.tree.propagation.nodes
|
||||||
|
|
|
@ -4,7 +4,7 @@ USING: fry accessors kernel sequences sequences.private assocs
|
||||||
words namespaces classes.algebra combinators
|
words namespaces classes.algebra combinators
|
||||||
combinators.short-circuit classes classes.tuple
|
combinators.short-circuit classes classes.tuple
|
||||||
classes.tuple.private continuations arrays alien.c-types math
|
classes.tuple.private continuations arrays alien.c-types math
|
||||||
math.private slots generic definitions stack-checker.state
|
math.private slots generic definitions stack-checker.dependencies
|
||||||
compiler.tree
|
compiler.tree
|
||||||
compiler.tree.propagation.info
|
compiler.tree.propagation.info
|
||||||
compiler.tree.propagation.nodes
|
compiler.tree.propagation.nodes
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel sequences words fry generic accessors
|
USING: kernel sequences words fry generic accessors
|
||||||
classes.tuple classes classes.algebra definitions
|
classes.tuple classes classes.algebra definitions
|
||||||
stack-checker.state quotations classes.tuple.private math
|
stack-checker.dependencies quotations classes.tuple.private math
|
||||||
math.partial-dispatch math.private math.intervals sets.private
|
math.partial-dispatch math.private math.intervals sets.private
|
||||||
math.floats.private math.integers.private layouts math.order
|
math.floats.private math.integers.private layouts math.order
|
||||||
vectors hashtables combinators effects generalizations assocs
|
vectors hashtables combinators effects generalizations assocs
|
||||||
|
|
|
@ -5,7 +5,7 @@ parser sequences strings vectors words quotations effects classes
|
||||||
continuations assocs combinators compiler.errors accessors math.order
|
continuations assocs combinators compiler.errors accessors math.order
|
||||||
definitions sets hints macros stack-checker.state
|
definitions sets hints macros stack-checker.state
|
||||||
stack-checker.visitor stack-checker.errors stack-checker.values
|
stack-checker.visitor stack-checker.errors stack-checker.values
|
||||||
stack-checker.recursive-state summary ;
|
stack-checker.recursive-state stack-checker.dependencies summary ;
|
||||||
IN: stack-checker.backend
|
IN: stack-checker.backend
|
||||||
|
|
||||||
: push-d ( obj -- ) meta-d push ;
|
: push-d ( obj -- ) meta-d push ;
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1,37 @@
|
||||||
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
USING: assocs classes.algebra fry kernel math namespaces
|
||||||
|
sequences words ;
|
||||||
|
IN: stack-checker.dependencies
|
||||||
|
|
||||||
|
! Words that the current quotation depends on
|
||||||
|
SYMBOL: dependencies
|
||||||
|
|
||||||
|
SYMBOLS: inlined-dependency flushed-dependency called-dependency ;
|
||||||
|
|
||||||
|
: index>= ( obj1 obj2 seq -- ? )
|
||||||
|
[ index ] curry bi@ >= ;
|
||||||
|
|
||||||
|
: dependency>= ( how1 how2 -- ? )
|
||||||
|
{ called-dependency flushed-dependency inlined-dependency }
|
||||||
|
index>= ;
|
||||||
|
|
||||||
|
: strongest-dependency ( how1 how2 -- how )
|
||||||
|
[ called-dependency or ] bi@ [ dependency>= ] most ;
|
||||||
|
|
||||||
|
: depends-on ( word how -- )
|
||||||
|
over primitive? [ 2drop ] [
|
||||||
|
dependencies get dup [
|
||||||
|
swap '[ _ strongest-dependency ] change-at
|
||||||
|
] [ 3drop ] if
|
||||||
|
] if ;
|
||||||
|
|
||||||
|
! Generic words that the current quotation depends on
|
||||||
|
SYMBOL: generic-dependencies
|
||||||
|
|
||||||
|
: ?class-or ( class/f class -- class' )
|
||||||
|
swap [ class-or ] when* ;
|
||||||
|
|
||||||
|
: depends-on-generic ( generic class -- )
|
||||||
|
generic-dependencies get dup
|
||||||
|
[ swap '[ _ ?class-or ] change-at ] [ 3drop ] if ;
|
|
@ -10,6 +10,7 @@ stack-checker.visitor
|
||||||
stack-checker.backend
|
stack-checker.backend
|
||||||
stack-checker.branches
|
stack-checker.branches
|
||||||
stack-checker.known-words
|
stack-checker.known-words
|
||||||
|
stack-checker.dependencies
|
||||||
stack-checker.recursive-state ;
|
stack-checker.recursive-state ;
|
||||||
IN: stack-checker.inlining
|
IN: stack-checker.inlining
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ stack-checker.visitor
|
||||||
stack-checker.backend
|
stack-checker.backend
|
||||||
stack-checker.branches
|
stack-checker.branches
|
||||||
stack-checker.transforms
|
stack-checker.transforms
|
||||||
|
stack-checker.dependencies
|
||||||
stack-checker.recursive-state ;
|
stack-checker.recursive-state ;
|
||||||
IN: stack-checker.known-words
|
IN: stack-checker.known-words
|
||||||
|
|
||||||
|
|
|
@ -44,35 +44,3 @@ SYMBOL: literals
|
||||||
V{ } clone \ meta-d set
|
V{ } clone \ meta-d set
|
||||||
V{ } clone literals set
|
V{ } clone literals set
|
||||||
0 d-in set ;
|
0 d-in set ;
|
||||||
|
|
||||||
! Words that the current quotation depends on
|
|
||||||
SYMBOL: dependencies
|
|
||||||
|
|
||||||
SYMBOLS: inlined-dependency flushed-dependency called-dependency ;
|
|
||||||
|
|
||||||
: index>= ( obj1 obj2 seq -- ? )
|
|
||||||
[ index ] curry bi@ >= ;
|
|
||||||
|
|
||||||
: dependency>= ( how1 how2 -- ? )
|
|
||||||
{ called-dependency flushed-dependency inlined-dependency }
|
|
||||||
index>= ;
|
|
||||||
|
|
||||||
: strongest-dependency ( how1 how2 -- how )
|
|
||||||
[ called-dependency or ] bi@ [ dependency>= ] most ;
|
|
||||||
|
|
||||||
: depends-on ( word how -- )
|
|
||||||
over primitive? [ 2drop ] [
|
|
||||||
dependencies get dup [
|
|
||||||
swap '[ _ strongest-dependency ] change-at
|
|
||||||
] [ 3drop ] if
|
|
||||||
] if ;
|
|
||||||
|
|
||||||
! Generic words that the current quotation depends on
|
|
||||||
SYMBOL: generic-dependencies
|
|
||||||
|
|
||||||
: ?class-or ( class/f class -- class' )
|
|
||||||
swap [ class-or ] when* ;
|
|
||||||
|
|
||||||
: depends-on-generic ( generic class -- )
|
|
||||||
generic-dependencies get dup
|
|
||||||
[ swap '[ _ ?class-or ] change-at ] [ 3drop ] if ;
|
|
||||||
|
|
|
@ -7,7 +7,8 @@ classes.tuple.private effects summary hashtables classes sets
|
||||||
definitions generic.standard slots.private continuations locals
|
definitions generic.standard slots.private continuations locals
|
||||||
sequences.private generalizations stack-checker.backend
|
sequences.private generalizations stack-checker.backend
|
||||||
stack-checker.state stack-checker.visitor stack-checker.errors
|
stack-checker.state stack-checker.visitor stack-checker.errors
|
||||||
stack-checker.values stack-checker.recursive-state ;
|
stack-checker.values stack-checker.recursive-state
|
||||||
|
stack-checker.dependencies ;
|
||||||
IN: stack-checker.transforms
|
IN: stack-checker.transforms
|
||||||
|
|
||||||
: call-transformer ( word stack quot -- newquot )
|
: call-transformer ( word stack quot -- newquot )
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
USING: arrays definitions generic assocs kernel math namespaces
|
USING: arrays definitions generic assocs kernel math namespaces
|
||||||
sequences strings vectors words quotations io io.files
|
sequences strings vectors words quotations io io.files
|
||||||
io.pathnames combinators sorting splitting math.parser effects
|
io.pathnames combinators sorting splitting math.parser effects
|
||||||
continuations checksums checksums.crc32 vocabs hashtables graphs
|
continuations checksums checksums.crc32 vocabs hashtables
|
||||||
compiler.units io.encodings.utf8 accessors source-files.errors ;
|
compiler.units io.encodings.utf8 accessors source-files.errors ;
|
||||||
IN: source-files
|
IN: source-files
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
! Copyright (C) 2004, 2009 Slava Pestov.
|
! Copyright (C) 2004, 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors arrays definitions graphs kernel
|
USING: accessors arrays definitions kernel kernel.private
|
||||||
kernel.private slots.private math namespaces sequences
|
slots.private math namespaces sequences strings vectors sbufs
|
||||||
strings vectors sbufs quotations assocs hashtables sorting vocabs
|
quotations assocs hashtables sorting vocabs math.order sets
|
||||||
math.order sets words.private ;
|
words.private ;
|
||||||
IN: words
|
IN: words
|
||||||
|
|
||||||
: word ( -- word ) \ word get-global ;
|
: word ( -- word ) \ word get-global ;
|
||||||
|
|
Loading…
Reference in New Issue