Commit Graph

533 Commits

Author SHA1 Message Date
Jason Orendorff
52fe5a97ba Bug 497618 - Change JSString macros to methods. r=Waldo. 2009-06-10 20:29:44 -05:00
Andreas Gal
659a7a9b6c Implement oracle-based speculative fmod/fdiv/fmul demotion (474443, r=graydon,dvander). 2009-06-12 08:33:32 -07:00
David Mandelin
3db63853e3 Bug 496922: do upvars correctly when the function defining the upvar was called with extra args, r=brendan,gal 2009-06-09 11:49:53 -07:00
David Mandelin
344e868872 Bug 496251: use up-to-date typemap when getting upvar from trace entry native frame, r=gal 2009-06-08 10:48:18 -07:00
Andreas Gal
3882ad59b6 Merge. 2009-06-04 20:12:44 -07:00
Andreas Gal
7d8559c586 Backed out changeset 2ad658e9f42a (bug 495958, re-opened). 2009-06-04 20:12:31 -07:00
David Mandelin
80a97eb5d3 Bug 496319: correctly unpack FrameInfo::argc, r=mrbkap 2009-06-04 15:19:59 -07:00
Andreas Gal
9ded7b0c3e Capture missing globals from current environment, not the tree entry map when extending a side exit (495958, r=graydon). 2009-06-03 12:43:38 -07:00
David Mandelin
a90aee411c Bug 494269: trace JSOP_LAMBDA_FC, r=brendan,gal 2009-06-03 11:19:20 -07:00
David Mandelin
5baa8fe491 Bug 495773: include trace entry JSStackFrame in upvar search, also remove obsolete union from FrameInfo, r=gal 2009-06-01 14:50:02 -07:00
David Mandelin
504424ebf3 Bug 495566: fix stack offset calculations for traces that start at top level, r=gal 2009-05-29 18:50:35 -07:00
David Mandelin
9af4ca2612 Bug 493512: correcting native stack navigation arithmetic, r=gal 2009-05-20 18:57:42 -07:00
Andreas Gal
0d2b989430 Update JSSLOT_ARRAY_COUNT when emitting array constructor code on trace (493255, r=jorendorff). 2009-05-18 15:56:11 -07:00
Andreas Gal
40284299a7 Fix compiler warning (493345, r=brendan). 2009-05-15 21:01:22 -07:00
Blake Kaplan
774d6933f4 Bug 492912 - Clean up the way that TraceRecorder::elem interacts with the rest of the world. r=gal 2009-05-15 15:41:41 -07:00
David Mandelin
112ce8b24b Bug 458838: enable tracing of upvar accesses that go outside the current trace to interpreter state, r=gal 2009-05-11 18:05:44 -07:00
Andreas Gal
4778325174 Ensure that cx->interpState is always accurate by maintaing a stack (490776, r=jorendorff). 2009-05-11 17:25:38 -07:00
David Mandelin
d6c2eeddf4 Bug 491620: make traces specialized for argc, r=gal 2009-05-11 15:57:28 -07:00
Andreas Gal
5f2681ef36 Bug 489836 - TM: chiptune causes Assertion failure: \!ti->typeMap.matches(ti_other->typeMap) 2009-05-11 12:20:41 -04:00
jorendorff
93c6d226d3 Record all calls to native functions (487134, r=gal, brendan). 2009-05-05 14:26:06 -07:00
Jim Blandy
56af1e088d Bug 488018: Propagate errors from tracer to interpreter. r=igor
Rename JSMonitorRecordingStatus to JSRecordingStatus.  The JSMRS_
prefix becomes JSRS_, accordingly.

Make 'record_' functions return JSRecordingStatus, not bool.  'false'
becomes 'JSRS_STOP'; 'true' becomes 'JSRS_CONTINUE'.  Since subsequent
patches will begin to use more than two values (the next assigns
meaning to JSRS_IMACRO), take care to propagate values to callers
accurately.

Define a new recording status, JSRS_ERROR.  Return it from recording
functions when appropriate.  Check for it at appropriate bottlenecks
in tracer and interpreter.

ABORT_TRACE becomes one of:
. ABORT_TRACE, for when we're simply aborting the recording process
. ABORT_TRACE_ERROR, for aborting due to an error
. ABORT_TRACE_CV, for producing an error message and returning something
  other than JSRS_STOP --- some contexts require boolean values.

Conditionally provide an alternative definition for the
JSRecordingStatus type that cannot be converted to 'bool', so that we
can use the C++ compiler to catch improperly converted code.

