Commit Graph

391 Commits

Author SHA1 Message Date
Jim Blandy
90bf6a2d1e Bug 97954: Give jsconfig.h a better name, and make room for the new js-config.h. r=bsmedberg
We'd like the SpiderMonkey configure script to generate a header file
named js-config.h to hold #definitions chosen at configure time that
affect the SpiderMonkey API, like JS_THREADSAFE.  However, that name
is very similar to that of an existing header file, jsconfig.h.  This
patch renames the existing header file, and updates all references to
it.

--HG--
rename : js/src/jsconfig.h => js/src/jsversion.h
2008-09-05 10:19:17 -07:00
Brendan Eich
4fa7c5195d Put the trace-recording/executing flag in the trace monitor to handle many contexts per thread (451666, r=gal). 2008-09-03 00:38:24 -07:00
David Anderson
be89898254 Merge with mozilla-central. 2008-09-02 14:17:19 -07:00
Andreas Gal
1d525db0e4 New attempt at fixing 453235. If building without JIT (like PPC/MacOSX), don't include the deep abort calls in jsinterp.cpp 2008-09-01 18:40:45 -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
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
Brendan Eich
45ea54d2d1 Don't let GC run when recording. 2008-08-29 16:04:54 -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
Igor Bukanov
9022efe160 bug 449494 - uniform handling of bytecodes with variable stack uses. r=mrbkap,brendan 2008-09-02 08:25:15 +02:00
Brendan Eich
5d132dba83 Record JSOP_IN (452563, r=gal). 2008-08-27 23:00:43 -07:00
Brendan Eich
722ff40a11 Remove bogus assertion (452178). 2008-08-27 00:34:53 -07:00
Brendan Eich
43b25b3c09 Rename gcDontBlock to runningJittedCode, and assert it's false on entry to js_Interpret (for 451657, but not the fix, just prolog). 2008-08-25 23:08:21 -07:00
Brendan Eich
d28554f3cc Remove over-eager gvar optimization for JSOP_DEFFUN (451678, r=shaver). 2008-08-22 18:07:32 -07:00
Brendan Eich
791221dfae Followup upvar fix, easy assertbotch avoidance. 2008-08-21 04:16:50 -07:00
Brendan Eich
9cd8e5a539 Upvar, v0.1 (limited to looking up from eval in a function, to the function's args and vars). 2008-08-21 03:47:33 -07:00
Brendan Eich
2c4e22add3 Fix CHECK_RECORDER macro to use XOR to evaluate both terms. 2008-08-21 01:38:50 -07:00
Brendan Eich
4a25cf5a32 Defer eval'ed script destruction to next GC; expose js_obj_eval for tracing. 2008-08-20 22:18:42 -07:00
Andreas Gal
f3972bfb84 Backed out changeset be63a51a0a3b. Breaks tofte if run from ./time.sh. 2008-08-20 14:57:49 -07:00
Brendan Eich
6bc330ef33 Don't disable property caching in eval (this requires GC'ing eval scripts). Do tolerate active Call object at head of scope chain in record_JSOP_CALLNAME, and go straight to the stack slots. 2008-08-20 14:04:37 -07:00
Brendan Eich
bea371d215 Record JSOP_IN (452563, r=gal). 2008-08-28 00:18:05 -07:00
Brendan Eich
cbb33d1a83 Remove bogus assertion (452178). 2008-08-27 00:41:57 -07:00
Brendan Eich
eddb7e1614 Remove over-eager gvar optimization for JSOP_DEFFUN (451678, r=shaver). 2008-08-22 18:11:47 -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
David Anderson
2c45d81524 Fixed recorder not aborting when leaving js_Execute (bug 450532). 2008-08-14 15:29:04 -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
Brendan Eich
8efccf4d7d Abort recording if unwinding from js_Interpret to js_Invoke and still recording (this can happen via fun.call/.apply). Also assert in threaded interpreter BEGIN_CASE and DO_OP (from END_CASE) that we either have no recorder or are using the recordingJumpTable. 2008-08-13 19:22:07 -07:00
Brendan Eich
74c6d3ffe3 Merge, plus ((void)0) parens. 2008-08-12 09:23:38 -07:00
shaver@mozilla.org
41a6158c57 fix build for !JS_TRACER, both threaded and switch interps 2008-08-12 12:09:59 -04:00
Brendan Eich
0280e606df Beware macro argument multiple expansion... 2008-08-11 14:44:22 -07:00
Brendan Eich
40050a1e4d Try fixing LOAD_INTERRUPT_HANDLER based on Andreas's patch. 2008-08-11 13:05:28 -07:00
Brendan Eich
a56862bdff Make js_ConcatStrings JS_FASTCALL and use directly as a built-in; remove gcflag param from it and from js_NewString. 2008-08-11 11:03:54 -07:00
Brendan Eich
7967defc01 Fix ASSERT_VALID_PROPERTY_CACHE_HIT pcoff argument (my bad from 887fc4facdeb). 2008-08-11 10:40:24 -07:00
Brendan Eich
0d83651633 - Skip dense array object, try prototype, in all JSOP_GET*PROP variants, interpreter and tracer.
- Test entry instead of retesting aobj->map->ops->getProperty == js_GetProperty in JSOP_CALLPROP.
- Handle object and null types as well as booleans in record_JSOP_NOT.
- Trivially implement JSOP_STRICT{EQ,NE} recording by forwarding to the non-strict record methods. This works so long as the latter trace only same-type operands and do no conversions.
2008-08-11 00:05:39 -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
337988cd85 Fix obj2 typo, meant obj (obvious use-before-set, sorry about that). 2008-08-09 13:30:49 -07:00
Brendan Eich
eaf4254c15 Merge from mozilla-central. 2008-08-08 18:58:04 -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
Igor Bukanov
b16852c1cd bug 412296 - removal of minarg support for fast native 2008-08-08 18:02:50 +02:00
Graydon Hoare
aaf41f8ee5 Bug 447713, remove the import/export functionality from spidermonkey, r=brendan 2008-08-06 17:34:58 -07:00
Igor Bukanov
46b1a8edf2 bug 447762 - merging var and local JS bytecodes. r=brendan 2008-08-06 16:13:22 +02: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
David Anderson
921bbecea3 Fixed infinite looping on non-threaded tracing (rumor is that we do Windows builds of Firefox) 2008-07-29 19:04:17 -05:00
Igor Bukanov
0e9a6fa3da bug 446320 - fixing -Wformat warnings in debug printouts. r=crowder 2008-07-29 16:11:36 +02:00
Igor Bukanov
0f9d60d4c4 Backed out changeset 65836af09dac - compilation errors 2008-07-27 23:05:52 +02:00
Igor Bukanov
e04b341333 bug 446320 - fixing -Wformat warnings in debug printf code. r=crowder 2008-07-27 22:52:10 +02:00
Brendan Eich
a8c6046d8c Avoid JSOP_POPV in global scripts from load(), etc. 2008-07-26 01:23:12 +02: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
shaver@mozilla.org
8a97552a28 merge (mostly, doesn't build) 2008-07-22 23:58:43 -04:00
Brendan Eich
c73f865645 Fix property cache fill to use the best shape (445899, r=shaver). 2008-07-20 16:27:10 -07:00
Igor Bukanov
fc68712767 bug 441686 - eliminating JSStackFrame.(nvars|vars). r=brendan 2008-07-20 22:13:17 +02:00
Igor Bukanov
d3223d86a3 [Bug 446229] Fixing GCC conversion warnings within SpiderMonkey. r=brendan 2008-07-20 14:53:21 +02:00
shaver@mozilla.org
991ee56658 fix no-tracer build 2008-07-21 06:59:38 -04:00
Brendan Eich
c278ae56e0 Nit patrol. 2008-07-20 16:09:08 -07:00
shaver@mozilla.org
ed1d0a8953 improve tracing/recording diagnostics 2008-07-20 15:42:19 -04:00
Brendan Eich
032f06cdc0 Property-cache JSOP_NAMEINC etc. direct slot case (445893, r=shaver). 2008-07-18 22:53:22 -07:00
L. David Baron
ff3cb68441 Backed out changeset 5c009a853d70 for hitting a fatal JS_Assert during xpcshell unit tests (xpcom/unit/test_bug374754.js) on the DO_NEXT_OP(JSOP_INCNAME_LENGTH) line on !JS_THREADED_INTERP platforms (Windows). 2008-07-18 21:53:07 -07:00
Brendan Eich
3ec5069d69 Property-cache JSOP_NAMEINC etc. direct slot case (445893, r=shaver). 2008-07-18 19:16:15 -07:00
shaver@mozilla.org
beb2ed6657 Propagate TCF_COMPILE_N_GO through to inner functions, so that we can avoid nulling their parents and then cloning expensively in DEFLOCALFUN.
Also make Process do COMPILE_N_GO.
2008-07-18 17:15:41 -07:00
Brendan Eich
08930f369e Use the property cache for JSOP_NAMEINC, etc. 2008-07-17 16:54:01 -07:00
Brendan Eich
04a56fbab2 Fix property cache fill to use the right shape. 2008-07-17 16:51:27 -07:00
Igor Bukanov
708422ea13 [Bug 433337] jsinterp.cpp source no longer split between 2 compilation units when compiling on Windows. r=brendan 2008-07-17 10:57:34 +02: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
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
47d2c66cc7 Remove dead code. 2008-07-15 16:25:19 -07: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
shaver@mozilla.org
6d68b678b3 don't include jstracer.h (and thus nanojit, etc.) if not building with JS_TRACER 2008-07-10 22:19:15 -04:00
shaver@mozilla.org
a82e389447 support non-JS_TRACER builds 2008-07-10 21:38:26 -04:00
shaver@mozilla.org
f9a01d9be5 fix opcode math with the mighty hammer of casting 2008-07-10 20:41:55 -04:00
shaver@mozilla.org
07c51d9867 interp needs tracer.h 2008-07-10 17:31:38 -04:00
Brendan Eich
ab59004c84 Memoize implicit gvars in the interpreter, on assignment (JSOP_BINDNAME/JSOP_SETNAME); fix recoder l/r operand order bug. 2008-07-09 16:37:31 -07:00
Blake Kaplan
bac9a8c577 Add missing #undef, clean up trailing whitespace. 2008-07-09 23:40:06 +02:00
Andreas Gal
f4e8e89333 Sync with mozilla-central. 2008-07-09 01:18:56 -07:00
Blake Kaplan
10f59fb6a7 Follow the invariant that we flow through label exit2. bug 442358, r=igor 2008-07-08 14:04:02 +02:00
shaver@mozilla.org
2d307b4b59 Implement JSOP_DOUBLE. 2008-07-06 07:28:36 -04:00
Andreas Gal
48e459ba73 Added blacklisting of recording points where we failed to complete a trace (overly aggressive at this point, needs tuning, we want to try several times for each point.) 2008-07-05 19:15:00 -07:00
Andreas Gal
ab1dc289ba Fixed some stack handling and trace activation issues. We can run trace.js again. 2008-07-04 15:07:05 -07:00
Andreas Gal
1503932551 Properly switch tracer on and off depending on loopEdge and abort signaling from trace recorder recording functions. 2008-07-04 01:10:57 -07:00
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
Andreas Gal
a6ded872bf Steer macro naming in jsinterinlines.h using a macro. This allows us to prefix all primitives with some prefix (i.e. interp_) when we compile the tracer and replace them with new primitives that invoke the interpreter version first, and then do some tracer specific action. 2008-05-29 17:14:42 -07:00
Brendan Eich
7cdb540c44 Fix goof in switching from word to jsval counters. 2008-05-28 23:12:45 -07:00
Brendan Eich
ed4274e179 Instrument loop headers with jsvals above fp->vars and below fp->spbase. 2008-05-28 19:07:32 -07:00
Brendan Eich
8bfb8bfef7 Split trace-supporting inlines, add ifdefs/macros for deriving js_TracingInterpret in jstracer.cpp. 2008-05-28 19:07:25 -07:00
Brendan Eich
968021cff9 Style (and substance for vim users: left brace opening in column 1 enables [[ navigation). 2008-05-28 19:07:16 -07:00
Andreas Gal
f4d6e71bf6 Make relational operations (<,<=,>,>=) traceable. 2008-05-27 10:45:58 -07:00
Andreas Gal
8a5d86fa50 Mark getting and setting arguments and local variables as safe for tracing. 2008-05-26 23:40:52 -07:00
Andreas Gal
e0a5de51b2 Make branch instructions traceable using a new primitive guard_boolean_is_true. 2008-05-26 23:33:23 -07:00
Andreas Gal
32908d0e2f Enable tracing for selected opcodes that do not have any remaining tracing hazards. 2008-05-26 20:04:58 -07:00
Andreas Gal
33ec9a35fb Opcodes that can be traced through can be declared with TRACE_CASE(op). Currently all opcodes are declared as BEGIN_CASE(op), which automatically aborts trace recording. In addition, error handlers (defined with DEFINE_HANDLER) also abort trace recording. At every backwards branch trigger monitor_branch(), which will monitor for new trace tree anchors. 2008-05-26 18:55:16 -07:00
Andreas Gal
288e988b40 Introduce primitives for common binary operations. 2008-05-26 17:29:28 -07:00
Andreas Gal
6d10603538 Convert macro code in jsinterp.cpp into inline functions and introduce trace primitives (prim_*, guard_*, call_*). 2008-05-26 15:27:13 -07:00
Brendan Eich
c611e90657 Fix bad merge. 2008-05-24 10:17:15 -07:00
Brendan Eich
5e03c06ce3 Igor's patch for bug 433382, r=me. 2008-05-23 23:44:08 -07:00
Brendan Eich
2595b54a6b Fix POP_STACK to take a macro out param. 2008-05-23 22:18:36 -07:00
Brendan Eich
602bcd5f50 First round of macro cleanups to enable tracing. 2008-05-23 19:24:10 -07:00
Brendan Eich
2f95757906 Igor's fix for bug 432881, r=me. 2008-05-23 19:14:05 -07:00
Brendan Eich
c0c9201c0a Fix for bug 433672, r=igor. 2008-05-23 19:08:44 -07:00