Commit Graph

440 Commits

Author SHA1 Message Date
shaver@mozilla.org
21a3ec3485 implement JSOP_MOD 2008-07-15 23:19:29 -04: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
21490a6e41 Fix uncomplete range check for slot numbers of interned globals. 2008-07-15 17:10:52 -07:00
Andreas Gal
cd739bdb35 Strict aliasing cleanup. 2008-07-15 16:14:00 -07: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
Andreas Gal
cbf4813605 Merge. 2008-07-15 13:14:05 -07:00
Andreas Gal
a81b83090e Sync with TT. 2008-07-15 13:06:05 -07:00
shaver@mozilla.org
919139d11b initialize dslots_ins 2008-07-15 13:40:11 -04: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
shaver@mozilla.org
409bb7f29d more ABORT_TRACE instrumentation (some should be asserts?) 2008-07-15 09:07:54 -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
df84a21add Fix warnings. 2008-07-14 17:52:38 -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
shaver@mozilla.org
0180d69fd8 fix our aliasing idiocy by extending jsdpun, add Math.sqrt, add strict-aliasing to our Makefile.ref flags 2008-07-14 18:22:05 -04:00
Brendan Eich
815146e0e4 Non-null prop from js_LookupProperty means found, so must unlock obj2 (now pobj) in all such cases. 2008-07-14 00:13:31 -07:00
Andreas Gal
4a598274f5 Clean up shaver's cleanup. 2008-07-13 22:02:42 -07:00
Andreas Gal
28e3ed165f Fixed printing of integer incoming values in DEBUG mode. 2008-07-13 21:53:35 -07:00
shaver@mozilla.org
0f64113822 merge, and fix locking and logic for FORALL_SLOTS 2008-07-14 00:51:43 -04:00
shaver@mozilla.org
4779e69591 make JSOP_CALL builtin specialization data-driven 2008-07-14 00:28:31 -04:00
Andreas Gal
8750e39409 Skip properties that were not found by LookupProperty. 2008-07-13 21:17:56 -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
Brendan Eich
044d6f9c93 Merge. 2008-07-12 23:44:23 -07:00
shaver@mozilla.org
46b4c7def2 fix the secondary map-native guard 2008-07-13 00:09:24 -04:00
Brendan Eich
ba3c776fc2 js_ for library-extern names like math_sin. 2008-07-12 12:35:36 -07:00
shaver@mozilla.org
6b30961e58 Guard against subzero array indices 2008-07-12 09:04:58 -04:00
Andreas Gal
3ccfc13098 Demote fneg to neg if input is known to be an integer (untested). 2008-07-12 00:34:10 -07:00
Andreas Gal
223f4f23f7 Merge. 2008-07-12 00:28:28 -07:00
Andreas Gal
b5e654f120 5 hours of debugging, and 9 keystrokes to fix it. That was one expensive bug. shaver's reduced fannkuch example works now. I think independently of this one we don't check properly for index underflow in dense arrays. Shaver is going to have to take a look at that (this fix makes fannkuch indexes not become negative, but doesn't explain why we crash so hard if they do become negative). 2008-07-12 00:27:21 -07:00
shaver@mozilla.org
b7dac1100d add JSOP_NEG and tests 2008-07-12 00:20:48 -04:00
shaver@mozilla.org
fd5ac5b844 add Math.cos and Math.pow to the specialized-call party, and add tests 2008-07-12 00:03:33 -04:00
shaver@mozilla.org
d180a6755d I will remember that stacked values are not boxed.
I will remember that stacked values are not boxed.
I will remember that stacked values are not boxed.
I will remember that stacked values are not boxed.
2008-07-11 23:04:29 -04:00
shaver@mozilla.org
9c69964575 Specialized tracing of Math.sin, as a proof of concept. Doesn't quite work due to regalloc mismatch, but close! 2008-07-11 22:59:09 -04: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
Andreas Gal
3e39ec9d3b Print meaningful filename/line-number info for trace entry/exit. 2008-07-11 13:57:16 -07:00
Andreas Gal
8c6dbda691 Report the source location when recording a trace. 2008-07-11 13:45:38 -07:00
Andreas Gal
b222836a73 Don't demote u2f conversions and sink the type cast into the side exit type map, because this loses the sign bit for unsigned values. We could fix this by adding an explicit unsigned type to the map, but for now I think we should stick to int/double only since there is the risk of fanning out trees. Crypto doesn't seem to use ush all that much so we should be ok performance-wise. 2008-07-11 13:18:29 -07:00
Andreas Gal
cd0b213cec Poking around in the arm code, trying to make it not die miserabily with BUILD_OPT=1. 2008-07-11 00:46:44 -07:00
Andreas Gal
3f31810cee Still trying to get the ARM register updating right. 2008-07-11 00:31:48 -07:00
Andreas Gal
5d93de0225 Trying to make arm work. Flying blind here. 2008-07-10 22:35:06 -07:00
Andreas Gal
bde4b2e588 Adjust sp/ip for ARM. Very useful when trying to run on ARM. 2008-07-10 22:29:06 -07:00
shaver@mozilla.org
6bb689e6c3 some ARM stuff 2008-07-11 01:27:06 -04:00
Andreas Gal
fe9354b377 Merge (no, really, can someone teach Mercurial to not do this?). 2008-07-10 22:12:04 -07:00
Andreas Gal
41ded9b128 Output the value if we can't enter a trace because of a type mismatch. 2008-07-10 22:10:02 -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
Andreas Gal
cc38ec5e21 Don't crash when expecting an int32 as double box in unbox but getting something else (and better debug output). 2008-07-10 21:23:32 -07:00
Andreas Gal
4cba5853d4 Merge. 2008-07-10 20:35:40 -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
shaver@mozilla.org
66b22a063c use a type that windows knows about for offset computation 2008-07-10 22:17:41 -04:00
shaver@mozilla.org
795a6bbef1 try to get alloca on Windows; remind me to strip these flailing commits before we merge 2008-07-10 22:10:48 -04:00
shaver@mozilla.org
03ad7cdff2 my turn to merge; had to happen eventually 2008-07-10 21:44:41 -04: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
0695011b26 try to make alloca work for Windows 2008-07-10 21:37:49 -04:00
David Anderson
1bfa0a2b0e Actually fixed ifeq/ifne fusion now. 2008-07-10 17:54:19 -07:00
Andreas Gal
4a0541e2ae nanojit doesn't support loads with non-constant offsets so don't do that 2008-07-10 17:41:24 -07:00
Andreas Gal
16eda7e83e Merge. 2008-07-10 17:05:13 -07:00
Andreas Gal
e6cb4750e2 Steal the reference to cx from the BoxDouble call instead of observing the load. 2008-07-10 17:03:59 -07:00
Andreas Gal
4ad95932a2 Fixed the setelem a[i] bug. 2008-07-10 16:55:37 -07:00
shaver@mozilla.org
60c7caba17 Unlike software developers, g++ doesn't like variable-sized arrays. Have some alloca! 2008-07-10 16:48:42 -04:00
David Anderson
8282c44200 Fixed guarding of eq+ifeq/ifne fusions and enabled tracing JSOP_GOTO (no-op) 2008-07-10 13:35:17 -07:00
Andreas Gal
1b8705e646 Root all strings and objects first when unboxing. Then box values that might trigger the GC (doubles/ints). This probably needs some performance tuning over time. 2008-07-10 13:24:49 -07:00
Andreas Gal
222a958b75 Merge. 2008-07-10 09:24:59 -07:00
Andreas Gal
ed0cfa6ce8 Don't concede an inch to ISO C++. Substract the size of array[1] from the overall struct size when allocating. 2008-07-10 09:22:01 -07:00
shaver@mozilla.org
0b4c4a7782 fix compilation, but possibly not logic, of shared-object defense 2008-07-10 08:05:25 -04:00
Andreas Gal
bdeea1b3cb Prime the page cache during VM startup. This makes us eat the page cache allocation overhead there instead of during the first use. This is just a hotfix. We still need a rewrite of the page cache. 2008-07-09 23:47:17 -07:00
Andreas Gal
0a93e4dd69 Assert if no gvar is allocated for an undeclared global. 2008-07-09 18:51:08 -07:00
Andreas Gal
40a15bccc7 Merge. 2008-07-09 18:25:36 -07:00
Andreas Gal
ef76c5d316 varobj is not passed through the chain. Make sure to use global->varobj for gvar access. 2008-07-09 18:25:10 -07:00
Brendan Eich
31b11b4e90 Merge. 2008-07-09 17:58:19 -07:00
Andreas Gal
4617cc628c Fixed name/setname code to just track the value move instead of touching memory since we have global variables in our native frame now. We have to fix the page cache issues before we can benchmark this. 2008-07-09 17:15:27 -07:00
Brendan Eich
8d88185086 Condition fp->arg*/*vars usage on fp->callee, not fp->down. 2008-07-09 17:10:42 -07:00
Andreas Gal
9a72a1d41d Add verbose native stack frame printing. 2008-07-09 17:09:22 -07: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
Brendan Eich
20a5a9ef31 1. Fix inc to address the right result stack slot; 2. Require via assertions that the interpreter memoize implicit gvars (patch to do that next; bitwise-and will assert until that lands). 2008-07-09 15:15:32 -07:00
Brendan Eich
2210ed4a21 Remove unnecessary JSOp cast. 2008-07-09 13:46:46 -07:00
Brendan Eich
d8cf234b33 Memoize global name gets and sets as if they refer to a declared gvar. 2008-07-09 11:42:31 -07:00
Andreas Gal
626026b70a Merge. 2008-07-09 10:06:24 -07:00
Andreas Gal
202ec610da Removed assert that compares nativeFrameSlots to nativeFrameOffset since nativeFrameOffset is undefined in case sp is at sp+depth, so the assert sometimes randomly bites. Also fixed typo in cmp(). trace-test.js compiles now. 2008-07-09 10:05:59 -07:00
Brendan Eich
cffa8d2279 Tweak a few interval tests, eliminate casts, space patrol. 2008-07-09 09:59:51 -07:00
Andreas Gal
05554d05b3 Stricter typing of the tracker code path which now only accepts jsval as suggested by Brendan. 2008-07-09 00:29:23 -07:00
Andreas Gal
19a2dcb6f5 Fixed bug in nativeFrameSlots and use an assert to compare the result with nativeFrameOffset (which is slower, but more precise). 2008-07-09 00:26:01 -07:00
Andreas Gal
1c24e264ad Removed numMapEntries since typeMap is not really part of the SideExit struct yet anyway. 2008-07-09 00:13:35 -07:00
Andreas Gal
d6b834b98a Move builtin[] table in jsbuiltin.cpp 2008-07-08 23:48:06 -07:00
Andreas Gal
5ee8b4abd7 Housekeeping. Remove a few warnings during BUILT_OPT and spelling in comments. 2008-07-08 22:40:07 -07:00
Andreas Gal
216f33a0bb sp_adj is now maintained in bytes, not words, so +8 is now the magic value to point to the top of the stack. All stores above that watermark are eliminated by StackFilter in nanojit. 2008-07-08 21:03:30 -07:00
Andreas Gal
c9ee018202 Merge. 2008-07-08 20:20:24 -07:00
shaver@mozilla.org
815f787a8a merge 2008-07-08 23:14:47 -04:00
Andreas Gal
ade00cfeb0 Removed bogus debug printfs. 2008-07-08 20:09:15 -07:00
Andreas Gal
795edf3334 Fixed frame walking FORALL_PENDING_FRAME_SLOTS and add 4 to sp in getTop (hotfix, not the right way to do it.) 2008-07-08 20:06:54 -07:00
shaver@mozilla.org
4fcad3cb1e rval tracking and JSOP_POPV 2008-07-08 22:21:25 -04:00
Andreas Gal
4d84965bb8 Merge. 2008-07-08 19:17:15 -07:00
Andreas Gal
8e439abde3 Use more efficient address mode for LIR_load if possible and removed bogus printf. 2008-07-08 19:16:56 -07:00
shaver@mozilla.org
ff2b728cfd protect printf with DEBUG 2008-07-08 21:22:46 -04:00
Brendan Eich
6a2a47ede9 Merge. 2008-07-08 18:14:14 -07:00
Brendan Eich
654d46135f Single-ended interval tests, plus space patrol. 2008-07-08 18:12:22 -07:00
shaver@mozilla.org
46bdd14d57 Implement JSOP_SETNAME for globals. 2008-07-08 21:07:27 -04:00
David Anderson
daa8ef943b Merge. 2008-07-08 17:20:11 -07:00
David Anderson
fcf8410125 Builds against latest nanojit; merged VMSideExitInfo into SideExit 2008-07-08 17:16:51 -07:00
Andreas Gal
444ffb8230 Fixed argv[n] and vars[n], should be [0] of course. 2008-07-08 17:14:01 -07:00
Andreas Gal
27628a1abf Add dummy vpname/vpnum parameters when not compiling in DEBUG mode. 2008-07-08 16:46:54 -07:00
Andreas Gal
4550dd77f0 Introduce a generic stack frame walking macro. This eliminates the 6 (hg pull) redundant blocks of code that all walked the stack in 6 different ways, each with their individuals quirks. 2008-07-08 16:29:23 -07:00
Andreas Gal
9a4e0a6467 Don't check the types for invalid global slots in checkType. Proper gvar lookup in boxing path. We have to unify the stack frame traversal and enumeration code. I fixed this bug before, just in a different place. 11x speedup for gvar.js 2008-07-08 01:30:29 -07:00
Andreas Gal
c1491b01c2 Properly display the 'any' type in the side exit map printout. 2008-07-08 01:14:02 -07:00
Andreas Gal
0afa601949 Cleanup definition of tracker (don't use LInsp, use T, its a template now). 2008-07-08 00:46:53 -07:00
Andreas Gal
ac0b138197 Hack: demotable stores have to be flagged as int in the exit typemap. This needs cleanup. 2008-07-07 22:41:58 -07:00
Andreas Gal
64bf4baa1c Don't expect args and vars in a top-level frame that is mapped to the native frame. 2008-07-07 22:20:27 -07:00
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