Commit Graph

272 Commits

Author SHA1 Message Date
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