Commit Graph

328 Commits

Author SHA1 Message Date
Andreas Gal
1e0a9a8363 Merge. 2008-07-07 22:00:25 -07:00
Andreas Gal
a6d30ed7c2 Fixed native frame offset calculation for globals. 2008-07-07 22:00:07 -07:00
shaver@mozilla.org
8fa1b5215f fix type checking of gvars 2008-07-08 00:19:20 -04:00
shaver@mozilla.org
3f51971710 more detailed type-instability diagnostics 2008-07-07 23:51:56 -04:00
Andreas Gal
205ab22204 We urgently need shaver's magic native stack/typeframe iterator. Fixed exit map builder to skip argv/vars for global scope. 2008-07-07 19:29:54 -07:00
Andreas Gal
2f939b51d1 Fixed increment for DECGVAR. 2008-07-07 19:27:36 -07:00
Andreas Gal
a0c960adee Bugfixes to the native stack and typemap handling code. 2008-07-07 19:20:40 -07:00
Andreas Gal
56397d3c0e Attempt at cleaning up the typemap/stack frame iteration code. 2008-07-07 18:35:38 -07:00
Andreas Gal
6aaa63a172 ngvars and the slot index are not related, so don't rely on ngvars < JS_INITIAL_NSLOTS to decide whether dslots exists 2008-07-07 18:08:28 -07:00
Andreas Gal
0fe5682c00 Make gvar ops use the global varobj values we unbox onto the native stack. The stack offset handling needs more work. 2008-07-07 17:21:54 -07:00
Andreas Gal
a4f454ae32 We shouldn't read globals onto the stack if the global object is used by another context so we just refuse to execute the trace in this case. 2008-07-07 15:23:48 -07:00
Andreas Gal
1d36b97516 Unbox global variables onto the native stack and re-box them. This has certain synchronization implications but will make top-level scripts quite a bit faster. 2008-07-07 15:15:56 -07:00
Andreas Gal
4da1b65be4 Don't try to demote a slot we already decided we can't demote. Also, make sure we only demote additions with constants where the constant fits into an int. 2008-07-07 12:58:28 -07:00
Brendan Eich
affcda00d2 Merge. 2008-07-07 02:56:52 -07:00
Brendan Eich
175ce14f5b Indentation and comment wrapping (at 79, 99 looks too long and most comments still avoid going past 80+/-). 2008-07-07 02:55:03 -07:00
Andreas Gal
ef4a0f7533 Merge. 2008-07-07 02:51:36 -07:00
Andreas Gal
e4f8fa2f97 Sync nanojit with tamarin-tracing tip. 2008-07-07 02:47:40 -07:00
Brendan Eich
6d65efee60 Use jsopcode.tbl for tracer JSOP_* method decls; trim trailing whitespace. 2008-07-07 02:21:04 -07:00
Andreas Gal
e15355bc04 Cleanup the native frame -> interpreter frame boxing code. We sometimes end up with numbers on our stack in double format that are really ints. We have to detect those and properly store them as in on the interpreter stack. 2008-07-07 01:37:40 -07:00
Andreas Gal
a38e8a96c3 Add support to demote stores of constants that are currently represented as float but are really integers. bitwise.js is now compiled complete fp-casts free. 2008-07-07 01:05:53 -07:00
Andreas Gal
efa3309778 Demote floating point comparisons even if one side is constant (bug in nanojit, filed as #443884 against tamarin). Also demote add/sub/mul using the integer overflow detection side exit code that Ed adopted upstream. Tight loops (bitwise) are not emitted completely as integer code after the initial compilation using doubles triggered a speculative demotion of the context slots. 2008-07-07 00:43:40 -07:00
Andreas Gal
8ce0de1ad7 Sink type conversions into the side exit by updating the map and seeing though the cast in the store (in ExitFilter). Add a whole bunch of asserts on the varios speculative type states to make sure we get the state machine right. Import speculated integer values as integers into the trace (indicate in entry map). 2008-07-07 00:10:22 -07:00
Andreas Gal
34c2283213 Added loop-tail driven context slot type demotion. Without all the buzzwords, what this essentially means is that we detect if the last value that the trace leaves in a slot (which is the value that flows along the backedge back to the loop header) is known to originate from an integer value via i2f, we flag the slot as type integer and recompile the trace. We do this where type stability is certain (result of an and, i.e.) or where its very likely (++operator). If the speculation fails, the same analysis flags the slot as blocked, which means it will always be double. The hope is that this analysis converges quickly (1-2 recompilations tops). 2008-07-06 22:35:19 -07:00
Andreas Gal
d6172e525e Make sure we don't get the argument order in BoxDouble wrong again. 2008-07-06 20:27:50 -07:00
Andreas Gal
efee2381b5 Make typemap uint8_t and fix order of arguments in call to BoxDouble. 2008-07-06 20:25:49 -07:00
shaver@mozilla.org
9ed160ad12 remove outdated guard (now inferred via filter as needed) 2008-07-06 23:11:59 -04:00
shaver@mozilla.org
2c69d44f6f we only speak double around here now 2008-07-06 23:01:58 -04:00
shaver@mozilla.org
10d122ba09 remove bogus NOT_REACHED 2008-07-06 22:39:02 -04:00
Andreas Gal
312d176937 Strength reduce i2f(doubleToInt32(x)) and u2f(doubleToUint32(x)) to x. This eliminate most of the on-trace overhead, but we still need type peeling of loop variable into int to win back the performance loss casting introduced. 2008-07-06 17:43:08 -07:00
Andreas Gal
bd6deef4fc Reduce redundant doubleToInt32(i2f(x)) chains to simply x. 2008-07-06 17:32:21 -07:00
Andreas Gal
5ec69f76a7 Strength reduce BoxDouble(i2f(x)) to BoxInt32(x). Make sure loop indexes are actually integers. This guard will be eliminated further down in the pipeline if we decided to peel the type of the loop variable (index) down to integer. 2008-07-06 16:38:54 -07:00
Andreas Gal
a990d4a2e6 Since numbers are now always represented by doubles at the recorder/type level, using BoxDouble and UnboxDouble only when moving numbers from or to memory. A filter will then turn f2i(UnboxDouble) into UnboxInt where appropriate. 2008-07-06 16:18:45 -07:00
Andreas Gal
aeeff83beb Move the type level from int/double to number. All traces start out as double in all slots, and denote and promote to/from int as needed. The FuncFilter optimizes on-trace casting and elininates redundant f->i-> chains. More optimization needed on this of course, and this code is now a bit slower than the previous integer-register use. However, this does solve the q += 2.5 issues. The heap access code does not properly cast yet and is likely unstable. 2008-07-06 15:55:04 -07:00
shaver@mozilla.org
b28afaa80d Trace GETGVAR and INCGVAR, though not yet correctly. 2008-07-06 16:59:59 -04:00
Andreas Gal
d30b7d1c8a Add unary and binary helpers that automatically demote and promote when dealing with integer operations (not used yet, need loop typemap peeling in place first.) 2008-07-06 13:16:34 -07:00
Andreas Gal
4e1aa1d977 JSVAL_IS_BOOLEAN does what isTrueOrFalse was trying to do. 2008-07-06 12:16:55 -07:00
Andreas Gal
5816dee707 Fix template, should use typename, not class. 2008-07-06 12:03:51 -07:00
Andreas Gal
1343901446 Add ExitFilter, which builds side exit typemaps for us. This had to be moved into a filter, because this has to happen after we eliminate redundant i2f-f2i chains as we can sink those into the side exit by simply storing the unpromoted/undemoted value and just flip the type in the exit map. 2008-07-06 11:48:41 -07:00
Andreas Gal
84ec537a0c Merge. 2008-07-06 11:19:06 -07:00
Andreas Gal
9501bcd749 Added doubleToUint32 builtin and make tracker a template. 2008-07-06 10:59:55 -07:00
shaver@mozilla.org
d881a494aa fix builtin_UnboxInt32 signature and name shape_ins for debugging 2008-07-06 13:58:59 -04:00
shaver@mozilla.org
45b3826103 Trace JSOP_NAME, and refactor out jsval unboxing. 2008-07-06 13:38:55 -04:00
shaver@mozilla.org
06a27ca367 begin on JSOP_NAME, refactor stobj_get_slot to chain better 2008-07-06 12:15:55 -04:00
shaver@mozilla.org
f463dc6891 actually record at HOTLOOP1 (fencepost) 2008-07-06 09:56:25 -04:00
shaver@mozilla.org
7f5f2ae1c8 some remaining low-hanging ops 2008-07-06 09:52:50 -04:00
shaver@mozilla.org
38235e2eec move JSOP_DOUBLE impl to, er, JSOP_DOUBLE (wtf?) 2008-07-06 09:33:13 -04:00
shaver@mozilla.org
2d307b4b59 Implement JSOP_DOUBLE. 2008-07-06 07:28:36 -04:00
Andreas Gal
100f4ea5e0 Added support for semi-stable loop variables. Compiling for(...) q += 2.5; is ridiculously difficult because it flip-flops between int and double. Add support to promote integer values to doubles at the loop tail if at loop entry we expect a double. Since this isn't possible the other way around, we have to get luck that we catch a path into the loop where q is already double. For this we add 3 trigger points (10, 13, 37). We will try three times to record a trace at those iteration counts of a loop. If none succeed the loop is blacklisted. This probably needs more tuning down the road. 2008-07-05 23:21:53 -07:00
Andreas Gal
41efb6c488 Merge and rename jsIf to ifop. 2008-07-05 22:23:34 -07:00
Andreas Gal
a48c36fae3 Added FuncFilter from tamarin core (not part of nanojit yet since its slightly VM dependant). 2008-07-05 22:20:35 -07:00
Andreas Gal
0b28897ad3 Add helpers for i->f and f->i conversion. The f->i path goes via builtin calls. 2008-07-05 22:04:58 -07:00
Andreas Gal
68359155b9 Add type primitives for numbers (isNumber and asNumber). 2008-07-05 21:51:26 -07:00
shaver@mozilla.org
a268883f3c Implement JSOP_IFEQ, JSOP_IFNE, JSOP_DUP, JSOP_DUP2. 2008-07-05 23:47:24 -04:00
Andreas Gal
075e3f00a6 Add casting for objects and cleanup casting code. 2008-07-05 20:30:11 -07:00
shaver@mozilla.org
501239ca11 let JSOP_GETELEM handle boolean values too 2008-07-05 23:04:42 -04:00
shaver@mozilla.org
26cc9c9e54 Handle boolean lval in SETELEM; now runs access-nsieve unmodified. 2008-07-05 22:39:34 -04:00
Andreas Gal
0245a6ba7c Believe it or not NEG can actually overflow the int32 range, so add an overflow bailout. This will only trap for -0x80000000. 2008-07-05 19:25:38 -07:00
Andreas Gal
54a349ce1f Merge. 2008-07-05 19:18:14 -07: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
shaver@mozilla.org
1c4f82c592 Allow hole-filling JSOP_SETELEM to remain on trace. 2008-07-05 21:50:54 -04:00
Andreas Gal
04ae2a44d4 Fixed boolean boxing. 2008-07-05 18:36:40 -07:00
Andreas Gal
cf8e2a555b Added boolean boxing/unboxing code. 2008-07-05 18:34:41 -07:00
Andreas Gal
8ac9e3ca57 Use default parameter in LSH/RSH/URSH to indicate we don't care for the overflow. 2008-07-05 18:18:06 -07:00
Andreas Gal
888d2f9aee Add support for some misc opcodes including binary and arithmetic and/or/not. 2008-07-05 17:26:00 -07:00
Andreas Gal
810d54beac Track trace entry/exit in debug mode and count cycles. 2008-07-05 17:10:58 -07:00
Andreas Gal
19152ffb1f Signal error from the boxing/unboxing using magic cookies since gcc seems to very seriously object to the use of uint64 return values during a fastcall (horribly inefficient code). 2008-07-05 16:28:03 -07:00
Andreas Gal
05c4c4bb27 Help the branch predictor in the builtins. 2008-07-05 15:46:58 -07:00
shaver@mozilla.org
00b1baa734 use FASTCALL for builtins 2008-07-05 17:37:15 -04:00
Andreas Gal
16b463a6cb Style nitpicking. Fix overlong lines. 2008-07-05 14:05:25 -07:00
Andreas Gal
d765c3ead2 Finish SETELEM for int and double values. 2008-07-05 14:00:32 -07:00
Andreas Gal
1e9c9451e0 Merge unboxing code into GETELEM code. 2008-07-05 13:44:48 -07:00
Andreas Gal
503bf13dac Merge. 2008-07-05 11:46:08 -07:00
Andreas Gal
f9981c8870 Added box_int_jsval for the store path. Use only there. 2008-07-05 11:45:53 -07:00
Andreas Gal
ba7e66df92 Code generators to access object slots and native code callouts (builtins) for boxing doubles and ints. Ints have to be boxed through a native code helper on read and write (BoxInt32 and UnboxInt32), because we sometimes have to cast internally to double to store 32-bit values. We don't want a separate trace in this case, so we have to do this inline in a helper. Also a couple of modifications to shaver's code. Always make sure to check types (JSOP_NEG). 2008-07-05 11:35:55 -07:00
Brendan Eich
2e457ec7ab Fix dumb bugs I just committed, use JS_NOT_REACHED. 2008-07-05 11:29:28 -07:00
Brendan Eich
ab0e34e2ae Try to keep 64-bit portability via size_t instead of unsigned, jsuword for uintptr instead of long, etc. 2008-07-05 11:18:26 -07:00
Brendan Eich
e544b391b2 Spacing and comment nits picked while reading. 2008-07-05 10:41:35 -07:00
shaver@mozilla.org
ef07fe09b8 shift ops 2008-07-05 09:59:32 -04:00
shaver@mozilla.org
de59f88d9c Beginning of SETELEM/GETELEM tracing for dense arrays. Needs computed-offset
insLoad before they'll work.
2008-07-05 09:47:59 -04:00
shaver@mozilla.org
f298721bf2 update to isInt 2008-07-05 09:43:00 -04:00
shaver@mozilla.org
13b4f67ef5 merge 2008-07-05 09:34:19 -04:00
shaver@mozilla.org
92e9aa44c0 [mq]: simple-ops 2008-07-05 09:15:33 -04:00
Andreas Gal
2df2214a9e Introduce asInt and asDouble to check for the type of values based on the actual value since some 32-bit integers hide out in doubles. 2008-07-04 23:53:29 -07:00
Andreas Gal
cef5e9becc Make trace-code 32-bit clean and extend interpreter state to carry the current context (cx). The recorder still has to record a 31-bit int path through the loop, but the emitted code is able to stay in the tree even if values bump over to 32-bit ints. 2008-07-04 16:24:42 -07:00
Andreas Gal
e35d351b28 Added support for SET_VAR again. bitwise.js working now. 2008-07-04 15:21:56 -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
5e9ca6ef0e Cleanup of stack handling. 2008-07-04 13:23:42 -07:00
Andreas Gal
9b8f5f75a8 Added back support for the instructions required to compile trace.js. 2008-07-04 03:06:18 -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
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
8f4707fd29 Added dmod builtin and flag broken builtins for removal (shaver). 2008-07-02 22:05:30 -07:00
Andreas Gal
6eb6314e75 Support recording of ValueToECMAInt32, ValueToECMAUint32 and ValueToBoolean. 2008-07-02 21:48:42 -07:00
Andreas Gal
2cd7b6993b VOIDs hang out in the BOOLEAN value space, so we have to treat them like a boolean on the trace. For ValuetoECMAInt32 all special boolean values except TRUE produce 0, and TRUE produces 1. Use a conditional move to implement this. 2008-07-02 19:11:07 -07:00
Andreas Gal
b137f2da3b Introduce a VMSideExitInfo structure (holds the exit typemap only for now). 2008-07-02 18:06:24 -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
47c6075eb2 Fix unstable trace rejection for optimized build. 2008-07-02 15:31:40 -07:00
Andreas Gal
7906238314 Fix type stability check. 2008-07-02 15:17:53 -07:00
Andreas Gal
6f3af33edf Add type stability check for loop variables. Rename readstack to import. 2008-07-02 15:14:43 -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
8907cd354b Flag ints as type INT in the incoming context if its merely a double holding an int that was too large to fit into jsval directly. Along the side exits make sure we can properly box oversized ints (by casting them to doubles). The fetch_int/store_int paths still need fixing to ensure that values are merely passed through (prim_copy) instead of explicit casting or calling to ValueToECMAInt32 etc. 2008-07-02 02:53:24 -07:00
Andreas Gal
08bd8d4245 Generate proper overflow detection code. Requires a trivial fix in nanojit (included, pending review to be pushed upstream). 2008-07-02 00:13:05 -07:00
Andreas Gal
7eba55b32b Merge. 2008-07-01 19:44:24 -07:00
Andreas Gal
f3fba20c9c Create type maps during trace entry and in each side exit and store them in the LIR using LIR_skip. Use these type maps during trace entry and exit. 2008-07-01 19:43:10 -07:00
Brendan Eich
9d20e12316 snprintf takes sizeof buffer. 2008-07-01 15:58:47 -07:00
Andreas Gal
39891951f4 Merge. 2008-07-01 13:36:33 -07:00
shaver@mozilla.org
da72d620b9 fix frame offset calculation for args, I think also non-entry frames 2008-07-01 08:11:49 -04:00
shaver@mozilla.org
50d599cb99 label arg/var/stack/sp/state for easier trace-reading 2008-07-01 08:06:02 -04: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
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
87396e1870 Rework memory management, don't leak memory in the filter pipeline. 2008-06-30 18:08:32 -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
7511e45275 Use #ifdef DEBUG instead of VERBOSE. 2008-06-30 11:44:47 -07:00
Andreas Gal
806d0de678 Must use (&gc) new otherwise memory doesn't get cleared (found by danderson). 2008-06-30 11:39:00 -07:00
Andreas Gal
5d1d997c9d Housekeeping (add comments, removed some dead code.) 2008-06-30 09:36:10 -07:00
Andreas Gal
d8d25140f9 Mockup of trace execution. Speedup is 10x for a tight loop. Keep in mind that this is a hack and the trace code is not optimized yet. 2008-06-29 23:02:22 -07:00
Andreas Gal
b1e24b8c98 Execute trace code. Boxing back the side exit state is not handled yet. 2008-06-29 20:56:06 -07:00
Andreas Gal
e267cb120c Fix native frame addressing (reported by vlad.) 2008-06-29 17:17:39 -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
ef71223de2 Remember JSContext instead of trying to keep track of frame pointer. 2008-06-28 18:47:12 -07:00
Andreas Gal
628a1f6985 Cleanup trace abort/end code. 2008-06-28 18:19:21 -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
Andreas Gal
552425ee07 Hook up pc and sp to the tracer in order to generate proper PC/SP adjustment code. 2008-06-28 11:00:18 -07:00
Andreas Gal
1f37ae3e62 Small cleanups and licensing blurb housekeeping. 2008-06-28 09:58:15 -07: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
40f1a90a78 Move recorder initialization into TraceRecorder and encapsulate its state. 2008-06-27 18:06:50 -07:00
Andreas Gal
2c370239e5 Add a way to calculate the current size of the native frame. 2008-06-27 16:24:17 -07:00
Andreas Gal
afd5f3b1e3 Clarified argument names in guard code and explain better why we guard for overflow the way we do. 2008-06-27 07:28:10 -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
a21ca6a788 Prepare LIR_ov to be used as soon Ed adds it and add a few comments that explain how overflow is handled. 2008-06-26 23:34:50 -08: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
f357ff14f0 Move the recorder functionality into TraceRecorder to unclutter trace inlines. 2008-06-26 21:58:57 -08:00
Andreas Gal
0c98250a90 Move set/get into recorder and introduce init. 2008-06-26 21:41:10 -08:00
Andreas Gal
431b7b810a Moved loading context slots into the recorder (more to follow). 2008-06-26 21:33:33 -08:00
Andreas Gal
2dca610f28 Make sure nativeOffset uses 64-bit slots on the native stack. 2008-06-26 21:25:30 -08:00
Andreas Gal
693ee7f0cc Turn macros into inline functions and start prepatations for inlining function calls. 2008-06-26 21:19:11 -08:00
Andreas Gal
c7bab6721b Drop JS prefix from classes related to traceing. 2008-06-26 19:49:04 -08:00
Andreas Gal
ad5ceed9cd Merge. 2008-06-26 19:46:51 -08:00
Andreas Gal
a1b42735cd Backed out changeset fa82b7eda72a 2008-06-26 19:44:23 -08:00
Andreas Gal
2fddbfdceb Removed debug printfs from tracker. 2008-06-26 19:41:58 -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
407b9cdf75 Parameterize tracker. 2008-06-26 17:13:54 -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
d8e0d5edec Removed debug code. 2008-06-23 17:17:48 -07:00
Andreas Gal
5e55f5e1f4 Merge. 2008-06-23 16:52:37 -07:00
Andreas Gal
5b30ba137c Merge. 2008-06-23 16:51:28 -07:00
Andreas Gal
0c1996ce25 Don't setup debugging data structures when not debugging. 2008-06-22 23:59:41 -07:00
Brendan Eich
d5d3c6fb26 Random style nit-picking. 2008-06-22 23:42:54 -07:00
Andreas Gal
17d189ecb9 Eliminate boxing in trace code. To execute such traces all values on the stack must have the same type at execution time as at trace time. Code to detect and enforce these types will be added next. 2008-06-22 21:32:24 -07:00
Andreas Gal
4312eb9b9b Write back stack/local variable state in the trace code and improved redundand boxing/unboxing elimination. 2008-06-22 19:58:24 -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
2270a14eb0 Fix guard code assembly. This code generates trace code for the first time. 2008-06-21 23:45:16 -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
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
179be35727 Notify the recorder of all primitives as they are recorded. If the recorder doesn't support a primitive we abort the trace. In debugging mode this also stops the VM. 2008-06-11 20:22:00 -07:00
Andreas Gal
448d1ba7e3 Merge with be's last push. 2008-06-11 18:13:43 -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
Brendan Eich
a64ed1a5ee native_pointer_to_jsval should not lose low-order bits (plus random style nits). 2008-06-11 17:21:15 -07:00
Andreas Gal
54dd5103e9 Track data flow through variables in the recorder. Set an error flag if the recorder signals an error. 2008-06-11 17:15:49 -07:00
Brendan Eich
74c80d5597 Kill trailing spaces. 2008-06-11 13:07:24 -07:00
Andreas Gal
fef28e9f56 Allow recorder to abort recording. 2008-06-11 11:29:35 -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
Brendan Eich
45358518de Minimize JSInterpreterState, fix warning. 2008-06-10 21:40:47 -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
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
Andreas Gal
3094b79c6b Switch to a uniform style for jstracer.cpp. 2008-06-03 17:15:58 -07:00
Andreas Gal
8b6c4d02c6 Remove InitTacer. Pointless for JSRuntime. 2008-06-03 17:04:42 -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
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
Brendan Eich
ef8a767739 Left brace style. 2008-05-31 10:17:40 -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
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