Commit Graph

482 Commits (8c223d40736c3150771cc8b0bda59d4aa873d628)

Author SHA1 Message Date
John Benediktsson 2bbec0dd61 stack-checker: more use of hash-sets. 2013-03-16 13:41:51 -07:00
Doug Coleman 875e45a640 sequences: Add some short useful factors. Clean up the use of longest. 2013-03-11 17:47:52 -07:00
John Benediktsson 013160df9a change some "2drop 2drop" to "4drop". 2012-10-23 12:21:30 -07:00
John Benediktsson 909b28a360 stack-checker: adding 4dup and 4drop. 2012-10-22 12:27:15 -07:00
Doug Coleman 106e4d100e stack-checker: Add alien-assembly to the do-not-compile list. Remove a duplicate word from the do-not-call list. Reorder a bit. 2012-10-22 09:47:35 -07:00
Doug Coleman 3582a6c624 kernel: Add 4dup, 4drop, and 4cleave. 2012-10-22 09:47:34 -07:00
John Benediktsson 4e72d80256 Using "same?" in more places. 2012-07-21 10:22:44 -07:00
Doug Coleman d979478bc4 stack-checker: meta-d was a word and symbol, now meta-d word and (meta-d) symbol
issuse #358
2012-07-20 12:30:14 -07:00
Doug Coleman 1c3deddf61 issue #358: Rename all of the words depends-on-* to add-depends-on* 2012-06-21 08:35:45 -07:00
John Benediktsson 8c1165cac1 cleanup some lint warnings. 2012-04-18 17:46:01 -07:00
John Benediktsson 22c26ff3f5 vm: adding bignum_gcd primitive. 2012-04-05 09:17:35 -07:00
Doug Coleman c1a49e69c8 combinators.smart: Implement reduce-outputs using compose, fix some stack effects, add using 2011-11-28 20:55:10 -08:00
Doug Coleman 2b87eaa1b5 generalizations: Refactor stack-checker so that smart combinators can be used with curry and compose. 2011-11-27 20:25:22 -08:00
Doug Coleman cab0369fec classes: Make methods dispatch on maybes. Fix a couple bugs in the implementation of maybe. classoid? is now a dumb test if an object could be a well-formed classoid; valid-classoid? tests for well-formedness. Move maybe tests. Make pprint* work better on methods. 2011-11-22 15:12:20 -08:00
Doug Coleman 067f9830ef classes.union: Define a maybe: word that makes a tuple that acts as an anonymous union for a type and f. Updated all the places we define UNION: ?foo foo POSTPONE: f ;. Fixes #416 and lots of headaches. 2011-11-22 01:56:13 -08:00
Joe Groff c8fd36bbdb kill tools.profiler.counting and ui.tools.profiler
Load tools.profiler.sampling from bootstrap/tools instead.
2011-11-10 12:33:10 -08:00
Joe Groff 7619ff785b stack-checker.known-words: add ffi-signal-handlers 2011-11-03 15:20:42 -07:00
Doug Coleman 03a5293ed1 Add stack effects for the sampling profiler 2011-11-02 17:26:13 -07:00
Joe Groff eac90675c0 move counting profiler to tools.profiler.counting 2011-11-02 13:23:09 -07:00
Joe Groff 33919b2919 tools.profiler: rename to tools.counting-profiler 2011-11-02 13:23:06 -07:00
Slava Pestov c1b7de8339 stack-checker.known-words: add effects for signal-handler and leaf-signal-handler primitives, even though they can't be called directly 2011-10-29 17:15:35 -07:00
Doug Coleman ff69e2f240 Rename c-type to lookup-c-type. Fixes #230. 2011-10-24 14:37:24 -07:00
John Benediktsson b237df3a3b Remove unused stack effects from DEFER: declarations. 2011-10-18 14:42:17 -07:00
John Benediktsson 80e1c8e3f2 Eliminate duplicate syntax for stack effects "(" no longer drops and is identical to the old "((", which is now removed. 2011-10-18 13:19:39 -07:00
Joe Groff 5a072c57a6 bootstrap, io.streams.c: use new fread primitive
Change the fread primitive to fread-unsafe, matching the new primitive in the VM, and update the implementation of c-reader to implement stream-read-unsafe and stream-read in terms of fread-unsafe
2011-10-17 21:22:58 -07:00
Joe Groff f39f97840a stack-checker: update tests
[ bi ] infer now hits the row polymorphism checker before it hits the unknown-macro-input checker because of the effect on keep. Change the test to more directly test that call fails with an unknown input.
2011-10-14 15:35:29 -07:00
John Benediktsson afc07c0e05 io.binary: make le> and be> faster (20% and 75%, respectively).
Removed primitive byte-array>bignum and digit_stream_to_bignum from vm/.
2011-10-11 21:13:30 -07:00
Doug Coleman 181f11faa8 Make M\ throw an error upon lookup failure. Change method -> ?lookup-method, lookup-method is the throwing version of ?lookup-method. Fixes #229. 2011-10-03 15:49:49 -07:00
Doug Coleman 8504b17aad Rename spread>quot to deep-spread>quot, and spread>quot-shallow to shallow-spread>quot. 2011-10-02 20:25:39 -07:00
Doug Coleman 001ac7fbcd Extraneous top-level stack-effect 2011-09-25 19:32:34 -07:00
Joe Groff e293966618 stack-checker.row-polymorphism: check stack effects correctly when a one-sided polymorphic declared effect is matched to a shallow subtype, for example, ( x -- ..a ) to ( -- ); fixes #88 2011-09-09 18:13:17 -07:00
Slava Pestov ed9cf9e4fd Move some primitives from memory and memory.private to tools.memory.private, add data-heap and code-heap words that wrap the struct for you 2011-09-05 16:47:29 -07:00
Erik Charlebois 64252dbdbc 32 and 64 bit Linux PPC support 2011-05-23 23:36:14 -04:00
Slava Pestov c36d73e242 Change do-callback to register the current thread with the callback, instead of busy waiting for the current callback to become the right one before returning. Fixes 100% CPU usage issue with system-alert. Thanks to Blei and ex-rzr for doing preliminary analysis of the issue 2011-04-12 21:48:54 -04:00
Keita Haga 073eda332a In several documentation, remove whitespace before or after the colon or period 2011-02-10 01:51:13 +09:00
Keita Haga c04fbe892d stack-checker: add a sample output in the last example of inference-recursive-combinators article 2011-01-23 22:48:41 +09:00
Slava Pestov f27080498d Remove bignum>float VM primitive, and use bignum/f to implement >float on bignums instead, for a slight accuracy gain. Also, bignum/f now has a more efficient post-scaling algorithm to break the circular dependency on bignum>float 2010-11-24 22:41:15 -08:00
Slava Pestov 3323284db4 stack-checker.alien: get a bit more inlining going with callbacks, to expose another bug 2010-09-05 21:27:39 -07:00
Slava Pestov d2cf2d8f92 Rename get-fpu-state entry point to fpu-state, and fix stack-checker unit tests 2010-09-04 12:58:59 -07:00
Slava Pestov 1985705413 compiler: now that FFI has been deconcatenatized, we no longer need the special ##unary-float-function and ##binary-float-function fastpaths 2010-08-13 23:59:19 -07:00
Slava Pestov 723d780703 stack-checker.alien: generate a declaration for input parameter types 2010-07-30 15:50:05 -04:00
Slava Pestov fd1aad71bd combinators: make the behavior of 'case' consistent between the optimized and unoptimized forms 2010-07-30 14:21:30 -04:00
Slava Pestov 0f4c5d2bff classes.algebra: make it work better to fix bug reported by Sascha Matzke 2010-07-29 19:57:23 -04:00
Slava Pestov 168dd1f825 FFI rewrite part 7: compile callback bodies with the optimizing compiler 2010-07-28 00:49:26 -04:00
Slava Pestov e2ceb11337 stack-checker: calling 'boa' on a non-tuple would compile as a no-op rather than an error (reported by Joe Groff); clean up some other error reporting code too 2010-07-17 15:57:44 -04:00
Slava Pestov ae2c2909af Revert guarded method inlining
This reverts commit 44a835e3fc, reversing
changes made to d45926bda0.
2010-06-24 12:35:21 -04:00
Slava Pestov e07ce4d220 stack-checker.dependencies: Oops 2010-06-24 05:27:01 -04:00
Slava Pestov 97eb276c48 stack-checker.dependencies: fix error thrown if depends-on-single-method parameters are no longer valid 2010-06-24 04:28:40 -04:00
Daniel Ehrenberg 7599841221 Merge branch 'master' of git://factorcode.org/git/factor into propagation 2010-06-23 12:17:24 -04:00
Slava Pestov 1014b62ee7 stack-checker.row-polymorphism: minor cleanup 2010-06-22 22:35:55 -04:00
Daniel Ehrenberg 83327635f3 Fixing one of the bad bugs, in row-polymorphism 2010-06-22 17:31:21 -04:00
Slava Pestov 5ae75af6a8 Clarify documentation for resize-array, resize-byte-array, resize-string words, and remove flushable declaration since technically they don't satisfy the flushable contract (reported by Daniel Ehrenberg) 2010-06-22 15:48:48 -04:00
Daniel Ehrenberg 2c8897c56b Merge branch 'master' of git://factorcode.org/git/factor into propagation 2010-06-22 14:47:57 -04:00
Slava Pestov 75d2635c05 Merge branch 'master' of git://github.com/erg/factor 2010-06-22 04:13:39 -04:00
Doug Coleman 0edadff45f remove system-micros word from factor src tree 2010-06-22 01:49:11 -05:00
Joe Groff bcf6d83a8f stack-checker.errors.prettyprint: refer to unbalanced-branches quotation in singular when there's only one 2010-06-18 15:36:03 -07:00
Daniel Ehrenberg b362fe25b1 Fixing infinite loop in loading benchmark.fib4 2010-06-15 13:53:40 -04:00
Daniel Ehrenberg 30cfbc8512 Merge branch 'master' into propagation 2010-06-15 13:26:01 -04:00
Slava Pestov 7c85fdc1e5 stack-checker.alien: callback and assembly quotations can be callables 2010-05-19 00:31:46 -04:00
Slava Pestov 1834241e5a alien.libraries, stack-checker.alien: check user inputs more carefully to ensure that invalid ABI descriptors don't slip through and break random stuff (reported by prunedtree) 2010-05-18 18:46:31 -04:00
Slava Pestov 5b48cd2a63 FFI rewrite part 5: return value boxing and callback parameter boxing now uses vregs; simplify return value unboxing 2010-05-16 03:43:23 -04:00
Daniel Ehrenberg fbaa8d153f Inlining no-method when a generic word has no method 2010-05-14 20:28:09 -05:00
Daniel Ehrenberg 05290ee1b1 Merge branch 'master' of git://factorcode.org/git/factor into propagation
Conflicts:

	basis/compiler/tree/propagation/propagation-tests.factor
