Commit Graph

801 Commits

Author SHA1 Message Date
Jason Orendorff
fcfd80cfc5 Merge from TM. Huge merge. Stack changes from bug 656462. 2011-06-15 16:14:09 -05:00
Jim Blandy
a282ee62d3 Bug 660039: Provide a WeakMap usable from C++. r=jorendorff
Remove WeakMap class; implement the JavaScript object using functions static to jsweakmap.cpp.

Define a new WeakMap class template, parameterized by Key and Value types,
and accepting a MarkPolicy argument saying how to mark them.

Add assertions to check that we check and set the right mark bits, and
tests that trip them in the presence of mistakes in earlier revisions of
this patch.
2011-06-14 19:21:47 -07:00
Nikhil Marathe
acda759fc1 Bug 656519 - Avoid a malloc (and a finalizer) by storing the malloc'd array in our slots instead of in a separate malloc'd structure in our private field. r=mrbkap
--HG--
extra : rebase_source : 791ede2d8db96f56e4ef8478d491aec413d3e392
2011-06-14 15:33:11 -04:00
Jim Blandy
88decefd28 Merge from TM. 2011-06-07 12:12:28 -07:00
Jim Blandy
8bd7752c01 Backed out changeset d02083014f57; build problems in nsXPConnect.cpp 2011-06-06 09:01:47 -07:00
Jason Orendorff
6a958619a0 Automatically turn debug mode on/off when adding/removing debuggees.
This allows most of the tests to run without the -d command-line flag.

Now a compartment is in debug mode if
 * JSD1 wants debug mode on, thanks to a JS_SetDebugMode* call; OR
 * JSD2 wants debug mode on, because a live Debug object has a debuggee
   global in that compartment.

Since this patch only adds the second half of the rule, JSD1 should be
unaffected.

The new rule has three issues:

1. When removeDebuggee is called, it can cause debug mode to be turned
   off for a compartment. If any scripts from that compartment are on
   the stack, and the methodjit is enabled, returning to those stack
   frames will crash.

2. When a Debug object is GC'd, it can cause debug mode to be turned off
   for one or more compartments. This causes the same problem with
   returning to deleted methodjit code, but the fix is different: such
   Debug objects simply should not be GC'd.

3. Setting .enabled to false still does not turn off debug mode
   anywhere, so it does not reduce overhead as much as it should.

A possible fix for issue #1 would be to make such removeDebuggee calls
throw.  The fix to issues #2 and #3 is to tweak the rule--and to tweak
the rule for Debug object GC-reachability.

--HG--
rename : js/src/jit-test/tests/debug/Debug-ctor.js => js/src/jit-test/tests/debug/Debug-ctor-01.js
2011-06-02 21:58:46 -05:00
Alon Zakai
2f4274045c Bug 644241, part 1 - Remove script stack quota. r=igor 2011-06-03 17:54:26 -07:00
Bill McCloskey
c23838f371 Fix jstest timeouts caused by patch for bug 650978 2011-06-02 15:07:01 -07:00
Gregor Wagner
9ce0f0d1ba Bug 660329 - GC: add reason for GC to GCTimer. r=igor 2011-06-02 13:02:21 -07:00
Jason Orendorff
0305e45450 Merge from tracemonkey to jsdbg2. 2011-05-25 17:52:35 -05:00
Jason Orendorff
2e05c87e09 Require the CCW slot of a Debug.Object object to contain an actual cross-compartment wrapper. That way, per-compartment GC never collects referents, simplifying sweep phase. 2011-05-21 00:40:33 -05:00
Jason Orendorff
8d48b54691 Merge from tracemonkey to jsdbg2. 2011-05-20 11:34:31 -05:00
Bill McCloskey
b902b98248 Bug 650978 - Add gczeal setting to GC on every allocation (r=gwagner) 2011-06-01 17:48:52 -07:00
Bill McCloskey
719f0678e9 Bug 652985 - Use off-the-books malloc in DumpHeap (r=pbiggar) 2011-06-01 17:48:02 -07:00
timeless@mozdev.org
0333a7ce54 Bug 620251 js_CurrentThread and friends should have AndLockGC in their name
r=jorendorff
2011-05-27 10:58:26 -07:00
Chris Leary
8a58ce9072 Bug 657537: clean up jschar inflation/deflation. (r=Waldo) 2011-05-26 15:50:05 -07:00
Jason Orendorff
001c42745d Merge from tracemonkey to jsdbg2. This merge reveals a bug in DebugFrame_getOlder, to be fixed separately. 2011-05-16 17:50:52 -05:00
Jason Orendorff
03415943ee Merge from tracemonkey to jsdbg2. 2011-05-04 12:13:58 -05:00
Jason Orendorff
a0e4b2bf22 Merge from tracemonkey to jsdbg2. 2011-04-29 10:12:46 -05:00
Paul Biggar
b005c6c2d4 Merge backout. 2011-04-29 04:01:23 -07:00
Paul Biggar
15828cd649 Backed out changeset 334ada87e329 (bug 628332) - those a11y errors arrived at the same time as this landing, so backing this out to see if that fixes it. 2011-04-29 04:00:57 -07:00
Christian Holler
faf48eb1e7 Bug 628332 - Avoid double-frees when compartment allocation fails (r=billm). 2011-04-27 16:09:00 -07:00
Paul Biggar
e4d6748cc4 Bug 642772: Don't recreate a class during enumeration, if it has been deleted (r=bhackett)
In SM, classes are lazily resolved. If we detect that a class about to be used
has not yet been resolved, then we resolve it. However, the way that we decided
that they were resolved was broken. If the global object had a String property,
then it had been resolved. So what happened when we deleted the String
property? Well, it got resolved again.

