Commit Graph

209 Commits

Author SHA1 Message Date
Andreas Gal
efb72df02a Re-integrate trace recording and trace activation infrastructure. Model more closely after Tamarin. 2008-07-04 00:51:30 -07:00
Andreas Gal
731614bfe9 Create a stub for each opcode in TraceRecorder and invoke them from the stubs that are pointed to by the recorder dispatch-table. 2008-07-03 23:57:57 -07:00
Andreas Gal
1d27756235 Extend dispatch table to include 256 extra cases for traceing. 2008-07-03 22:28:01 -07:00
Andreas Gal
62d0c7bbfb Switch back to mozilla-central jsinter.cpp. Lets try a different approach to attach the tracer to the interpreter. 2008-07-03 22:08:13 -07:00
Andreas Gal
ea9279b6d0 Sync with mozilla-central. 2008-07-03 21:45:09 -07:00
Andreas Gal
6eb6314e75 Support recording of ValueToECMAInt32, ValueToECMAUint32 and ValueToBoolean. 2008-07-02 21:48:42 -07:00
Andreas Gal
e39f6596d3 Fix returning from trace execution into the interpreter. 2008-07-02 18:00:13 -07:00
Andreas Gal
ce702fec67 Shortcut the wait time to activate fragments after compiling a new fragment. 2008-07-02 17:24:10 -07:00
Andreas Gal
523ba92b3d Use fragmento to track fragments and add proper trace activiation code. 2008-07-02 17:19:07 -07:00
Andreas Gal
e70272bfab Removed attempt to imply ints into doubles on the fly. This can't work. Use proper float loads where needed and add some initial code for builtin functions. 2008-07-02 14:38:12 -07:00
Andreas Gal
0d7c8f648b Indicated in a separate primitive when integers get stored as a double because they don't into a jsval. 2008-07-02 09:38:55 -07:00
Andreas Gal
8113879262 This patch eliminates ValueToECMAInt32 and instead tries to emit specialized code depending on the true type. 32-bit integers are detected and treated like integers in fetch_int via ValueToECMA32. Similarly, int store_int NewIntInRootedValue is used if the value is really an underlying int. NewIntInRootedValue is a nop on the trace. 2008-07-02 03:33:18 -07:00
Brendan Eich
d0966c0fc0 Clean up for-in ops and naming nit (443039, r=igor). 2008-07-01 18:59:18 -07:00
Andreas Gal
d3e7a57a68 Fix deallocation bug in the recorder. We will have to lift more code Tamarin's Interpreter to stabilize the recording. 2008-07-01 02:37:07 -07:00
Andreas Gal
1567618f99 Better naming (MARK_EXIT => MARK_REGS). 2008-06-30 18:41:22 -07:00
Andreas Gal
84274f1b33 Save the VM registers into markRegs at opcode entry and restore that state when ending or aborting recording. The same info is pushed into sideexit and used by guards. With this change we can eliminate the hack in MONITOR_BRANCH that had to adjust the stack pointer depending on the opcode type, and it also allows us to trace through the recently added boolean guard opcode fusing. This improves trace code quality, since only the pre-conditional check state is saved. The guard restores into that state, so the trace code doesn't have to emit the value of the conditional evaluation onto the stack, saving a handful ops. 2008-06-30 18:31:29 -07:00
Andreas Gal
19b4bcdc69 Save the side exit state at entry in to the opcode (since we want to restart ops) and enable store filter. 2008-06-30 17:12:52 -07:00
Andreas Gal
eff9ce9111 Disable fusing of conditional check and branch when recording. 2008-06-29 16:57:27 -07:00
Andreas Gal
b3060293c7 When a conditional branch instructions terminates the trace, we have to make sure its restartable, so put the conditional value it was deciding on back onto the stack by incrementing sp before jumping back to the outer interpreter. 2008-06-29 15:21:50 -07:00
Andreas Gal
253b2572b2 Initialize jump table when side-entering the interpreter. Keep track of cx and sp directly in the recorder instead of going through the tracker. 2008-06-29 13:53:40 -07:00
Andreas Gal
28d2ed62d9 Guard inside the clause, not seperately. 2008-06-29 12:21:16 -07:00
shaver@mozilla.org
d93ba06080 guard on inlined branch in TRY_BRANCH_AFTER_COND 2008-06-29 10:36:31 -04:00
shaver@mozilla.org
d571eaac32 Merge with mozilla-central as of c5dc9d84d476, and restore obj-to-boolean fixes
from 2b107c27dedf (accidentally backed out during an earlier merge).  22 test
suite failures for -L lc2 lc3 spidermonkey-n slow-n, probably needs some guard
work in TRY_BRANCH_AFTER_COND.
2008-06-29 10:01:59 -04:00
Andreas Gal
628a1f6985 Cleanup trace abort/end code. 2008-06-28 18:19:21 -07:00
Andreas Gal
91c85e9cb4 Merge. 2008-06-28 17:14:42 -07:00
Andreas Gal
6df975a5b5 Rewritten frame management. Use cx->fp->regs chain instead of direct passing of those structures. 2008-06-28 17:14:06 -07:00
shaver@mozilla.org
f81f153710 fix typo in DoIncDec leading to script termination 2008-06-28 19:28:56 -04:00
shaver@mozilla.org
fac133d1e5 Implement icmp_ne (in terms of LIR_ugt(i, 0)!) and make JSOP_NE traceable. 2008-06-28 17:47:33 -04:00
shaver@mozilla.org
8cb49dede9 avoid trace-troubling temporaries via cast gymnastics 2008-06-28 14:48:02 -04:00
Andreas Gal
b6773c0340 Move obj_is_xml into interp since its not a primitive. 2008-06-28 10:12:24 -07:00
shaver@mozilla.org
cc9079bc60 More work on tracing EQUALITY_OP. Still need to synthesize LIR_ne before it
traces correctly.  (This loses the length-test equality-check short-circuit
for strings, until such time as we have a builtin for EqualStrings as well:
regresses js1_5/String/regress-322772.)
2008-06-28 12:46:21 -04:00
shaver@mozilla.org
293db3763e abort tracing if we see an XML object in an equality op 2008-06-28 00:14:21 -04:00
shaver@mozilla.org
4fc71515e0 Add guards for XML objects, and some tracer bits to accommodate them. 2008-06-27 23:58:06 -04:00
Andreas Gal
e5d4f398ef Merge. 2008-06-27 18:09:33 -07:00
Andreas Gal
40f1a90a78 Move recorder initialization into TraceRecorder and encapsulate its state. 2008-06-27 18:06:50 -07:00
shaver@mozilla.org
06500a1a50 merge 2008-06-27 12:01:28 -04:00
shaver@mozilla.org
af19dd5627 rename ENABLE_TRACER to TRACING_ENABLED and explicitly parameterize on cx 2008-06-27 11:41:59 -04:00
Andreas Gal
5d9de143af More concise conversion from object to boolean. 2008-06-27 07:48:18 -07:00
Andreas Gal
e59076860a Instead of guarding on null -> boolean conversion just emit a null compare and use the boolean result. 2008-06-27 06:53:10 -07:00
Andreas Gal
3492763c96 Throw out a bunch of primitives (guards) that we are no longer interested in. 2008-06-27 06:18:12 -07:00
Andreas Gal
49fe7a95eb More cleanup and code move into TraceRecorder and prepare for LIR_ov. 2008-06-26 23:22:16 -08:00
Andreas Gal
5b4f0aaeaa Allocate recorder dynamically to avoid having a vtable in the struct holding the reference. Emit writebacks for every update to the tracker, not just stack writes. 2008-06-26 19:37:28 -08:00
Andreas Gal
4678be95aa Fix a bug in tracing can_do_fast_inc_dec (wasn't tracking a copy and traced incorrect code). Merge with TT tip. 2008-06-24 15:57:33 -07:00
Andreas Gal
6d192a7054 Added end-of-trace detection and make sure trace loops back to the loop header. 2008-06-22 09:30:04 -07:00
Andreas Gal
3197b76462 Mork work on attaching nanojit to our primitives. Traces have now their own box type (Box), which is an opaque 64-bit value. Its never supposed to appear in the trace since we will optimize away all boxing operations. 2008-06-21 22:28:41 -07:00
Andreas Gal
78da0668af Start attaching our tracer to nanojit. This is incomplete and meant for review by David only. 2008-06-21 14:55:32 -07:00
Andreas Gal
33ecda6e85 Added danderson's test cases for nanojit. Execute with nanojit() from JS shell. 2008-06-19 18:28:15 -07:00
Andreas Gal
e04746d2c0 Make fast inc/dec traceable. 2008-06-18 17:40:32 -07:00
Andreas Gal
1a0333027b Added new primitive guard_can_do_fast_inc_dec and report reason for trace aborts. 2008-06-18 16:23:24 -07:00
Igor Bukanov
d24b2f9846 [Bug 432881] SM: JSVAL_VOID as a pseudo-boolean. r=brendan 2008-06-25 11:43:02 +02:00
Brendan Eich
874574312e Fix 433672, r=igor, a=shaver. 2008-06-24 17:28:22 -07:00
Igor Bukanov
eecb145915 [Bug 441619] Fixing ICC compilation issue: in goto *expr the type of expr should be void*. r=sayrer 2008-06-24 22:31:16 +02:00
Jason Orendorff
3f24f04578 Bug 419091 - Assertion failure: JS_PROPERTY_CACHE(cx).disabled >= 0, at jsinterp.c:463 using js.c Scatter() test and gczeal(2) (r=brendan) 2008-06-24 14:42:33 -05:00
Brendan Eich
00548a9ef5 Fix bustage caused by over-aggressive TRY_BRANCH_AFTER_COND in STRICT_EQUALITY_OP (used by JSOP_CASE*). 2008-06-20 14:25:38 -07:00
Brendan Eich
ff11123bed Fuse branch after relational or equality op (363534, r=igor). 2008-06-20 13:17:51 -07:00
Igor Bukanov
c6b43c7494 [Bug 433382] More efficient interpreter switch when computed goto is not available. r=brendan 2008-06-20 11:55:49 +02:00
Igor Bukanov
fed7ad6a4a Backed out changeset 97977f224aff due to build breakage 2008-06-20 11:46:36 +02:00
Igor Bukanov
ac0a058f20 [Bug 433382] More efficient interpreter switch when computed goto
is not available. r=brendan
2008-06-20 10:06:45 +02:00
Igor Bukanov
26b618a50f Backed out changeset 21527193c49b: the patch has used CSRCS, not CPPSRCS. 2008-06-20 09:45:29 +02:00
Igor Bukanov
feb0f05335 [Bug 433382] More efficient interpreter switch when computed goto is not available. r=brendan 2008-06-20 09:36:56 +02:00
Brendan Eich
02f5b1cb7b Fix old assignment expression rval mutation via getter design, optimize setprop;pop and similar cliches (312354, r=igor). 2008-06-19 12:51:57 -07:00
Andreas Gal
40be837c3c Merge. 2008-06-15 17:49:28 -07:00
Andreas Gal
6fedd2b687 Call into the recorder for each primitive. Don't use vp in primitives, use &v instead. 2008-06-15 16:31:28 -07:00
Brendan Eich
77dcedf8cc Fix slew of gcc warnings, clear pending exception before triggering recorder error. 2008-06-12 12:07:04 -07:00
Andreas Gal
ab59446c58 Initialize ok to true if we didn't side-enter via state. 2008-06-11 18:05:58 -07:00
Andreas Gal
bb1b206714 Use an error property in the recorder instead of a return value to indicate errors and make sure DO_OP aborts the trace once we go into the error state in the tracer. 2008-06-11 17:59:28 -07:00
Andreas Gal
2a34b19f23 js_CallRecorder has no return value any more. 2008-06-11 17:36:35 -07:00
Brendan Eich
c58ac03421 Fix used before set ok bugs, fiddled ifdef style a bit. 2008-06-11 13:55:34 -07:00
Brendan Eich
74c80d5597 Kill trailing spaces. 2008-06-11 13:07:24 -07:00
Andreas Gal
73698e5e72 Pass JSContext* to all primitives (needed by the recorder.) 2008-06-11 11:46:47 -07:00
Andreas Gal
fef28e9f56 Allow recorder to abort recording. 2008-06-11 11:29:35 -07:00
Andreas Gal
3e75d9e04e Save and restore ok when switching interpreters. 2008-06-11 09:01:29 -07:00
Brendan Eich
e90aa46c27 Init ok before goto exit, plus indentation style policing. 2008-06-11 03:41:50 -07:00
Andreas Gal
76f6917ece Cleanup and fixed beneign bug. 2008-06-11 01:32:02 -07:00
Andreas Gal
50bf94c527 Notify recorder when tracing starts/stops. Restore code accidently lost during last merge. 2008-06-11 01:22:39 -07:00
Andreas Gal
9bb9f4893d Connect tracer with the interpreter. Errors and exits are handled in the main interpreter. 2008-06-11 00:21:51 -07:00
Andreas Gal
8dee65f176 Merged with Brendan's changes. 2008-06-10 22:30:46 -07:00
Andreas Gal
c79c0bfeef Added code to switch to the tracer and back. Incomplete and for review only. 2008-06-10 22:20:05 -07:00
Brendan Eich
45358518de Minimize JSInterpreterState, fix warning. 2008-06-10 21:40:47 -07:00
Brendan Eich
57eff0cc24 Style nits, plus no need for rt in JSInterpreterState. 2008-06-10 19:40:09 -07:00
Andreas Gal
b5238a9929 Create a side-entry path into the interpreter that bypasses the initialization code and allows switching back and forth between two interpreters (i.e. tracing and non-tracing). 2008-06-10 17:45:38 -07:00
Andreas Gal
17d0d41459 Added branch monitoring using a single unified branch frequency counter. 2008-06-10 16:49:05 -07:00
Andreas Gal
a1bf0819b2 Removed JSOP_HEADER code. Its too costly. This patch restore essentially the same performance as unmodified SM. 2008-06-10 14:44:51 -07:00
Andreas Gal
aa4de72f2b Disable JSOP_HEADER counting. 2008-06-10 14:17:05 -07:00
Andreas Gal
b54446d182 Fixed typo that caused sunspider to fail. 2008-06-09 18:30:08 -07:00
Andreas Gal
0077c6a422 Backed out value_to_iter inline method extraction. 2008-06-09 14:47:14 -07:00
Andreas Gal
8d20524c9b Convert value_to_iter goto/fall through hack into a proper inlined method. 2008-06-06 13:32:04 -07:00
Brendan Eich
2010276730 Followup patch for bug 260106. 2008-06-05 16:00:25 -07:00
Brendan Eich
f6f44f8c9a Fix 260106, r=shaver. 2008-06-04 17:00:46 -07:00
Brendan Eich
04b1ac5592 Merge. 2008-06-04 00:09:57 -07:00
Brendan Eich
894dd03e2a First stage of loop table work; bitmap free space management and GC hook-up still to come. 2008-06-03 23:52:28 -07:00
Andreas Gal
9684e2070f Introduced a JavaScript recording script that is loaded dynamically. 2008-06-03 21:01:23 -07:00
Brendan Eich
9c2b039d6f JSOP_HEADER takes a byte index of loop header counting from script->loopBase, and related changes. 2008-06-03 14:48:47 -07:00
Andreas Gal
53060c32ce Move all inlines that do not represent primitives out of jsinterpinlines.h since we don't have to overwrite them in jstracerinlines.h. They live in jsinterp.cpp now. Added missing error handling for prim_ddiv and prim_dmod. Make sure prim_ddiv and prim_dmod do not call other primitives. Fixed bug in dmod (-1 should be n, but since all invocations had n=-1 this was a non-issue). 2008-06-02 23:26:17 -07:00
Brendan Eich
946fa41d8c Fiddle loop table slot interface and impl in hope of freeing slots over time. 2008-06-02 18:06:33 -07:00
Brendan Eich
01514c4b16 No JS_TRACER ifdefs, keep line len < 80, reparameterize jstracer.cpp functions, js_OpLength helper. 2008-06-02 17:19:41 -07:00
Brendan Eich
5b116ae998 Merge, style nits, no locking for tracing. 2008-05-31 15:29:54 -07:00
Andreas Gal
e66383e26e Fixed a bug that triggered the tracer at TRACE_THRESHOLD/2 already. 2008-05-31 09:53:16 -07:00
Andreas Gal
e461a72736 The table is now per-thread in a multi-threaded environment, and per-runtime otherwise. During code generation we merely allocate a loop table slot to each loop. Each thread will enlarge the table as needed in JSOP_HEADER. 2008-05-30 18:58:43 -07:00
Andreas Gal
de3107d2ee Add a per-runtime loop attribute table that associates a jsval attribute with every loop in the code. The jsval is used initially as a counter until a certain threshold is reached, at which point the loop is traced and compiled and the resulting native code object is stored in the jsval to be executed for future encounters of the loop. 2008-05-30 10:11:56 -07:00