Commit Graph

17608 Commits

Author SHA1 Message Date
Andreas Gal
39d9d53d83 Back out multi-trees. There is absolutely no way this will be debugged in time for tomorrow. Need a bit more gdb man-power. 2008-08-19 23:28:13 -07:00
Andreas Gal
55c1e3d15d Always blacklist the first fragment in the peer list, and blacklist if we see a loop that is not type-stable. 2008-08-19 23:10:28 -07:00
Andreas Gal
25bf562fe6 Don't build trees inside tree calls if no suitable tree can be found (for now.) 2008-08-19 23:00:19 -07:00
Andreas Gal
4ee5ead209 Improved debug output. 2008-08-19 22:59:08 -07:00
Andreas Gal
8569359e49 Add debugging facilities for typemaps and fix sp_adj calculation for tree calls. 2008-08-19 22:29:02 -07:00
Andreas Gal
454c89d72b Support multiple fragments with different entry maps per PC location. 2008-08-19 20:30:16 -07:00
Andreas Gal
b3efe4fbeb Clear out the list of global slots when the shape changes. 2008-08-19 13:34:20 -07:00
Andreas Gal
1ee261ca2e Emit the tree call stack setup code before executing the inner tree, otherwise we might see stale references to instructions prior to the call that no longer guarantee certain types (since the inner tree overwrite them.) 2008-08-19 13:11:18 -07:00
Andreas Gal
1ded8ec0ad Merge. 2008-08-19 11:32:52 -07:00
Andreas Gal
e79f9ed689 Intern globals per-context, not per tree, which allows transitioning between trees that use globals. The type of all global slots compiled code uses is expected to remain stable, otherwise the entire code cache has to be flushed. Changes to the shape of the global object also flush the code cache. Working for trace-tests.js, but fails math-partial-sum.js 2008-08-19 11:32:36 -07:00
David Anderson
b279c87417 Disabled 64-bit JIT for now, failing 3 test cases. 2008-08-19 11:19:56 -07:00
David Anderson
ee4a887045 Merge. 2008-08-19 11:02:57 -07:00
David Anderson
aef458673b Fixed codegen bug for amd64 64-bit binary ops. 2008-08-19 11:00:17 -07:00
Brendan Eich
c2229dbd5e Back out changeset 1d0574db8320 (for 450997), it was based on a bum steer. 2008-08-18 22:18:33 -07:00
Andreas Gal
dfb94ccec1 Add a global type map to the monitor and rename slotList to globalSlots. 2008-08-18 21:08:35 -07:00
Brendan Eich
76380c598b Add a final js_ReconstructStackDepth assert after setting fp->regs->sp in js_ExecuteTree's bail-out epilog. 2008-08-18 19:26:47 -07:00
Brendan Eich
87a6e416ef 1. Fix json2.js (it crashes later, another bug) to restore a non-empty stack for a call with missing args after a nested bail-out. This involves changing js_SynthesizeFrame to return the number of stack slots it reconstructed that map to native slots. It also means not counting the missing args in the spdist uint16 pushed onto the state.rp stack (this was the root of all over-counting evil, for this bug).
2. Use if (C) { do {...} while (C); } instead of if (C) { while (C) {...} } and other style fixage.
2008-08-18 18:36:05 -07:00
David Anderson
e503629dbe Fixed AMD64 accidentally treating the shape as a 64-bit integer. 2008-08-18 17:36:24 -07:00
David Anderson
908183cf6f Merge. 2008-08-18 16:38:32 -07:00
David Anderson
0f46c5d568 Fixed some bugs in the AMD64 port, still crash in 5 sunspider tests. 2008-08-18 16:23:37 -07:00
Brendan Eich
21b6e353e2 Cosmetic cleanup. 2008-08-18 15:32:17 -07:00
Andreas Gal
f1b353f1c2 Add a place to store the current shape of the global object as we add slots it the global slot list. 2008-08-18 13:14:19 -07:00
Andreas Gal
ad4bfa3b5b Add a global slot list to the trace monitor. 2008-08-18 13:12:19 -07:00
David Anderson
938044313a Added AMD64 JIT building to the makefile. 2008-08-18 12:57:35 -07:00
Andreas Gal
199891edab Merge. 2008-08-18 12:55:09 -07:00
David Anderson
751ef6d2af Improved AMD64 nanojit compatibility. 2008-08-18 12:54:04 -07:00
Andreas Gal
afc782cbe2 Make sure to trasm the vmprivate of dependent trees as well. 2008-08-18 12:53:38 -07:00
David Anderson
d584e27cb8 Fixed compiling on AMD64. 2008-08-18 12:41:55 -07:00
David Anderson
b39fadd1f3 Updated nanojit for the AMD64 patch. 2008-08-18 12:32:14 -07:00
Andreas Gal
f7aac4002e Tighter fencepost in getTop, don't overshoot the stack (450997). 2008-08-18 10:09:24 -07:00
Andreas Gal
202a9de38b Doh. Deep bailots are pretty rare and js_SynthesizeFrame already uses the fairly slow js_ReconstructStackDepth helper internally, so anotherone to avoid counting stack slots via spbase can't hurt. 2008-08-18 10:04:03 -07:00
Andreas Gal
e7645176d5 Merge. 2008-08-18 08:03:51 -07:00
Andreas Gal
535584eecb Add a method to type map that captures missing slots (which have been lazily added to the slot list since the type map was created.) 2008-08-18 07:32:42 -07:00
Brendan Eich
4d8c1fda9b Fix missing paren in comment; also s/scope/frame/ in same comment. 2008-08-17 12:04:33 -07:00
Andreas Gal
9f71dd226f Extend the globalTypeMap import(), not in the caller, since we missed extending it in case of re-reading registers after a tree call. 2008-08-17 11:38:49 -07:00
Andreas Gal
f08e18fc14 If RecordTree is triggered, create a new peer fragment (or recycle and unused one) if we already have a tree for this location. 2008-08-17 00:49:59 -07:00
Andreas Gal
2d983bcee2 Try to execute the tree first, and if that fails worry about counting and triggering compilation. This speeds up trace activiation by a tiny bit, but makes code that we can't trace a little bit slower. We use a micro optimization to bypass the call to js_ExecuteTree when its clear that it wouldn't find a tree to executed to reduce this overhead. This change is necessary for multiple trees per bytecode location. 2008-08-17 00:30:36 -07:00
Andreas Gal
ef8a6041cc Give root fragments a treeInfo decorator only if the trace was successfully compiled. Otherwise just keep a reference in the recorder and delete it when the recorder is destroyed. Review welcome. The involved state machine is a bit complex. Added lots of asserts as safety net. 2008-08-16 23:43:49 -07:00
Andreas Gal
26fc76213a Only capture the shape of the global object in a tree once that tree tries to access a global, and only check the stored global shape in trees against the current global shape if the tree actually uses globals (which also doesn't trash trees when global variables are added if that tree doesn't actually use globals.) This is approx. a 1% win for sunspider. 2008-08-16 21:05:03 -07:00
Andreas Gal
efd76e5daf Change interface of js_ExecuteTree to indicate which of the peer fragments it really executed (since we soon will have more than one tree that could be activated for that particular bytecode location). 2008-08-16 15:45:48 -07:00
Andreas Gal
c7f1119cef Add a ->first pointer to all fragments that points to the first fragment in the peer list. This is the fragment we do JIT throttling/blacklisting on. 2008-08-16 15:41:21 -07:00
Andreas Gal
af92aac55a Append peer fragments at the end of the list (so f->blacklist() always counts against the same fragment). 2008-08-16 11:42:38 -07:00
Andreas Gal
dcb470b104 Add a simple script that calculates an aggregate score over all tests running with the jit in t/*. 2008-08-15 20:26:45 -07:00
Andreas Gal
b9e946d830 Merge. 2008-08-15 20:16:46 -07:00
Andreas Gal
7b954b5cd7 Add the concept of peer fragments to nanojit. Each loop fragment can have a number of peer fragments, which we can use to have several different specialized variants of a loop (i.e. for different types). The makefile doesn't pick up the change to Fragmento.h, so make sure you clobber by hand or you will end up wasting an hour of your life in gdb (like me.) 2008-08-15 20:15:47 -07:00
Brendan Eich
ede29d299e Merge. 2008-08-15 18:02:30 -07:00
Brendan Eich
bfc9f75d14 Update stale comment. 2008-08-15 18:01:26 -07:00
Andreas Gal
10a24ff80c Don't allow inner trees to lazily pick up any globals since we currently can't handle that. We already ensure that we don't inline trees that have globals. This patch merely makes sure they don't get some additional globals on the fly. 2008-08-15 18:00:22 -07:00
Andreas Gal
dea1843401 Similarly to attaching new branches to a side exit, we might end up with a partial type map when exiting from a trace during tree execution, so make sure to merge in missing types from the tree's entry map in this case as well. 2008-08-15 17:11:57 -07:00
Andreas Gal
1d0582a6ec Add test case for type map merging (450535). 2008-08-15 16:04:44 -07:00