Commit Graph

97 Commits

Author SHA1 Message Date
Terrence Cole
a683dde987 Bug 722946 - Add method to HashTable::Enum for inline rekeying; r=luke
It is possible in several places to have unconstrained client objects as the key
of a HashMap/HashSet. For generational and compacting GC, we will need to move
these objects in memory. This means we will need to remove and re-insert these
keys in a new location, during GC. Because we cannot safely allocate memory for
this, we need a specialized algorithm inside the HashTable itself.
2012-03-14 13:48:59 -07:00
Ehsan Akhgari
aad636cb78 Backout changeset ea6be5f60c42 (bug 722946) for breaking Windows builds 2012-03-14 14:29:58 -04:00
Terrence Cole
6ab75b39c1 Bug 722946 - Add method to HashTable for inline rekeying/removal; r=luke
It is possible in several places to have unconstrained client objects as the key
of a HashMap/HashSet.  For generational and compacting GC, we will need to move
these objects in memory.  This means we will need to remove and re-insert these
keys in a new location, during GC.  Because we cannot safely allocate memory
for this, we need a specialized algorithm inside the HashTable itself.
2012-02-03 15:43:34 -08:00
Mike Hommey
526bd939af Bug 717540 - Remove MFBT dependency on JS_Assert, add MOZ_Assert, and use it for WTF assertions. r=waldo,r=khuey 2012-02-13 15:48:23 +01:00
Mike Hommey
c893472974 Backout 8eef38643ceb (bug 717540) and 78941a969e20 (bug 725230) because of windows debug bustage 2012-02-13 16:35:13 +01:00
Mike Hommey
ac9a4a0719 Bug 717540 - Remove MFBT dependency on JS_Assert, add MOZ_Assert, and use it for WTF assertions. r=waldo,r=khuey 2012-02-13 15:48:23 +01:00
Luke Wagner
01e91dd80f Bug 724748 - simplify RegExpShared lifetime management (r=cdleary) 2012-02-07 12:34:29 -08:00
Jason Orendorff
a12e6e2526 Fix a few typos in comments in js/src. No bug, no_r=me. 2012-01-20 06:11:42 -06:00
Chris Leary
12e2b7fd7e Bug 717762: Proliferate js_memcpy and PodCopy, take 2. (r=luke)
--HG--
extra : rebase_source : 73083063f32036d037b34f0ec96d06192f2ae649
2012-01-17 14:32:36 -08:00
Jeff Walden
5aeba45a34 Mark a bunch more copy-construction, assignment, default-construction, etc. operators and methods as deleted in the JS engine. No bug, r=bhackett over IRC
--HG--
extra : rebase_source : c238c0f7230a2e43705f6069309ff0475724bee4
2011-12-28 08:09:07 -06:00
Jeff Walden
87d3f92e61 Bug 708735 - Use <stdint.h> types in JSAPI and throughout SpiderMonkey. Continue to provide the {u,}int{8,16,32,64} and JS{Uint,Int}{8,16,32,64} integer types through a single header, however, for a simpler backout strategy -- and also to ease the transition for embedders. r=timeless on switching the jsd API to use the <stdint.h> types, r=luke, r=dmandelin 2011-12-08 22:54:10 -05:00
Nathan Froyd
f5918cd8f9 Bug 560349 - make PodZero use inline loops rather than memset; r=luke 2011-12-08 19:59:08 -05:00
Jeff Walden
d1d58969b8 Silence unused-value warnings with various Valgrind macros in clang, and add a silencing instance to jsgc.cpp. No bug, rs=jorendorff, a=philor 2011-12-13 17:31:08 -05:00
David Mandelin
bd6b2c6bea Bug 707341: remove VOUCH_DOES_NOT_REQUIRE_STACK, r=jorendorff 2011-12-07 17:49:10 -08:00
David Anderson
4b78345140 Remove LeaveTrace and related structures (bug 698201 part 5, r=luke). 2011-11-22 17:41:43 -05:00
Chris Leary
8951d2e99a Bug 701387: RegExpPrivateCache can disappear after lookup. (r=Waldo) 2011-11-10 21:04:04 -08:00
Luke Wagner
179eb73d2a Bug 689362 - Remove empty jsstaticcheck.h (r=billm) 2011-10-12 10:28:56 -07:00
Justin Lebar
26e4ee32cd Back out rev 4c0e6b3f7791 (bug 689362) due to suspected mac x64 opt moth orange. 2011-10-12 23:07:04 -04:00
Luke Wagner
8d6c125463 Bug 689362 - Remove empty jsstaticcheck.h (r=billm)
--HG--
extra : rebase_source : d37d29af2a4f6b8c4f9a18468e57285ea8098824
2011-10-12 10:28:56 -07:00
Luke Wagner
c7d3e6785c Bug 689362 - Create js/public (with the intention that its contents will eventually be the only INSTALLED_HEADERS), move Vector and HashTable to js/public and some dependencies (r=billm,sr=dmandelin)
--HG--
rename : js/src/jshashtable.h => js/public/HashTable.h
rename : js/src/jsvector.h => js/public/Vector.h
rename : js/src/mfbt/InlineMap.h => js/src/ds/InlineMap.h
extra : rebase_source : 818639b74653667b7a572bc1234398c0e4559a60
2011-10-04 15:33:00 -07:00
Jeff Walden
f47bb0a324 Make the guard-object macros, used to ensure a class can't accidentally be constructed only temporarily, JS_FRIEND_API-compatible, since they're being used in friend declarations now. rs=cdleary/luke, no bug 2011-10-05 15:21:53 -07:00
Rafael Ávila de Espíndola
b9c70d96b3 Bug 689066 - Fix c++11 incompatibility. r=luke. 2011-09-29 13:49:54 -04:00
Chris Leary
14bc4cf54d Bug 684039: rewrite JS LIFO allocator, avoids thrashing. (r=luke)
--HG--
rename : js/src/jsarena.h => js/src/ds/LifoAlloc.h
extra : rebase_source : 098bf9561114f82363ebd0862213acf952709257
2011-09-22 13:22:30 -07:00
Rafael Ávila de Espíndola
4c8d09d6be Revert 687e0bbfe996 while I try to find std::move is on the android SDK. r=revert. 2011-09-27 10:29:42 -04:00
Rafael Ávila de Espíndola
9dcc1e7f14 Bug 689066 - Fix c++11 incompatibility. r=luke.
IF MoveRef is used in a rvalue position (which is expected), we could end up
in a situation where, without this this, we would try to pass a T& to a move
constructor, which fails. It is not clear if the compiler should instead use
the copy constructor, but for now this lets us build with clang. See bug
689066 and llvm.org/pr11003 for the details.

