Commit Graph

22950 Commits (5921431a7c58d69ed8f17c4f56b54f40f6f61b0d)

Author SHA1 Message Date
Slava Pestov 5921431a7c io.ports: clean up 2011-11-10 00:40:31 -05:00
Joe Groff a25fd29d34 io.ports: make read-step inline 2011-11-09 19:59:46 -08:00
Joe Groff 65c17f7ace slice boa -> <slice-unsafe>
If you didn't define it, don't boa it
2011-11-09 19:22:09 -08:00
Joe Groff 0617838fb9 io: clean up some mess 2011-11-09 19:11:04 -08:00
Joe Groff f5bdff14f6 io: fix each-block-slice typo 2011-11-09 18:06:58 -08:00
Joe Groff 53d027928c io: more hot-rodding for #376
* Change the interface of read-into to return a slice and an eof boolean separately so the compiler can optimize the slice.
* Add an each-stream-block-slice combinator that behaves like each-block but reuses a preallocated buffer for every iteration.
* Pull some strings in the stream-read-into implementation to further improve type propagation and bounds check elimination.
2011-11-09 17:22:01 -08:00
Joe Groff faf49ff25c io.ports: fix bootstrap
Apparently can't use TYPED: or have HINTS: in the wrong place.
2011-11-09 16:32:47 -08:00
Joe Groff afc36ec52b io.backend.unix: hints on M\ fd refill
Trims some low-order dispatch overhead for #376.
2011-11-09 16:32:47 -08:00
John Benediktsson f0f0751910 sequences: improve docs for map-sum. 2011-11-09 15:00:08 -08:00
Joe Groff ce6669d87d io.files: add file-reader, file-writer mixins
This lets us do some trickery so that the stream-element-type propagates from <file-reader>/<file-writer>. For #376.
2011-11-09 14:43:39 -08:00
Joe Groff 1de810f416 io:read: don't resize output buffer if unnecessary
Even with a short-circuit test in the VM primitives, resize still has an overly high runtime cost in tight loops. For #376.
2011-11-09 14:29:12 -08:00
Joe Groff a33971fa33 io.ports: make read-step TYPED:
Eliminates more dispatch. For #376.
2011-11-09 14:13:41 -08:00
Joe Groff 940e355292 io.buffers, io.ports: trim some dispatch
For #376. Still some work to do.
2011-11-09 13:31:02 -08:00
Joe Groff 1a25143431 tools.profiler.sampling: preliminary docs 2011-11-09 11:34:31 -08:00
Joe Groff 5f47dd85f4 vm: hand SIGALRM to signal pipe if not sampling 2011-11-08 23:37:22 -08:00
Joe Groff 7edbf3f2ec deques: fix help-lint 2011-11-08 23:27:33 -08:00
Joe Groff feb9221c5b vm: fix build on windows 2011-11-08 23:17:51 -08:00
Joe Groff cf1f0c2d27 unix.signals: documentation and metadata 2011-11-08 23:12:10 -08:00
Joe Groff 5d81e6e2f0 vm: make signal pipe nonblocking
On the off chance the Factor end of the signal handler mechanism isn't listening, we don't want to tie up the VM because the pipe's buffer got full.
2011-11-08 22:07:22 -08:00
Joe Groff 37f47e093a tools.profiler.sampling: top-down-max-depth report
Fixes #366
2011-11-08 14:35:25 -08:00
Joe Groff a4c011240b tools.profiler.sampling: change some names around
Rename the versions of top-down etc. that take sample data to "top-down*" (from "(top-down)") so they don't look so scary to use. Change "get-raw-profile-data" to "most-recent-profile-data".
2011-11-08 14:11:53 -08:00
Joe Groff 2f0efb62e8 vm: don't send foreign samples to outer space 2011-11-08 14:00:33 -08:00
John Benediktsson 48205fcb63 deques: adding ?peek-front and ?peek-back. 2011-11-08 13:20:56 -08:00
Joe Groff 70dcd875ff io.backend: start signal thread after io-backend
The c-io-backend can't handle input-ports and raises an error during bootstrap.
2011-11-08 11:54:54 -08:00
Joe Groff fca09f21ed vm: don't pass this to safepoint constructor
It's bad juju and MSVC calls us out on it.
2011-11-08 11:06:00 -08:00
Joe Groff afa0ed1f6e unix.process: take raise from unix.ffi
And fix introduced ambiguity between unix.ffi:kill and unix.process:kill
2011-11-08 10:42:51 -08:00
Joe Groff 37494b301b new module unix.signals: app-level signal handlers
example:

