Brendan Eich
9dd296d70a
Merge, in the name of all that which does not suck\!
2008-08-11 18:53:21 -07:00
David Anderson
9ce9cb42b5
Merge.
2008-08-11 18:49:34 -07:00
David Anderson
9c0315ccf7
Fragmento lifetime is now associated with the thread/runtime instead of the context.
2008-08-11 18:47:22 -07:00
Brendan Eich
7fbc9732fd
JSOP_LENGTH handles dependent strings now.
2008-08-11 18:41:06 -07:00
shaver@mozilla.org
6a35d8134e
implement JSOP_ADD(str, num)
2008-08-11 21:32:26 -04:00
David Anderson
c0b377bb8b
Fixed some explicit deallocation bugs that cropped up running in the browser.
2008-08-11 18:20:10 -07:00
Andreas Gal
ade8388ef5
Merge.
2008-08-11 18:03:31 -07:00
Andreas Gal
20318a6ce0
Trash tree if we see an obsolete treeinfo object on record.
2008-08-11 18:03:13 -07:00
Brendan Eich
5137a68ca5
Merge.
2008-08-11 17:54:59 -07:00
Brendan Eich
d004346b52
Object.prototype.{hasOwnProperty,propertyIsEnumerable}.
2008-08-11 17:47:05 -07:00
Brendan Eich
9849ef7434
Handle multi-level property cache hits; put BRANCH_EXIT on its own line so it stands out as the third param to guard in ifop.
2008-08-11 17:40:26 -07:00
David Anderson
c5a85f7524
Merge.
2008-08-11 16:14:29 -07:00
David Anderson
1b623f7d25
Added explicit deallocation (bug 443500, r=gal)
2008-08-11 16:01:21 -07:00
Andreas Gal
020e68ab1e
Remove default parameter for guard, specify MISMATCH_EXIT explicitly.
2008-08-11 15:40:04 -07:00
Andreas Gal
00e5631b45
Remove dead code, add a debug printf.
2008-08-11 15:23:37 -07:00
Andreas Gal
7bcf550b11
If we get a series of tree type mismatches, trash the tree (and all dependent trees in case of nesting.)
2008-08-11 15:16:34 -07:00
Andreas Gal
120117749e
Don't try to access the name of arguments beyond nargs (r=brendan).
2008-08-11 12:47:18 -07:00
Andreas Gal
285acf8b9c
Merge.
2008-08-11 11:43:59 -07:00
Andreas Gal
ca11b2e069
Don't use asprintf (446508).
2008-08-11 11:37:35 -07:00
Brendan Eich
13cfac8f97
Rework GCF_DONT_BLOCK to be cx->gcDontBlock, assert it's set, set before entering trace and clear on exit.
2008-08-11 11:18:16 -07:00
Brendan Eich
a56862bdff
Make js_ConcatStrings JS_FASTCALL and use directly as a built-in; remove gcflag param from it and from js_NewString.
2008-08-11 11:03:54 -07:00
Brendan Eich
56fac8fe90
Back out extra gcflag param change (859b9a23adbf), I set bad precedent and will back out previous such shortly. Want cx->gcflags instead.
2008-08-11 10:33:23 -07:00
Brendan Eich
fced00a77b
- Trace JSOP_NEWINIT/INITPROP/INITELEM/ENDINIT, which required extending the FastNewObject builtin to create a dense Array or a new Object (easy to discriminate on the constructor function's u.n.clasp member).
...
- Fix record_JSOP_SETELEM to avoid storing if a JSOP_POP that will be skipped follows.
2008-08-11 10:24:47 -07:00
shaver@mozilla.org
ee67ea9db4
extend js_NewObjectWithGivenProto to permit specifying additional new-thing flags (such as GCX_DONT_BLOCK)
2008-08-10 22:56:10 -04:00
Brendan Eich
0d83651633
- Skip dense array object, try prototype, in all JSOP_GET*PROP variants, interpreter and tracer.
...
- Test entry instead of retesting aobj->map->ops->getProperty == js_GetProperty in JSOP_CALLPROP.
- Handle object and null types as well as booleans in record_JSOP_NOT.
- Trivially implement JSOP_STRICT{EQ,NE} recording by forwarding to the non-strict record methods. This works so long as the latter trace only same-type operands and do no conversions.
2008-08-11 00:05:39 -07:00
Brendan Eich
43649cd01e
Record JSOP_LOOKUPSWITCH.
2008-08-10 23:20:24 -07:00
Brendan Eich
64fc3b0367
- Fix shapeless callee guarding to guard on function object value.
...
- Add JSOP_NULLTHIS to help the tracer guard shapeless callees (see trace-tests.js)
- Culled bogus record_JSOP_CALLGVAR left-over forwarding to record_JSOP_GETGVAR.
- Better shapeless callee tests.
2008-08-10 22:36:48 -07:00
Brendan Eich
a67dad8f4d
Reoptimize call and new based on shape guards and branded method-ful scopes -- no need to emit function-is-interpreted guards.
2008-08-10 15:26:39 -07:00
Brendan Eich
0099753ff4
Add Array (generic) join builtin, plus (not yet used) optional this-class guarding for builtins.
2008-08-10 14:50:31 -07:00
Brendan Eich
5bbc609a8b
Implement JSOP_OBJECT.
2008-08-10 12:01:03 -07:00
Brendan Eich
e5b0039eaa
Match native map guard specializations in tracer to interpreter, particularly to skip up the proto chain from a dense array in JSOP_CALLPROP (json2.js showed an abort here, pointing to the tracer/interpreter discrepancy).
2008-08-10 11:54:27 -07:00
Brendan Eich
18248a701c
Fix JSOP_FORLOCAL to push false when guarded conditions are false while recording (449961).
2008-08-10 10:42:21 -07:00
Brendan Eich
2991c66416
- Avoid unnecessary FASTCALL builtin wrappers for existing js_* library-private or friend functions, which could be (and now are) fastcall (JS_FASTCALL). A couple of builtins avoid name collisions by using js_Fast instead of just js_ as their name prefix.
...
- Use GCF_DONT_BLOCK from fastcall builtins that call into the GC allocator (mostly; a few places need help still, or better: need to avoid allocation).
- Cope with C clients of jscntxt.h and its include files (these hacks should go away).
- Naming convention and function definition line-break style nit-picks.
2008-08-10 00:39:18 -07:00
Brendan Eich
f2b84e6ea0
- Test JSVAL_BOOLEAN tag in TraceRecorder::record_JSOP_TYPEOF, assert no holes or other pseudo-booleans, to unify false/true/undefined testing.
...
- JS_NOT_REACHED("...") not JS_ASSERT(0 && "...").
-
2008-08-09 22:27:58 -07:00
shaver@mozilla.org
bd5846e102
JSOP_ANONFUNOBJ
2008-08-09 23:12:32 -04:00
shaver@mozilla.org
a937f98d5b
JSOP_TYPEOF and JSOP_TYPEOFEXPR
2008-08-09 22:54:01 -04:00
shaver@mozilla.org
c4ca6755bf
Builtin for String.prototype.concat (single int-arg version)
2008-08-09 22:15:21 -04:00
shaver@mozilla.org
3341bf1c11
Implement cmp for string-on-string.
...
Add < and > tests for strings.
Condition the top-level truthies test on a synthetic test name, so it can be
excluded.
2008-08-09 21:50:52 -04:00
Robert Sayre
c8dd484645
Bug 449978 – TM: trace some more builtins for string-validate-input
2008-08-09 21:47:52 -04:00
Robert Sayre
2ac505035a
Bug 449666 – TM: Assertion failure: JSSTRING_IS_FLAT during trace recording. r=brendan
2008-08-09 18:20:18 -04:00
shaver@mozilla.org
d431dd547d
improve naming of anonymous functions and excess args
2008-08-09 15:05:34 -04:00
Brendan Eich
c90cc76482
Prettier spacing knownNatives table.
2008-08-08 22:43:31 -07:00
Andreas Gal
36eb8da275
Merge.
2008-08-08 19:24:50 -07:00
Andreas Gal
66dd6aab15
Add an assert to protect against nested exits (not implemented yet.)
2008-08-08 19:23:28 -07:00
Brendan Eich
eaf4254c15
Merge from mozilla-central.
2008-08-08 18:58:04 -07:00
Andreas Gal
8244eafaff
Support calling of nested tree from within inlined frames. When we call a tree that tree expects to be the top-level tree, which means it assumes callDepth=0. If the call of the tree is within an inlined frame, thats not true (callDepth > 0). We adjust the native stack pointer accordingly before calling the tree, and then restore the value of the stack pointer after the call. Fancy stuff.
2008-08-08 18:52:08 -07:00
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
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
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
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
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
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
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
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
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
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
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
a253b66a09
If we stop recording, immediately attempt to trigger the tree.
2008-08-06 13:18:30 -07:00
Andreas Gal
141f71186c
Properly deal with trace entry with non-empty stack.
2008-08-06 12:38:17 -07:00
Andreas Gal
0ed65746a7
Split side exit handling from js_ExecuteTree.
2008-08-06 06:34:16 -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
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
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
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
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
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
shaver@mozilla.org
3221386525
add specialized StringToInt32 and filter for it
2008-07-31 11:35:08 -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
David Anderson
60181b7fd2
Fixed some MSVC whinings, implemented rdtsc on win32
2008-07-29 19:19:51 -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
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
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
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
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
Andreas Gal
c9cac5757f
Handle leaving of frames in one central place.
2008-07-22 20:16:12 -07:00
Andreas Gal
c6828d3504
Reduce HOTLOOP threshold to 2.
2008-07-22 18:31:44 -07:00
Andreas Gal
06365155c2
Avoid calculating native frame offset by tracking the last load/store for every slot and extracting the offset from there.
2008-07-22 17:54:04 -07:00
Andreas Gal
48b195e651
Avoid nativeFrameOffset calls in import().
2008-07-22 17:24:29 -07:00
Andreas Gal
14b0a0827d
Merge.
2008-07-21 19:38:03 -07:00
Andreas Gal
9b799905ed
Add a pattern to recognize safe_add and emit a simple add for it.
2008-07-21 19:37:43 -07:00
shaver@mozilla.org
e0b2e86c09
use nargs rather than argc, since bytecode only refers to [o-nargs) args
2008-07-21 22:31:08 -04:00
Andreas Gal
2d2bcf0fc8
Reverse the insanity that used to be tamarin's arg passing in ins2. Now it makes sense.
2008-07-21 17:59:42 -07:00
Andreas Gal
3b2a943332
Avoid overflow checks on integer adds when its safe to do so.
2008-07-21 17:50:17 -07:00
Andreas Gal
410c0b9a98
Eliminate entryFrame pointer (not safe to carry that around.)
2008-07-21 16:20:53 -07:00
Andreas Gal
b30f4c9be6
Use callDepth instead of entryFrame in the FORALL macro.
2008-07-21 16:19:38 -07:00
Andreas Gal
f1ef7f0175
Eliminate exit filter, write the type map directly in snapshot.
2008-07-21 15:09:19 -07:00
Andreas Gal
9495f9cb50
Sink stack-targeting type conversion in the set() path instead of in the ExitFilter.
2008-07-21 15:01:47 -07:00
Andreas Gal
a7cc4892f9
Use callDepth, not entryFrame in nativeFrameSlots().
2008-07-21 14:55:41 -07:00
Andreas Gal
bce8e13528
Remove excess parameters of verifyTypeStability.
2008-07-21 13:21:00 -07:00
Andreas Gal
a0cd046167
Track call depth in the trace recorder. This lays the groundwork to get rid of entryFrame.
2008-07-21 13:18:08 -07:00
shaver@mozilla.org
124244af4b
beginning of entryFrame removal
2008-07-21 15:57:02 -04:00
Andreas Gal
5067fc2638
Merge.
2008-07-21 12:44:03 -07:00
Andreas Gal
3f6f0d1ea5
Use ti instead of fi for TreeInfo pointers.
2008-07-21 12:43:51 -07:00
Andreas Gal
e9b2918575
Rename VMFragmentInfo to TreeInfo.
2008-07-21 12:41:43 -07:00
Andreas Gal
2f5e227963
Merge.
2008-07-20 17:36:47 -07:00
Andreas Gal
221f99adce
Style cleanup and eliminate redundant f2u(i2f|u2f) chains.
2008-07-20 17:36:11 -07:00
Brendan Eich
4a9828f126
Cite bug 445262 with a FIXME instead of omfgHack_ prefix ;-).
2008-07-20 16:21:45 -07:00
Brendan Eich
464b70d055
Tighten up js_IsLoopEdge and include JSOP_IFNEX.
2008-07-20 16:11:52 -07:00
Brendan Eich
c278ae56e0
Nit patrol.
2008-07-20 16:09:08 -07:00
Andreas Gal
e82ab0c21f
Simplify updating of the side exit target.
2008-07-20 14:56:04 -07:00
shaver@mozilla.org
368d1588bf
simpler loop exit check (backwards is a loop exit, forwards is not)
2008-07-20 17:54:16 -04:00
shaver@mozilla.org
7546f723f5
force Math to be interned, and defend against non-interned globals until upvar saves us all
2008-07-20 17:23:39 -04:00
Andreas Gal
0b74e54db8
Use exponential backoff when trying to extend trees.
2008-07-20 14:28:56 -07:00
Andreas Gal
a0e38ffd84
Merge.
2008-07-20 13:29:20 -07:00
Andreas Gal
d4d2117f7c
Don't emit boxed values, use the unboxed representation for constants.
2008-07-20 13:28:53 -07:00
Andreas Gal
71eb1da52f
Removed meaningless assert.
2008-07-20 13:25:36 -07:00
shaver@mozilla.org
cadc5891e5
don't pretend we can trace INCELEM and friends (fixes trace-test.js, ahem)
2008-07-20 16:21:43 -04:00
shaver@mozilla.org
ed1d0a8953
improve tracing/recording diagnostics
2008-07-20 15:42:19 -04:00
shaver@mozilla.org
d03348f92d
discard trace on global shape mismatch
2008-07-19 22:32:45 -07:00
Brendan Eich
5b009b1b49
Breathe, vertical-spacing, breathe!
2008-07-19 15:42:31 -07:00
shaver@mozilla.org
ef2e8305dc
Avoid tracking object properties, make incElem work.
2008-07-19 10:24:10 -07:00
shaver@mozilla.org
f34cd71b78
Implement DEFLOCALFUN for the fully-lightweight case.
...
Reset atoms base register on function entry and exit.
2008-07-19 06:29:56 -07:00
Brendan Eich
293e6bd4c4
Improve js_IsLoopExit (unannotated JSOP_GOTO is still ambiguous).
2008-07-19 10:52:24 -07:00
Brendan Eich
a26be1bd4b
Fix incProp to box and store (incElem still todo).
2008-07-19 10:24:28 -07:00
Andreas Gal
f2ad868fc0
Merge. hg sucks.
2008-07-19 00:40:54 -07:00
Andreas Gal
457c855d15
Don't demote fmul since it overflows in math-partial. We might try to demote it and then promote back if this happens (depends how aggressively we want so speculate). Speedup 6.6 for math-partial (since its sin/cos/pow heavy.)
2008-07-19 00:27:45 -07:00
Brendan Eich
d1b171e5e2
First stab at incops, plus unbox_jsval tag-masking guard fixes, plus misc. cleanup.
2008-07-19 00:15:22 -07:00
Andreas Gal
5495ccf586
Abort trace is STOP is leaving the recording context.
2008-07-18 19:15:49 -07:00
Andreas Gal
47ae25da20
Make entryFrame/entryRegs relative to the tree entry since we only adjust ip/sp/rp when exiting from the tree, not in between fragments.
2008-07-18 16:21:22 -07:00
Andreas Gal
a8b127d5af
Adjust ip/sp/rp in the interpreter recovery code, not on the trace.
2008-07-18 15:35:59 -07:00
Andreas Gal
1c9c67b6a1
Write all the debug output to stdout (we can't easily make everything go to stderr, so this way at least it all goes into the same place.)
2008-07-18 14:13:31 -07:00
Andreas Gal
89b50ed124
Rework some of David's changes. Make sure we don't modify the tree until we are ready to attach the new fragment. Share lirbufs between tree branches.
2008-07-18 14:11:01 -07:00
David Anderson
4770d4b3e0
Got side exits seemingly working, added if.js to trace-test.js
2008-07-18 10:33:17 -07:00
shaver@mozilla.org
61d58bad87
Handle more operand types in ifop().
2008-07-18 08:01:51 -07:00
shaver@mozilla.org
983e9cdb83
Better diagnostic info for trace abort.
2008-07-18 07:59:37 -07:00
shaver@mozilla.org
3eaeae50b5
lookup/find, but do not fill prop cache from recorder
2008-07-18 00:46:18 -07:00
shaver@mozilla.org
7078a99d21
When PROPERTY_CACHE_TEST misses, fall back to doing our own lookup via js_GetPropertyHelper.
2008-07-17 23:57:56 -07:00
Brendan Eich
84c0998916
Warning elimination.
2008-07-17 18:30:54 -07:00
Andreas Gal
f94180fbe2
Make sure we compile again if we reject a trace by decrementing hits.
2008-07-17 18:15:55 -07:00
Andreas Gal
f58160134a
Fix hot loop triggering.
2008-07-17 18:10:47 -07:00
shaver@mozilla.org
859ec6fbb6
can't easily find real names for globals, so just number them
2008-07-17 17:33:18 -07:00
Andreas Gal
dded69f2a3
Merge.
2008-07-17 17:13:41 -07:00
Andreas Gal
19ed222624
Disable trees for the time being.
2008-07-17 17:12:28 -07:00
Andreas Gal
43fbfbfe1e
Add if.js example for trees.
2008-07-17 16:38:09 -07:00
Andreas Gal
dbf2dc54bd
Add the beginning of support for trees.
2008-07-17 16:20:13 -07:00
shaver@mozilla.org
3db81baa04
Label globals and locals with their source-names in trace.
...
Show line number on abort.
2008-07-17 15:09:48 -07:00
Andreas Gal
f91ca871ac
Add js_IsLoopExit that indicates whether a side exit is likely to continue the loop or not.
2008-07-17 14:58:09 -07:00
Andreas Gal
3df09fb85c
Cleanup recorder activation, use a single hot loop threshold (10).
2008-07-17 13:42:58 -07:00
Andreas Gal
954c5830e1
Added statistics and a js_DestroyJIT hook. Also use debug_only and not verbose_only as #ifdef DEBUG shortcut.
2008-07-17 10:22:40 -07:00
Andreas Gal
bfb3e457f1
Fix signature of insCall in the FuncFilter and remove f2i(i2f) elimination since we shouldn't really ever hit it.
2008-07-17 03:24:17 -07:00
Andreas Gal
e12047397c
Move up addName to make sure it gets inline in non-debug mode.
2008-07-17 02:02:48 -07:00
shaver
87eacb1139
Add setprop and tests for setprop and cleanup labling code for debug mode (m=gal).
2008-07-17 02:00:23 -07:00
Andreas Gal
9d6fa41738
Cleanup trace abort handling.
2008-07-17 01:29:41 -07:00
Andreas Gal
3fa6978605
Merge.
2008-07-17 00:48:30 -07:00
Andreas Gal
3cd2b84ec4
Fixed ASSERT JS_DOUBLE != JS_VOID issue. If the root fragment fails to compile, trash the type-map and re-capture it when we try to re-compile.
2008-07-17 00:48:10 -07:00
shaver@mozilla.org
acde4fceb0
JSOP_LENGTH
2008-07-16 23:53:14 -07:00
Andreas Gal
6cfd498b7c
Increase code cache size.
2008-07-16 23:47:57 -07:00
Andreas Gal
ad6b349616
Merge.
2008-07-16 23:39:12 -07:00
Andreas Gal
e2a0438e22
Fix f2i(i2f) filter (broken since the last TT sync, argument order changed from right to left to left to right).
2008-07-16 23:38:39 -07:00
Brendan Eich
13d6469f9b
Prefer getarg;length, etc. to getargprop.
2008-07-16 23:33:04 -07:00
Andreas Gal
83ac88d4c7
Don't clear out arguments, clear out variables at method entry.
2008-07-16 23:04:50 -07:00
Andreas Gal
b243a8350a
Better naming of the after_JSOP_CALL event (EnterFrame).
2008-07-16 23:00:59 -07:00
Andreas Gal
2442099090
Notify the recorder when a new frame was created by JSOP_CALL.
2008-07-16 22:58:06 -07:00
Andreas Gal
2379d6dcde
Initialize arguments to void and write JSVAL_HOLE's value onto the native stack, not its boxed representation.
2008-07-16 22:25:56 -07:00
Andreas Gal
df5005a322
Hand in typemap the recorder is supposed to use (preparation for side exit compilation and trees).
2008-07-16 21:49:42 -07:00
Andreas Gal
def4afc614
Move the allocation of the LIR buffer and the FragmentInfo data structure creation (which includes typemap and interned global calculation) into loopedge.
2008-07-16 21:41:03 -07:00
Andreas Gal
af95344998
Make JSOP_CALLNAME tell us why it doesn't like to trace.
2008-07-16 19:00:14 -07:00
Andreas Gal
74f767e62b
Fix generation of VOID immediates and initialize rval after the new frame was setup by CALL.
2008-07-16 17:44:44 -07:00
Andreas Gal
db7e41ed40
Add generic recorder hooks that are called before and after all opcodes as we trace. We might want to instead just move to pre_OP and post_OP.
2008-07-16 17:29:08 -07:00
Andreas Gal
c041bad939
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
7f119dc35a
Enable CALLNAME and add test case for it so we can call global functions.
2008-07-16 15:40:35 -07:00
Andreas Gal
c7714a3ad5
Make sure this/argv[-1] is set fpr CALLVAR and CALLARG.
2008-07-16 15:13:27 -07:00
Andreas Gal
04ea9e0e09
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
43b7ba1be4
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
5dca2ad552
Synced nanojit with TT tip.
2008-07-16 14:21:31 -07:00
shaver@mozilla.org
ef9a5dc216
fix GETXPROP; thanks to brendan for playing chewbacca
2008-07-16 13:10:17 -04:00
shaver@mozilla.org
f8c80ec490
CALLARG, CALLVAR
2008-07-15 23:37:57 -04:00
shaver@mozilla.org
4937938676
fix scalpel left in nativeFrameSlots from aborted thisp addition to frame
2008-07-15 23:20:53 -04:00
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