--HG--
extra : rebase_source : 16f1c6dcb31cf3f5023e044fdbe8cb78acd683a2
2011-09-27 10:01:34 -04:00
Luke Wagner
cc2ce861d1 Bug 684526 - Unify jsval and js::Value (r=jorendorff)
--HG--
extra : rebase_source : 5655602775d575bb5adba0a8fc4c20621f393a67
2011-09-19 09:34:49 -07:00
Luke Wagner
515a3493d3 Bug 686280 - js::Move(temporary) should strip the const (also, this fixes build error caused by gcc 4.6 bug) (r=jimb) 2011-09-19 10:02:53 -07:00
Nicholas Nethercote
35e556c14e Bug 684799 - Measure slop in more JS memory reporters. r=dmandelin. 2011-09-07 18:41:38 -07:00
Bill McCloskey
f9580c15ed Bug 681071 - Enable GC compartment assertions in nightlies (r=dmandelin) 2011-08-25 10:09:19 -07:00
Paul Biggar
373ea045df No bug: Fix comment where "new_array" should be "array_new" (rs=sfink). 2011-08-12 17:15:59 -07:00
Bill McCloskey
d80b33e02c Bug 677773 - Allow JS crash diagnostics to be disabled; simplify them (r=dmandelin,ted) 2011-08-12 06:57:45 -07:00
Matt Brubeck
5a6712b2b5 Back out cd7f694c9f2f (bug 677773) because of build failures 2011-08-12 07:35:31 -07:00
Bill McCloskey
b6af04e6bb Bug 677773 - Allow JS crash diagnostics to be disabled; simplify them (r=dmandelin,ted) 2011-08-12 06:57:45 -07:00
Jim Blandy
3ee5bd65a5 Bug 672728: Define MoveRef, an rvalue reference type; provide some support for move construction and assignment in js::Vector and js::HashTable. r=luke 2011-08-01 17:52:53 -07:00
Bill McCloskey
162941e24a Bug 673625 - Add more assertions to check JSScript validity (r=dmandelin) 2011-07-25 18:05:05 -07:00
Bill McCloskey
2a3d5215a6 Bug 662646 - GC topcrash diagnostics [needs backout before Aurora merge!] (r=dmandelin) 2011-07-07 17:31:24 -07:00
Luke Wagner
c9e1bf13c0 Bug 667915 - Don't let content JS consume all the stack and cause chrome JS to OOM (r=waldo,mrbkap) 2011-06-30 09:26:56 -07:00
Luke Wagner
0319982d42 Bug 665247 - Remove unused metering code (r=igor)
--HG--
extra : rebase_source : 78ec31e4236f63f8a91024f34b1b99a889dc47f5
2011-06-21 10:26:22 -07:00
David Mandelin
2299c54162 Bug 656282: Remove redundant declaration that causes an MSVC warning, r=luke
--HG--
extra : rebase_source : 42c6e9594f36fd7320bdea90fdb01c955bf07f4d
2011-05-16 16:17:19 -07:00
David Mandelin
37887345d9 Backed out changeset de6dfe16fd91 due to Linux/Mac build bustage 2011-05-23 14:22:03 -07:00
David Mandelin
f7eb07c405 Bug 625600: Update Yarr import to WebKit rev 83339, r=cdleary,dvander 2011-05-12 18:39:47 -07:00
Chris Leary
a7253cc393 Bug 654301: Better interned string API, take 2. (r=Waldo) 2011-05-17 12:15:12 -07:00
Paul Biggar
e0fa025e18 Bug 657384: Change new_ parameters to pass-by-copy, not pass-by-const-reference. (r=luke)
new_ [1] took a const reference for each of its parameters. Unfortunately, that
adds const-ness even when the constructor needs non-constness. Unfortunately,
the other way (turning off constness) can lead to excess copying.

