Commit Graph

758 Commits (ba10e893b0f1348ad06a51a3a5bd48358f3b18e0)

Author SHA1 Message Date
John Benediktsson bdc5faad93 using if-zero in even more places. 2012-07-16 19:38:49 -07:00
John Benediktsson 1a72249983 math: using if-zero in more places. 2012-06-18 14:32:39 -07:00
Joe Groff d37851fb5d cpu.x86.32.bootstrap: oops, meant bootstrap-cell 2011-12-19 20:55:07 -08:00
Joe Groff d533bbb88c cpu.x86.32.bootstrap: update unwind-native-frames
The arguments passed from C are in a different position now.
2011-12-19 18:42:14 -08:00
Joe Groff d6b520734d cpu.x86.64: define jit-load-vm as a no-op
This was the signal handler prolog code can be shared completely between x86.32 and x86.64.
2011-12-14 11:33:05 -08:00
Joe Groff 9078282855 oops, handler still need to jit-load-vm on x86-32 2011-12-14 09:56:50 -08:00
Joe Groff af989f533a cpu.x86.*: clean up signal handler prolog code
Also bump the signal handler frame sizes up again since it looks like we shrank them too much.
2011-12-14 09:56:50 -08:00
Joe Groff 6dd5973bdd cpu.x86: reduce compiled frames by 2 cells too 2011-12-14 09:56:49 -08:00
Joe Groff 1c44a4e8ae simplify function prologs 2011-12-14 09:56:49 -08:00
Joe Groff 5f0102fb7c cpu.*.bootstrap: return address for (set-context)
Instead of pushing zero as the fake return address for a set-context call, push an address that points back into the primitive so that callstack walking can match the frame back to the subprimitive.
2011-12-14 09:56:46 -08:00
Joe Groff 8981fccbe8 vm: frame size for signal handler code blocks 2011-12-14 09:56:46 -08:00
Joe Groff 9186a1bdf3 vm: store stack frame size in code blocks
Change modify-code-heap primitive so it takes a sixth element in each array for the frame size.
2011-12-14 09:56:45 -08:00
Joe Groff 819e1602be cpu.x86: enable POPCNT with a flag
If bootstrapped with '-enable-popcnt' and the host CPU supports it, enable the POPCNT-based fixnum-bit-count intrinsic. Fixes #436.
2011-12-12 16:43:49 -08:00
Joe Groff eee483654a use radix literals 2011-11-23 19:03:40 -08:00
Joe Groff 62e665bb88 compiler: emit safepoints in optimized prologs 2011-11-23 11:11:25 -08:00
Joe Groff ce205e1e3a code beautification 2011-11-13 16:10:26 -08:00
Joe Groff 2c4c04f973 compiler: add intrinsic for PMOVMSKB/MOVMSKP[SD]
Combined with a fast bit-count this will let us rice byte-counting.
2011-11-13 16:10:20 -08:00
Joe Groff 4984bde393 cpu.*.bootstrap: clear faulting flag directly
No reason to go through a safepoint in unwind-native-frames really.
2011-11-12 13:02:57 -08:00
Joe Groff beb0f48da9 vm: more defense against multi-faulting
* Clear faulting_p from a safepoint rather than inside general_error, because jumping into unwind-native-frames could blow up.
* Handle multiple faults from fatal_error by breakpointing. Is there anything else we can safely do at that point?
* Verify memory protection faults in the top half of the signal handlers because signal dispatch could fault. Treat memory faults during gc or fep as fatal errors.
* Add a function factor_vm::abort() that restores the default SIGABRT handler and ::abort()s. Use it from fatal_error() so we get useful context from gdb and so the user gets feedback from the system crash reporter that Factor blew up and didn't just disappear.
* In factorbug(), don't proceed with .s .r .c if it would be unsafe to do so.
* Don't pile on signals if we've already called fatal_error().
2011-11-12 13:02:57 -08:00
Joe Groff 5b43301eb6 vm: strip out call-counting profiler
This makes the separate "code" and "entry_point" fields in word and quotation redundant, so also remove them to reclaim an additional cell per word and quotation object, which should help with #318.
2011-11-10 16:01:07 -08:00
Joe Groff c78b4d7f60 cpu.x86.*.bootstrap: save flags in signal-handlers 2011-11-04 11:56:01 -07:00
Joe Groff db1a47ffc1 cpu.x86.bootstrap: cell -> bootstrap-cell 2011-11-04 11:54:40 -07:00
Joe Groff a944e41e79 cpu.x86.assembler: PUSHF, POPF instructions 2011-11-04 11:23:11 -07:00
Joe Groff d4f24f44c3 cpu.x86.64.bootstrap: save all the regs on signal
Appears to fix another sporadic crash from mason on x86-64. There's no reason to cut corners here, really.
2011-11-04 10:01:56 -07:00
Joe Groff a28192859a cpu.x86.bootstrap: don't safepoint in a safepoint
Safepointing in the signal-handler primitive causes a crash if the safepoint is guarded and the signal being handled was raised by a safepoint. Put our own RET in the subprimitive to bail out before the standard epilog gets written out. This tentatively appears to fix #349.
2011-11-03 20:19:38 -07:00
Joe Groff 1155da01c9 cpu.x86.32.bootstrap: typo 2011-11-03 13:07:13 -07:00
Joe Groff 7ac94bd09f vm: always generate safepoints in jit
Even if there's no stack frame we still need to safepoint before leaving the function. Fixes #332.
2011-11-03 11:57:43 -07:00
Joe Groff 75cba3106a remove BSD,solaris,etc. misc platform support code 2011-11-02 17:13:51 -07:00
Joe Groff a3979cd123 fix platform dependency in leaf-signal-handler 2011-11-02 13:23:12 -07:00
Joe Groff 0ee07f1f2a cpu.x86.bootstrap: simplify leaf-signal-handler
We can use RET (stack-frame-size - cell) instead of doing stack gymnastics.
2011-11-02 13:23:08 -07:00
Doug Coleman be12f2b27d Make "foo.private" require load foo instead.
Move require from vocabs.loader to vocabs. Update everything.
Fixes #201.
2011-11-02 11:50:03 -07:00
Joe Groff 09088ec3ce cleanups from code review 2011-10-27 21:18:23 -07:00
Joe Groff 871ea10cb0 cpu.x86.64: also must save ctx-reg 2011-10-27 21:18:21 -07:00
Joe Groff 66ffd0f138 cpu.x86.32: update for resumable signal handlers 2011-10-27 21:18:19 -07:00
Joe Groff 9c7731e4c9 vm: suppress signal-handler stack frame generation
This is a hack; see #295
2011-10-27 21:18:19 -07:00
Joe Groff 1eddaf34f1 vm: resumably handle signals from leaf procedures 2011-10-27 21:18:18 -07:00
Joe Groff cb6f175ef8 vm: dispatch signal handlers through subprimitive
We also need to save C ABI volatile registers before calling the signal handler in order to be able to reliably resume. Add signal-handler and leaf-signal-handler subprimitives to preserve volatile registers before invoking the signal handler C function.
2011-10-27 21:18:18 -07:00
Joe Groff d41c3f2709 cpu.x86.(32,64).bootstrap: get rid of PUSH malarky
In the function prologue, move the stack pointer once after the stack frame is set up instead of PUSHing the stack frame piece by piece.
2011-10-27 21:14:50 -07:00
Joe Groff cf45e0d581 compiler: add ##safepoint IR insn 2011-10-27 21:14:46 -07:00
Joe Groff 6e237abb5e cpu.x86.assembler: add MOVABS instruction
MOVABS generates the one-byte opcode version of MOV eAX, [absolute] or MOV [absolute], eAX, which saves a byte per safepoint on x86-32.
2011-10-27 21:14:45 -07:00
Joe Groff 09d0fdaf8d cpu.x86.bootstrap: add safepoint to jit-epilog 2011-10-27 21:14:45 -07:00
Doug Coleman cb41cc99d8 Fix 32bit platform bootstrap 2011-10-24 16:24:01 -07:00
Doug Coleman 14a2511d57 Found a few more places to use lookup-c-type 2011-10-24 15:58:40 -07:00
Doug Coleman 7bfbe17861 Rename c-type to lookup-c-type. Fixes #230. 2011-10-24 14:37:24 -07:00
Slava Pestov b1b7b24ad5 Add RT_INLINE_CACHE_MISS relocation type to avoid frequent dlsym lookups when compiling PICs. Fixes #123 2011-10-03 00:26:21 -07:00
Slava Pestov 8336d898a3 Rework non-optimizing compiler backend to use compiler.codegen.relocation 2011-10-03 00:26:21 -07:00
Slava Pestov 83f602c1da Split up compiler.codegen.fixup into compiler.codegen.{gc-maps,labels,relocation} 2011-10-03 00:25:47 -07:00
Doug Coleman 94f3ca3b8c Remove all non-core uses of (scan-token)
Add scan-datum
Add scan-number
Document more words
Fixes #225.
2011-10-02 12:00:08 -07:00
Doug Coleman 17e0fbe501 Remove Windows CE from core/ basis/ and build-support/
Rename the winnt singleton to windows in core/ basis/ extra/
Rename boot images winnt -> windows
Fixes #84.
2011-09-18 23:19:06 -05:00
Slava Pestov 238fea7b7e cpu.ppc: add 'not loaded' tags so that load-all doesn't break an x86 image 2011-08-24 23:52:02 -07:00