Commit Graph

17572 Commits

Author SHA1 Message Date
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
Andreas Gal
d51fdd4130 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
d356a10871 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
8938c62c44 Enable nested trees by default. This is going to be exciting. 2008-08-15 10:21:07 -07:00
Andreas Gal
432ca408ef 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
Andreas Gal
c42833b03c Merge. 2008-08-15 10:12:47 -07:00
Andreas Gal
91a71447a9 Change sp_adj in guards to always reflect the current stack depth, so if we enter a trace/loop with something on the stack, sp_adj will reflect always at least that minimum amount. InterpState->sp now always runs in parallel with regs->sp of the current frame. This breaks nesting badly. I really need help with the stack layout logic. 2008-08-15 10:09:36 -07:00
Blake Kaplan
40e749ecc6 bug 450765 - Fix aliasing in LIR.h 2008-08-15 09:55:32 -07:00
Blake Kaplan
a6f7e7c0f7 Merge 2008-08-15 09:35:16 -07:00
Blake Kaplan
5aa5360905 bug 450529 - pass pc to String.prototype.match so we can avoid unnecessary object creation when tracing. r=brendan 2008-08-15 09:29:03 -07:00
Andreas Gal
9474c22bf7 Merge. 2008-08-14 23:23:15 -07:00
Andreas Gal
07cb6236c0 Add callee onto the stack to make sure our native frame layout matches the interpreter during calls. 2008-08-14 23:22:51 -07:00
Brendan Eich
bb1e475a4d Fix gc hazard just introduced in fix for bug 450538. 2008-08-14 23:20:24 -07:00
Andreas Gal
1274eac1f3 Merge. I love hg. 2008-08-14 17:52:37 -07:00
Andreas Gal
6ba62a6fa7 Cleanup stack adjustment during tree calling. 2008-08-14 17:52:11 -07:00
Blake Kaplan
7bbee60c81 Don't just undepend the string, canonicalize it as well. 2008-08-14 17:31:39 -07:00
David Anderson
238cf072dd Merge. 2008-08-14 17:28:32 -07:00
David Anderson
a41cb6c005 Fixed js_ValueToNumber overwriting values on the stack as different types, causing the exit type map to assert. The breaking conversion was JSVAL_VOID becoming a NaN. (bug 450538) 2008-08-14 17:27:45 -07:00
Brendan Eich
af7353e4e9 Consolidate tracing-out-of-js_Interpret abort code at bottom of js_Interpret. 2008-08-14 17:00:03 -07:00
Andreas Gal
801923081c Make sure sp points to the native stack base of the inner tree when calling a nested tree. 2008-08-14 16:22:01 -07:00
Andreas Gal
13a4a98604 Merge. 2008-08-14 16:04:14 -07:00
Andreas Gal
1edbe7e6bf Don't over-compensate sp_adj (exclude the callee). 2008-08-14 16:02:33 -07:00
David Anderson
f2223e2048 Merge. 2008-08-14 15:29:25 -07:00
David Anderson
2c45d81524 Fixed recorder not aborting when leaving js_Execute (bug 450532). 2008-08-14 15:29:04 -07:00
Blake Kaplan
8440f739f0 Avoid the malloc altogether if we're going to use a unit string. 2008-08-14 15:19:57 -07:00
Vladimir Vukicevic
61a89af8e6 b=450176; trace parseInt and parseFloat; r=gal 2008-08-14 15:13:39 -07:00
Blake Kaplan
e0872c3629 bug 450641 - Add missing JS_free call. 2008-08-14 15:03:08 -07:00
David Anderson
9f7d261303 Fixed the known native arg handler from accidentally using 'continue' to break out of a loop one level higher. This was causing crashes when the arg didn't match the expected types (bug 450530). 2008-08-14 11:48:43 -07:00
Andreas Gal
d0056d1820 Assert on the recording table only if we have enabled the tracer (446551). 2008-08-14 09:04:22 -07:00
Andreas Gal
bfcf6a784d Write back outer tree frames, but exclude the current frame (which the next tree will do). This still crashes the trace-tests.js test case with nesting enabled and for the life of me I can't figure out why (try with TRACEMONKEY=nesting). 2008-08-14 01:44:32 -07:00
Andreas Gal
fa52d00c5a Backed out changeset 089406b2b0aa 2008-08-14 00:45:39 -07:00
Andreas Gal
55bc4df432 Add an explicit start frame parameter to the FORALL macros, which allows FlushNativeStackFrame to be used for other frames than just the topmost N ones. 2008-08-13 23:20:44 -07:00
Andreas Gal
a5e83b133c Fix outrageously incorrect comment. 2008-08-13 22:54:23 -07:00
Andreas Gal
d6e6e333e2 Added bitsinbyte-ish testcase to trace-test.js. This currently still crashes the VM in nested mode. 2008-08-13 21:44:01 -07:00
Andreas Gal
2f533e6051 Merge. I miss CVS. 2008-08-13 21:37:33 -07:00
Andreas Gal
0530506440 Restore state of the outer frames in case of a nested exit. Should be feature complete but needs more debugging. 2008-08-13 21:34:41 -07:00
Brendan Eich
bb2a177553 LOL ANDR3AS SUX0RZ!!! 2008-08-13 19:24:40 -07:00