According to the Forwarding Problem [2], there is no great solution here. C++
does not have a perfect way to write a function which wraps another function.
So we settle for non-constness, and we must rely on forbidding copying of
expensive objects.

[1] as in cx->new_<T>(p1)
[2] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1385.htm
2011-05-17 04:25:39 -07:00
Chris Leary
089bf2c468 Back out bug 654301 to run again on try. 2011-05-16 19:03:20 -07:00
Chris Leary
338cf025af Bug 654301: Better interned string API. (r=Waldo) 2011-05-16 18:18:59 -07:00
Chris Jones
ea1f5e599c Bug 647011: Sprinkle some DebugOnly in js/src. r=luke 2011-04-20 18:27:30 -05:00
Paul Biggar
59c1af50d3 Fix minor typo, followup to bug 634155 (no review) 2011-03-31 19:34:14 -07:00
Paul Biggar
43b850291d Bug 643548: Remove mozalloc_undef_macro_wrappers hack from JS engine. (r=luke,rs=brendan)
mozalloc_undef_macro_wrappers are brittle and have side-effects that are hard
to debug and fix. The alternative is the just stick an underscore on the end of
malloc, free, etc, which is a comparatively small burden.
2011-03-31 01:14:12 -07:00
Paul Biggar
72c7701093 Bug 634155: Account for NewCompartment's memory, and change allocation APIs (r=nnethercote)
This changes the allocation API, in the following way:

  js_malloc -> {cx->,rt->,OffTheBooks::}malloc
  js_calloc -> {cx->,rt->,OffTheBooks::}calloc
  js_realloc -> {cx->,rt->,OffTheBooks::}realloc
  js_free -> {cx->,rt->,Foreground::,UnwantedForeground::}free
  js_new -> {cx->,rt->,OffTheBooks::}new_
  js_new_array -> {cx->,rt->,OffTheBooks::}new_array
  js_delete -> {cx->,rt->,Foreground::,UnwantedForeground::}delete_

This is to move as many allocations as possible through a JSContext (so that they may be aken into account by gcMallocBytes) and to move as many deallocations to the background as possible (except on error paths).
2011-03-31 01:13:49 -07:00
Luke Wagner
7c96945e3c Bug 613457 - clean up string interfaces (r=njn)
--HG--
extra : rebase_source : 3e77b67fa9fe2cc31312ad99951cf92258a98e64
2011-03-14 13:59:53 -07:00