Commit Graph

2713 Commits

Author SHA1 Message Date
Andreas Gal
3f90159e8b Remove ip from InterpState. Calculate the new pc after a trace side exit relative to lr->from->root->ip, which also works if we side exit on a different tree than we entered (which can happen in case of nested trees.) 2008-08-08 18:20:20 -07:00
Brendan Eich
f028f26f52 Merge. 2008-08-08 16:40:45 -07:00
Brendan Eich
072c7b59a5 Guard against shapeless callees, with tests (more to do here, can't break the unknown callee case yet, but it should be breakable). 2008-08-08 16:37:01 -07:00
Andreas Gal
c7be42f2f3 Add very preliminary nesting for trees. This is disabled by default. To enable set TRACEMONKEY=nesting in the environment. 2008-08-08 15:26:31 -07:00
Brendan Eich
de40e589da Merge. 2008-08-08 14:45:27 -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
Brendan Eich
f644a96ebb Better idea for avoiding level-1 property cache collisions. 2008-08-08 14:28:10 -07:00
Brendan Eich
4e0e30452f Improve first-level property cache hash function to avoid collisions in linear sequence of setprops. 2008-08-08 14:12:55 -07:00
Ben Turner
184d478d40 Bug 447711 - "FindInJSObjectScope calls JS from within a request and a lock". r+sr=jst. 2008-08-08 13:13:41 -07:00
Ben Turner
b21229606c Bug 443871 - "Protect against null objects in a title's scope/map". r=brendan. 2008-08-08 12:17:42 -07:00
Igor Bukanov
b16852c1cd bug 412296 - removal of minarg support for fast native 2008-08-08 18:02:50 +02:00
Andreas Gal
c1ce126b85 Don't activate a tree if it has globals, since we can't handle that yet. 2008-08-07 19:59:21 -07:00
Andreas Gal
f2972efa5c Remove tracking of outer trees and merging of globals since globals will be maintained centrally soon, not attached to trees. 2008-08-07 19:40:41 -07:00
Brendan Eich
43f60608f4 Fix bug 449627. 2008-08-07 18:12:31 -07:00
Bob Clary
969199e57d JavaScript Tests - regression test for bug 448595, by Oliver Hunt 2008-08-07 18:00:38 -07:00
Andreas Gal
f77dcbe3f6 We don't deallocate JIT-related data structures when the JIT is shut down. Add a TODO for this. 2008-08-07 17:52:48 -07:00
Andreas Gal
2d0c9c41ab Hand the script in when updating the oracle regarding global variable slots even if we don't use it right now. This will be useful for caching information across runtimes. 2008-08-07 17:43:13 -07:00
Andreas Gal
3ac96b066b Use a typedef SlotList instead of Queue<uint16>. 2008-08-07 17:22:21 -07:00
Andreas Gal
a21818bc72 Teach typemaps how to capture the types of all slots in a slot list. 2008-08-07 17:20:49 -07:00
Andreas Gal
d9159ecfb2 When merging globals from inner trees to outer trees, make sure to push the expected type upstream as well. 2008-08-07 17:08:27 -07:00
Andreas Gal
afda8f7095 When we trash a tree, we have to trash all outer trees that call it as well. 2008-08-07 17:01:00 -07:00
Andreas Gal
d988d3523a Recognize loop edges that hit a nested tree. 2008-08-07 16:41:20 -07:00
Andreas Gal
bbe7acfbaf Fix typo (missing memcmp in statement). 2008-08-07 16:27:26 -07:00
Andreas Gal
600b9c3e14 Remove type-map hash code. A direct memcmp seems to be faster (probably some SSE magic behind it in gcc/glibc). 2008-08-07 16:26:56 -07:00
Andreas Gal
27e8ef817a Factor out the code to capture the current stack type map and move around the type map method implementations to make sure they can see the FORALL macros. 2008-08-07 16:23:50 -07:00
Andreas Gal
01e3af1f79 We expect no interned globals in a new tree. Assert on that. 2008-08-07 15:44:11 -07:00
Andreas Gal
7351e39b63 Merge. 2008-08-07 15:41:50 -07:00
Andreas Gal
00b12bbaca Always trash TreeInfo when we recompile. This avoids the much dreaded JS_ASSERT(insInt32) errors and we can do this now because the demotion information is provided by the oracle and no longer stored in the typemap directly. 2008-08-07 15:38:54 -07:00
Andreas Gal
95f5262e4f Use an oracle to predict when slots are demotable. This allows trashing the TreeInfo* object in the root fragment more aggressively. Rebuild the stack type map at every compile to avert type map mismatches. Purge all global slot info when we re-record a tree. 2008-08-07 15:28:43 -07:00
Brendan Eich
e04a6b22c4 Don't fail to flush cx->thread's JIT cache if JS_THREADSAFE. 2008-08-06 23:38:57 -07:00
Andreas Gal
e09041e2a5 If we run into an error during compilation, blacklist that fragment. If we run out of memory, flush the cache. 2008-08-06 22:26:20 -07:00
Andreas Gal
0fe0cf9a98 Flush JIT cache for all contexts. Clear nanojit error state when we start compiling. 2008-08-06 22:18:33 -07:00
Andreas Gal
e9733ceed9 Remove dead code. 2008-08-06 22:10:30 -07:00
Andreas Gal
9385e7842c Add a helper to flush the JIT code cache (and the fragment lookup quick cache). On a global shape mismatch trash the entire cache (might be a bit overly aggressive). Similary, during GC flush the code cache. 2008-08-06 21:56:25 -07:00
Andreas Gal
cd8d6cd3da Merge. 2008-08-06 19:31:52 -07:00
Andreas Gal
d1a1a76121 Tracker outer trees for every tree and merge globals of inner trees into all outer trees as we register inner trees with outer trees. 2008-08-06 19:25:24 -07:00
shaver@mozilla.org
7c89606155 add tests for missing and excess arity for trace-entry function context 2008-08-06 22:24:39 -04:00
Andreas Gal
6bb6800be5 Add a contains method to Queue. 2008-08-06 19:06:37 -07:00
Andreas Gal
3785f2a5af Fix misleading debug text. 2008-08-06 19:04:41 -07:00
Andreas Gal
ff22344594 Fix tracing of code inside methods that were called with arity mismatch. 2008-08-06 18:51:26 -07:00
Brendan Eich
f23efc77b2 Replace bogus assertion with runtime test for correct abort test (getter or setter, given sprop hit from propcache). 2008-08-06 17:54:36 -07:00
Andreas Gal
c8df243f32 Fix nonEmptyStack1 test. 2008-08-06 17:44:39 -07:00
Graydon Hoare
aaf41f8ee5 Bug 447713, remove the import/export functionality from spidermonkey, r=brendan 2008-08-06 17:34:58 -07:00
Bob Clary
8977765520 JavaScript Tests - regression test for bug 443569, by Jesse Ruderman 2008-08-07 05:18:54 -07:00
Bob Clary
93b3246f1a JavaScript Tests - regression test for bug 442333 2008-08-07 05:00:42 -07:00
Bob Clary
8447a6217c JavaScript Tests - regression test for bug 442242, by Igor Bukanov 2008-08-07 04:47:33 -07:00
Bob Clary
80a4237137 JavaScript Tests - regression test for bug 441477, by Jason Orendorff 2008-08-07 03:23:36 -07:00
Bob Clary
628a0aabbe JavaScript Tests - regression test for bug 440558, by Ben Turner 2008-08-07 02:54:46 -07:00
Bob Clary
c02b8f58c9 JavaScript Tests - regression tests for bug 435345, by Cyrus Omar 2008-08-06 21:58:03 -07:00
Bob Clary
2569db84d4 JavaScript Tests - regression tests for bug 434837, by Cyrus Omar 2008-08-06 21:48:28 -07:00
Bob Clary
aefe5a062e JavaScript Tests - regression tests for bug 446169, by romaxa, Igor Bukanov 2008-08-06 19:59:24 -07:00
Bob Clary
7c449116ff JavaScript Test - binary operator evaluation order, bug 433672 2008-08-06 19:15:12 -07:00
Gavin Sharp
348213c998 Bug 449503: fix --enable-dtrace, r=igor 2008-08-06 17:51:38 -07:00
Andreas Gal
d41941073e Disable outerlining, to be replaced with nesting. 2008-08-06 17:34:06 -07:00
Andreas Gal
1bf2697257 Add a helper to emit a tree-call into the currently recording trace. 2008-08-06 16:24:29 -07:00
Andreas Gal
1b8f21c8f3 Add CallTree builtin. 2008-08-06 15:56:31 -07:00
Andreas Gal
6bd49e0d49 Make ip in InterpStruct const*. 2008-08-06 15:55:00 -07:00
Andreas Gal
bc93ceb9d5 Merge. 2008-08-06 15:04:18 -07:00
Andreas Gal
27de48d1f9 Cleanup stack offset calculation and eliminate the stack offset fiddling that was necessary for nanojit prior to adding the getTop hook. 2008-08-06 15:04:02 -07:00
Brendan Eich
5331ec8967 Add first non-empty stack testcase, which now passes (yay). 2008-08-06 13:53:34 -07:00
Brendan Eich
0f1f29e9a4 Merge again, I lost to Andreas\! 2008-08-06 13:44:07 -07:00
Andreas Gal
2acb2afdec Always trashing the tree on a type mismatch can't work since the first iteration comes in as undefined for loop-outputs and then kills the main tree that deals with the proper stable types. Have to find a different way to deal with this. 2008-08-06 13:41:04 -07:00
Brendan Eich
586464070d Merge. 2008-08-06 13:37:45 -07:00
Andreas Gal
fcaab6d007 Pull recompile flag out of the state and pass in as argument. Trash the tree if a secondary trace can't be connected to the loop header. This is very aggressive and might need more tinkering. Trashing the tree on every mismatch doesn't seem to work well, so thats currently disabled. 2008-08-06 13:37:29 -07:00
Brendan Eich
6e215765df - Add builtins to support for-in loops, both iterating and getting/setter properties by name using o[i] instead of o.p where i is 'p'.
- Record JSOP_ITER and JSOP_ENDITER, which must be handled since tracing could start in between them (and always will, until we nest or unless we outerline).
- Add a null state guard in JSOP_FORVAR's recorder method.
- Pick include order, indentation, and trailing space nits.
2008-08-06 13:36:29 -07:00
Andreas Gal
d1d2895356 Merge. 2008-08-06 13:23:55 -07:00
Andreas Gal
a253b66a09 If we stop recording, immediately attempt to trigger the tree. 2008-08-06 13:18:30 -07:00
shaver@mozilla.org
9615dbd804 add test for non-empty stack on trace entry (fails currently, but no longer crashes) 2008-08-06 16:12:49 -04:00
Andreas Gal
141f71186c Properly deal with trace entry with non-empty stack. 2008-08-06 12:38:17 -07:00
Bob Clary
f4b3de7f12 JavaScript Tests - regression test for bug 433279, by nanto_vi (TOYAMA Nao), Jesse Ruderman 2008-08-06 10:50:20 -07:00
Igor Bukanov
46b1a8edf2 bug 447762 - merging var and local JS bytecodes. r=brendan 2008-08-06 16:13:22 +02:00
Andreas Gal
0ed65746a7 Split side exit handling from js_ExecuteTree. 2008-08-06 06:34:16 -07:00
Bob Clary
ea4d3895ed JavaScript Test - regression test for bug 427798, by Igor Bukanov 2008-08-06 02:39:15 -07:00
Bob Clary
8a5fdc395e JavaScript Tests - regression test for bug 422269, by Igor Bukanov 2008-08-06 02:25:25 -07:00
Bob Clary
4f4763f9a8 JavaScript Tests - regression test for bug 410852, by Rob Sayre 2008-08-06 01:46:49 -07:00
Bob Clary
8112f86430 JavaScript Tests - regression test for bug 438415, by Brian Crowder 2008-08-05 23:47:20 -07:00
Blake Kaplan
40e2a77e0b Bug 449152 - js_CheckAccess should init out params on failure, r=brendan 2008-08-05 14:49:50 -07:00
Bob Clary
8b19078644 merge commit for test, bug 430740 2008-08-05 13:48:32 -07:00
Bob Clary
97df12d1ba JavaScript Tests - modify test for BOM to whitespace conversion, bug 430740 2008-08-05 13:46:36 -07:00
Brendan Eich
a1c6f2606a Comment or/and test framework not being traceable. 2008-08-05 11:36:25 -07:00
Brian Crowder
848148a3cd Bug 384244 - update jsdtoa with interesting pieces of more-recent dtoa, r=igor 2008-08-05 11:18:29 -07:00
Blake Kaplan
3e20948873 Try to fix the orange by overriding platform-specific errors 2008-08-04 18:04:19 -07:00
Blake Kaplan
2d7e4ce617 Fix missed review comment from bug 408412 2008-08-04 16:54:16 -07:00
Bob Clary
8ddc6ebd74 JavaScript Tests - regression test for bug 446494, by Philip Taylor 2008-08-04 16:48:01 -07:00
Blake Kaplan
d8801925e5 Implement ES3.1's Object.getPrototypeOf. bug 444787, r=brendan 2008-08-04 16:43:12 -07:00
Blake Kaplan
062612435a let declarations at top level and function level should not shadow var. bug 346749, r=brendan 2008-08-04 16:37:00 -07:00
Blake Kaplan
3838ee5d02 Don't pass around information we don't use. bug 448595, r=brendan 2008-08-04 16:36:35 -07:00
Blake Kaplan
608073442a Cleanup error reporting in dis and dissrc. bug 445743, r=brendan 2008-08-04 16:36:10 -07:00
Blake Kaplan
0b0d6afb1e Propagate compilation errors to our caller to make syntax errors easier to debug. bug 408412, r=shaver sr=brendan 2008-08-04 10:03:34 -07:00
Brendan Eich
03b511f9e4 - Use JSStackFrame* fp over, don't declare another JSStackFrame* f, in the FORALL macros and clones (f is canonical variable name for nanojit::Fragment*, fp for JSStackFrame*).
- Nit-pick include order (alphabetical within each group).
- Trailing space and indentation no-knock raid.
2008-08-03 22:55:28 -07:00
Brendan Eich
da42a8c6f7 Strength-reduced unsigned modulus in the fragment quick cache, don't use signed % which requires a branch and less-than-zero test. 2008-08-03 22:35:15 -07:00
Brendan Eich
fc2c669949 Misc. cleanup. 2008-08-03 01:34:07 -07:00
Brendan Eich
df36d9e36f Use INS_CONST to addName a few lir->insImm immediates. 2008-08-02 20:01:36 -07:00
Brendan Eich
5b9f299115 Fix TraceRecorder::ifop backward logic bug in the OBJECT case, and implement the STRING case. Add tests for truthy and falsy strings. 2008-08-02 16:51:22 -07:00
Brendan Eich
607e259b69 Fix return NULL in bool to return false. 2008-08-02 16:05:29 -07:00
Brendan Eich
0ac70ec2cc Avoid JSUint64 (NSPR style), use uint64 (SpiderMonkey style). 2008-08-02 16:05:16 -07:00
Brendan Eich
3488a68372 Restore lost or/and tests (hg strikes again, grrrr!) 2008-08-02 15:56:28 -07:00
Andreas Gal
3799a6f8ff Merge. 2008-08-02 03:24:03 -07:00
Andreas Gal
3106dc8845 Use quick cache to bypass fragmento is possible. 2008-08-01 22:56:52 -07:00
Andreas Gal
12f1c06952 Factor out most of the remaining code in js_LoopEdge into js_RecordTree and move the code to attach new branches into js_ExecuteTree. 2008-08-01 22:47:15 -07:00
Andreas Gal
746cb91802 Factor out js_ContinueRecording from js_LoopEdge. 2008-08-01 22:39:52 -07:00
Andreas Gal
6df2ea22c9 Add a fragment cache data structure. This will be used to accelerate the fragment lookup during branching. 2008-08-01 22:33:05 -07:00
Andreas Gal
3fea3f5d53 Split up FORALL_SLOTS_IN_PENDING_FRAMES macro in a macro that processes a frame, and a macro that uses that macro to process all pending frames. 2008-08-01 22:27:39 -07:00
Brendan Eich
5c506ec0ba Merge. 2008-08-01 21:09:48 -07:00
Brendan Eich
1c627f62ca Backed out changeset 8421b003fb5f -- it broke string to number, demonstrated by running trace-test.js without the -j (jit) option (10 - "1.3" => NaN instead of 8.7).
/be
2008-08-01 21:07:17 -07:00
Brendan Eich
269f35e4ad Fix ifop null/object inverted logic sense bug. 2008-08-01 20:19:28 -07:00
Brendan Eich
9cff9bf4d1 Add || and && tests; use newlines to join pass and fail results now that there are too many tests to be readable joined by commas on one line. 2008-08-01 20:18:10 -07:00
Brendan Eich
88bba45b34 Add || and && tests. 2008-08-01 20:13:11 -07:00
Brendan Eich
3691962a2f Extend ifop to handle undefined tests; implement JSOP_OR and JSOP_AND (so much work\!). 2008-08-01 12:06:04 -07:00
Brendan Eich
dc1072fe55 Style police raid: function names start in column 1, with one blank line between functions. 2008-08-01 11:03:52 -07:00
Brendan Eich
2cfdd9a55a 1. Don't store thisp literally in state.rp, get it from argv[-1]. 2. Fix DEBUG localNames code. 2008-08-01 10:40:38 -07:00
Brendan Eich
422ce674b5 Remove synthesizeFrames private declaration -- js_SynthesizeFrames is a static helper now. 2008-08-01 08:39:44 -07: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
Andreas Gal
4eba8e4012 Remove entryStackDepth. Calculate sp_adj relative to entryNativeStackSlots. 2008-08-01 02:33:54 -07:00
Andreas Gal
dd3ebd2cfe Make synthesizeFrame private. 2008-07-31 16:30:00 -07:00
Andreas Gal
144cccb3f1 Merge. 2008-07-31 13:43:02 -07:00
Andreas Gal
bef0cf6f23 Add vprof source files (this time for real.) 2008-07-31 13:42:25 -07:00
David Anderson
ea8cf3b5ce Fixed builtin_dmod not working on Win32. 2008-07-31 15:42:03 -05:00
Andreas Gal
80036e48d3 Pull in Moh's vprof utility from tamarin-tracing. 2008-07-31 13:39:41 -07:00
Andreas Gal
f0c74cce54 Sync with tamarin-tracing/nanojit tip. 2008-07-31 13:28:12 -07:00
shaver@mozilla.org
df01719b57 use optimized path for fromCharCode 2008-07-31 12:22:48 -07:00
shaver@mozilla.org
c274666457 Refactor js_GetUnitString to permit passing in a bare jschar, and use in js_str_fromCharCode. 2008-07-31 12:21:59 -07:00
shaver@mozilla.org
b078fb1509 Refactor trace-test.js to permit running a single test via js trace-test.js testName. 2008-07-31 12:15:22 -07:00
shaver@mozilla.org
3221386525 add specialized StringToInt32 and filter for it 2008-07-31 11:35:08 -07:00
shaver@mozilla.org
bccb36ea81 give strtointeger a way to avoid octal, to streamline ValueToNumber a bit 2008-07-31 11:33:55 -07:00
shaver@mozilla.org
12614d0334 Coerce strings to numbers for appropriate ops.
(Wants a specialized StringToInt32 and a filter to put it in place.)
2008-07-31 07:41:58 -07:00
shaver@mozilla.org
d200eb863e merge backout of d24e6005ee4c to fix the world 2008-07-31 06:36:53 -07:00
shaver@mozilla.org
f2c0c93637 Backed out changeset d24e6005ee4c (causing major array-fail). 2008-07-31 06:35:11 -07:00
Andreas Gal
e5a87ade9f Merge. 2008-07-31 01:35:56 -07:00
Andreas Gal
6f4cfc2628 Remove ANY_TYPE and move debug printf around to print entry point even if we can't enter due to type mismatch. 2008-07-31 01:35:18 -07:00
shaver@mozilla.org
a3bc7296d9 Make guard return expected, so we can trace alternate cases easily.
Better diagnostic for non-global scope chain head.
2008-07-30 22:59:13 -07:00
Andreas Gal
86aa1f7ff7 If trees are not enabled, don't try to reuse state and param1. 2008-07-30 21:40:21 -07:00
David Anderson
ad3e892e92 Re-use initial parameters on tree fragments. 2008-07-30 23:30:58 -05:00
shaver@mozilla.org
959dd9184f Implement JSOP_EQ and JSOP_NE over strings, plus JSOP_STRING. 2008-07-30 17:28:59 -07:00
Andreas Gal
e91eb4bc47 Merge. 2008-07-30 16:37:35 -07:00
Brendan Eich
fe3a6127c5 - Export JSSLOT_ITER_* from jsiter.cpp to jsiter.h, for jstracer.cpp to use.
- Fix OBJ_GET_SLOT to be STOBJ_GET_SLOT in jsiter.cpp, no thread safety here (bug on file).
- Move JSNativeEnumerator from jsobj.cpp to jsobj.h for jstracer.cpp as well.
- Rename JOF_2BYTE JOF_UINT8 for consistency, and actually decompile it.
- Trace JSOP_FORVAR (can't do anything in JSOP_ITER, it comes before the loop).
- Shortened some guardMyLongSummerVacationWithinBounds names ;-).
- Removed/refactored to avoid dslots_ins obligation on all callers.
2008-07-30 16:32:33 -07:00
Andreas Gal
698d3fb5cc Make the global frame layout match the slot layout in the global object. This will allow leaving global values in place when switching trees as long both inner and outer tree use the same value. 2008-07-30 16:28:48 -07:00
Andreas Gal
e8043788a7 Merge. 2008-07-30 16:06:11 -07:00
Andreas Gal
9b9d60583c Use isGlobal to distinguish whether a value is a global slot instead of scanning the table every time. 2008-07-30 16:05:51 -07:00
shaver@mozilla.org
124e9ae44b trace Math.random 2008-07-30 15:51:44 -07:00
shaver@mozilla.org
b1df95f721 Trace String.fromCharCode.
Handle failure signals of < 0 or NULL from traceable natives.
2008-07-30 15:19:25 -07:00
Andreas Gal
266a7c534f Clean up the living room a bit since people are going to come by to look at it. 2008-07-30 13:34:22 -07:00
Andreas Gal
3a278cdf00 Add isGlobal to check whether a value is a slot of the global object. 2008-07-30 12:15:53 -07:00
Andreas Gal
40696cff65 Note to self: hacking after 4am is detrimental to my spelling. 2008-07-30 04:20:48 -07:00
Andreas Gal
f1a5494d05 Major shakeup of the interning code for globals. Globals are now detected on demand as they are used and the slots are noted in treeInfo->globalSlots. At the same time the type is recorded in treeInfo->globalTypeMap. The stack type-map is maintained separately in treeInfo->stackTypeMap. All these structures are lists and are maintained as List<T> objects. Imports for globals can appear at the top (if we have already seen some imports for the loop header and are recompiling), or on the fly for lazily found values. We no longer intern all global properties that happen to match a name in the current function, and we also support inlining of functions that touch globals that are not used in the method where the trace started in. 2008-07-30 04:17:22 -07:00
Andreas Gal
7290f281a0 Use List<T> to maintain global slot list in TreeInfo. 2008-07-30 01:38:21 -07:00
Andreas Gal
7beb3cd77f Trash entire tree with all the information associated with it when we have a typemap conflict or the global shape changes. 2008-07-30 01:29:13 -07:00
Andreas Gal
afc7936599 Remember number of global slots known at that point in the trace in every side exit (forward-looking change to cope with dynamic collection of interned globals.) 2008-07-30 00:15:07 -07:00
Andreas Gal
90eee755f0 Merge. 2008-07-29 23:51:43 -07:00
Andreas Gal
f60c785137 Add a generic list data structure and fix side exit handling to always pick the right typemap to work with (exit map, not entry map). 2008-07-29 23:48:39 -07:00