Commit Graph

11457 Commits

Author SHA1 Message Date
Andreas Gal
7e947d706b Don't intern global function objects onto the native frame since we rarely ever need them anyway (we call them via the property cache). 2008-07-16 15:48:51 -07:00
Andreas Gal
17c5a0d239 Enable CALLNAME and add test case for it so we can call global functions. 2008-07-16 15:40:35 -07:00
Andreas Gal
e40c27e48d Add test cases for call. 2008-07-16 15:26:51 -07:00
Andreas Gal
3456c6f0ec Make sure this/argv[-1] is set fpr CALLVAR and CALLARG. 2008-07-16 15:13:27 -07:00
Andreas Gal
7298396084 Enable inlining for calls. Deep bailouts (from within side exits) are generated but are not allowed to be ever taken (for now). 2008-07-16 15:01:55 -07:00
Andreas Gal
465f6c4288 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
David Anderson
4f0e18b670 Synced nanojit with TT tip. 2008-07-16 14:21:31 -07:00
shaver@mozilla.org
c2220078ce fix GETXPROP; thanks to brendan for playing chewbacca 2008-07-16 13:10:17 -04:00
shaver@mozilla.org
5d8295a18c CALLARG, CALLVAR 2008-07-15 23:37:57 -04:00
shaver@mozilla.org
f671e7b977 fix scalpel left in nativeFrameSlots from aborted thisp addition to frame 2008-07-15 23:20:53 -04:00
shaver@mozilla.org
2136865a8a implement JSOP_MOD 2008-07-15 23:19:29 -04:00
shaver@mozilla.org
1c6e05b518 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
14d275934b Fix uncomplete range check for slot numbers of interned globals. 2008-07-15 17:10:52 -07:00
Andreas Gal
6aa74fd10e Added math-partial-sums.js for danderson. 2008-07-15 17:07:24 -07:00
Andreas Gal
0cd1df652c Remove dead code. 2008-07-15 16:25:19 -07:00
Andreas Gal
d0ac13e8c9 Aliasing cleanup for LIR.h. Patch submitted for upstream review. 2008-07-15 16:17:34 -07:00
Andreas Gal
319455e0ce Strict aliasing cleanup. 2008-07-15 16:14:00 -07:00
Andreas Gal
22112d7fad Add a few consts to char* pointers to pacify gcc 4.2. 2008-07-15 16:04:08 -07:00
Andreas Gal
6686004130 Compilation fixes for gcc 4.2. Ripp out write-barrier code in our avmplus glue layer. 2008-07-15 15:58:43 -07:00
Andreas Gal
edf66b558f Merge. 2008-07-15 15:54:07 -07:00
Andreas Gal
b729c7668e Switch tracemonkey over to gcc-4.2 on macosx. We need a compiler that was released in this millenium so we can use SSE2-based calling conventions. 2008-07-15 15:53:38 -07:00
shaver@mozilla.org
ca4e5926f9 rename getpropfromval, it burns mine eyes 2008-07-15 18:29:42 -04:00
Andreas Gal
27f1faf389 Assign blame where blame is due. 2008-07-15 15:05:16 -07:00
Andreas Gal
0c2ba01a9a Merge. 2008-07-15 13:14:05 -07:00
Andreas Gal
8510740900 Add missing namespace use (pending upstream for review.) 2008-07-15 13:12:14 -07:00
Andreas Gal
3f8fd8325a Sync with TT. 2008-07-15 13:06:05 -07:00
shaver@mozilla.org
e3eb8b8a70 initialize dslots_ins 2008-07-15 13:40:11 -04:00
Brendan Eich
d49babfbb7 Propagate error exceptions from TraceRecorder ctor; fiddle/trim space. 2008-07-15 10:26:15 -07:00
shaver@mozilla.org
852092181c GETVARPROP, GETARGPROP, GETXPROP 2008-07-15 13:17:51 -04:00
shaver@mozilla.org
1e5cb70b56 more ABORT_TRACE instrumentation (some should be asserts?) 2008-07-15 09:07:54 -04:00
Andreas Gal
5a8460802e 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
db779b5fc8 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
bcc152e41a 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
30a0a39e21 Store list of interned global slots in struct FragmentInfo 2008-07-15 01:03:49 -07:00
Andreas Gal
e7ce814072 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
b779c15706 Fix warnings. 2008-07-14 17:52:38 -07:00
Andreas Gal
f353de24c1 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
4003fe23db 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
73b9a6f0c5 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
a4cb1dd828 Clean up shaver's cleanup. 2008-07-13 22:02:42 -07:00
Andreas Gal
93bf68110b Fixed printing of integer incoming values in DEBUG mode. 2008-07-13 21:53:35 -07:00
shaver@mozilla.org
9f70036004 merge, and fix locking and logic for FORALL_SLOTS 2008-07-14 00:51:43 -04:00
shaver@mozilla.org
0ae6befc07 make JSOP_CALL builtin specialization data-driven 2008-07-14 00:28:31 -04:00
Andreas Gal
13d783642c Skip properties that were not found by LookupProperty. 2008-07-13 21:17:56 -07:00
Andreas Gal
d26c06e68e Merge--again. 2008-07-13 21:15:34 -07:00
Andreas Gal
cea1858e3f Merge. 2008-07-13 21:15:15 -07:00
Andreas Gal
e2bdc50a59 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
shaver@mozilla.org
fbc565cb03 merge 2008-07-13 22:33:53 -04:00
shaver@mozilla.org
7c5fc1d5db expand int-equality tests 2008-07-13 22:33:08 -04:00
Andreas Gal
e605d56636 Backed out changeset 2af185cb0fb7. We will map in global variabls different so we don't need the higher ngvars count to find globals in the native frame. 2008-07-13 17:14:08 -07:00
Brendan Eich
6216536537 Merge. 2008-07-12 23:44:23 -07:00
shaver@mozilla.org
8bf6f691ce fix the secondary map-native guard 2008-07-13 00:09:24 -04:00
Brendan Eich
e65f8a0ec7 js_ for library-extern names like math_sin. 2008-07-12 12:35:36 -07:00
shaver@mozilla.org
d21c77279f initialize traceMonitor in threadsafe builds 2008-07-12 09:57:23 -04:00
shaver@mozilla.org
d7595f89c6 Guard against subzero array indices 2008-07-12 09:04:58 -04:00
Andreas Gal
80d5f05679 Demote fneg to neg if input is known to be an integer (untested). 2008-07-12 00:34:10 -07:00
Andreas Gal
2f965da0c9 Merge. 2008-07-12 00:28:28 -07:00
Andreas Gal
f7f769f703 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
5b55a4d4e7 add JSOP_NEG and tests 2008-07-12 00:20:48 -04:00
shaver@mozilla.org
b095935e2a 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
5bc840f84d 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
edd9236cfd 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
131566085f 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
shaver@mozilla.org
469722c66c add reduced fannkuch version 2008-07-11 17:47:51 -04:00
Andreas Gal
0e0aa2426d Print meaningful filename/line-number info for trace entry/exit. 2008-07-11 13:57:16 -07:00
Andreas Gal
7db02022b6 Report the source location when recording a trace. 2008-07-11 13:45:38 -07:00
Andreas Gal
301d3557a1 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
shaver@mozilla.org
3c0fe29055 Windows cares a lot more about where FASTCALL is; such a sensitive platform 2008-07-11 11:40:07 -04:00
shaver@mozilla.org
139ef8227d begone, cat nspr/Version error noise 2008-07-11 11:20:44 -04:00
shaver@mozilla.org
2569788e27 set some more config bits for Windows, mostly blindly 2008-07-11 11:02:14 -04:00
shaver@mozilla.org
4d0b323d47 turn on all the shift tests, and find a bug with it! 2008-07-11 10:50:57 -04:00
Andreas Gal
c9cc6c5f45 Brendan fixed global variable access in non-top level code so re-enable that in trace-test.js. We pass all of shaver's trace torture tests. 2008-07-11 00:53:06 -07:00
Andreas Gal
6d574df7af 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
e58f7ed9d8 Still trying to get the ARM register updating right. 2008-07-11 00:31:48 -07:00
Andreas Gal
3f4882a830 Trying to make arm work. Flying blind here. 2008-07-10 22:35:06 -07:00
Andreas Gal
4b5a8a918c Adjust sp/ip for ARM. Very useful when trying to run on ARM. 2008-07-10 22:29:06 -07:00
shaver@mozilla.org
f47e82b2de some ARM stuff 2008-07-11 01:27:06 -04:00
Andreas Gal
9139b65106 Merge (no, really, can someone teach Mercurial to not do this?). 2008-07-10 22:12:04 -07:00
Andreas Gal
556bf3f96f 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
53883bfbf4 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
a753eda39f here, have a _working_ Thumb back-end 2008-07-11 00:45:54 -04:00
shaver@mozilla.org
e47a75e65c here, have a Thumb back-end 2008-07-11 00:40:26 -04:00
Andreas Gal
b6707f6c19 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
shaver@mozilla.org
c0366e9b30 only build JIT builtins if ENABLE_JIT, and lose antique *inlines.h 2008-07-11 00:10:27 -04:00
Andreas Gal
90c5b152e7 Merge. 2008-07-10 20:35:40 -07:00
Andreas Gal
20f942f5f0 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
7b70cff612 Build the JIT by default if we're on x86, and control enabling it for content
via javascript.options.content_jit.
2008-07-10 23:05:27 -04:00
shaver@mozilla.org
3a894689a8 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
ccab8cc3f3 use a type that windows knows about for offset computation 2008-07-10 22:17:41 -04:00
shaver@mozilla.org
ecfdf28842 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
fd8b6334ac my turn to merge; had to happen eventually 2008-07-10 21:44:41 -04:00
shaver@mozilla.org
ff932a53d8 disable tracer for platforms not supported by nanojit 2008-07-10 21:43:05 -04:00
Andreas Gal
5e77678d2a 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
03fde28ae1 some better OS_CFLAGS for Linux 2008-07-10 21:38:47 -04:00
shaver@mozilla.org
b010bb1781 support non-JS_TRACER builds 2008-07-10 21:38:26 -04:00
shaver@mozilla.org
6ec66f18d6 try to make alloca work for Windows 2008-07-10 21:37:49 -04:00
David Anderson
3a3cd06c43 Actually fixed ifeq/ifne fusion now. 2008-07-10 17:54:19 -07:00
Andreas Gal
c9bf6a6091 Merge. 2008-07-10 17:42:25 -07:00
shaver@mozilla.org
b0ad41b5ab fix opcode math with the mighty hammer of casting 2008-07-10 20:41:55 -04:00
Andreas Gal
bc8f19facf Merge. 2008-07-10 17:41:45 -07:00
Andreas Gal
c506cb686e nanojit doesn't support loads with non-constant offsets so don't do that 2008-07-10 17:41:24 -07:00
shaver@mozilla.org
c673ef75a9 the rest of the stdint defs, no idea why I didn't do them before 2008-07-10 20:25:57 -04:00
Andreas Gal
3e9da8925c Merge. 2008-07-10 17:05:13 -07:00
Andreas Gal
dffeaf5997 Steal the reference to cx from the BoxDouble call instead of observing the load. 2008-07-10 17:03:59 -07:00
Andreas Gal
929143b685 Fixed the setelem a[i] bug. 2008-07-10 16:55:37 -07:00
David Anderson
421a4d9058 Nanojit needs a LINUX define (which may be my fault), fixing it here for now 2008-07-10 16:26:28 -07:00
shaver@mozilla.org
4a4a43e952 use VirtualAlloc for Windows, since it lacks valloc 2008-07-10 18:39:51 -04:00
shaver@mozilla.org
4a120b6af6 interp needs tracer.h 2008-07-10 17:31:38 -04:00
shaver@mozilla.org
325fb165a9 Decouple jscntxt.h from jstracer.h so that xpconnect doesn't try to include all of
nanojit.
2008-07-10 17:29:16 -04:00
shaver@mozilla.org
7ee1731d53 FASTCALL for Windows 2008-07-10 17:16:31 -04:00
shaver@mozilla.org
ff2b500e91 int32_t, now available on Windows 2008-07-10 16:58:08 -04:00
shaver@mozilla.org
86412904af Unlike software developers, g++ doesn't like variable-sized arrays. Have some alloca! 2008-07-10 16:48:42 -04:00
shaver@mozilla.org
344d5edbe7 merge 2008-07-10 16:47:12 -04:00
David Anderson
229e5b4a36 Fixed guarding of eq+ifeq/ifne fusions and enabled tracing JSOP_GOTO (no-op) 2008-07-10 13:35:17 -07:00
Andreas Gal
6f69a35718 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
e42a82831b Merge. 2008-07-10 09:24:59 -07:00
Andreas Gal
63e8552ce0 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
65319f7c27 update trace-test.js, now crashes calling lsh() the second time 2008-07-10 10:45:11 -04:00
shaver@mozilla.org
9218d7f8e3 MSVC knows about intptr_t, and doesn't like our remix 2008-07-10 10:21:29 -04:00
shaver@mozilla.org
66ff430be2 I'm going to just keep bludgeoning these typedefs until they stick 2008-07-10 10:18:22 -04:00
shaver@mozilla.org
131f5aca33 try to find malloc on Linux; this buildbot thing rules the school 2008-07-10 10:03:45 -04:00
shaver@mozilla.org
7357ba307c use typedefs instead of stdint.h, because someone forgot to tell MSVC it was 2008 2008-07-10 09:52:34 -04:00
shaver@mozilla.org
ee71713651 can't have zero-sized arrays in ISO C++, says gcc 2008-07-10 09:29:42 -04:00
shaver@mozilla.org
3f3e4c108b use stdint.h instead of typedefs to help Linux find intptr_t 2008-07-10 09:20:36 -04:00
shaver@mozilla.org
2ffa61c5b4 build nanojit 2008-07-10 09:12:53 -04:00
shaver@mozilla.org
edb9d11c27 Make nanojit arch selection explicit in config/*, though for now only OS X and Linux
on x86.
2008-07-10 09:12:17 -04:00
shaver@mozilla.org
4b07cd2663 rename builtins.tbl *back*, because nanojit expects that name, and whatever
--HG--
rename : js/src/jsbuiltins.tbl => js/src/builtins.tbl
2008-07-10 08:53:03 -04:00
shaver@mozilla.org
0ed71e422d rename builtins.tbl to our usual form
--HG--
rename : js/src/builtins.tbl => js/src/jsbuiltins.tbl
2008-07-10 08:51:44 -04:00
shaver@mozilla.org
8413035cda fix include ordering for THREADSAFE build 2008-07-10 08:40:43 -04:00
shaver@mozilla.org
f105edebe6 fix compilation, but possibly not logic, of shared-object defense 2008-07-10 08:05:25 -04:00
shaver@mozilla.org
19e59bdda5 revert ancient shuffling of js_CompareAndSwap decl to fix THREADSAFE build 2008-07-10 07:57:18 -04:00
shaver@mozilla.org
c66b22b530 some build fixes to help in-browser and other-arch build 2008-07-10 07:56:36 -04:00
Andreas Gal
dd9aee02b8 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
106c582c79 Merge. 2008-07-09 23:42:46 -07:00
Andreas Gal
cb1318a185 Backed out changeset 234230320093 (reducing code cache size due to startup issue.) 2008-07-09 23:42:27 -07:00
Andreas Gal
e5989165b9 Merge. 2008-07-09 19:12:09 -07:00
Brendan Eich
1168c30a0a Always allocate gvars for top-level scripts if any global names are used -- may hurt some microbenchmarks but we can fix it via bug 441686. 2008-07-09 19:10:01 -07:00
Andreas Gal
520e1d0567 Assert if no gvar is allocated for an undeclared global. 2008-07-09 18:51:08 -07:00
Andreas Gal
9690bf6254 Merge. 2008-07-09 18:25:36 -07:00
Andreas Gal
1a2aead6ae varobj is not passed through the chain. Make sure to use global->varobj for gvar access. 2008-07-09 18:25:10 -07:00
shaver@mozilla.org
96af6df932 More tests, working on crashes. 2008-07-09 21:09:11 -04:00
Brendan Eich
0ce52c7d2d Merge. 2008-07-09 17:58:19 -07:00
Andreas Gal
ff827bd70c Reduce code cache size until we fix the page allocation code to not touch all the pages at startup (nanojit issues, assigned to gal). 2008-07-09 17:37:41 -07:00
Andreas Gal
429ebf8d6c 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
a86297702a Condition fp->arg*/*vars usage on fp->callee, not fp->down. 2008-07-09 17:10:42 -07:00
Andreas Gal
a529e2f6b2 Add verbose native stack frame printing. 2008-07-09 17:09:22 -07:00
Brendan Eich
25d02bc059 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
046cf0942e 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
Blake Kaplan
496daa0233 Add missing #undef, clean up trailing whitespace. 2008-07-09 23:40:06 +02:00
Brendan Eich
16d64a228c Remove unnecessary JSOp cast. 2008-07-09 13:46:46 -07:00