2010-05-14 18:59:39 -05:00
Slava Pestov 42b0d456cd Refactor x86-32 stack cleanup logic 2010-05-12 02:09:11 -04:00
Slava Pestov 7316d41226 FFI rewrite part 2: use ##peek and ##replace instructions to access stack 2010-05-09 23:26:43 -04:00
Daniel Ehrenberg 4d5b7fe883 Fixing bug in dependency tracking for guarded method inlining 2010-05-04 16:47:00 -05:00
Daniel Ehrenberg 0f0b56f1ef Adding dependency checking and proper handing of dispatch# to the new method inlining 2010-05-04 16:46:38 -05:00
Slava Pestov a9ccfa8f05 strings: move string-nth primitive out of the VM and into the library 2010-05-03 17:34:12 -04:00
Doug Coleman 366ce2896f Add callstack-bounds primitive to vm/ for use with javascriptcore library 2010-04-19 20:08:15 -05:00
Daniel Ehrenberg aa6158b366 Changing require-when usages to the new syntax for require-when 2010-04-18 14:29:24 -05:00
Slava Pestov 288090d993 math.parser: expose a format-float primitive for use by formatting vocabulary 2010-04-13 21:21:28 -07:00
Slava Pestov 572b71238f stack-checker: calling 'dispatch' with unbalanced branches generated an error message that erroneously talked about 'if' 2010-04-13 05:24:49 -07:00
Slava Pestov ed40eb4239 cpu.x86.32: cleanups and fixes to make fastcall and thiscall callbacks work 2010-04-10 16:54:17 -07:00
Slava Pestov 0faa3bcf4a vm: pre-allocate context alien 2010-04-02 00:02:21 -04:00
Slava Pestov 1b271f8202 locals: remove some dead code 2010-03-30 21:56:51 -04:00
Slava Pestov fb2ecab614 threads: delete old contexts immediately instead of handing them off to a 'context recycler' thread 2010-03-30 21:47:48 -04:00
Slava Pestov c7142e4281 threads: use context-switching primitives 2010-03-29 20:40:17 -04:00
Slava Pestov 99771eb689 bootstrap.compiler: fix joint dependencies declared here 2010-03-29 13:14:26 -04:00
Slava Pestov b6dfdcb909 set-context and start-context primitives can now pass parameters around 2010-03-27 08:13:57 -04:00
Slava Pestov e6b9e54454 stack-checker.known-words: fix load error 2010-03-27 03:35:01 -04:00
Slava Pestov 1717b8d0f7 Implement start-context and set-context primitives 2010-03-27 02:56:11 -04:00
Slava Pestov 560c119cd2 vm: actually use context callstacks when running code 2010-03-26 22:44:43 -04:00
Slava Pestov 6aee6b3adc Add context-specific special object table, generalizing catchstack_save and current_callback_save fields of context struct 2010-03-18 22:06:00 +13:00
Slava Pestov fb06bbcae7 stack-checker.errors.prettyprint: give it some smart quotes lovin' 2010-03-17 19:20:28 +13:00
Daniel Ehrenberg 512fe14e4e Merge branch 'bags' of git://github.com/littledan/Factor
Conflicts:

	basis/compiler/cfg/ssa/construction/tdmsc/tdmsc.factor
	basis/furnace/auth/auth.factor
	basis/stack-checker/backend/backend.factor
