Commit Graph

476 Commits

Author SHA1 Message Date
Robert Sayre
d5acda3fc3 Merge tracemonkey to mozilla-central. 2009-03-19 14:49:04 -04:00
Andreas Gal
47b45e60e7 Always check operation callback on backwards branches (484035, r=brendan). 2009-03-19 01:07:31 -07:00
Graydon Hoare
44c661ddb2 Bug 471373 - OOM in imacro trips assert, r=brendan. 2009-03-17 15:50:55 -07:00
Jim Blandy
debdb32ef3 Bug 480132: Clone lexical blocks only when needed. r=igor
Terminology:

A "script block" is an object of class Block allocated by the byte
compiler and associated with a script.  Script blocks are never
modified, and may be used as a prototype for a "closure block":

A "closure block" is an object of class Block that holds variables
that have been closed over (although we actually leave the variables
on the stack until we leave their dynamic scope).  A closure block is
a clone of a script block (its prototype is a script block).

Adjust the meanings of fp->blockChain and fp->scopeChain:

  fp->blockChain is always the innermost script block in whose static
  scope we're executing.

  fp->scopeChain is the current scope chain, including 'call' objects
  and closure blocks for those function calls and blocks in whose
  static scope we are currently executing, and 'with' objects for with
  statements; the chain is typically terminated by a global object.
  However, as an optimization, the young end of the chain omits block
  objects we have not yet needed to clone.

Closures need fully reified scope chains, so have js_GetScopeChain
reify any closure blocks missing from the young end of fp->scopeChain
by cloning script blocks as needed from fp->blockChain.  Thus, if we
never actually close over a particular block, we never place a closure
block for it on fp->scopeChain.

Have JSOP_ENTERBLOCK and JSOP_LEAVEBLOCK always keep fp->blockChain
current.  When JSOP_LEAVEBLOCK pops a block from fp->blockChain that
has been cloned on fp->scopeChain, pop fp->scopeChain as well.

Remove the JSFRAME_POP_BLOCKS flag, as it is no longer needed.

Ensure that the JIT won't have to create closure blocks or call
js_PutBlockObject; it can't handle those things yet.  Note our current
script block when we begin recording.  Abort recording if we leave
that block; we can't tell in advance whether it will need to be "put"
in future trace invocations.  Leave trace if we call js_GetScopeChain
while in the static scope of lexical blocks.  Remove JIT tests based
on JSFRAME_POP_BLOCKS.

Verify that generators capture the correct value for blockChain.

