Commit Graph

195130 Commits

Author SHA1 Message Date
Andreas Gal
bda3ded8af Add debugging facilities for typemaps and fix sp_adj calculation for tree calls. 2008-08-19 22:29:02 -07:00
Andreas Gal
4f574e7377 Support multiple fragments with different entry maps per PC location. 2008-08-19 20:30:16 -07:00
Andreas Gal
aa04b2ccaf Clear out the list of global slots when the shape changes. 2008-08-19 13:34:20 -07:00
Andreas Gal
5c1bcaf9e8 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
0f05ce6b00 Merge. 2008-08-19 11:32:52 -07:00
Andreas Gal
81ff872b3b 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
e614b47fa6 Disabled 64-bit JIT for now, failing 3 test cases. 2008-08-19 11:19:56 -07:00
David Anderson
f7ce4102c2 Merge. 2008-08-19 11:02:57 -07:00
David Anderson
61d44517d5 Fixed codegen bug for amd64 64-bit binary ops. 2008-08-19 11:00:17 -07:00
Brendan Eich
71fc057e8b Back out changeset 1d0574db8320 (for 450997), it was based on a bum steer. 2008-08-18 22:18:33 -07:00
Andreas Gal
b1400df8f3 Add a global type map to the monitor and rename slotList to globalSlots. 2008-08-18 21:08:35 -07:00
Brendan Eich
16c8a91e33 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
2ac6880199 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
736e0f3032 Fixed AMD64 accidentally treating the shape as a 64-bit integer. 2008-08-18 17:36:24 -07:00
David Anderson
9c97f1af57 Merge. 2008-08-18 16:38:32 -07:00
David Anderson
7f510f0d09 Fixed some bugs in the AMD64 port, still crash in 5 sunspider tests. 2008-08-18 16:23:37 -07:00
Brendan Eich
eee1b1202a Cosmetic cleanup. 2008-08-18 15:32:17 -07:00
Andreas Gal
80709eb7bd 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
bcb5cd6a9b Add a global slot list to the trace monitor. 2008-08-18 13:12:19 -07:00
David Anderson
6e1c8c7ba3 Added AMD64 JIT building to the makefile. 2008-08-18 12:57:35 -07:00
Andreas Gal
a75e5194c0 Merge. 2008-08-18 12:55:09 -07:00
David Anderson
9e6709f697 Improved AMD64 nanojit compatibility. 2008-08-18 12:54:04 -07:00
Andreas Gal
62424ea6de Make sure to trasm the vmprivate of dependent trees as well. 2008-08-18 12:53:38 -07:00
David Anderson
1e448baf21 Fixed compiling on AMD64. 2008-08-18 12:41:55 -07:00
David Anderson
db7cc342aa Updated nanojit for the AMD64 patch. 2008-08-18 12:32:14 -07:00
Andreas Gal
fa6839b132 Tighter fencepost in getTop, don't overshoot the stack (450997). 2008-08-18 10:09:24 -07:00
Andreas Gal
71e22110f6 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
6e03627225 Merge. 2008-08-18 08:03:51 -07:00
Andreas Gal
ec848cb082 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
f72369dd28 Fix missing paren in comment; also s/scope/frame/ in same comment. 2008-08-17 12:04:33 -07:00
Andreas Gal
a6ee96a0a4 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
bdab8b05a6 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
f353001dc4 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
0d8ae567b4 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
7494752ee6 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
44276098c7 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
7de9d2311c 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
d8d837f5ee 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
08a0cdd594 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
d7091898fa Merge. 2008-08-15 20:16:46 -07:00
Andreas Gal
e71a8dfa09 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
995207a6ab Merge. 2008-08-15 18:02:30 -07:00
Brendan Eich
5d0b92ee79 Update stale comment. 2008-08-15 18:01:26 -07:00
Andreas Gal
83b34a424a 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
1df8c04228 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
1a45073d39 Add test case for type map merging (450535). 2008-08-15 16:04:44 -07:00
Andreas Gal
31d28b1621 If we extend a tree along a side exit that knew about fewer global slots that we have now in the tree, merge in the types for those additional slots from the entry map (450535). 2008-08-15 16:00:24 -07:00
Andreas Gal
a91faa3c28 Funnel all write-backs to the stack and the global frame through TraceRecorder::writeBack() so we can intercept and manipulate them in one central location. 2008-08-15 14:47:49 -07:00
Andreas Gal
87f65aaf6b Enable nested trees by default. This is going to be exciting. 2008-08-15 10:21:07 -07:00
Andreas Gal
5be81adb30 I honestly to god don't know why this change is necessary but with this nesting works now for SunSpider and all of my test cases. The stack layout calculation needs some reviewing, seriously. 2008-08-15 10:19:24 -07:00