Commit Graph

405 Commits (84c7f10ab7dbc5e0d3d901b848ef018ddb39a86d)

Author SHA1 Message Date
Slava Pestov bf41b187b0 Re-organize code so that with-compilation-unit can infer
Fix with-compilation-unit to work in deployed code
2009-03-13 19:39:32 -05:00
Slava Pestov 2f85a1a9eb Don't report inference warnings for inline words 2009-03-12 17:30:41 -05:00
Slava Pestov 80e719ba5b Remove stupid commented out code 2009-03-12 17:30:33 -05:00
Slava Pestov 4fdb5d0557 Fix infinite fixed point iteration bug found by littledan; generalize-counter-interval wasn't called in all the right places 2009-03-12 17:30:24 -05:00
Slava Pestov b6f6e880bf Make partially dispatched integer ops foldable 2009-03-11 13:57:13 -05:00
Slava Pestov 42224eb4e7 Propagation pass: add inlined node counts to total node count, so that the more we inline the less we are eager to inline more 2009-03-06 23:34:01 -06:00
Slava Pestov 37bc52afa8 Redefining methods didn't always update callers if more than one method on the same generic was redefined in a compilation unit 2009-03-06 23:33:30 -06:00
Slava Pestov ca7a155b72 Merge branch 'master' into new_ui 2009-03-01 20:13:05 -06:00
Slava Pestov 03cb32ad9c Make execute( faster, add execute-unsafe( and make effect tuple slots read only 2009-03-01 20:12:35 -06:00
Slava Pestov 25a877e50b Merge OneEyed's patch 2009-02-28 17:06:55 -06:00
Slava Pestov 78ce670101 Merge branch 'for-slava' of git://git.rfc1149.net/factor 2009-02-28 14:42:56 -06:00
Slava Pestov e0cfad4676 Merge branch 'master' into new_ui 2009-02-26 14:27:55 -06:00
Slava Pestov bda8b2dda6 Better inlining for both-fixnums? 2009-02-26 14:11:26 -06:00
Slava Pestov ce1bc1d6ed Fixing conflicts from stack checker changes 2009-02-24 01:21:10 -06:00
Slava Pestov 91d0c4ed1f Fix conflict 2009-02-22 20:02:13 -06:00
Doug Coleman 990513db60 use CONSTANT: in basis 2009-02-22 19:13:08 -06:00
Slava Pestov b4a61114e1 Merge branch 'master' into new_ui 2009-02-19 13:36:32 -06:00
Slava Pestov 60134eeb98 Documentation fixes 2009-02-19 13:35:53 -06:00
Samuel Tardieu da2ebe21a6 Fix two overzealous [ ] removal in tests 2009-02-18 03:06:14 +01:00
Samuel Tardieu 087d931c36 Remove the tail argument from do/until/while 2009-02-18 02:41:14 +01:00
Slava Pestov 421ee726b8 Merge branch 'master' into new_ui 2009-02-16 21:22:12 -06:00
Slava Pestov 6b25e99470 Add summary for heaps more vocabs 2009-02-16 21:05:13 -06:00
Slava Pestov 634435d816 Merge branch 'master' into new_ui 2009-02-15 04:07:51 -06:00
Slava Pestov cddb1f6133 Fix spelling 2009-02-15 04:07:05 -06:00
Slava Pestov 8fd159dadd Fix conflict 2009-02-12 09:22:35 -06:00
sheeple facd455e92 Working on complex float support in FFI on NetBSD 2009-02-12 06:25:07 -06:00
Slava Pestov ab386d01aa Merge branch 'master' into new_ui 2009-02-10 16:23:14 -06:00
Slava Pestov 07caee3405 Update some existing code to use initialize 2009-02-10 16:16:12 -06:00
Slava Pestov 3045777f02 Fix conflict 2009-02-09 00:34:00 -06:00
Daniel Ehrenberg b65b88364c Updating lots of things to use call( -- ) 2009-02-08 22:12:11 -06:00
Slava Pestov 043b77c702 Fix conflict 2009-02-08 00:07:59 -06:00
Slava Pestov 01c2e26dfe Fix alien tests, oops 2009-02-06 12:30:11 -06:00
sheeple 173b0ee78d Add some more tests for complex numbers in FFI 2009-02-06 12:21:53 -06:00
Slava Pestov dd9cf39467 Fix conflict in libc 2009-02-06 05:10:41 -06:00
Slava Pestov d6aa376ed0 Removing now-redundant underlying>> calls 2009-02-06 04:37:28 -06:00
Slava Pestov 7bb0e78314 Add support for C99 complex float and complex double types to FFI
They are named complex-float and complex-double in the Factor world
2009-02-06 04:02:00 -06:00
slava e29f18a2f4 Trying to fix a bad merge...
Revert "Merge branch 'master' of git://factorcode.org/git/factor"

This reverts commit da639739bd, reversing
changes made to 346a61f497.
2009-02-03 00:27:34 -06:00
Slava Pestov 669548e62e Clean up some usages of tuck, and add Joe's curried cleave/spread/apply combinators to kernel vocabulary 2009-02-02 13:43:54 -06:00
Slava Pestov e88812b76a map infimum => [ min ] map-reduce 2009-02-02 06:04:29 -06:00
Slava Pestov b684db297a Use [ max ] map-reduce instead of map supremum; would be nice to find a good name for this and put it in sequences vocab 2009-02-02 03:46:10 -06:00
Doug Coleman 3c408342ef renaming: contain? -> any?, deep-contains? -> deep-any?, pad-left -> pad-head, pad-right -> pad-tail, trim-left -> trim-head, trim-right -> trim-tail 2009-01-29 22:19:07 -06:00
Slava Pestov 44bfff7c7b Rename ##load-indirect to ##load-reference since this is more descriptive; value numbering doesn't assign expressions to ##load-reference nodes since this would end up folding literals which were eq? but not = 2009-01-29 01:44:58 -06:00
Slava Pestov 3e685b2eb4 Add test case for bug discovered by erg 2009-01-28 23:35:41 -06:00
Slava Pestov 65a53e1fa5 Don't keep compiled-effect around anymore 2009-02-23 23:55:16 -06:00
Slava Pestov 901bcccc1c Fix remaining text failures 2009-02-23 23:25:13 -06:00
Slava Pestov 1951d739a0 Stack effect declarations are mandatory on all words now
define-temp now takes an effect parameter
Fix compiler bug that Dan found
Stricter enforcement of * effects
Move compile-call from compiler.units to compiler
2009-02-23 20:27:05 -06:00
Slava Pestov 60f36cd9c8 Update user-space code for modify-code-heap primitive change 2009-01-24 20:17:11 -06:00
Slava Pestov f34c14a0f5 Remove some usages of tuck 2009-01-23 18:20:47 -06:00
Slava Pestov a8d1459c08 Rename compiled slot of words to optimized, to reflect what it really means (all words are compiled) 2009-01-23 00:37:02 -06:00
Slava Pestov ca2f01e0d0 Updating non-core libraries for monotonic? change 2009-01-16 17:02:54 -06:00
Slava Pestov bf5ff11720 Update usages of all-equal? now that its in the grouping vocab 2009-01-16 15:14:30 -06:00
Slava Pestov 4204fd495f Move formatted stream output words to io.styles; they didn't belong in core, and this reduces deployed image size 2009-01-13 17:12:43 -06:00
Doug Coleman e661c67189 refactor a word to use smart combinators 2009-01-08 23:09:38 -06:00
Slava Pestov 7b110b0bfd Move 3each, 3map from compiler.utilities to sequences 2009-01-05 17:32:08 -06:00
Slava Pestov 5fdb474c76 Fixing various test failures and updating some more vocabs for >r/r> removal 2008-12-17 22:29:32 -06:00
Slava Pestov 34792a9f23 Remove >r/r> 2008-12-17 19:17:37 -06:00
Slava Pestov c5160d76e9 Merge qualified, alias, symbols, constants into core 2008-12-17 18:10:01 -06:00
Slava Pestov 60a1378a0a Faster dynamic variable lookup: 6% speedup in benchmark.fib5
- If type of first input of equal? is known but not second, rewrite it as swap equal? and try to inline again
- Fix hints on methods to work better
- Put hints for word and fixnum keys on at* and set-at on hashtables
2008-12-17 14:57:24 -06:00
Slava Pestov 0021cde743 Fix more compile errors 2008-12-15 22:21:56 -06:00
Slava Pestov daf2857d7b define-inline now takes an effect parameter
C: now sets the stack effect of the new word to slot names
add new basis/constants vocab; CONSTANT: foo bar is equivalent to : foo bar ; inline
(going to fold CONSTANT:, ALIAS: and qualified into core soon perhaps)
tighten the screws: inline words now need a stack declaration too
update some usages of inline words
2008-12-15 19:44:56 -06:00
Slava Pestov c679ae025b Rename tools.disassembler.udis:& to alien.syntax:&: and fix it to survive image save/load 2008-12-11 00:03:58 -06:00
Slava Pestov ec23584f48 Finish up O(1) byte array allocation 2008-12-09 18:17:04 -06:00
Slava Pestov eb79c6ab71 Fix conflict 2008-12-09 17:52:45 -06:00
Slava Pestov a90118da5d Add inc-at word to core, and update some usages of at+ to use it instead 2008-12-09 16:54:48 -06:00
Slava Pestov db92c90569 Eliminate some usages of locals in compiler.tree.dead-code 2008-12-09 01:04:15 -06:00
Slava Pestov 640b37cb70 More permissive 2008-12-08 19:14:18 -06:00
Slava Pestov 4f0a9f311e Untangling some dependencies 2008-12-08 14:58:00 -06:00
Slava Pestov e4f8448eb1 Fix some problems with arithmetic type inference, exposed by recent changes to log2 word
- declared input type for bignum-shift was stricter than the runtime behavior, leading to bad propagation of type info if shift count was a bignum
- types inferred for type functions which used number-valued/integer-valued/real-valued were not always precise, eg bignum bignum bitxor => integer
- add interval-log2, type function for (log2)
- remove math-class-min, it was useless
2008-12-07 19:44:49 -06:00
Slava Pestov 8a8f0c925c Use BSR instruction to implement fixnum-log2 intrinsic 2008-12-06 15:31:17 -06:00
Slava Pestov 145b635eb6 More optimization intended to reduce compile time. Another 10% speedup on compiling empty PEG parser
- new map-flat combinator replaces usages of 'map flatten' in compiler
- compiler.tree.def-use.simplified uses an explicit accumulator instead of flatten
- compiler.tree.tuple-unboxing uses an explicit accumulator instead of flatten
- fix inlining regression from last time: custom inlining results would sometimes be discarded
- compiler.tree's 3each and 3map combinators rewritten to not use flip
- rewrite math.partial-dispatch without locals (purely stylistic, no performance increase)
- hand-optimize flip for common arrays-of-arrays case
- don't run escape analysis and tuple unboxing if there are no allocations in the IR
2008-12-06 11:17:19 -06:00
Slava Pestov a56d480aa6 Various optimizations leading to a 10% speedup on compiling empty EBNF parser:
- open-code getenv primitive
- inline tuple predicates in finalization
- faster partial dispatch
- faster built-in type predicates
- faster tuple predicates
- faster lo-tag dispatch
- compile V{ } clone and H{ } clone more efficiently
- add fixnum fast-path to =; avoid indirect branch if two fixnums not eq
- faster >alist on hashtables
2008-12-06 09:16:29 -06:00
Slava Pestov 044e2867d5 Teach compiler about string-nth range 2008-12-05 23:51:58 -06:00
Slava Pestov f48653c47a Fix compile error 2008-12-05 23:51:34 -06:00
Slava Pestov aa838dbc2d Fix compile errors 2008-12-05 09:04:16 -06:00
Slava Pestov 908644ee7a O(1) <sbuf> and new-sequence on byte-arrays (work in progress) 2008-12-05 07:28:52 -06:00
Slava Pestov e256846acd Tweak string representation; high bit indicates if character has high bits in aux vector. Avoids memory access in common case. Split set-string-nth into two primitives; set-string-nth-fast is open-coded by optimizing compiler. 13% improvement on reverse-complement 2008-12-05 06:38:51 -06:00
Slava Pestov 6c7005d588 Tweak inlining heuristic 2008-12-05 01:50:14 -06:00
Slava Pestov fa6a2047f0 New inlining heuristic: number of usages within this word. Speeds up bootstrap by 10% 2008-12-04 07:05:59 -06:00
Slava Pestov e304d3c9f8 Local DCE 2008-12-04 06:02:49 -06:00
Slava Pestov e6cb449b19 optimized. now accepts method-specs 2008-12-03 10:44:21 -06:00
Slava Pestov e5ed7447ed Removing more >r/r> usages 2008-12-03 08:46:16 -06:00
Slava Pestov d60c79c9bf Expand instance? with literal class 2008-12-03 08:11:51 -06:00
Slava Pestov 402da00390 Fixing bootstrap with specialized arrays 2008-12-02 02:44:19 -06:00
Slava Pestov f51708386d Fix conflicts 2008-12-01 20:39:43 -06:00
Slava Pestov 6dce834d91 Get rid of some more >r/r> usages 2008-11-30 18:28:15 -06:00
sheeple 6400085bea Fix bootstrap, add a unit test 2008-11-30 07:36:29 -06:00
Slava Pestov e7f4563374 fixnum* intrinsic for x86 2008-11-30 07:26:49 -06:00
Slava Pestov e8a69a3aea Fix conflict 2008-11-29 05:14:49 -06:00
Slava Pestov 52f1ff3a95 Fix conflict 2008-11-29 04:23:23 -06:00
Slava Pestov 86d45262dc Add toutput ype propagation for #alien-invoke and #alien-indirect nodes 2008-11-29 03:47:38 -06:00
Slava Pestov 1c0789e616 Didn't generate ##branch after ##alien-invoke and ##alien-indirect 2008-11-29 03:46:57 -06:00
sheeple 26c002d23f Fix fixnum* problem; result was shifted to the right by 3 bits if both input registers were equal 2008-11-29 00:44:46 -06:00
Slava Pestov 265e57e21a Fix optimized. to literalize words when printing #push nodes 2008-11-29 00:37:26 -06:00
Slava Pestov c1d249afb2 Add unit test 2008-11-29 00:37:07 -06:00
Slava Pestov 67471dedac Forgot to emit a ##branch after ##fixnum-{add,sub,mul} ops; tools.annotations test faild 2008-11-29 00:36:43 -06:00
Slava Pestov 68dd6cc35a Working on PowerPC overflow checks 2008-11-28 20:02:50 -06:00
Slava Pestov eb8c621b6f Faster generic arithmetic on fiixnums: both-fixnums? sub-primitive performs a check if the top two stack items are both fixnums with a single conditional branch 2008-11-28 08:35:02 -06:00
Slava Pestov f44506089d More work on overflow instructions: don't need temp register anymore, add -tail variants which don't need stack frame 2008-11-28 06:36:30 -06:00
Slava Pestov 5634becda1 ##fixnum-add, ##fixnum-sub instructions open-code overflow check 2008-11-28 05:33:58 -06:00
Slava Pestov f2040c0529 Add some more tests 2008-11-24 11:12:36 -06:00
Slava Pestov ab689c098b Clean up direct literal code and make a first attempt at PowerPC support 2008-11-24 08:16:14 -06:00
Slava Pestov 2aaf860f47 Experimental optimizations 2008-11-24 06:40:51 -06:00
Slava Pestov 1fa819191d Change inlining heuristic so that it behaves the same with dip and >r/r> 2008-11-24 05:46:26 -06:00
Slava Pestov eeb2133ba2 Fix compiler test 2008-11-23 21:40:10 -06:00
Slava Pestov 7788b3e0db Merge branch 'master' into microseconds 2008-11-23 03:06:32 -06:00
Slava Pestov 3a2e15327f Disable these for now 2008-11-22 22:47:40 -06:00
Slava Pestov f0716b3a0d 1% image size reduction by not storing empty compiled-generic-uses and compiled-uses props 2008-11-22 22:46:57 -06:00
Slava Pestov c678e6e362 Don't use combinators.short-circuit in compiler 2008-11-21 04:00:37 -06:00
Slava Pestov 79bffecc2e Add type function for /mod 2008-11-21 01:54:56 -06:00
Slava Pestov 8819f23312 Replace millis primitive with micros primitive
Add millis as a library word
sleep now takes either a duration or a microsecond count; code using durations doens't need to be updated, code using millisecond counts updated to use durations for the most part
2008-11-19 01:50:05 -06:00
Slava Pestov 281657dd82 Fix conflict 2008-11-18 22:18:14 -06:00
Slava Pestov ff7358beb3 Fix typo 2008-11-17 17:48:06 -06:00
Slava Pestov 20f5541d35 Refactoring FFI for Win64 2008-11-17 13:34:37 -06:00
Slava Pestov 14246fde37 Better FFI unit tests expose a new problem 2008-11-17 12:23:44 -06:00
Slava Pestov 9e82f1f8dd Better inference error messages 2008-11-16 19:42:53 -06:00
Slava Pestov 7fc13ef03c dlists no longer have a length slot; tweak dlist code so that types infer better 2008-11-16 05:53:25 -06:00
Slava Pestov 2fe364a7bb Specialized arrays work in progress 2008-11-14 20:18:16 -06:00
Slava Pestov 5b4e8e9d09 Rename tests/templates.factor to tests/codegen.factor since that's really what its testing 2008-11-13 04:16:58 -06:00
Slava Pestov eb05dd3a12 Optimize a ##dispatch that is applied to the result of a ##sub-imm or ##add-imm; this eliminates an instruction from the common 1 fixnum-fast { ... } dispatch and 8 fixnum-fast { ... } dispatch code sequences appearing in generic word expansions 2008-11-13 04:16:08 -06:00
Slava Pestov 6590c894bc Forgot a constant 2008-11-13 04:10:21 -06:00
Slava Pestov b1aa3697cb Emit branches in the same order they're written in code 2008-11-13 03:52:01 -06:00
Slava Pestov 5bae69426d Stack checker cleanup and optimization
- stack-checker.state vocabulary split up into stack-checker.{state,values,recursive-state}
- code that modifies and searches recursive state factored out into stack-checker.recursive-state
- recursive state is now a set of three binary hash trees instead of an alist, and no longer contains unnecessary data
- binary hash trees are in stack-checker.recursive-state.tree: unbalanced, persistent
- ~8 second speedup on bootstrap, ~20 second speedup in "peg.javascript" require
2008-11-13 00:07:45 -06:00
Slava Pestov 4a1bcacfd4 Refactoring recursive-state alist; now its a mapping from words to local state triples, reduces searching by a bit 2008-11-12 19:08:40 -06:00
Slava Pestov 9f52ee50b0 Another speedup to >alist: create vector with right size up-front. 10 second bootstrap time reduction 2008-11-12 00:10:50 -06:00
Slava Pestov ed3a81a503 Faster M: hashtable >alist performs less dispatch and allocates less junk 2008-11-11 23:03:50 -06:00
Slava Pestov d970a632bb Fix nodes>quot 2008-11-11 19:51:12 -06:00
Slava Pestov 26f309d2ae Trying to make PEGs compile faster by reducing the number of low level IR nodes: merge functionality of #>r and #r> into #shuffle, and generate 1 node instead of 3 for calls to get-local 2008-11-11 18:46:31 -06:00
Slava Pestov a32acdcff0 Tweak grouping code for better method inlining 2008-11-11 12:11:13 -06:00
Slava Pestov f04b32ea02 Remove duplicated logic 2008-11-11 09:10:33 -06:00
Slava Pestov 792df37431 Update unit test 2008-11-11 08:50:30 -06:00
Slava Pestov 5f4b247072 Propagation pass now uses a stack of hashtables for predicated constraints instead of cloning a hashtable. New strategy for recursive propagation; now converges with fewer iterations. ~15 sec bootstrap time improvement 2008-11-11 08:49:00 -06:00
Slava Pestov 7f9fbdaa4e cleanup pass didn't properly handle conditionals where both branches were dead 2008-11-11 08:38:03 -06:00
Slava Pestov 43335d9c36 Intervals now use a special singleton for the full interval to eliminate FP math in the common case; fix a bug in value-info<= 2008-11-11 08:30:14 -06:00
sheeple 067e9934e1 Merge branch 'master' of git://factorcode.org/git/factor 2008-11-10 03:02:17 -06:00
sheeple 5b7d40d9b4 We need to end the basic block after the ##prologue in the dispatch branch so that the GC check can go after the prologue 2008-11-10 02:58:05 -06:00
unknown f7fe84e563 Working on Win64 FFI 2008-11-08 21:40:47 -06:00
sheeple d1f248dac6 Fixing PowerPC backend: prolog register clobberage, spilling, and general stack frame usage. Add some lame tests for spilling 2008-11-06 19:00:56 -06:00
Slava Pestov 4e55cd973b If a #dispatch branch is a call to another word which is not an intrinsic, we avoid generating the dispatch branch and just jump to the word directly 2008-11-06 11:48:55 -06:00
Slava Pestov 64cbf619a9 Add more algebraic simplifications: comparison of a comparison, comparison where first is immediate 2008-11-06 09:27:52 -06:00
Slava Pestov 1c1333fbe9 Compile not and >boolean as branchless intrinsics by having the CFG builder detect certain code patterns 2008-11-06 09:09:21 -06:00
sheeple d2ec46e38f PowerPC backend almost functional; some new compiler unit tests added,
better compilation of 'f eq?'; f becomes an immediate operand
move aux-offset to compiler.constants
2008-11-06 06:27:27 -06:00
Slava Pestov 53cd75b06c Add string-nth intrinsic 2008-11-06 01:11:28 -06:00
Slava Pestov bfd119e3b5 I/O ricing: various hints added so that UTF8 and ASCII fastpaths compile with less dispatch. 25% improvement on reverse-complement 2008-11-06 00:02:44 -06:00
Slava Pestov cc879fa9b7 Tuple layouts are now arrays, instead of built-in types. The superclass
array is now part of the tuple layout object itself, and class hashcodes
are stored alongside class words there. This removes 2 indirections when
reading a superclass, and 3 when reading a superclass hashcode.
2008-11-05 22:20:29 -06:00
Slava Pestov 4fd1767768 Old fix for classes-intersect? no-method bug was incorrect; we were
ignoring anonymous classes in compiled-generic-crossref. Also,
forget* now calls reset-word so that references to predicates of
forgotten classes don't break the compiler with a similar error.
2008-11-05 18:32:02 -06:00
Slava Pestov dae41147fe %bignum>integer now takes a temporary register since this is useful on both x86 and ppc 2008-11-05 04:16:08 -06:00
Slava Pestov c8521ad826 Add tool to dump live intervals 2008-11-04 17:23:20 -06:00
Slava Pestov 46830bb38d Fix another name clash in tests; putting all compiler tests in compiler.tests vocab is probably not good 2008-11-04 00:46:06 -06:00
Slava Pestov 1af3b8ed65 If a register is spilled and the reload location is also a copy, we chicken out and don't coalesce. This is suboptimal but it's not clear to me how to implement it cleanly, and SSA graph coloring will solve this problem eventually anyway 2008-11-04 00:32:56 -06:00
Slava Pestov efcb916e35 Handle a jump to a jump by cloning the block, in the same way we optimize jumps to returns 2008-11-03 21:02:34 -06:00