Add a constructor to JSAutoTempValueRooter for rooting JSObject
pointers.
2009-03-16 09:55:06 -07:00
Igor Bukanov
20e6be9c80 bug 362910 - js_GetMethod cleanup. r=brendan 2009-03-14 17:41:47 +01:00
Jim Blandy
74847db9cd Back out 480132: orange on Linux (http://tinderbox.mozilla.org/showlog.cgi?log=TraceMonkey/1237017748.1237029269.2403.gz&fulltext=1) 2009-03-14 08:19:58 -07:00
Jim Blandy
bed3611385 Bug 480132: Clone lexical blocks only when needed. r=igor
Terminology:

A "script block" is an object of class Block allocated by the byte
compiler and associated with a script.  Script blocks are never
modified, and may be used as a prototype for a "closure block":

A "closure block" is an object of class Block that holds variables
that have been closed over (although we actually leave the variables
on the stack until we leave their dynamic scope).  A closure block is
a clone of a script block (its prototype is a script block).

Adjust the meanings of fp->blockChain and fp->scopeChain:

  fp->blockChain is always the innermost script block in whose static
  scope we're executing.

  fp->scopeChain is the current scope chain, including 'call' objects
  and closure blocks for those function calls and blocks in whose
  static scope we are currently executing, and 'with' objects for with
  statements; the chain is typically terminated by a global object.
  However, as an optimization, the young end of the chain omits block
  objects we have not yet needed to clone.

Closures need fully reified scope chains, so have js_GetScopeChain
reify any closure blocks missing from the young end of fp->scopeChain
by cloning script blocks as needed from fp->blockChain.  Thus, if we
never actually close over a particular block, we never place a closure
block for it on fp->scopeChain.

Have JSOP_ENTERBLOCK and JSOP_LEAVEBLOCK always keep fp->blockChain
current.  When JSOP_LEAVEBLOCK pops a block from fp->blockChain that
has been cloned on fp->scopeChain, pop fp->scopeChain as well.

Remove the JSFRAME_POP_BLOCKS flag, as it is no longer needed.

Ensure that the JIT won't have to create closure blocks or call
js_PutBlockObject; it can't handle those things yet.  Note our current
script block when we begin recording.  Abort recording if we leave
that block; we can't tell in advance whether it will need to be "put"
in future trace invocations.  Leave trace if we call js_GetScopeChain
while in the static scope of lexical blocks.  Remove JIT tests based
on JSFRAME_POP_BLOCKS.

Verify that generators capture the correct value for blockChain.

Add a constructor to JSAutoTempValueRooter for rooting JSObject
pointers.
2009-03-14 00:58:27 -07:00
Jim Blandy
d72dff994b Back out 480132 fix; static analysis red 2009-03-14 00:57:54 -07:00
Jim Blandy
4778b96a85 Bug 480132: Clone lexical blocks only when needed. r=igor
Terminology:

A "script block" is an object of class Block allocated by the byte
compiler and associated with a script.  Script blocks are never
modified, and may be used as a prototype for a "closure block":

A "closure block" is an object of class Block that holds variables
that have been closed over (although we actually leave the variables
on the stack until we leave their dynamic scope).  A closure block is
a clone of a script block (its prototype is a script block).

Adjust the meanings of fp->blockChain and fp->scopeChain:

  fp->blockChain is always the innermost script block in whose static
  scope we're executing.

  fp->scopeChain is the current scope chain, including 'call' objects
  and closure blocks for those function calls and blocks in whose
  static scope we are currently executing, and 'with' objects for with
  statements; the chain is typically terminated by a global object.
  However, as an optimization, the young end of the chain omits block
  objects we have not yet needed to clone.

Closures need fully reified scope chains, so have js_GetScopeChain
reify any closure blocks missing from the young end of fp->scopeChain
by cloning script blocks as needed from fp->blockChain.  Thus, if we
never actually close over a particular block, we never place a closure
block for it on fp->scopeChain.

Have JSOP_ENTERBLOCK and JSOP_LEAVEBLOCK always keep fp->blockChain
current.  When JSOP_LEAVEBLOCK pops a block from fp->blockChain that
has been cloned on fp->scopeChain, pop fp->scopeChain as well.

Remove the JSFRAME_POP_BLOCKS flag, as it is no longer needed.

Ensure that the JIT won't have to create closure blocks or call
js_PutBlockObject; it can't handle those things yet.  Note our current
script block when we begin recording.  Abort recording if we leave
that block; we can't tell in advance whether it will need to be "put"
in future trace invocations.  Abort recording if we call
js_GetScopeChain while in the static scope of lexical blocks.  Remove
JIT tests based on JSFRAME_POP_BLOCKS.

Verify that generators capture the correct value for blockChain.

Add a constructor to JSAutoTempValueRooter for rooting JSObject
pointers.
2009-03-13 23:43:32 -07:00
Robert Sayre
8e061e35da Backout patch for Bug 480132. Debug only nit fix busts static analysis compile. 2009-03-14 02:20:45 -04:00
Jim Blandy
40e8a7d560 Bug 480132. SpiderMonkey clones too many blocks into the heap. r=igor 2009-03-14 02:09:28 -04:00
Igor Bukanov
4b95050fe2 Backed out changeset 57de81309176 - bug 437325 - due to mochitest leaks on tinderbox 2009-03-13 18:36:46 +01:00
Igor Bukanov
3de011b9cd bug 437325 - JSThread is no longer shared between runtimes. r=brendan 2009-03-13 12:36:21 +01:00
Igor Bukanov
75640ecce1 Backed out changeset 4159ebdfe31e to fix some typos in the patch 2009-03-13 12:21:04 +01:00
Igor Bukanov
8eeedd9647 bug 437325 - JSThread is not shared between runtimes. r=brendan 2009-03-13 12:10:34 +01:00
Igor Bukanov
3e7114aad2 bug 482038 - removal of JSRuntime.gcPoke checks from js_NewGCThing. r=brendan 2009-03-12 10:15:55 +01:00
Jim Blandy
875aee5e88 Bug 479258: Include "jsstdint.h" for <stdint.h> type use within SpiderMonkey. r=brendan 2009-03-18 11:38:16 -07:00
Brendan Eich
e37fd1b818 Bug 476447 - Array.prototype getter/setter does not work as usual (r=jorendorff). 2009-03-09 11:25:43 -07:00
Andreas Gal
52cc17234c Check for non-stub getters/setters in SETNAME and SETPROP and invoke SetPropHit after setting the property in INITPROP (481989, r=brendan). 2009-03-07 01:25:37 -08:00
Brendan Eich
0332084955 Bug 481516 - Assertion failure: pobj_ == obj2, at ../jsinterp.cpp:4276 when getting a property that is cached but shadowed (r=jorendorff). 2009-03-06 16:34:19 -08:00
Robert Sayre
8f71e6c715 Merge m-c to tm 2009-03-04 14:52:53 -05:00
Brendan Eich
f32c3d8613 Bug 480657 - TM: Add an API to define traceable constructors (r=gal, jorendorff). 2009-03-03 22:53:27 -08:00
Andreas Gal
5b7dfe03a9 Assert prototype shapes when reading a hole from a dense array instead of calling a builtin (481328, r=brendan). 2009-03-03 21:58:56 -08:00
Andreas Gal
8c3223aab5 Browser spuriously sets runtime->anyArrayPrototypeHasElement and makes perf bad (481251, r=mrbkap). 2009-03-03 18:04:15 -08:00
Robert Sayre
f4c8ebe128 Merge tm to m-c. 2009-03-03 13:48:15 -05:00
Igor Bukanov
7f8a45e9f9 bug 479430 - adding mixing operation callback calls. r=gal 2009-03-02 14:32:27 +01:00
Andreas Gal
4c04aa2f53 Backed out bug 480657. Massive failures across all platforms. 2009-02-28 23:40:04 -08:00
Andreas Gal
7bd6cbad5f Add an API to define traceable constructors (480657, r=brendan). 2009-02-28 18:18:42 -08:00
Andreas Gal
1cbf259c3c Improve blacklisting (479109, r=graydon). 2009-02-25 18:47:22 -08:00
Jason Orendorff
2f464f3348 Bug 479826 - Remove cx->pcHint. r=gal.
--HG--
extra : rebase_source : caf9fef929fe161fad2f6a98b53cb3d00e43f31f
2009-02-23 17:29:40 -06:00
Robert Sayre
12943580cf Merge m-c to tracemonkey. 2009-02-23 12:44:23 -05:00
Jason Orendorff
15b9f03458 Bug 479566 - Rename array "dense length" to capacity. r=shaver. 2009-02-21 15:33:50 -06:00
Igor Bukanov
7ac32de806 bug 478543 - fixing warnings about casts between function and data pointers. r=brendan 2009-02-19 09:33:37 +01:00
Jim Blandy
2d6ea8b787 Bug 478075: Remove parent argument to js_GetCallObject. r=brendan 2009-02-18 23:57:24 -08:00
Jason Orendorff
c936fbe2d4 Bug 463239 - JS_SetTrap alters code execution. r=brendan. 2009-02-18 18:31:09 -06:00
Robert Sayre
695b4646c3 Merge tm to mc 2009-02-19 11:48:08 -05:00
Jim Blandy
ede7e6d142 Bug 391488: Eliminate PTRDIFF macro; delete jssttddef.h. r=jimb
Delete jsstddef.h, since its only remaining purpose is to make certain
Win16-specific definitions; we don't support Win16 any more.  In
particular, we can just subtract pointers now, so the PTRDIFF macro is
unnecessary noise.

Most places get stddef.h via jstypes.h or some other header, so we can
just delete #inclusions of jstddef.h.  The exception is jskwgen.h, so
there we explicitly include <stddef.h> instead.
2009-02-18 09:14:51 -08:00
Robert Sayre
a3ab3a989e Merge tm to m-c. 2009-02-17 20:08:01 -05:00
Wladimir Palant
0028837f26 Bug 475334 - Don't trigger debugger hooks until frame initialization is complete. r=mrbkap 2009-02-11 22:28:55 +01:00
Andreas Gal
93eb39269d Substitute operation counting with a watchdog thread (477187, 3nd attempt, r=brendan/mrbkap/jst, sr=brendan/jst). 2009-02-10 14:07:01 -08:00
Andreas Gal
474d0d308f Backout bug 477187. 2009-02-10 09:54:14 -08:00
Andreas Gal
f796bcd60a Substitute operation counting with a watchdog thread (477187, 2nd attempt, r=brendan/mrbkap/jst, sr=brendan/jst). 2009-02-10 03:45:36 -08:00
Andreas Gal
7ea402f38c Merge. 2009-02-09 22:54:41 -08:00
Andreas Gal
2a20c2a6de Backing out bug 477187. Breaks xpcshell. 2009-02-09 22:54:05 -08:00
Andreas Gal
2e46d80547 Merge. 2009-02-09 18:21:15 -08:00
Andreas Gal
cbfbbd3cac Substitute operation counting with a watchdog thread (477187, r=brendan/mrbkap/jst, sr=brendan/jst). 2009-02-09 18:20:50 -08:00
Blake Kaplan
843dd4928c Bug 469405 - Handle an __iterator__ implementation returning a primitive value on trace. r=brendan 2009-02-07 11:28:23 -08:00
Jason Orendorff
b93b5173f2 Bug 476873 - TM: Trace JSOP_ARRAYPUSH. r=brendan. 2009-02-06 13:19:06 -06:00
Jeff Walden
ece84ef199 Bug 474501 - JS array and object literals should define properties, not set them, to avoid calling getters or setters along the prototype chain. r=brendan 2009-02-03 23:14:36 -08:00
Igor Bukanov
5fb2f0b511 bug 467495 - JSOP_DEFUN fixes to deal with non-top-level function statements redeclaring local argument and variables. r=brendan 2009-02-05 14:11:04 +01:00
Jeff Walden
3c038a63cb Bug 463243 - Assert correct type in JSVAL_TO_* (and vice versa) macros to fail fast when type errors happen. r=brendan 2009-02-03 13:56:25 -08:00
Andreas Gal
359fa8c1b5 Backout bug 474501. Causes a massive slowdown in trace-tests.js that needs to be investigated. 2009-02-04 01:47:44 -08:00
Jeff Walden
6a3bcef361 Bug 474501 - JS array and object literals should define properties, not set them, to avoid calling getters or setters along the prototype chain. r=brendan 2009-02-03 23:14:36 -08:00
Jason Orendorff
e4c1fb1cfd Bug 462027 - Bail off trace when reentering interpreter. r=gal. 2009-02-03 18:25:12 -06:00
Jeff Walden
461e28ae88 Backed out changeset ca733f2cc237; looks like some include system weirdness is biting where an old version of jsapi.h is being included which then causes a *newer* included version to miscompile. Weird, still investigating... 2009-02-03 15:48:30 -08:00
Jeff Walden
e356cf1d3a Bug 463243 - Assert correct type in JSVAL_TO_* (and vice versa) macros to fail fast when type errors happen. r=brendan 2009-02-03 13:56:25 -08:00
Jason Orendorff
27c16ff3b1 Bug 476666 - TM: Crash reading near 0 @Detecting, regression due to bug 476238. r=gal. 2009-02-03 12:39:46 -06:00
Jason Orendorff
4e3f2cfd40 Revert to 07be1f190a3d. Revision 5f5c1cd63641 should not have been pushed. 2009-02-03 12:38:44 -06:00
Jason Orendorff
f8ca22b197 Bug 476666 - TM: Crash reading near 0 @Detecting, regression due to bug 476238. r=gal. 2009-02-03 12:19:50 -06:00
Andreas Gal
68e8901a4a Bake the value of fp->imacpc into the trace and report it at recording time when detecting inside JSOP_GETELEM (follow-up for 476238, r=brendan,jorendorff). 2009-02-02 18:21:28 -08:00
Andreas Gal
37c6216a54 Merge. 2009-02-02 17:26:22 -08:00
Andreas Gal
3682914dfd Leave a hint for GetProperty in the context so it can figure out the current bytecode location without de-optimizing (476238, r=jorendorff). 2009-02-02 17:25:59 -08:00
Igor Bukanov
70bfc5a80d bug 476049 - optimizing js_CheckRedeclaration for the common case of non-existing properties. r=brendan 2009-02-02 20:53:56 +01:00
Robert Sayre
5bdafd3aba Merge tm to m-c. 2009-02-28 12:38:33 -05:00
Blake Kaplan
14658eb0ed Bug 479288 - Move wrapping back into the outerObject hook. r+sr=bent/jst 2009-02-25 17:32:09 -08:00
Jeff Walden
543f0d5a97 Back out bug 474501; it has a problem with one Mochitest. 2009-01-30 20:00:52 -08:00
Ben Turner
60956ac6bd Bug 460882. r+sr=mrbkap. 2009-02-16 13:16:13 -08:00
Jeff Walden
e961f82d89 Bug 474501 - JSON literals shouldn't have prototype setters run during evaluation. r=brendan 2009-01-30 17:40:33 -08:00
Jason Orendorff
37f2985bdf Bug 476177 - TM: cx->stackPool must not be accessed on trace. r=brendan.
--HG--
extra : rebase_source : 746d61b54aa38cbe18fe31bce4efcbbad4629678
2009-01-30 17:40:05 -06:00
Andreas Gal
595570a83e Add debug hook to the threaded interpreter to trace instruction stream (476128, r=shaver). 2009-01-30 15:14:31 -08:00
Jason Orendorff
6142999fde Bug 468782 - TM: js_FastValueToIterator and js_FastCallIteratorNext can reenter (relanding with a bug fix). r=brendan. Note that this changeset alone does not fix the bug; an upcoming patch in bug 462027 completes the fix. 2009-01-28 09:24:35 -06:00
Andreas Gal
7c6106e86d Abort if we hit SETGVAR with a NULL slot (465567, r=brendan). 2009-01-28 00:35:20 -08:00
Andreas Gal
1bbc35daad Backed out changeset d50d3681b94e (attempted re-landing of 474771). 2009-01-27 16:41:43 -08:00
Igor Bukanov
65cda4b280 Backed out changeset 39b1c9f21064 - the patch again has triggered the crashtest timeout. 2009-01-27 15:11:47 +01:00
Andreas Gal
f17d7cf056 Set on-trace flag only during trace execution, not recording (474771, r=brendan, patch has failed before, please back out at the earliest sign of trouble). 2009-01-27 01:55:31 -08:00
Andreas Gal
868cf7c72c Backed out changeset ece63b96379b 2009-01-27 00:10:38 -08:00
Jason Orendorff
c0cc74fa99 Bug 468782 - TM: js_FastValueToIterator and js_FastCallIteratorNext can reenter. r=brendan. Note that this changeset alone does not fix the bug; an upcoming patch in bug 462027 completes the fix. 2009-01-27 00:19:58 -06:00
Robert Sayre
b5cd4ca3dc Backout c0b2c82a524e. 2009-01-25 22:36:46 -08:00
Andreas Gal
e481ee3eb8 Only set onTrace flag while running native code, not when recording (474771, r=brendan). 2009-01-25 20:24:25 -08:00
Brendan Eich
c13882a292 Bug 470187 - TM: "Assertion failure: entry->kpc == (jsbytecode*) atoms[index]" with valueOf, regexp (r=jorendorff). 2009-01-23 14:33:42 -08:00
Brendan Eich
196e15a45e Bug 473282 - TM: Crash [@ JS_CallTracer] (r=jwalden). 2009-01-23 14:31:07 -08:00
Andreas Gal
184fc63cd1 Backout bug 468782. Confirmed to leak. 2009-01-25 16:38:31 -08:00
Jason Orendorff
c9961fe054 Bug 468782 - TM: js_FastValueToIterator and js_FastCallIteratorNext can reenter. r=brendan. Note that this changeset alone does not fix the bug; an upcoming patch in bug 462027 completes the fix. 2009-01-22 16:39:26 -06:00
Andreas Gal
1d277bc633 Backout all patches since last mozilla-central merge (Thu Jan 22 19:14:02 2009 -500 by sayrer). 2009-01-25 02:58:22 -08:00
Andreas Gal
1baff988de Only set onTrace flag while running native code, not when recording (474771, r=brendan). 2009-01-23 20:22:23 -08:00
Andreas Gal
1b154f72a6 Merge. 2009-01-23 15:15:34 -08:00
Andreas Gal
920ecc2113 Backed out changeset 17663da1b840 (bug 462027). 2009-01-23 15:14:46 -08:00
Brendan Eich
94412bc214 Bug 470187 - TM: "Assertion failure: entry->kpc == (jsbytecode*) atoms[index]" with valueOf, regexp (r=jorendorff). 2009-01-23 14:33:42 -08:00
Brendan Eich
4ade60e63d Bug 473282 - TM: Crash [@ JS_CallTracer] (r=jwalden). 2009-01-23 14:31:07 -08:00
Jason Orendorff
9ff9140ae0 Bug 468782 - TM: js_FastValueToIterator and js_FastCallIteratorNext can reenter. r=brendan. Note that this changeset alone does not fix the bug; an upcoming patch in bug 462027 completes the fix.
--HG--
extra : rebase_source : 585d590aace159914629a786489b0883d23cf2a8
2009-01-22 16:39:26 -06:00
Graydon Hoare
a2f947e2a1 Bug 470310 - Interpreter errors or pending exceptions should abort trace, r=brendan. 2009-01-21 12:14:47 -08:00
Igor Bukanov
c032867e33 bug 472702 - using watchdog thread in js shell to trigger operation callback 2009-01-14 18:23:51 +01:00
Igor Bukanov
f28d80b499 Backed out changeset e117c22cc1d1 - the landed patch for bug 437325 has a shutdown leak. 2009-03-22 10:15:27 +01:00
Igor Bukanov
a61176553e bug 437325 - JSThread is no longer shared between JSRuntime instances. r=brendan 2009-03-22 10:07:14 +01:00
Andreas Gal
b438fd1512 Can't allocate new stack chunks while on trace (484524, r=brendan). 2009-03-21 00:26:03 -07:00
Igor Bukanov
05591c4681 bug 426827 - removing incorrect assert. r=mrbkap 2009-03-20 12:37:20 +01:00
Andreas Gal
89c862278e Merge. 2009-01-05 16:23:07 -08:00
Andreas Gal
135f143d10 Backed out changeset adbe8e4b21dc due to tinderbox failures/timeouts (453157). 2009-01-05 16:22:42 -08:00
Andreas Gal
8582d80da4 Merge. 2009-01-05 16:14:14 -08:00
Andreas Gal
61a1479f3e Don't try to deallocate the trace recorder from inside one of its own instance methods (472049, r=brendan). 2009-01-05 16:13:53 -08:00