Commit Graph

2508 Commits

Author SHA1 Message Date
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
dvander@iroh.alliedmods.net
6fe516cd73 Merge. 2008-07-29 19:20:36 -05:00
David Anderson
60181b7fd2 Fixed some MSVC whinings, implemented rdtsc on win32 2008-07-29 19:19:51 -05:00
Andreas Gal
8a6d3622fe Merge. 2008-07-29 17:15:00 -07:00
Andreas Gal
79fa051958 Removed unused field from TreeInfo. 2008-07-29 17:14:36 -07:00
David Anderson
340cb50c53 Merge (an empty one, thanks hg) 2008-07-29 19:05:59 -05:00
David Anderson
921bbecea3 Fixed infinite looping on non-threaded tracing (rumor is that we do Windows builds of Firefox) 2008-07-29 19:04:17 -05:00
Brendan Eich
48a3285a82 Merge again. 2008-07-29 16:02:53 -07:00
Brendan Eich
73e208808e Guard property cache hits by shape(s). 2008-07-29 16:01:00 -07:00
Andreas Gal
4d5b44839c Rename gslots to globalSlots. 2008-07-29 15:28:23 -07:00
Andreas Gal
437f15d428 Remove global frame transition code. Obsoleted by the new on-demand global loading code which we are about to add. 2008-07-29 15:16:35 -07:00
Brendan Eich
cc79bb34c5 Merge. 2008-07-29 14:52:22 -07:00
Andreas Gal
5a7ac301e6 Limit tree growth to side exits that expicitly declare that they want to be grown. 2008-07-29 11:13:41 -07:00
Brendan Eich
636b8ed6b6 Fix a couple of comments. 2008-07-29 10:53:58 -07:00
shaver@mozilla.org
ce85bd8955 JSOP_ADD over strings 2008-07-29 07:53:31 -07:00
shaver@mozilla.org
2a1fd601c4 signs, signs, everywhere signs 2008-07-29 07:38:04 -07:00
shaver@mozilla.org
a8b963d4a4 Trace String.prototype.substring for two-arg case.
* Export str_substring as js_str_substring.
* Add basic String_p_substring builtin (only handle end > begin, both in range).
* Add String_p_substring_1 builtin for the missing-end case.
* INS_CONST for named constants in traces.
* Support boxing of strings.
* Support CALLPROP with primitive this.
* Support traceable natives which require cx and this.
* Support fallible traceable natives.
* Fix JSOP_LENGTH to use i2f on result (need that everything-is-doubles T-shirt).
* Add strings test.
2008-07-29 07:32:18 -07:00
shaver@mozilla.org
98caf383a5 Trace JSOP_LENGTH over flat strings. (Need some cmovery for dep strings.) 2008-07-29 06:51:27 -07:00
Andreas Gal
eaeee57c9b Fix spelling. 2008-07-29 01:02:06 -07:00
Andreas Gal
1d8df7fd3c Cleanup global frame switching and add delayed write-back code for doubles. 2008-07-29 01:00:50 -07:00
Brendan Eich
747b8fab0e Regularize loop update in SwitchNativeGlobalFrame. 2008-07-29 00:13:59 -07:00
Brendan Eich
0a6546fb7a Fix synthesizeFrame's newifp->callerRegs/frame.regs update to pass along the pointer to the precious js_Interpret regs local and update it. 2008-07-29 00:06:29 -07:00
Brendan Eich
f2ca9496f4 Try to fix SwitchNativeGlobalFrame, still studying it but these changes seem necessary. 2008-07-28 23:59:29 -07:00
Brendan Eich
3e4d484622 Fix synthesizeFrame parameterization, and have it reconstruct stack depth; warning and space fixes. 2008-07-28 23:47:20 -07:00
Brendan Eich
fff2cda315 Export js_ReconstructStackDepth for use by side-exit code when synthesizing stack frames. 2008-07-28 23:46:27 -07:00
Andreas Gal
28deb1f5b0 Merge. 2008-07-28 23:31:39 -07:00
Andreas Gal
0bb95b6c46 Switch from one global frame to another by walking the two sorted gslots lists. 2008-07-28 23:30:16 -07:00
Brendan Eich
9894a22d65 Fix uninitialized nbytes in synthesize_frame. 2008-07-28 22:25:13 -07:00
Andreas Gal
ed2b81df60 Compilation fix for MSVC. 2008-07-28 21:17:43 -07:00
Andreas Gal
a9e5f84f42 Cleanup and split native frame reading/writing into stack and global part. 2008-07-28 18:06:34 -07:00
Andreas Gal
52bda2ec2c Sort interned global slots in ascending order for fast comparison of two different global frames when switching between them. 2008-07-28 16:49:13 -07:00
shaver@mozilla.org
9c4c8495f9 not-yet-working beginnings of frame reconstruction 2008-07-28 09:05:55 -04:00
Andreas Gal
cd39ba2407 Trash the interned globals of a tree if we experience a global shape mismatch. 2008-07-27 21:44:08 -07:00
Andreas Gal
4df581e3b3 Trash the typemap if a change of the global shape forces us to throw away a tree. 2008-07-27 19:18:51 -07:00
Andreas Gal
b798d08035 Abort trace if we inline too deeply. 2008-07-27 16:28:09 -07:00
Andreas Gal
4710877c9a Merge. 2008-07-27 16:19:15 -07:00
Andreas Gal
6126f5fa5c Track the type of guards and react accordingly if we bail out on them. Guards that protect against out-of-memory conditions don't try to grow the tree. Instead we just resume the interpreter. 2008-07-27 16:18:53 -07:00
Andreas Gal
51b608badc Don't use ABORT_TRACE outside the recorder. 2008-07-27 15:40:34 -07:00
shaver@mozilla.org
a4af3457f4 do setelem in a builtin, so we don't abort trace every 8 times when growing 2008-07-27 18:34:23 -04:00
Andreas Gal
e6cc02f5cc If we see a f2i(UnboxDouble) chain, simplify it to UnboxInt32 which does the conversion internally. This also enables a fastpath to read 31-bit jsval integers from arrays. 2008-07-27 14:55:26 -07:00
Andreas Gal
7837aae392 Merge. 2008-07-27 14:29:24 -07:00
Andreas Gal
a3eb60b77e Add limited outerlining. Much of this will be subsumed by nested trees. 2008-07-27 14:28:56 -07:00
shaver@mozilla.org
e69c5b7239 remove rval tracking, since it's no longer necessary 2008-07-27 15:47:43 -04:00
Andreas Gal
ca563057ee Remove guardCount. No longer needed. 2008-07-27 12:05:01 -07:00
Andreas Gal
05870cebe8 Merge. 2008-07-27 02:15:42 -07:00
Andreas Gal
8a7bb9c550 Smarter speculative demotion of numbers to integers and promotion of the trace seems to require actual doubles. If the number at entry looks like an int we make the slot an int and compile as such. If the loop-tail proves the slot to be a double, we recompile the trace. Currently such miss-speculation cannot be handled on secondary traces since we are currently unable to recompile the primary trace. Such secondary traces are blacklisted. 2008-07-27 02:15:17 -07:00
Brendan Eich
4d1de6a956 Add JSSF_NO_SCRIPT_RVAL script flag, and uint8 flags field for it. 2008-07-27 00:12:01 +01:00
Brendan Eich
8b62f00bae Fix comment typo. 2008-07-27 00:11:30 +01:00
Andreas Gal
a4fc19765e Don't try to demote slots on secondary traces (we have to recompile the primary trace as well for that, which we currently don't do.) 2008-07-25 19:30:33 -07:00
Andreas Gal
02997616f4 Add a test case for trees. 2008-07-25 19:10:23 -07:00
Andreas Gal
059abfa50f Added sunspider tests to t/ for dvander. 2008-07-25 18:43:19 -07:00
Andreas Gal
812989bb8a Eliminate EntryRegs. Its not safe to keep a reference to the entry SP since we might extend the tree from a different outer stack frame. Instead just store the entryStackDepth. 2008-07-25 18:22:15 -07:00
Andreas Gal
bbb1bc89c0 Print real recording point, not entryRegs and add an assert that makes sure the guard we come out of is associated with the tree we entered into. 2008-07-25 18:13:57 -07:00
Andreas Gal
24447ee8fb Merge. 2008-07-25 16:54:14 -07:00
Andreas Gal
1b7930d39d The VP engineering broke JSOP_NAME! We have to check whether the slot is actually interned and otherwise abort. 2008-07-25 16:51:42 -07:00
Brendan Eich
a8c6046d8c Avoid JSOP_POPV in global scripts from load(), etc. 2008-07-26 01:23:12 +02:00
David Anderson
4560ed961f Fixed entry typemap having wrong allocation size. 2008-07-25 13:30:52 -07:00
Andreas Gal
d952f192ba Can't use lr->from. Seems to not get set in certain cases. Go figure. The nanojit tree code is really weird. 2008-07-25 02:29:36 -07:00
Andreas Gal
dee805421b Factor out AttemptToGrowTree. 2008-07-25 02:00:02 -07:00
Andreas Gal
ecb79b1640 Determine ahead of time whether a side exit is a loop-terminating side exit instead of re-determining this at every side exit. 2008-07-25 01:44:40 -07:00
Andreas Gal
f3573b9940 Move trace activation code into js_ExecuteTree(). 2008-07-25 01:20:40 -07:00
Andreas Gal
3999210c12 Make demotion threshold optional (0=off, 32=default). Turn off to debug the type assert bug. 2008-07-24 17:33:34 -07:00
Andreas Gal
e838b138b8 Don't demote slots in overly long traces (based on counting the number of guards, current threshold=32). 2008-07-24 16:25:18 -07:00
Andreas Gal
f0399ffea7 Cleanup iteration over all slots to use a single macro to avoid code duplication. 2008-07-24 14:51:14 -07:00
Andreas Gal
e7f92ecf31 Add shark support to md5.js directly, no longer around the recorder. 2008-07-24 11:08:37 -07:00
Andreas Gal
6df91a21a0 Make the interpreter notify us when frames are popped so we see he right cx->fp value. Fix return value tracking for JSOP_STOP. 2008-07-24 10:35:10 -07:00
Andreas Gal
5ae4ef819e Backed out changeset a58e7ce6eb7f. stack(0) is wrong, if at all it should have been stack(-(1 + argc)). But anyway, its impossible to write through to the frame via set() at that point because leaveFrame() doesn't actually modify cx->fp. We need to wait for the interpreter to do so. Until then nativeFrameOffset produces incorrect values and the assert fails in set. 2008-07-24 10:09:51 -07:00
shaver@mozilla.org
b989e7b3e7 fix return-value handling for new stack layout 2008-07-24 00:31:37 -07:00
Andreas Gal
41e0593392 Maintain a separate frame for globals using InterpState->gp.
This will allow nested loops to access the globals interned by outer loops while at the same time sharing parts of the stack of the outer loop.
2008-07-23 23:18:02 -07:00
Andreas Gal
117bc4d9f9 Add a fast path for nativeFrameOffset that walks entire groups at a time, not slots. Check against the result calculated by the FORALL macro in DEBUG builds (for sanity). 2008-07-23 16:39:17 -07:00
Andreas Gal
4cc2061091 Merge. Make sure we clear out all slots from the tracker when leaving a frame. 2008-07-23 15:56:27 -07:00
Andreas Gal
df280d08d7 When addressing locations above the stack water level, use ->sp as base. Shaver accidently changed this to ->spbase when merging Igor's patch, so we were writing past the water mark and the stores were killed. 2008-07-23 15:48:15 -07:00
shaver@mozilla.org
c29aa4c3d2 tighten up some bounds, still not quite right 2008-07-23 11:42:52 -04:00
Andreas Gal
5dd9876515 Lazy fill the stackTracker as we lookup the nativeFrameOffset for values. Purge all entries related to the current frame when it is popped. This code could be further simplified if Tracker was a template. 2008-07-23 02:57:56 -07:00
shaver@mozilla.org
f0a625f5bc merge from andreas 2008-07-23 01:08:23 -04:00
shaver@mozilla.org
6f5e58e443 merge (still not working, probably box/unbox dumbness) 2008-07-23 01:06:18 -04:00
shaver@mozilla.org
a93fbcc99d merge (now compiling, untested) 2008-07-23 00:20:29 -04:00
shaver@mozilla.org
8a97552a28 merge (mostly, doesn't build) 2008-07-22 23:58:43 -04:00
Andreas Gal
c9cac5757f Handle leaving of frames in one central place. 2008-07-22 20:16:12 -07:00