diff --git a/CHANGES.html b/CHANGES.html index f74d2c24c6..63066458af 100644 --- a/CHANGES.html +++ b/CHANGES.html @@ -14,23 +14,44 @@
  • New basic block optimizer performs more aggressive dead load and store elimination.
  • Stack shuffles are compiled more efficiently.
  • Pushing literals on either side of a stack shuffle is now compiled more efficiently.
  • -
  • Tail-recursive inlined words are compiled in a new way, saving a few instructions.
  • -
  • Sequences: +
  • Collections: diff --git a/TODO.FACTOR.txt b/TODO.FACTOR.txt index d8d834de46..43f6ae8b2a 100644 --- a/TODO.FACTOR.txt +++ b/TODO.FACTOR.txt @@ -1,6 +1,21 @@ -- nodes: lazily create history, class/literal map hashes - 5 car gives wrong error - compile interruption checks +- check that set-datastack and set-callstack compile correctly in the + face of optimization +- [ 2cdr < ] sort -- sig11 +- slice: if sequence or seq start is changed, abstraction violation +- array>tuple: check length and class +- code walker & exceptions +- floating point intrinsics +- fix fixnum/mod overflow on PowerPC +- intrinsic char-slot set-char-slot +- split: return vectors +- vectors: ensure its ok with bignum indices +- nth-unsafe and set-nth-unsafe; ensure it works with bignum indices +- set-path: iterative +- parse-command-line: no unswons of cli args +- investigate if rehashing on startup is really necessary +- remove word transfer hack in bootstrap + ui: @@ -35,7 +50,6 @@ http://clozure.com/cgi-bin/viewcvs.cgi/ccl/lisp-kernel/lisp-exceptions.c?rev=1.9&content-type=text/vnd.viewcvs-markup - http keep alive, and range get -- code walker & exceptions + ffi: @@ -55,10 +69,7 @@ - [ ] [ throw ] ifte ==> should raise 'unbalanced branches' error - declare slot types for built-ins - remove dead code after a 'throw' -- floating point intrinsics - flushing optimization -- fix fixnum/mod overflow on PowerPC -- intrinsic char-slot set-char-slot - [ [ dup call ] dup call ] infer hangs - the invalid recursion form case needs to be fixed, for inlines too - recursion is iffy; if the stack at the recursive call doesn't match @@ -66,11 +77,8 @@ + sequences: -- split: return vectors - specialized arrays - instances: do not use make-list -- vectors: ensure its ok with bignum indices -- nth-unsafe and set-nth-unsafe; ensure it works with bignum indices - >c/c>: vector stack - search: slow - vectorize >n, n>, (get) @@ -91,10 +99,6 @@ - there is a problem with hashcodes of words and bootstrapping - delegating generic words with a non-standard picker - code gc -- set-path: iterative -- parse-command-line: no unswons of cli args -- investigate if rehashing on startup is really necessary -- remove word transfer hack in bootstrap + i/o: diff --git a/library/compiler/basic-blocks.factor b/library/compiler/basic-blocks.factor index 0dc6ccb48a..377fa18c02 100644 --- a/library/compiler/basic-blocks.factor +++ b/library/compiler/basic-blocks.factor @@ -30,19 +30,17 @@ M: %inc-d simplify-stack* ( vop -- ) d-height accum-height ; M: %inc-r simplify-stack* ( vop -- ) r-height accum-height ; -: update-ds ( vop -- ) +GENERIC: update-loc ( loc -- ) + +M: ds-loc update-loc dup ds-loc-n d-height get - swap set-ds-loc-n ; -: update-cs ( vop -- ) +M: cs-loc update-loc dup cs-loc-n r-height get - swap set-cs-loc-n ; -M: %peek-d simplify-stack* ( vop -- ) 0 vop-in update-ds ; +M: %peek simplify-stack* ( vop -- ) 0 vop-in update-loc ; -M: %peek-r simplify-stack* ( vop -- ) 0 vop-in update-cs ; - -M: %replace-d simplify-stack* ( vop -- ) 0 vop-out update-ds ; - -M: %replace-r simplify-stack* ( vop -- ) 0 vop-out update-cs ; +M: %replace simplify-stack* ( vop -- ) 0 vop-out update-loc ; : simplify-stack ( block -- ) #! Combine all %inc-d/%inc-r into two final ones. @@ -106,14 +104,10 @@ M: %inc-r trim-dead* ( tail vop -- ) simplify-inc drop ; : redundant-peek? ( vop -- ? ) dup 0 vop-in swap 0 vop-out vreg-contents get hash = ; -: ?dead-peek ( tail vop -- ) +M: %peek trim-dead* ( tail vop -- ) dup redundant-peek? >r tuck live-load? not r> or [ dup remember-peek dup , ] unless drop ; -M: %peek-d trim-dead* ( tail vop -- ) ?dead-peek ; - -M: %peek-r trim-dead* ( tail vop -- ) ?dead-peek ; - : redundant-replace? ( vop -- ? ) dup 0 vop-out swap 0 vop-in vreg-contents get hash = ; @@ -128,14 +122,10 @@ M: %peek-r trim-dead* ( tail vop -- ) ?dead-peek ; dup 0 vop-out forget-stack-loc dup 0 vop-out swap 0 vop-in vreg-contents get set-hash ; -: ?dead-replace ( tail vop -- ) +M: %replace trim-dead* ( tail vop -- ) dup redundant-replace? >r tuck live-load? not r> or [ dup remember-replace dup , ] unless drop ; -M: %replace-d trim-dead* ( tail vop -- ) ?dead-replace ; - -M: %replace-r trim-dead* ( tail vop -- ) ?dead-replace ; - : ?dead-literal dup forget-vregs tuck live-load? ?, ; M: %immediate trim-dead* ( tail vop -- ) ?dead-literal ; diff --git a/library/compiler/ppc/generator.factor b/library/compiler/ppc/generator.factor index 63520fa213..2d53efeb3a 100644 --- a/library/compiler/ppc/generator.factor +++ b/library/compiler/ppc/generator.factor @@ -72,7 +72,7 @@ M: %untag generate-node ( vop -- ) M: %dispatch generate-node ( vop -- ) 0 check-src - 3 3 2 SLWI + 3 3 1 SRAWI ! The value 24 is a magic number. It is the length of the ! instruction sequence that follows to be generated. 0 1 rel-address compiled-offset 24 + 4 LOAD32 @@ -86,9 +86,11 @@ M: %type generate-node ( vop -- )