2010-03-16 13:28:00 -04:00
Joe Groff 8687a7e283 Merge branch 'master' of git://factorcode.org/git/factor into row-polymorphism 2010-03-12 14:36:13 -08:00
Joe Groff dfbe1211f7 pre-chew the bite-sized morsels of stack-checker.row-polymorphism so they're easy for old people to digest 2010-03-11 14:09:18 -08:00
Slava Pestov 16ddd015d3 typed: forgetting a final class would throw an error while recompiling typed words depending on it 2010-03-12 10:22:35 +13:00
Joe Groff 26ff757de4 carve the tough, gamey steak of stack-checker.polymorphism into chewable morsels 2010-03-11 00:53:40 -08:00
Joe Groff b9bced9a5e update docs for unbalanced-branches-error 2010-03-09 18:42:10 -08:00
Joe Groff 34b29af245 non-polymorphic input parameter check was too strict: wouldn't allow ( x -- ) for ( x x -- x ), for example 2010-03-09 15:57:00 -08:00
Joe Groff 191ac353fd generalize stack effects so we can bootstrap with the stricter stack effect checking 2010-03-08 23:38:10 -08:00
Joe Groff 3abf1f1ef7 stack-checker.row-polymorphism: modify check-variables to enforce non-polymorphic stack effects 2010-03-08 19:44:01 -08:00
Joe Groff 21aa4632c8 refactor stack-checker.row-polymorphism a little 2010-03-08 19:32:25 -08:00
Joe Groff 5597ee691f add documentation about stack effect variable syntax and the effect on the stack checker 2010-03-08 17:17:47 -08:00
Joe Groff 8159a19187 combine unbalanced-branches-error and invalid-quotation-input into one error 2010-03-07 22:23:24 -08:00
Joe Groff 9e6f84bc24 declare effect on inputs to infer-if in non-literal case, so we get a better error than "unbalanced drop call/nip call" 2010-03-07 21:37:24 -08:00
Joe Groff 6689113519 unify inner-d-index when unifying branches; close a few other leaks where meta-d could have been popped without updating inner-d-index 2010-03-07 20:44:50 -08:00
Joe Groff 66687d6b21 reuse @ and _ from fry in placeholders for invalid-quotation-input errors rather than making our own redundant placeholder symbols 2010-03-07 20:08:35 -08:00
Joe Groff f353b13bbc add unit test from quotation that fails to infer during bootstrap.compiler 2010-03-07 20:07:30 -08:00
Joe Groff 4cd6ad840d add tests from old row-polymorphism implementation to stack-checker unit tests 2010-03-07 19:13:41 -08:00
Joe Groff 1512ed12f3 further improve error message for invalid quotation inputs using a table display with the actual quotation effects determined so far 2010-03-07 18:40:58 -08:00
Joe Groff ea4545e366 improve error message for invalid quotation inputs by referencing each declared-effect to its other references 2010-03-07 18:27:55 -08:00
Joe Groff 011a39457e clear away some rebar 2010-03-07 18:11:44 -08:00
Joe Groff 6b9a79159d tweak declared-effect to wrap the existing known instead of introducing a new value, so we don't confuse the compiler 2010-03-07 18:07:42 -08:00
Joe Groff b14d59030f add stack variable unification to M\ declared-effect infer-call* 2010-03-07 17:51:41 -08:00
Joe Groff bbbda64ee7 add a with-effect-here combinator that determines the effect of a scoped subset of the stack checker 2010-03-07 16:54:25 -08:00
Joe Groff 63ad397cc1 tweak recursive call site checking to consider declared-effects equivalent to their wrapped values 2010-03-07 11:55:47 -08:00
Joe Groff 339cc8f04e row polymorphism new approach: wrap polymorphic quotation inputs in a "declared-effect" value. M\ declared-effect infer-call* will then assert the effect of declared-effect values during the normal course of stack inference 2010-03-07 11:54:57 -08:00
Joe Groff 68dd644233 add unit test to show that polymorphic check breaks inference of inline recursive words 2010-03-06 12:28:09 -08:00
Joe Groff 9571bf6d4b give terminating stack effects a pass in the polymorphic checker 2010-03-05 21:51:38 -08:00
Joe Groff 15e6a7fa5e move error summaries for effect parsing errors to debugger vocab 2010-03-05 21:50:40 -08:00
Joe Groff 26e4bb818a reuse infer-call* for polymorphic inference, which handles curried quotations. tests can pass with real "each" etc. now 2010-03-05 15:20:55 -08:00
Joe Groff c9162c5e31 fix stack error in stack-checker.row-polymorphism 2010-03-05 14:34:50 -08:00
Joe Groff 4892bf1d47 refactor stack-checker slightly to fix circular dependency 2010-03-05 14:27:36 -08:00
Joe Groff a3033e885a make effect variables part of effect syntax, stored out of band in effect tuple 2010-03-05 13:30:10 -08:00
Joe Groff 1b1ccb71a4 make tests pass 2010-03-04 22:43:01 -08:00
Joe Groff 053ba583fc improve error reporting 2010-03-04 21:51:49 -08:00
Joe Groff 31640ea9c6 nested scopes were messing up stack checker state 2010-03-04 20:15:26 -08:00
Joe Groff 23de281186 initial implementation of row-polymorphism check 2010-03-04 19:30:08 -08:00
Daniel Ehrenberg 7074979745 Moving new-sets to sets 2010-02-26 16:01:01 -05:00
Slava Pestov af0ddd5985 Specialized arrays, structs and other objects responding to the >c-ptr / byte-length protocol can now be written to binary streams 2010-02-24 20:18:41 +13:00
Joe Groff 31a0d98e02 Merge branch 'master' into new-alien-pointers
Conflicts:
	basis/alien/c-types/c-types.factor
	basis/stack-checker/dependencies/dependencies.factor