Use recording function return value for imacro invocation.  Eliminate
the JSFRAME_IMACRO_START frame flag.  Instead, return JSRS_IMACRO
directly from recording functions.
2009-04-30 17:30:46 -07:00
Andreas Gal
cafa156d52 We don't cache access to shared properties in the property cache (490666, r=igor,brendan). 2009-04-30 15:52:13 -07:00
Andreas Gal
776395aee0 Eliminate test_property_cache_direct_hit (490370, r=jorendorff). 2009-04-27 16:01:52 -07:00
Andreas Gal
a89bbaad23 Stay on trace when reading holes from dense arrays (489899, r=brendan). 2009-04-24 16:28:21 -07:00
Andreas Gal
a51f22dbdf Need an API exposed to control code cache size (474497, r=bent,brendan, sr=mrbkap). 2009-04-22 16:52:59 -07:00
Andreas Gal
c5c7bd2f6c Trace getting String.length (484332, r=brendan). 2009-04-21 18:56:24 -07:00
Jeff Walden
c9680230c4 Bug 473117 - Rejigger how guards use side exits, and fix an erroneous comment. r=graydon 2009-04-18 16:47:23 -07:00
Jason Orendorff
4dd9ad09ef Bug 487845 - TM: After deep-bailing, we can lirbuf->rewind() and then return to a dead code page. r=gal.
--HG--
extra : rebase_source : b7de71b526d45c7caed1982fba80c65763a0a9c6
2009-04-15 09:47:02 -05:00
Andreas Gal
c11974bb60 Backed out changeset 4c157cfe2289 (bug 487845). 2009-04-14 21:28:40 -07:00
Jason Orendorff
0616f91d10 Bug 487845 - TM: After deep-bailing, we can lirbuf->rewind() and then return to a dead code page. r=gal. 2009-04-14 08:45:37 -05:00
Brendan Eich
26a5b7f3fc Bug 487563 - Crash [@ js_Interpret] (r=mrbkap). 2009-04-09 18:44:54 -07:00
Jason Orendorff
b5d4ba583e Bug 487676 - Nesting deep-aborting trace calls don't work. r=gal.
--HG--
extra : rebase_source : 436164485bd5e981e5ae8997eed2c371f3ecd77b
2009-04-09 18:07:00 -05:00
Jason Orendorff
a613c0d579 Backout changeset 143e997c858e (bug 484693) because it caused crashes on Mac tinderboxen. 2009-04-07 17:07:11 -05:00
Graydon Hoare
163d74068e Bug 484693 - Remove uses of alloca, r=gal. 2009-04-07 13:47:36 -07:00
Brendan Eich
ec9f3ae4a0 Another static analysis patch (I hope the last; for 452498). 2009-04-05 21:51:42 -07:00
Brendan Eich
962b187fe5 upvar2, aka the big one take 2 (452598, r=mrbkap). 2009-04-05 21:17:22 -07:00
Andreas Gal
fa2e6466b2 Bug 479110 - TM: avoid frequent mismatch exits. r=brendan 2009-04-04 17:23:34 -04:00
Andreas Gal
3c19b8b7fc Merge. 2009-04-04 10:15:04 -07:00
Andreas Gal
706120c0fb Backed out changeset 972c44aa9d1f (bug 452598). 2009-04-04 10:14:52 -07:00
Brendan Eich
7485baa00c Merge. 2009-04-04 10:07:44 +01:00
Brendan Eich
5f4d9ff474 upvar2, aka the big one (452598, r=mrbkap). 2009-04-04 10:05:49 +01:00
Andreas Gal
8787072e96 Backed out changeset b512be855093 (bug 484693). See bug for details. 2009-04-04 01:06:04 -07:00
Graydon Hoare
a2d4d5a779 Bug 484693 - Remove uses of alloca, r=gal. 2009-04-03 16:30:46 -07:00
Andreas Gal
a4f3bf56a6 Don't try to abort tracing after a successful compilation (486436, r=brendan). 2009-04-02 14:47:57 -07:00
Graydon Hoare
5689ffc3f8 Bug 474529 - Avoid artificial OOM conditions, r=gal. 2009-03-31 20:51:01 -07:00
Andreas Gal
78ced670dd specialize code for a specific global object, not just a global object shape (480905, r=graydon). 2009-03-31 11:49:44 -07:00
Andreas Gal
bd810801e3 maintain globalShape in VMFragment only (486049, r=graydon). 2009-03-31 11:43:30 -07:00
Igor Bukanov
a8094a7903 bug 437325 - JSThread is no longer shared between JSRuntime instances. r=brendan 2009-03-24 13:07:35 +01:00
Jeff Walden
136daf85e6 Bug 484495 - new String(obj) asserts when tracing. r=brendan, r=gal 2009-03-22 12:49:15 -07: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
47a36bca0d Property close loops even in the presence of partially constant loop conditions (482800, r=brendan). 2009-03-21 01:07:51 -07:00
Andreas Gal
43feef625d Support calling arbitrary JSFastNatives from trace (463238, r=brendan). 2009-03-20 18:52:11 -07:00
Vladimir Vukicevic
d317d0075d b=480796; detect whether ARM chip has VFP and/or v6t2 instructions; r=gal 2009-03-20 15:53:33 -07:00
Andreas Gal
65c3cf58a6 Backed out changeset e71cb3993380 (bug 479110). 2009-03-17 21:50:57 -07:00
Andreas Gal
771582b7b4 Extend tree when unboxing returns a different type (479110, r=jwalden). 2009-03-17 20:00:10 -07:00
Andreas Gal
1af13483ea Eliminate separate global frame and merge it with InterpState (482377, r=brendan). 2009-03-17 17:29:58 -07:00
Andreas Gal
7da88f37bd Backed out changeset 186ae511d5f2 (static analysis annotation only, no bug). 2009-03-17 15:55:06 -07:00
Andreas Gal
43debacfae Remove unnecessary JS_REQUIRES_STACK from guardNotGlobalObject (rs=brendan). 2009-03-17 15:44:50 -07:00
Andreas Gal
210b2d31e2 Try harder to trace array access with non-int / non-string index (478525, r=brendan). 2009-03-17 15:39:42 -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
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
Graydon Hoare
b65177a23f Bug 482263 - Avoid re-entering recorder while deep aborting, r=mrbkap. 2009-03-12 20:14:51 -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
Andreas Gal
b18ca034e3 Better coordination of nested tree recording (481793, r=dmandelin). 2009-03-06 17:25:04 -08:00
Andreas Gal
3067959f6b Guard that we don't have to re-brand when writing a function into a slot if we didn't do so at recording time (481246, r=brendan). 2009-03-03 14:34:48 -08:00
Andreas Gal
1cbf259c3c Improve blacklisting (479109, r=graydon). 2009-02-25 18:47:22 -08:00
David Anderson
10ded87ae6 Fixed breakage of type stability guarantees between linked trees, and fixed using the wrong global typemap in LeaveTree (bug 476653, r=gal). 2009-02-24 22:52:09 -05:00
Andreas Gal
d8bfd089e8 Backout 479109. Breaks trace-tests. 2009-02-23 12:29:08 -08:00
Andreas Gal
8ee9d2df93 Merge. 2009-02-23 11:34:50 -08:00
Andreas Gal
c36a8ab483 Improve blacklisting algorithm (479109, r=graydon). 2009-02-23 11:31:20 -08:00
Robert Sayre
12943580cf Merge m-c to tracemonkey. 2009-02-23 12:44:23 -05:00
Jeff Walden
5d932d1110 Bug 478968 - TM: equalityHelper can call toString or valueOf erroneously when tracing obj == undefined. r=brendan 2009-02-21 23:33:58 -08:00
Benjamin Smedberg ext:(%2C%20Jason%20Orendorff%20%3Cjorendorff%40mozilla.com%3E)
d40f9751c8 Bug 476643 - JS_REQUIRES_STACK errors in nsXPCWrappedJSClass::CallMethod. Mozilla code uses some JS-internal APIs and needs to bail off trace before doing so. This shouldn't affect performance now becuase XPConnect methods are not traceable yet. r=mrbkap, sr=mrbkap. 2009-02-18 12:47:16 -06:00
Jason Orendorff
6431f3391d Bug 476716 - Split ip_adj into two pointer fields, pc and imacpc. r=brendan. 2009-02-16 17:09:59 -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
Graydon Hoare
195e361c59 Bug 477425 - Back out lirbuf-based allocation of fragments and treeinfos, r=gal. 2009-02-11 21:59:57 -08:00
David Mandelin
39b9e72a0c Bug 475115: LIR_jtbl: jump tables to implement jsop_tableswitch, r=gal,r=edwsmith 2009-02-11 17:40:27 -08:00
Graydon Hoare
8c3802fc54 Bug 466747 - Flush fragments for a JSScript when it is destroyed, r=gal. 2009-02-09 16:58:39 -08:00
Graydon Hoare
d459aeaced Bug 477425 - Allocate TreeInfo and UnstableExit in LirBuffer, r=gal. 2009-02-09 16:49:25 -08:00
Andreas Gal
a4a912921f If js_AddAsGCBytes is called from trace and wants to GC and we can bail off trace then do so instead of returning an error (476869, r=jorendorff). 2009-02-06 10:11:45 -08:00
Jeff Walden
2ec31b1171 Back out 21494181fdb8 and subsequent merges because they turned OS X red. 2009-02-05 15:42:45 -08:00
Andreas Gal
7f9ae88519 If js_AddAsGCBytes is called from trace and wants to GC and we can bail off trace then do so instead of returning an error (476869, r=jorendorff). 2009-02-05 14:43:17 -08:00
Jeff Walden
56f45fc062 Kill trailing whitespace in jstracer.h to kick a box out of a bogus orange 2009-02-04 22:57:25 -08:00
Jason Orendorff
e4c1fb1cfd Bug 462027 - Bail off trace when reentering interpreter. r=gal. 2009-02-03 18:25:12 -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
f6ffd1d380 [mq]: bug-462027-v9 2009-02-02 20:42:46 -06: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
Graydon Hoare
5219181495 Bug 475474 - Maintain globalSlots per global, not just one per JIT instance, r=danderson. 2009-01-29 15:59:52 -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