Instead of using the String property of the global object, we now use the
contructor slot on the global object. This works fine for String, but some
classes don't have a constructor, like Math and JSON. For those classes, we set
the constructor slot to True. In either case, we can now tell that a class is
resolved if the constructor slot in not Undefined.
2011-04-27 04:13:56 -07:00
Jason Orendorff
782cb92948 Merge from tracemonkey to jsdbg2. 2011-04-26 14:45:06 -05:00
Bill McCloskey
194a0b290d Bug 657710 - Fix strict aliasing warning (r=luke) 2011-05-18 10:23:08 -07:00
Philipp von Weitershausen
4cba1e98dd Bug 655641 - Expose RegExp flags and source in JS API. r=gal 2011-05-08 22:10:21 -05:00
Paul O'Shannessy
c6e3f311c7 Bug 650931 - No API to determine if a JSObject is a RegExp. r=gal 2011-05-17 20:04:28 -07:00
Chris Leary
a7253cc393 Bug 654301: Better interned string API, take 2. (r=Waldo) 2011-05-17 12:15:12 -07:00
Christian Holler
b0902374f8 Bug 628332 - Avoid double-frees when compartment allocation fails (r=billm). 2011-05-03 04:26:40 -07:00
Jason Orendorff
5e2c73b316 Add rudimentary support for Debug.prototype.hooks.debuggerHandler. Note: A new constant JSPROP_NATIVE_ACCESSOR is added in jsapi.h, so that js_InitClass can create proper accessor properties. 2011-04-18 17:42:07 -05:00
Jeff Walden
a8a0234d77 Bug 641655 - Add a js::GlobalObject subtype of JSObject. r=njn 2011-04-18 16:50:47 -04:00
Jeff Walden
77e6fd7646 Backed out changeset c8ba5bd72b0c, we have too many test harnesses and I forgot to run one. r=tree-decorator 2011-04-21 16:29:54 -04:00
Jeff Walden
f7e9104cd4 Bug 641655 - Add a js::GlobalObject subtype of JSObject. r=njn 2011-04-18 16:50:47 -04:00
Luke Wagner
b02663aef4 Fix typo in --enable-threadsafe builds (r=burning) 2011-04-20 19:29:11 -07:00
Luke Wagner
6e9ef90124 Bug 651041 - add API to store private data to an external string (r=njn) 2011-04-20 18:34:49 -07:00
Bill McCloskey
4a9bde3182 Bug 648647 - Eliminate JSObjectMap (r=jorendorff) 2011-04-08 14:21:08 -07:00
Bill McCloskey
3c0cd83aa3 Bug 616666 - Use explicit stack for GC marking (r=gal) 2011-04-15 16:56:08 -07:00
Jeff Walden
9d216339ba Bug 646129 - [[DefaultValue]] on Date objects is wrong when called with no hint. r=luke 2011-04-01 15:24:21 -07:00
Andreas Gal
fd2168c3af Implement Harmony weak maps (bug 547941, r=jorendorff). 2011-04-16 21:23:44 -07:00
Wes Garland
256dd8ad05 Bug 586016, update JS_GetImplementationVersion. r=jorendorff 2011-04-16 14:16:50 -04:00
Colin Walters
2a0395d63b Bug 648102 - Make shell REPL/snarf/run always take UTF-8 input; add JS_DecodeUTF8; add UTF-8 flag to JS_BufferIsCompilableUnit. r=gal 2011-04-16 14:11:10 -04:00
Luke Wagner
6fcaf8c63f Bug 649531 - tidy up this-computation logic a bit, add some asserts (r=waldo)
--HG--
extra : rebase_source : f01409526e4582b87ced4b9f9d1170254a55373b
2011-04-12 17:16:12 -07:00
David Anderson
61cc68f032 Fix clang warnings (bug 647280, r=luke). 2011-04-14 13:45:06 -07:00
Luke Wagner
0d7bf8cc22 Bug 656462, part 4 - Simplify stack code, keep track of native calls, create new iterator over native/scripted callstack, make JS_SaveFrameChain fallible (r=waldo,mrbkap)
--HG--
extra : rebase_source : 756a640568464d11fe6bb00104a2fdb6f6d02d02
2011-05-13 08:56:26 -07:00
Luke Wagner
67af97e094 Bug 656462, part 3 - Syntactic touchups (r=waldo)
--HG--
extra : rebase_source : 7a81c352a96b9e23fc8f7bee5cb1d095c5cdb998
2011-05-24 16:08:40 -07:00
Luke Wagner
fe7b0581ce Bug 656462, part 2 - Merge ContextStack::get* and push* operations (r=waldo)
--HG--
extra : rebase_source : bdc7a7ba9ee21435a20e77bf6cea8c4d34a840c9
2011-05-24 16:04:18 -07:00
Jeff Walden
d3676c4409 Bug 649819 - Remove JS_BeginJSONParse/JS_ConsumeJSONText/JS_EndJSONParse now that these APIs are no longer used and the cleaner API is available and works. r=brendan 2011-03-21 11:42:14 -07:00
Luke Wagner
774c050740 Bug 602994 - Preparatory syntactic cleanup (r=waldo) 2011-04-08 10:52:48 -07:00
Blake Kaplan
d7c603eab8 Bug 618176 - Skip multiple wrappers when deciding whether this object is an array. r=gal 2011-04-12 15:56:45 -07:00
Rob Arnold
1fa00902b6 Bug 651510 - "Signature for JS_StructuredClone differs in jsapi.h and jsapi.cpp" [r=jorendorff] 2011-04-20 08:28:00 -07:00