IN: scratchpad USING: unix.ffi unix.signals ;
Loading resource:basis/unix/signals/signals.factor
IN: scratchpad [ V{ "Me not that kind of orc!" "Me busy, leave me alone!" "Work work" "Zug zug" } pop print flush ] SIGINFO add-signal-handler
IN: scratchpad load: 0.60  cmd: factor 41541 running 0.28u 0.16s
Zug zug
load: 0.71  cmd: factor 41541 running 0.28u 0.16s
Work work
load: 0.71  cmd: factor 41541 running 0.28u 0.16s
Me busy, leave me alone!
load: 0.73  cmd: factor 41541 running 0.28u 0.16s
Me not that kind of orc!
2011-11-08 10:21:49 -08:00
Joe Groff 7a7b19a8fd vm: more commentary on lock_console() stuff 2011-11-08 08:52:52 -08:00
Joe Groff ec85bf7acc io.backend.unix: startup hook for signal-pipe 2011-11-08 08:42:48 -08:00
Joe Groff 7df1c228bd vm: don't mask SIGTTIN from stdin_loop
Fixes #360
2011-11-08 08:42:48 -08:00
Joe Groff b3598c2384 io.backend.unix: init-signal-pipe function
Currently just reads off signal numbers and drops them.
2011-11-08 08:42:48 -08:00
Joe Groff 75f9904c40 vm: interrupt stdin_loop when entering fep
The stdin_loop thread will keep trying to consume input unless we stop it by sending it a signal. Use SIGUSR2 to stop the read syscall and a mutex to hold up the loop while the fep is active.
2011-11-08 08:42:48 -08:00
Joe Groff 0c132cf861 vm: write signals to pipe immediately
The whole point is to wake up the mx without waiting for the next safepoint derp
2011-11-08 08:42:47 -08:00
Joe Groff 2db8dd3f80 vm: move bignum.cpp includes to master.hpp
That way they get PCHed
2011-11-08 08:42:47 -08:00
Joe Groff 06bb122b6e vm: enqueue signals for FEP signals too
Although SIGINT still can't interrupt the current Factor thread in a sane way, this will at least wake up the run loop when waiting for input and fix #348 when implemented at the application level.
2011-11-08 08:42:47 -08:00
Joe Groff 0db777edbb GNUmakefile: use PCH so compiler goes faster
Also add more accurate dependencies on headers so "make" works right when headers change
2011-11-08 08:42:46 -08:00
Joe Groff ceeb9f36d8 vm: write async signals to pipe for multiplexer
also factor out safepoint logic into its own file
2011-11-08 08:42:46 -08:00
Joe Groff 1583b94bf9 io.launcher.windows: update tests for prompt 2011-11-08 00:09:25 -08:00
Joe Groff 9c055136a7 vm: switch atomic::add to atomic::fetch_add
Win32 only provides fetch-and-add, not add-and-fetch, and we don't really care. Rename the functions so the order of operations is clear.
2011-11-07 17:58:53 -08:00
Joe Groff c79ef17deb lists: make lmap behave row-polymorphically
Fix contributed by @bremac. Fixes #355.
2011-11-07 10:37:35 -08:00
Doug Coleman cb66728b26 compiler.cfg: Change low-level IR constructors from ##foo to <##foo> 2011-11-06 23:02:46 -08:00
Doug Coleman 1a2be52f25 compiler.tree: Renamed high-level IR node constructors to <#foo> from #foo. Moving towards making classes/word names not conflict. 2011-11-06 23:02:45 -08:00
Joe Groff 04a3c88227 vm: readable feps for more types 2011-11-06 20:26:52 -08:00
Joe Groff dadc8a3baa vm: print type names instead of numbers in fep 2011-11-06 20:26:51 -08:00
Doug Coleman 5877dc3640 lint: Add a word to find redundant word props like 'inline [flushable|foldable]' 2011-11-06 19:33:07 -08:00
Doug Coleman dde0599353 math.functions: flushable and foldable don't do anything on inline words because flushable and foldable work on call sites (#call nodes), and inlined words are inlined into another word's call site; they don't generate their own #call node. 2011-11-06 19:25:53 -08:00
Doug Coleman 1539682597 compiler.tree.dead-code: Rewrite /mod to /i or mod in the dead-code pass in the high level optimizer. Fixes #279. 2011-11-06 19:23:26 -08:00
Joe Groff 830a7f7100 tools.deploy.backend: fix vocab manifest parse
We were absent-mindedly passing the VOCABS: line off as a vocab name itself. vocabs.loader doesn't put up with that anymore.
2011-11-06 18:57:12 -08:00
Doug Coleman be9f8a99f0 Rename lookup to lookup-word. 2011-11-06 16:00:00 -08:00
Doug Coleman 90692a7c10 webapps.help: Load the navbar from a Factor word instead of hardcoding it into the template so that the glossary link works. 2011-11-06 12:16:46 -08:00