Andreas Gal
9ea4e8a477
Merge.
2008-08-12 16:57:55 -07:00
Andreas Gal
d56662f293
Enumerate missing argument slots on the caller's stack and initialize them to undefined (450304).
2008-08-12 16:51:55 -07:00
Brendan Eich
a4111eea56
Fix shapelessUnknownCalleeHelper.
2008-08-12 16:36:32 -07:00
Brendan Eich
0ceb399b55
Merge.
2008-08-12 16:35:11 -07:00
David Anderson
a8821cdfc6
Added NaN test case that fails when jitting; currently looking into why.
2008-08-12 15:45:06 -07:00
Brendan Eich
25fc093756
Fix annoying warnings, finally.
2008-08-12 14:50:42 -07:00
Andreas Gal
4b6c770288
Merge.
2008-08-12 14:29:09 -07:00
Andreas Gal
1819586877
js_obj_hasOwnProperty is supposed to return a boolean but was incorrectly generating code to return a number, resulting on a failure in the boolean comparison due to an unexpected i2f (450304).
2008-08-12 14:28:15 -07:00
David Anderson
f4b6e09a98
Merge.
2008-08-12 11:53:24 -07:00
David Anderson
c340cb93c0
Only use fastcall on x86.
2008-08-12 11:46:57 -07:00
Brendan Eich
64fa74acf5
More guard argument formatting.
2008-08-12 11:36:52 -07:00
David Anderson
5e75ec729a
Merge.
2008-08-12 10:47:50 -07:00
David Anderson
40213894ff
Fixed nanojit using a variable before it got set (verbosity mode only it seems).
2008-08-12 10:45:24 -07:00
shaver@mozilla.org
3e4452be3c
fix !JS_TRACER build
2008-08-12 13:16:47 -04:00
shaver@mozilla.org
3f2af7e42d
add way to explicitly disable tracer for easier testing
2008-08-12 13:16:30 -04:00
Brendan Eich
827b341985
Consolidate common name (global slot) addressing code.
2008-08-12 09:42:29 -07:00
Brendan Eich
26c7507913
Put trailing args on their own lines when they otherwise would seem to associate with a nested call in a previous arg position.
2008-08-12 09:27:54 -07:00
Brendan Eich
74c6d3ffe3
Merge, plus ((void)0) parens.
2008-08-12 09:23:38 -07:00
Brendan Eich
fd08308ba0
Fix goto over init whinage.
2008-08-12 09:18:19 -07:00
shaver@mozilla.org
41a6158c57
fix build for !JS_TRACER, both threaded and switch interps
2008-08-12 12:09:59 -04:00
shaver@mozilla.org
9d4a33a8c6
guard all of jstracer.h against non-tracer builds
2008-08-12 11:36:29 -04:00
shaver@mozilla.org
1813fb2fa7
NAMEINC, INCNAME, NAMEDEC, DECNAME
2008-08-12 11:33:40 -04:00
Andreas Gal
b94f5433e5
Merge.
2008-08-12 03:40:16 -07:00
Andreas Gal
b4f7639e6e
Don't read type from typemap if we already have it in a local variable.
2008-08-12 02:00:05 -07:00
Andreas Gal
7e95e972d8
Don't re-record traces over and over in case of excessive type mismatches. Instead, blacklist the fragment and slowly back away from recording it.
2008-08-12 01:31:28 -07:00
Brendan Eich
8d77aad49c
JSOP_FORNAME.
2008-08-12 01:06:02 -07:00
Brendan Eich
d2e6e9e641
Factor forInOp from JSOP_FORLOCAL, use it from JSOP_FORARG's recorder too; tighten up JSOP_SETNAME.
2008-08-12 00:34:43 -07:00
Brendan Eich
d491ed65d3
Fix some comments and tighten up assertions about block scope (mrbkap please look).
2008-08-11 23:45:40 -07:00
Brendan Eich
e90731a3b6
Comments for JSOP_{,STRICT}{EQ,NE} about the layering and constraints on evolution of the non-strict equality ops' recorders.
2008-08-11 23:44:43 -07:00
shaver@mozilla.org
cfc93a30d9
cmp over number and (string or bool or undefined)
2008-08-12 01:05:33 -04:00
shaver@mozilla.org
2553ace88f
mistaken relanding, didn't track merges well enough
2008-08-12 00:41:23 -04:00
shaver@mozilla.org
2b16f54740
reland eb01b1d55d9b after the mismerge
2008-08-12 00:37:16 -04:00
shaver@mozilla.org
ba5a56aa89
reland 3ea1e1317707 after the mismerge
2008-08-12 00:36:25 -04:00
Brendan Eich
2cbfd79ea0
Restore lost shaver rev 0e50c89c476b -- how did that get lost?
2008-08-11 20:27:47 -07:00
Brendan Eich
daba5ef959
Dependent string test.
2008-08-11 20:26:04 -07:00
Brendan Eich
a63e9a65ba
Merge, sigh.
2008-08-11 19:21:42 -07:00
Brendan Eich
bba0ea3906
Rename js_DestroyJIT to js_FinishJIT to match Init/Finish vs. New/Destroy naming scheme used elsewhere; use same #if conditions around #include jstracer.h as around code depending on it.
2008-08-11 19:17:30 -07:00
shaver@mozilla.org
16a7af3ef4
JSOP_EQ/NE for objects
2008-08-11 22:11:31 -04:00
Brendan Eich
0ab33d4bfd
Argh, I hate hg.
2008-08-11 19:10:24 -07:00
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
Andreas Gal
1f5ce03d99
Don't try to delete names if we are not building a DEBUG build.
2008-08-11 17:49:56 -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
Brendan Eich
20ef6499d6
Make Print a fast native.
2008-08-11 16:19:55 -07:00
David Anderson
8e63b13307
Merge.
2008-08-11 16:15:01 -07:00
David Anderson
c5a85f7524
Merge.
2008-08-11 16:14:29 -07:00
Andreas Gal
b6bc18350b
Support non-flat strings in Any_getelem and Any_setelem.
2008-08-11 16:12:52 -07:00
David Anderson
1b623f7d25
Added explicit deallocation (bug 443500, r=gal)
2008-08-11 16:01:21 -07:00
Andreas Gal
80ab94547d
Remove obsolete Tests.cpp file.
2008-08-11 15:59:11 -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
Brendan Eich
391f5513d4
Fix FastNewObject built-in to create dense array instance with its own map.
2008-08-11 15:03:32 -07:00
Brendan Eich
0280e606df
Beware macro argument multiple expansion...
2008-08-11 14:44:22 -07:00
Brendan Eich
a2af1922f6
Merge.
2008-08-11 13:07:00 -07:00
Brendan Eich
40050a1e4d
Try fixing LOAD_INTERRUPT_HANDLER based on Andreas's patch.
2008-08-11 13:05:28 -07:00
Brendan Eich
7e793185ea
Match JSOP_NULLTHIS up to JSOP_NULL special cases in the decompiler.
2008-08-11 13:03:47 -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
a8e0893484
Avoid goto across initialization of sprop2 (446508).
2008-08-11 11:43:40 -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
40573b479e
Unregress FastNewObject builtin to handle user-defined constructors (note to self: run tests before coffee...).
2008-08-11 10:41:08 -07:00
Brendan Eich
7967defc01
Fix ASSERT_VALID_PROPERTY_CACHE_HIT pcoff argument (my bad from 887fc4facdeb).
2008-08-11 10:40:24 -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
207e579fe9
Use true and false for js_EqualString return values now that its return type is bool.
2008-08-10 23:17:28 -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
622dce0a42
joinTest.
2008-08-10 15:21:14 -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
Brendan Eich
9a1bab4473
Restore C compilation support to jscntxt.h, used by liveconnect (only one file now: jsj_JavaClass.c had no need to include jscntxt.h).
2008-08-09 22:25:54 -07:00
Brendan Eich
8d0b5ebbdc
camelCaps test names restored (NewTest => newTest, etc.).
2008-08-09 22:24:49 -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
b31572b1d5
Bug 449972 – TM: give xpcshell a JIT switch
2008-08-09 18:36:17 -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
Brendan Eich
337988cd85
Fix obj2 typo, meant obj (obvious use-before-set, sorry about that).
2008-08-09 13:30:49 -07:00
shaver@mozilla.org
33b067062b
restore preference for getarg+length over getargprop
2008-08-09 15:48:38 -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
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