Commit Graph

571 Commits

Author SHA1 Message Date
Graydon Hoare
0b98b2e8cb Bug 472180 - Move fragment hit and blacklist counts to hashtable in oracle, r=gal. 2009-01-23 14:24:50 -08:00
Jason Orendorff
9ff9140ae0 Bug 468782 - TM: js_FastValueToIterator and js_FastCallIteratorNext can reenter. r=brendan. Note that this changeset alone does not fix the bug; an upcoming patch in bug 462027 completes the fix.
--HG--
extra : rebase_source : 585d590aace159914629a786489b0883d23cf2a8
2009-01-22 16:39:26 -06:00
Andreas Gal
d940283d33 Fix incorrect reliance on the identity of the global object on trace (474888, r=brendan). 2009-01-22 17:58:18 -08:00
David Anderson
b3ff178462 Specialize trees to global types, so global type instability does not flush the cache (bug 469044, r=gal,brendan). 2009-01-22 01:45:19 -05:00
Jeff Walden
314cf39c41 Bug 472592 - unbox_jsval is infallible, make the signature reflect that. r=gal 2009-01-11 13:57:42 -08:00
Jeff Walden
179a1749fb Despite the previous log message, the previous push was r=brendan 2009-01-10 15:25:03 -08:00
Jeff Walden
949fc3d056 Bug 466905 - Fix JSOP_NEWARRAY to be not-buggy and use it when possible. NOT REVIEWED YET 2009-01-10 12:15:08 -08:00
Graydon Hoare
8424af9530 Bug 472553 - Annotations required by jsstack.js analysis, r=jorendorff. 2009-01-07 14:14:51 -08:00
Jason Orendorff
7f92f10b08 Bug 468641 - TM: Add bytecode disassembly to JS_JIT_SPEW output (r=crowder) 2009-01-06 16:51:32 -06:00
Andreas Gal
61a1479f3e Don't try to deallocate the trace recorder from inside one of its own instance methods (472049, r=brendan). 2009-01-05 16:13:53 -08:00
Andreas Gal
8b28ae8610 Store frame state information in the code cache and merely put a pointer to it onto the native call stack (470375, r=danderson). 2009-01-01 17:55:43 -08:00
Jeff Walden
af717d86d5 Bug 470739 - Trace more == cases. r=gal 2008-12-26 14:48:33 -05:00
Igor Bukanov
5d5cb0738c bug 469233 - using interrupt hook support in the interpreter for trace recording. r=brendan 2008-12-21 12:55:09 +01:00
Igor Bukanov
8062218e55 Backed out changeset 605fd1985d05 - more merge typos. 2008-12-21 12:50:36 +01:00
Igor Bukanov
1be7edd38e bug 469233 - using interrupt hook support in the interpreter for trace recording. r=brendan 2008-12-21 12:31:38 +01:00
Igor Bukanov
635ca1d23a Backed out changeset f13e2a2a5d66 - I was not careful when merging the unary op changes 2008-12-21 12:23:08 +01:00
Igor Bukanov
3388b615ce bug 469233 - using interrupt hook support in the interpreter for trace recording. r=brendan 2008-12-21 00:16:41 +01:00
Jeff Walden
4710efd8a4 Bug 469942 - TM: 20% slower to compute unary +/-. r=brendan 2008-12-19 19:30:09 -08:00
Brendan Eich
90fd9c4313 Merge m-c into tm again. 2008-12-18 22:11:42 -08:00
Brendan Eich
9af4f618a7 Bug 470300 - "Assertion failure: StackBase(fp) + blockDepth == regs.sp" with |let| (r=gal). 2008-12-18 21:08:57 -08:00
Andreas Gal
bbf40348b6 Trace apply/call with an imacro (465214, r=brendan). 2008-12-18 19:20:47 -08:00
Jeff Walden
201e000573 Bug 470133 - TM: fails to trace case with a type mismatch. r=gal 2008-12-18 10:35:09 -08:00
Andreas Gal
3af573343f Backed out changeset 95b210c2fc92 preemptively. Seems to crash the browser. 2008-12-17 23:09:26 -08:00
Andreas Gal
62f0547add Trace apply/call using an imacro (465214, r=brendan). 2008-12-17 22:53:35 -08:00
Brendan Eich
56658da21f Bug 465460 - TM: valueOf ignored on third iteration of loop (r=gal). 2008-12-16 19:03:42 -08:00
Robert Sayre
443f738d12 Backed out changeset f682453c06d0. Failing scriptaculous unit tests, doesn't build on windows or mac ppc. 2008-12-11 20:43:32 -08:00
Brendan Eich
ece10ee8df Bug 465460 - TM: valueOf ignored on third iteration of loop (r=gal). 2008-12-11 17:50:56 -08:00
Jeff Walden
6afac16038 Bug 465255 - Rewrite TraceRecorder::cmp, take five. (Three, sir!) Three! r=gal 2008-12-08 21:11:56 -08:00
Jason Orendorff
b7fb9bc849 Bug 460865 - Read barrier for cx->fp. r=mrbkap, r=dmandelin.
--HG--
extra : rebase_source : 19963188b2f9f96336ce6ca28dbaefccf3a639b7
2008-12-09 10:38:32 -06:00
Jeff Walden
e48c310d01 Dangit, why do the tests run correctly locally in small batches? Backing out bug 465255... 2008-12-08 22:19:54 -08:00
Jeff Walden
f143157358 Bug 465255 - Rewrite TraceRecorder::cmp, take two. r=gal 2008-12-08 21:11:56 -08:00
Jeff Walden
77eeb36575 Back out bug 465255, seems I was wrong about the compile error and warning being the only bugs. 2008-12-05 19:51:35 -08:00
Jeff Walden
6cb6d5d43b Bug 465255 - Rewrite TraceRecorder::cmp. r=gal 2008-12-05 16:17:59 -08:00
Andreas Gal
3653f3cb56 Merge. 2008-12-04 18:14:17 -08:00
Andreas Gal
e367780a2f Trace apply and call (462482, r=brendan). 2008-12-04 18:07:18 -08:00
Graydon Hoare
5a94caadef Bug 454569 - Improve accuracy of tracemonkey's oracle, r=gal. 2008-11-24 14:53:27 -08:00
David Anderson
56fbffe8c4 Allow recorders to trash multiple trees on the way out (bug 466128, r=gal). 2008-11-21 15:31:59 -08:00
Brendan Eich
37c40ca7c0 Merge. 2008-11-17 16:29:40 -08:00
David Anderson
321ce0dc05 Deep abort recorders outer recorders if we need to flush the JIT cache early (bug 463829, r=brendan,gal). 2008-11-15 18:54:24 -06:00
Brendan Eich
bab1f697ee Bug 464978 - TM: hang with "[] + null" (r=danderson). 2008-11-15 10:33:50 -08:00
Brendan Eich
cb47c4cf08 Bug 456511 - (imacros) TM: Make conversion work on arbitrary JSObjects (r=gal). 2008-11-13 00:30:20 -08:00
Andreas Gal
074d900a57 Backed out changeset a40f2117bcc0 2008-11-12 17:39:48 -08:00
Brendan
0ca607d76b Add imacros to support conversion of arbitrary JSObjects (456511, r=gal). 2008-11-12 16:55:45 -08:00
Andreas Gal
55c5823950 Backed out changeset 594ec832d9a8 2008-11-07 18:19:35 -08:00
Andreas Gal
54ba19de70 Trace Function.apply and Function.call (462482, r=brendan). 2008-11-07 15:58:52 -08:00
Andreas Gal
43daeaca87 Don't spill type definitions in avmplus.h into the global namespace (462288, r=danderson). 2008-11-07 15:52:51 -08:00
Andreas Gal
e609f0bb95 Cleanup GuardRecord, SideExit, and InterpStruct and extract VM-dependant fields (463313, r=danderson). 2008-11-07 15:23:43 -08:00
Jason Orendorff
5fdc83f169 Bug 462459 - TM: Better tracer support for |new Array(...)|. r=gal. 2008-11-05 07:29:38 -06:00
David Anderson
158e7f3bb0 Don't cache pointer to recorder since it might change in js_MonitorRecording (462980, r=gal). 2008-11-03 20:57:50 -08:00
Boris Zbarsky
d1afdda41f Bug 462184. Make INCLUDE_VERBOSE_OUTPUT actually work, and rename it to JS_JIT_SPEW. r=brendan 2008-10-29 21:56:35 -07:00
Brendan Eich
6ddc16bbe2 Bug 462103 - TM: We don't trace some variants of string + other type (gal+brendan red-headed stepchild). 2008-10-29 00:14:30 -07:00
Andreas Gal
7da6b31283 Handle dslots == NULL case when reading past the actual length of an array (461974, r=danderson). 2008-10-28 22:40:10 -07:00
Andreas Gal
25404443ff GC no longer flushes the JIT cache. Instead just make sure the shape of the global object will mismatch next time we try to record or execute code, which in turn will force a flush of the code cache (458288, r=brendan/danderson). 2008-10-28 16:22:08 -07:00
Brendan Eich
bad1b50498 Re-land patch for bug 458851 now that latent bug it uncovered (not filed; see hg log) is fixed. 2008-10-28 14:04:29 -07:00
Jason Orendorff
37724bb378 Backed out changeset d4fe79372140 (bug 458851) due to persistent orange on TraceMonkey tinderboxes. 2008-10-28 10:49:06 -07:00
Brendan Eich
51f987553a Bug 458851 - TM: for-in loops skip every other value in certain cases (r=gal/mrbkap). 2008-10-27 22:30:52 -07:00
David Anderson
bf1a78f4fe Implemented multiple type specialized trees per entry point (bug 450833, r=gal) 2008-10-27 20:42:49 -07:00
Andreas Gal
06b393e8a2 Trace reading from dense arrays out of bounds and trace undefined -> number conversion in binary ops (461611, r=brendan). 2008-10-24 21:51:04 -07:00
David Anderson
590d3d2443 Fixed crash from JIT cache flushes when js_Interpret was holding TraceRecorders (bug 458288, r=brendan). 2008-10-24 10:47:59 -07:00
Andreas Gal
5cc94e1d59 Re-use loop exit side exit if we already have one for that PC location and the same type map (461076, r=danderson). 2008-10-22 16:27:25 -07:00
Andreas Gal
e2a6acb46a Use LIR_loop for loop edge to avoid going into a side exit handler at every loop edge (461231, r=danderson). 2008-10-22 16:00:08 -07:00
Andreas Gal
ec7efc925c Remove code to unlink trees to reduce the size of GuardRecord. Allow GuardRecords to share one common SideExit structure. The VM places both explicitly into the LIR (460538, r=danderson). 2008-10-21 17:50:32 -07:00
Graydon Hoare
bf84bf6273 Merge tamarin-redux (nanojit2) into tracemonkey (457786, r=edwsmith,gal,danderson). 2008-10-13 13:29:18 -07:00
Jason Orendorff
6b88d0da8d Bug 459426 - Reunite record_JSOP_{NEW,CALL}. r=gal. 2008-10-13 11:04:26 -05:00
Andreas Gal
9bfc3c5072 Properly recover from a nested side exit with more than a single level of nesting (459539, r=danderson). 2008-10-12 15:39:32 -07:00
Andreas Gal
9a086f63ae Don't carry around oldpc in AbortRecording path (459321, r=danderson). 2008-10-09 16:17:13 -07:00
Andreas Gal
c974289da5 Support thin loops (iteration < 2) by closing the loop even if we are on the last iteration (456431, r=danderson). 2008-10-08 21:02:04 -07:00
Andreas Gal
fb350afe17 Non-fused ifs emit different comparison code than the interpreter uses (459151, r=danderson). 2008-10-08 16:23:54 -07:00
Jason Orendorff
a27d101dab Bug 458735 - Improve internal API for traceable natives (r=brendan, nanojit r=edwsmith) 2008-10-08 17:08:33 -05:00
Andreas Gal
1b0fd40e30 Trace push and pop for dense and sparse arrays (453734, r=brendan). 2008-10-07 11:00:16 -07:00
Brendan Eich
f875d89fa2 Bug 456810 - TM: Crash on digg.com with adblock plus [@ ReconstructPCStack] (r=gal). 2008-09-25 15:04:48 -07:00
Andreas Gal
5b117e1c3f Rewrite and cleanup GETELEM and SETELEM (455748, r=brendan). 2008-09-25 11:31:40 -07:00
Andreas Gal
f1cdf0fd1c Make sure JSOP_DEFLOCALFUN pushes the right function object (456470, r=brendan). 2008-09-24 19:31:51 -07:00
Andreas Gal
619234db4c Back out attempt to invoke natives that return a boxed value (namely push and pop, 453734). 2008-09-24 15:18:19 -07:00
David Anderson
ccd5e825b9 Fixed jstracer's operator delete leaking out into other shared libraries (bug 452721, r=gal). 2008-09-23 18:12:53 -07:00
David Anderson
b3141a864c Fix where recording could crash if globalObj->dslots got reallocated (bug 451137, bug 455137, r=gal). 2008-09-23 13:29:41 -07:00
Andreas Gal
df641c58e5 Compilation fixes for DISABLE_JIT=1 (r=danderson). 2008-09-22 13:04:47 -07:00
Andreas Gal
9d7afa336a Add support for fast native that return jsval and wire up push/pop (453734, r=mrbkap). 2008-09-18 16:53:09 -07:00
Andreas Gal
708f08ca9c Properly handle side exits in scripted constructors (originally mrbkap, r=brendan, 453462). 2008-09-18 14:13:37 -07:00
Andreas Gal
f074cc7a9f Cleanup and unify comparison code (455811, r=danderson). 2008-09-18 13:31:26 -07:00
Andreas Gal
a580bcd185 Implement comparison of numbers against null (455293, r=brendan,danderson). 2008-09-15 15:30:06 -07:00
Brendan Eich
a834957775 TraceRecorder::record_SetPropMiss mis-layered on top of record_SetPropHit (454689, r=mrbkap). 2008-09-11 15:53:00 -07:00
Benjamin Smedberg
b7c5804c10 Merge backout of the old patch for bug 453388 - we can statically allocate Oracle again, now that we're linking using the C++ linker magic, r=crowder 2008-09-10 15:38:28 -04:00
Benjamin Smedberg
bfeb170706 Merge backouts of bug 453388 - using g++ to link libjs.so means we can have static classes 2008-09-10 15:27:17 -04:00
Benjamin Smedberg
e780e5e3ea Backed out changeset e2614011f194 - Bug 453388 - the better solution is to allow static objects and link libjs.so with g++ so that _init and _fini run static constructors/destructors correctly backout r=crowder 2008-09-10 15:20:01 -04:00
Brendan Eich
ce15bc7cd3 Bug 454039 - TM: don't abort TraceRecorder::record_JSOP_SETPROP on cache miss (r=mrbkap). 2008-09-09 22:22:52 -07:00
Brendan Eich
7d5c49516c Back out patch for bug 454039. 2008-09-09 16:55:07 -07:00
Brendan Eich
c7b40d9f99 Bug 454039 - TM: don't abort TraceRecorder::record_JSOP_SETPROP on cache miss (r=mrbkap). 2008-09-09 16:05:04 -07:00
David Anderson
cd9032e6fe Fixed Linux build, extra qualification on member function. 2008-09-09 13:20:44 -07:00
Andreas Gal
6a76d26107 Extract the snapshot code for a single slot into determineSlotType() und use that method in snapshot(). 2008-09-09 15:06:23 +02:00
Brendan Eich
fc936fa1da Checkpoint arguments tour-de-force (453730). 2008-09-05 18:29:08 -07:00
Vladimir Vukicevic
a4ec50d569 Add VFP for floating point ops to nanojit ARM backend. 2008-09-02 22:29:23 -07:00
Vladimir Vukicevic
420e72ed85 b=449526, TM: fix up ARM code generation / softfloat 2008-09-02 22:29:23 -07:00
Andreas Gal
f91071f139 Allocate the oracle dynamically instead of making it a global object to avoid atexit C compatibility issues (453388, r=danderson). 2008-09-02 21:56:22 -07:00
Andreas Gal
4a36a6b709 Backed out changeset 25f856429db3. Wrong fix. Looks like jstracer.h is not included. We in fact can call methods of TraceRecorder directly. Sigh. I wish we had a try server. 2008-09-01 18:37:04 -07:00
Andreas Gal
fe70cfea9b Introduce js_DeepAbort to be used from jsinterp.cpp, instead of trying to call TraceRecorder->deepAbort directly (453235). 2008-09-01 18:32:41 -07:00
Brendan Eich
c7604aac4c - Support JSOP_CONDSWITCH's JSOP_CASE and extended-jump-offset JSOP_CASEX variants properly.
- Fix sleep-deprived constant conditions due to failure to test flags & CMP_TRY_BRANCH_AFTER_COND!
- Use new TraceRecorder::fuseIf that Andreas added in a few more places where the previous try-branch-after-cond logic was open-coded.
2008-08-30 00:01:59 -07:00
Blake Kaplan
219161a0aa Abort (deeply) if we re-enter js_Interpret in the middle of a trace. r=brendan 2008-08-29 18:59:21 -07:00
Andreas Gal
57a8fae3d1 Merge. 2008-08-29 15:17:20 -07:00
Andreas Gal
9e7246a2b9 Track locations of control-flow merges in cfgMerges during recording (452869). 2008-08-29 15:12:17 -07:00
Brendan Eich
655888f31e Consolidate equal and cmp code harder, trace switch ops, use INS_CONST more (bug to be filed -- bugzilla down atm). 2008-08-28 23:50:48 -07:00
Andreas Gal
1115d0162b Unroll loops we were not able to call once, but only if we don't have a tree available for that loop header. 2008-08-28 23:19:23 -07:00
Andreas Gal
4fb4d1fdc5 Monitor downward branches only during recording (452709). 2008-08-28 22:33:22 -07:00
Andreas Gal
c0e0852952 Notify the monitor of all branches, not just backwards branches. 2008-08-28 17:00:52 -07:00
Andreas Gal
453ea3339f If the inner tree cannot be adjusted to match the call site of the outer tree because it uses an int where the outer tree uses a double, trash the inner tree, not the outer one. In CallTree, return the innermost guard we return from, not the outermost one. Jump over at most 1 loop edge that doesn't go back to our own header, not an arbitrary amount. 2008-08-28 14:24:58 -07:00
Andreas Gal
c466258c18 Limit tree growth to 16 traces per tree to avoid code explosion due to tail duplication (452869, r=danderson). 2008-09-02 23:52:11 -07:00
Andreas Gal
2316d281a0 Keep unrolling inner loops as long we are not hitting the same inner loop edge twice in a row (452362). 2008-08-27 17:48:15 -07:00
Andreas Gal
cff18f06cd Fix trashing of inner trees. Keep track of trees that call to a tree and flush them as well since they directly embed the code address. Since flushing an inner tree might invalidate the tree we are currently compiling, trees are now trashed in the destructor of TraceRecorder. 2008-08-27 17:25:56 -07:00
Andreas Gal
eb0c261390 When extending an outer tree from its nesting guard, the guard we actually exited on determines the typemap for the current frame and all inlined frames, whereas the nesting guard is consulted for all type information frames below the current frame. 2008-08-26 01:00:53 -07:00
Andreas Gal
fc5667ef13 Split closeLoop() and compile() and add endLoop(), which omits an always-exit guard (will be used for break statements.) 2008-08-25 15:17:46 -07:00
Andreas Gal
71b12b53fe Enable outlining. If a loop doesn't connect back to its own header (i.e. break inside the loop), see if the outer loop path can be attached to the inner loop (outerlining). Added test case (failure mode is high number of activated traces in trace-test.js). This test exposes a regression in access-fannkuch. Committing so we can diagnose that separately. 2008-08-23 15:11:38 -07:00
Andreas Gal
454b252c63 If the outer loop has a value in a float register but the inner tree expects an int, tell the oracle that we want doubles in that slot in the inner tree and trash the inner tree so it gets re-compiled with a matching layout (451673). 2008-08-22 17:31:23 -07:00
Brendan Eich
9e4119701e Merge. 2008-08-20 22:44:16 -07:00
Brendan Eich
e9b635b38a 1. Add activeCallOrGlobalSlot, used by JSOP_NAME, JSOP_CALLNAME, etc. recorders to cope with Call objects on the scope chain, if they represent still-active frames covered by callDepth.
2. Add builtin for eval, to be optimized further, to handle very short eval'ed programs as found in popular benchmarks.
3. Add common scopeChain TraceRecorder helper, to generate the LIR to load cx->fp->scopeChain.
4. Add ABORT_TRACE to LeaveFrame for clarity.
2008-08-20 22:40:39 -07:00
Andreas Gal
8468ac7444 Support multiple returns from called trees by continueing the outer tree with a new nested guard. 2008-08-20 22:37:00 -07:00
Andreas Gal
fdb661bd5e Clear the oracle on every GC. 2008-08-20 16:01:56 -07:00
Andreas Gal
98f67af6d0 Add a way to clear the oracle. 2008-08-20 15:18:43 -07:00
Andreas Gal
3a4d105a0f If the outer tree has a slot in an integer register, but the inner tree expects a double, make sure to promote the value before calling the tree, otherwise the inner tree will read the value from the stack incorrectly. 2008-08-20 00:51:56 -07:00
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
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
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
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
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
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
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
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
Andreas Gal
e702dc5ac4 When re-importing register values after a tree call, make sure to use the inner tree's nativeStackBase, since we also use the inner tree's sp. 2008-08-13 16:29:59 -07:00
Andreas Gal
27c128f706 Merge. 2008-08-13 15:50:40 -07:00
Andreas Gal
e68f9ee859 Read back registers used by inner tree relative to inner_sp (the adjusted sp value). Print frames we enter into and return to in Enter/LeaveFrame. 2008-08-13 15:50:11 -07:00
Brendan Eich
3d21588b2c Major and winning overhaul to for-in codegen (mad props to Andreas for advice). 2008-08-13 14:02:35 -07:00
Andreas Gal
fa09943222 Flexible call stack allocation with proper guarding for call stack overflows. 2008-08-13 13:51:59 -07:00
Andreas Gal
a271a0ee0e When re-importing registers after a tree call, make sure to use the inner trees calldepth at its side exit, not the call depths of the calling tree. 2008-08-12 23:25:17 -07:00
Andreas Gal
58cd4dc419 Introduce a large fixed-size native frame stack and store its ceiling in state->eos. 2008-08-12 21:39:44 -07:00
Brendan Eich
827b341985 Consolidate common name (global slot) addressing code. 2008-08-12 09:42:29 -07:00
Brendan Eich
fd08308ba0 Fix goto over init whinage. 2008-08-12 09:18:19 -07:00
shaver@mozilla.org
9d4a33a8c6 guard all of jstracer.h against non-tracer builds 2008-08-12 11:36:29 -04:00
shaver@mozilla.org
1813fb2fa7 NAMEINC, INCNAME, NAMEDEC, DECNAME 2008-08-12 11:33:40 -04:00
Brendan Eich
d2e6e9e641 Factor forInOp from JSOP_FORLOCAL, use it from JSOP_FORARG's recorder too; tighten up JSOP_SETNAME. 2008-08-12 00:34:43 -07:00
Brendan Eich
bba0ea3906 Rename js_DestroyJIT to js_FinishJIT to match Init/Finish vs. New/Destroy naming scheme used elsewhere; use same #if conditions around #include jstracer.h as around code depending on it. 2008-08-11 19:17:30 -07:00
David Anderson
9c0315ccf7 Fragmento lifetime is now associated with the thread/runtime instead of the context. 2008-08-11 18:47:22 -07:00
David Anderson
c5a85f7524 Merge. 2008-08-11 16:14:29 -07:00
David Anderson
1b623f7d25 Added explicit deallocation (bug 443500, r=gal) 2008-08-11 16:01:21 -07:00
Andreas Gal
020e68ab1e Remove default parameter for guard, specify MISMATCH_EXIT explicitly. 2008-08-11 15:40:04 -07:00
Andreas Gal
7bcf550b11 If we get a series of tree type mismatches, trash the tree (and all dependent trees in case of nesting.) 2008-08-11 15:16:34 -07:00
Andreas Gal
120117749e Don't try to access the name of arguments beyond nargs (r=brendan). 2008-08-11 12:47:18 -07:00
Brendan Eich
64fc3b0367 - Fix shapeless callee guarding to guard on function object value.
- Add JSOP_NULLTHIS to help the tracer guard shapeless callees (see trace-tests.js)
- Culled bogus record_JSOP_CALLGVAR left-over forwarding to record_JSOP_GETGVAR.
- Better shapeless callee tests.
2008-08-10 22:36:48 -07:00
Brendan Eich
e5b0039eaa Match native map guard specializations in tracer to interpreter, particularly to skip up the proto chain from a dense array in JSOP_CALLPROP (json2.js showed an abort here, pointing to the tracer/interpreter discrepancy). 2008-08-10 11:54:27 -07:00
Brendan Eich
18248a701c Fix JSOP_FORLOCAL to push false when guarded conditions are false while recording (449961). 2008-08-10 10:42:21 -07:00
Brendan Eich
f028f26f52 Merge. 2008-08-08 16:40:45 -07:00
Brendan Eich
072c7b59a5 Guard against shapeless callees, with tests (more to do here, can't break the unknown callee case yet, but it should be breakable). 2008-08-08 16:37:01 -07:00
Andreas Gal
c7be42f2f3 Add very preliminary nesting for trees. This is disabled by default. To enable set TRACEMONKEY=nesting in the environment. 2008-08-08 15:26:31 -07:00
Brendan Eich
de40e589da Merge. 2008-08-08 14:45:27 -07:00
Brendan Eich
153e03bb32 Get operator new on interpreted functions working, along with JSOP_SETPROP on an unmutated object, or one of the right shape but where the setprop is adding the next property, and it's not in the object yet. 2008-08-08 14:38:44 -07:00
Andreas Gal
f2972efa5c Remove tracking of outer trees and merging of globals since globals will be maintained centrally soon, not attached to trees. 2008-08-07 19:40:41 -07:00
Andreas Gal
2d0c9c41ab Hand the script in when updating the oracle regarding global variable slots even if we don't use it right now. This will be useful for caching information across runtimes. 2008-08-07 17:43:13 -07:00
Andreas Gal
3ac96b066b Use a typedef SlotList instead of Queue<uint16>. 2008-08-07 17:22:21 -07:00
Andreas Gal
a21818bc72 Teach typemaps how to capture the types of all slots in a slot list. 2008-08-07 17:20:49 -07:00
Andreas Gal
d988d3523a Recognize loop edges that hit a nested tree. 2008-08-07 16:41:20 -07:00
Andreas Gal
600b9c3e14 Remove type-map hash code. A direct memcmp seems to be faster (probably some SSE magic behind it in gcc/glibc). 2008-08-07 16:26:56 -07:00
Andreas Gal
27e8ef817a Factor out the code to capture the current stack type map and move around the type map method implementations to make sure they can see the FORALL macros. 2008-08-07 16:23:50 -07:00
Andreas Gal
95f5262e4f Use an oracle to predict when slots are demotable. This allows trashing the TreeInfo* object in the root fragment more aggressively. Rebuild the stack type map at every compile to avert type map mismatches. Purge all global slot info when we re-record a tree. 2008-08-07 15:28:43 -07:00
Andreas Gal
e09041e2a5 If we run into an error during compilation, blacklist that fragment. If we run out of memory, flush the cache. 2008-08-06 22:26:20 -07:00
Andreas Gal
9385e7842c Add a helper to flush the JIT code cache (and the fragment lookup quick cache). On a global shape mismatch trash the entire cache (might be a bit overly aggressive). Similary, during GC flush the code cache. 2008-08-06 21:56:25 -07:00
Andreas Gal
d1a1a76121 Tracker outer trees for every tree and merge globals of inner trees into all outer trees as we register inner trees with outer trees. 2008-08-06 19:25:24 -07:00
Andreas Gal
6bb6800be5 Add a contains method to Queue. 2008-08-06 19:06:37 -07:00
Andreas Gal
1bf2697257 Add a helper to emit a tree-call into the currently recording trace. 2008-08-06 16:24:29 -07:00
Andreas Gal
fcaab6d007 Pull recompile flag out of the state and pass in as argument. Trash the tree if a secondary trace can't be connected to the loop header. This is very aggressive and might need more tinkering. Trashing the tree on every mismatch doesn't seem to work well, so thats currently disabled. 2008-08-06 13:37:29 -07:00
Brendan Eich
2cfdd9a55a 1. Don't store thisp literally in state.rp, get it from argv[-1]. 2. Fix DEBUG localNames code. 2008-08-01 10:40:38 -07:00
Brendan Eich
422ce674b5 Remove synthesizeFrames private declaration -- js_SynthesizeFrames is a static helper now. 2008-08-01 08:39:44 -07:00
Brendan Eich
8f837e0784 - Implement interpreter frame reconstruction (js_SynthesizeFrame).
- Fix MONITOR_BRANCH to restore frame-dependent interpreter locals (we want fewer of these if they can be removed with no perf loss).
- Fix FORALL_SLOTS_IN_PENDING_FRAMES not to scan argv in callee when it has scanned operand stack in caller.
- Fix import to take the localFrame from whose fun its localNames parameter was computed -- it was using cx->fp which is wrong when FORALL_SLOTS_IN_PENDING_FRAMES iterates other than the top of stack frame.
- A few interval tests that were double-ended are single-ended now.
- Add call.js mini-test (more cases needed).
2008-08-01 08:26:32 -07:00
Andreas Gal
4eba8e4012 Remove entryStackDepth. Calculate sp_adj relative to entryNativeStackSlots. 2008-08-01 02:33:54 -07:00
Andreas Gal
dd3ebd2cfe Make synthesizeFrame private. 2008-07-31 16:30:00 -07:00
shaver@mozilla.org
d200eb863e merge backout of d24e6005ee4c to fix the world 2008-07-31 06:36:53 -07:00
shaver@mozilla.org
f2c0c93637 Backed out changeset d24e6005ee4c (causing major array-fail). 2008-07-31 06:35:11 -07:00
Andreas Gal
e5a87ade9f Merge. 2008-07-31 01:35:56 -07:00
Andreas Gal
6f4cfc2628 Remove ANY_TYPE and move debug printf around to print entry point even if we can't enter due to type mismatch. 2008-07-31 01:35:18 -07:00
shaver@mozilla.org
a3bc7296d9 Make guard return expected, so we can trace alternate cases easily.
Better diagnostic for non-global scope chain head.
2008-07-30 22:59:13 -07:00
Brendan Eich
fe3a6127c5 - Export JSSLOT_ITER_* from jsiter.cpp to jsiter.h, for jstracer.cpp to use.
- Fix OBJ_GET_SLOT to be STOBJ_GET_SLOT in jsiter.cpp, no thread safety here (bug on file).
- Move JSNativeEnumerator from jsobj.cpp to jsobj.h for jstracer.cpp as well.
- Rename JOF_2BYTE JOF_UINT8 for consistency, and actually decompile it.
- Trace JSOP_FORVAR (can't do anything in JSOP_ITER, it comes before the loop).
- Shortened some guardMyLongSummerVacationWithinBounds names ;-).
- Removed/refactored to avoid dslots_ins obligation on all callers.
2008-07-30 16:32:33 -07:00
Andreas Gal
40696cff65 Note to self: hacking after 4am is detrimental to my spelling. 2008-07-30 04:20:48 -07:00
Andreas Gal
f1a5494d05 Major shakeup of the interning code for globals. Globals are now detected on demand as they are used and the slots are noted in treeInfo->globalSlots. At the same time the type is recorded in treeInfo->globalTypeMap. The stack type-map is maintained separately in treeInfo->stackTypeMap. All these structures are lists and are maintained as List<T> objects. Imports for globals can appear at the top (if we have already seen some imports for the loop header and are recompiling), or on the fly for lazily found values. We no longer intern all global properties that happen to match a name in the current function, and we also support inlining of functions that touch globals that are not used in the method where the trace started in. 2008-07-30 04:17:22 -07:00
Andreas Gal
7290f281a0 Use List<T> to maintain global slot list in TreeInfo. 2008-07-30 01:38:21 -07:00
Andreas Gal
f60c785137 Add a generic list data structure and fix side exit handling to always pick the right typemap to work with (exit map, not entry map). 2008-07-29 23:48:39 -07:00
Andreas Gal
79fa051958 Removed unused field from TreeInfo. 2008-07-29 17:14:36 -07:00
Andreas Gal
4d5b44839c Rename gslots to globalSlots. 2008-07-29 15:28:23 -07:00
Andreas Gal
5a7ac301e6 Limit tree growth to side exits that expicitly declare that they want to be grown. 2008-07-29 11:13:41 -07:00
Brendan Eich
3e4d484622 Fix synthesizeFrame parameterization, and have it reconstruct stack depth; warning and space fixes. 2008-07-28 23:47:20 -07:00
shaver@mozilla.org
9c4c8495f9 not-yet-working beginnings of frame reconstruction 2008-07-28 09:05:55 -04:00
Andreas Gal
6126f5fa5c Track the type of guards and react accordingly if we bail out on them. Guards that protect against out-of-memory conditions don't try to grow the tree. Instead we just resume the interpreter. 2008-07-27 16:18:53 -07:00
Andreas Gal
a3eb60b77e Add limited outerlining. Much of this will be subsumed by nested trees. 2008-07-27 14:28:56 -07:00
Andreas Gal
ca563057ee Remove guardCount. No longer needed. 2008-07-27 12:05:01 -07:00
Andreas Gal
8a7bb9c550 Smarter speculative demotion of numbers to integers and promotion of the trace seems to require actual doubles. If the number at entry looks like an int we make the slot an int and compile as such. If the loop-tail proves the slot to be a double, we recompile the trace. Currently such miss-speculation cannot be handled on secondary traces since we are currently unable to recompile the primary trace. Such secondary traces are blacklisted. 2008-07-27 02:15:17 -07:00
Andreas Gal
812989bb8a Eliminate EntryRegs. Its not safe to keep a reference to the entry SP since we might extend the tree from a different outer stack frame. Instead just store the entryStackDepth. 2008-07-25 18:22:15 -07:00
Andreas Gal
1b7930d39d The VP engineering broke JSOP_NAME! We have to check whether the slot is actually interned and otherwise abort. 2008-07-25 16:51:42 -07:00
Andreas Gal
dee805421b Factor out AttemptToGrowTree. 2008-07-25 02:00:02 -07:00
Andreas Gal
f3573b9940 Move trace activation code into js_ExecuteTree(). 2008-07-25 01:20:40 -07:00
Andreas Gal
e838b138b8 Don't demote slots in overly long traces (based on counting the number of guards, current threshold=32). 2008-07-24 16:25:18 -07:00
Andreas Gal
6df91a21a0 Make the interpreter notify us when frames are popped so we see he right cx->fp value. Fix return value tracking for JSOP_STOP. 2008-07-24 10:35:10 -07:00
Andreas Gal
41e0593392 Maintain a separate frame for globals using InterpState->gp.
This will allow nested loops to access the globals interned by outer loops while at the same time sharing parts of the stack of the outer loop.
2008-07-23 23:18:02 -07:00
Andreas Gal
5dd9876515 Lazy fill the stackTracker as we lookup the nativeFrameOffset for values. Purge all entries related to the current frame when it is popped. This code could be further simplified if Tracker was a template. 2008-07-23 02:57:56 -07:00
Andreas Gal
c9cac5757f Handle leaving of frames in one central place. 2008-07-22 20:16:12 -07:00
Andreas Gal
06365155c2 Avoid calculating native frame offset by tracking the last load/store for every slot and extracting the offset from there. 2008-07-22 17:54:04 -07:00
Andreas Gal
48b195e651 Avoid nativeFrameOffset calls in import(). 2008-07-22 17:24:29 -07:00
Andreas Gal
410c0b9a98 Eliminate entryFrame pointer (not safe to carry that around.) 2008-07-21 16:20:53 -07:00
Andreas Gal
f1ef7f0175 Eliminate exit filter, write the type map directly in snapshot. 2008-07-21 15:09:19 -07:00
Andreas Gal
bce8e13528 Remove excess parameters of verifyTypeStability. 2008-07-21 13:21:00 -07:00
Andreas Gal
a0cd046167 Track call depth in the trace recorder. This lays the groundwork to get rid of entryFrame. 2008-07-21 13:18:08 -07:00
shaver@mozilla.org
124244af4b beginning of entryFrame removal 2008-07-21 15:57:02 -04:00
Andreas Gal
5067fc2638 Merge. 2008-07-21 12:44:03 -07:00
Andreas Gal
e9b2918575 Rename VMFragmentInfo to TreeInfo. 2008-07-21 12:41:43 -07:00
shaver@mozilla.org
7546f723f5 force Math to be interned, and defend against non-interned globals until upvar saves us all 2008-07-20 17:23:39 -04:00
shaver@mozilla.org
ed1d0a8953 improve tracing/recording diagnostics 2008-07-20 15:42:19 -04:00
shaver@mozilla.org
ef2e8305dc Avoid tracking object properties, make incElem work. 2008-07-19 10:24:10 -07:00
Brendan Eich
a26be1bd4b Fix incProp to box and store (incElem still todo). 2008-07-19 10:24:28 -07:00
Brendan Eich
d1b171e5e2 First stab at incops, plus unbox_jsval tag-masking guard fixes, plus misc. cleanup. 2008-07-19 00:15:22 -07:00
Andreas Gal
47ae25da20 Make entryFrame/entryRegs relative to the tree entry since we only adjust ip/sp/rp when exiting from the tree, not in between fragments. 2008-07-18 16:21:22 -07:00
Andreas Gal
89b50ed124 Rework some of David's changes. Make sure we don't modify the tree until we are ready to attach the new fragment. Share lirbufs between tree branches. 2008-07-18 14:11:01 -07:00
David Anderson
4770d4b3e0 Got side exits seemingly working, added if.js to trace-test.js 2008-07-18 10:33:17 -07:00
shaver@mozilla.org
7078a99d21 When PROPERTY_CACHE_TEST misses, fall back to doing our own lookup via js_GetPropertyHelper. 2008-07-17 23:57:56 -07:00
Andreas Gal
dded69f2a3 Merge. 2008-07-17 17:13:41 -07:00
Andreas Gal
19ed222624 Disable trees for the time being. 2008-07-17 17:12:28 -07:00
shaver@mozilla.org
3db81baa04 Label globals and locals with their source-names in trace.
Show line number on abort.
2008-07-17 15:09:48 -07:00
Andreas Gal
954c5830e1 Added statistics and a js_DestroyJIT hook. Also use debug_only and not verbose_only as #ifdef DEBUG shortcut. 2008-07-17 10:22:40 -07:00
shaver
87eacb1139 Add setprop and tests for setprop and cleanup labling code for debug mode (m=gal). 2008-07-17 02:00:23 -07:00
Andreas Gal
9d6fa41738 Cleanup trace abort handling. 2008-07-17 01:29:41 -07:00
Andreas Gal
b243a8350a Better naming of the after_JSOP_CALL event (EnterFrame). 2008-07-16 23:00:59 -07:00
Andreas Gal
2442099090 Notify the recorder when a new frame was created by JSOP_CALL. 2008-07-16 22:58:06 -07:00
Andreas Gal
df5005a322 Hand in typemap the recorder is supposed to use (preparation for side exit compilation and trees). 2008-07-16 21:49:42 -07:00
Andreas Gal
def4afc614 Move the allocation of the LIR buffer and the FragmentInfo data structure creation (which includes typemap and interned global calculation) into loopedge. 2008-07-16 21:41:03 -07:00
Andreas Gal
db7e41ed40 Add generic recorder hooks that are called before and after all opcodes as we trace. We might want to instead just move to pre_OP and post_OP. 2008-07-16 17:29:08 -07:00
Andreas Gal
43b7ba1be4 Don't use a builtin for this. For functions its interned in the native frame. For global this we read from fp->thisp. Restore jsinterp.cpp and jsinterp.h (no longer need COMPUTE_THIS exposed). 2008-07-16 14:36:50 -07:00
shaver@mozilla.org
3a4c348313 Trace JSOP_THIS and JSOP_THISPROP.
Rename getprop to get_prop, just because.
Extract COMPUTE_THIS to jsinterp.h as JS_COMPUTE_THIS for reuse in tracer.
2008-07-15 21:37:00 -04:00
Andreas Gal
3aeb53f580 Add a few consts to char* pointers to pacify gcc 4.2. 2008-07-15 16:04:08 -07:00
shaver@mozilla.org
3693365174 rename getpropfromval, it burns mine eyes 2008-07-15 18:29:42 -04:00
Andreas Gal
1b783425aa Assign blame where blame is due. 2008-07-15 15:05:16 -07:00
Brendan Eich
3ccdb62685 Propagate error exceptions from TraceRecorder ctor; fiddle/trim space. 2008-07-15 10:26:15 -07:00
shaver@mozilla.org
7d7ece76a8 GETVARPROP, GETARGPROP, GETXPROP 2008-07-15 13:17:51 -04:00
Andreas Gal
5848fd6694 Generate a list of interned global slots (gslots) when we process the tree header. This list is then used whenever we iterate over the native frame. This is faster and safer than looking up properties in the global object every time. 2008-07-15 01:53:39 -07:00
Andreas Gal
84608819b9 Remove state exposing accessor functions from recorder and instead hand in that state via the constructor into ExitFilter. 2008-07-15 01:27:14 -07:00
Andreas Gal
1693476391 Guard in FragmentInfo on the shape of the global object. Don't check for the shape of the global object on the trace. 2008-07-15 01:08:13 -07:00
Andreas Gal
bac6ed12f4 Store list of interned global slots in struct FragmentInfo 2008-07-15 01:03:49 -07:00
Andreas Gal
9f761173f0 Added a callstack that will track the pc of the call that caused a function call to be inlined. This is necessary to recover from deep side exits inside inline functions. The callstack is subject to store elimination, so unnecessary stores to the stack will go dead automatically during compilation (i.e. if we inline a function that doesn't have side exits.) 2008-07-14 19:12:50 -07:00
Andreas Gal
e59427d0f7 Use JS_GetGlobalForObject to get the global object. Walking back the call chain is not equivalent and not safe. 2008-07-14 16:40:38 -07:00
Andreas Gal
30c7f0493e Reserve space for every global property that the current script has an atom for instead of trying to rely on ngvars. 2008-07-13 21:14:34 -07:00
shaver@mozilla.org
8ffe777b5a Incomplete stab at CALLPROP, added ABORT_TRACE for better diagnostics, make math_sin non-static in preparation for specializing call. 2008-07-11 20:59:10 -04:00
Brendan Eich
a17263a036 1. Fix !JS_THREADED_INTERP bugs in BRANCH and recording switch case generation.
2. Rename TraceRecorder op methods to record_JSOP_xxx to avoid shadowing JSOP_*
   enumerators used inside jsopcode.h macros -- death to ::JSOP_*!
3. Added atoms TraceRecorder member for giant literal pool scripts.
4. Condition assert in TraceRecorder::test_property_cache_direct_slot to avoid
   false positive when executing function code accessing a global.
2008-07-10 21:55:09 -07:00
Andreas Gal
4e34cfc559 IFEQ and IFNE are identical for us. We just expect the same boolean on the stack and side exit if not. 2008-07-10 20:35:19 -07:00
Andreas Gal
ca4e6419ee shaver's favorite operating system of choice doesn't like templates, so de-template tracker since we use it with LInsp only anyway. 2008-07-10 18:42:04 -07:00
shaver@mozilla.org
6a5deaf550 Decouple jscntxt.h from jstracer.h so that xpconnect doesn't try to include all of
nanojit.
2008-07-10 17:29:16 -04:00