2010-02-22 10:32:59 -08:00
Slava Pestov 23a1f0ed8c alien: some code cleanups and fixes 2010-02-23 01:28:56 +13:00
Slava Pestov eb3f8632dd stack-checker.alien: now that C types are words, the compiler can add dependencies on them when compiling alien words. This triggers the necessary recompilation when C types are redefined 2010-02-22 21:32:41 +13:00
Joe Groff c4cc70b92c stack-checker.dependencies: extend c-type-word method for depends-on-c-type to all words (so it works for non-c-types like void) 2010-02-21 23:13:12 -08:00
Joe Groff 310b3df2ec stack-checker.dependencies: add method for pointers to depends-on-c-type 2010-02-21 22:31:32 -08:00
Slava Pestov 2c34ecbdb5 stack-checker.dependencies: add depends-on-c-type 2010-02-22 19:25:09 +13:00
Slava Pestov c5a62b14e7 stack-checker.dependencies: fix load error 2010-02-20 12:08:14 +13:00
Slava Pestov 6501480a0e Fix two problems with recompilation: predicate constant folding was recording unsatisfied dependencies in some cases, and literal tuple instances of forgotten classes would cause problems for method inlining 2010-02-20 12:01:47 +13:00
Slava Pestov 60296be964 typed: only unbox final classes. Fixes bug reported by littledan 2010-02-18 02:39:12 +13:00
Slava Pestov f01487eb83 A few documentation fixes 2010-02-17 00:05:36 +13:00
Slava Pestov 747974f4ae vm: nuke unused (string>float) primitive 2010-02-08 08:16:56 +13:00
Slava Pestov 26cae00eeb Add code heap introspection primitive to VM, and make a code-blocks word in tools.memory that wraps a useful interface around this. Add a lookup-return-address word and use this in tools.disassembler.utils 2010-02-03 23:11:32 +13:00
Slava Pestov 0b278adb5a Test fixes 2010-02-03 23:11:31 +13:00
Slava Pestov 7de81976a5 Revert "macros: macro body is now defined in its own subword, for compile-time stack effect checking"
This reverts commit 24de7c52f0c3f21cfcdb80235cac7296b0401c85.
2010-02-03 23:11:29 +13:00
Slava Pestov 3259ef4bec vm: modify-code-heap primitive now takes a pair of parameters, update-existing? and reset-pics?. If no generic words were changed, PICs do not need to be reset. If no existing words were redefined, the code heap doesn't have to be traced at all. Speeds up compilation of PEGs since those create lots of compilation units 2010-02-03 23:11:28 +13:00
Slava Pestov b7fde7af27 macros: macro body is now defined in its own subword, for compile-time stack effect checking 2010-02-03 23:11:22 +13:00
Brad Christensen 9b9322ea1e A number of documentation fixes and cleanup. 2010-02-03 00:05:03 -07:00
Slava Pestov 2c63161c84 stack-checker.dependencies: make conditional dependencies more robust 2010-01-31 01:55:35 +13:00
Slava Pestov ea9dbf2ea1 compiler.crossref: more space-efficient storage of dependency information 2010-01-30 09:29:02 +13:00
Slava Pestov fa4f7d8ccf Clean up some code in preparation for a refactoring 2010-01-30 09:29:02 +13:00
Slava Pestov c438e84bd0 compiler.crossref: add next-method dependency 2010-01-30 09:29:01 +13:00
Slava Pestov 6cc68e889e stack-checker.dependencies: add tuple layout dependencies for use by 'new' and 'boa' 2010-01-30 09:29:00 +13:00
Slava Pestov 09ead56652 Re-work flushed dependencies into new compiler cross-referencing framework 2010-01-30 09:29:00 +13:00
Slava Pestov c058343167 Add some utility words to stack-checker.dependencies in preparation for a refactoring 2010-01-30 09:28:59 +13:00
Slava Pestov 26f311279c Re-defining a tuple class now invalidates cached quotation stack effects 2010-01-30 09:28:59 +13:00
Slava Pestov c027046857 New 'conditional dependency' mechanism for more accurate recording of recompilation information 2010-01-30 09:28:57 +13:00
Slava Pestov 817bc02392 compiler.tree.propagation.call-effect: clear out dependency tracking variables to ensure that infer calls made by call( as part of the compile process doesn't pollute the dependencies of the word being compiled 2010-01-30 09:28:57 +13:00
Slava Pestov f031a97084 Work in progress: record constant-folds of predicate words, and call-next-method invocations, in the same way that method inlining are recorded, for greater recompilation accuracy 2010-01-30 09:28:56 +13:00