Commit Graph

71 Commits

Author SHA1 Message Date
Nicholas Nethercote
3f670f9d0f Bug 634417 - Remove inappropriate uses of vanilla malloc/calloc/realloc/free/strdup from SpiderMonkey. r=luke.
--HG--
extra : rebase_source : 4470cdf58a482eb05f94cd00a9800d8e6a0d2252
2013-11-08 09:52:14 +11:00
Jeff Walden
61a2eb48a6 Bug 921561 - Make JS_DECLARE_NEW_METHODS use C++11 "perfect" forwarding (which isn't, because it won't let you pass an expression that's a bit field #nowyouknow), to eliminate issues arising when non-const references are used in these methods with classes that don't copy nicely, or shouldn't be copied for perf reasons. r=luke
--HG--
extra : rebase_source : d2b446e0ee6e5613faa962b92acc9f91584fe7ac
2013-09-27 11:19:43 -07:00
Masatoshi Kimura
5ed6f6037f Bug 928220 - Get rid of JS_INLINE 2013-10-22 06:34:24 +09:00
Dan Gohman
35a37abb6d Bug 916580 - Fix bugs related to the usage of calloc. r=luke 2013-09-25 12:18:43 -07:00
Birunthan Mohanathas
3f4f32b49a Bug 784739 - Switch from NULL to nullptr in js/ductwork/, js/ipc/, and js/public/; r=ehsan 2013-09-19 15:24:53 -04:00
Nicholas Nethercote
a08edb8e18 Bug 898274 (part 1) - Fix ordering of various #include statements. r=benjamin. 2013-08-13 15:34:12 -07:00
Brian Hackett
ac342eaa66 Bug 902095 - Allow accessing the compartment/zone for ExclusiveContext, r=billm. 2013-08-13 09:13:46 -06:00
Daniel Holbert
5147b2a802 Backed out changeset fde265c467b2 (Bug 902095) for SM(r) bustage 2013-08-12 13:40:15 -07:00
Brian Hackett
aafd4bd829 Bug 902095 - Allow accessing the compartment/zone for ExclusiveContext, r=billm. 2013-08-12 13:57:02 -06:00
Ehsan Akhgari
5ee21d6d3f Bug 895322 - Part 1: Replace the usages of MOZ_STATIC_ASSERT with C++11 static_assert; r=Waldo
This patch was mostly generated by running the following scripts on the codebase, with some
manual changes made afterwards:

# static_assert.sh
#!/bin/bash
# Command to convert an NSPR integer type to the equivalent standard integer type

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.mm" \) | \
    xargs -n 1 `dirname $0`/assert_replacer.py #sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_STATIC_ASSERT static_assert
hg rev --no-backup mfbt/Assertions.h \
                   media/webrtc/signaling/src/sipcc/core/includes/ccapi.h \
                   modules/libmar/src/mar_private.h \
                   modules/libmar/src/mar.h


# assert_replacer.py
#!/usr/bin/python

import sys
import re

pattern = re.compile(r"\bMOZ_STATIC_ASSERT\b")

def replaceInPlace(fname):
  print fname
  f = open(fname, "rw+")
  lines = f.readlines()
  for i in range(0, len(lines)):
    while True:
      index = re.search(pattern, lines[i])
      if index != None:
        index = index.start()
        lines[i] = lines[i][0:index] + "static_assert" + lines[i][index+len("MOZ_STATIC_ASSERT"):]
        for j in range(i + 1, len(lines)):
          if lines[j].find("                 ", index) == index:
            lines[j] = lines[j][0:index] + lines[j][index+4:]
          else:
            break
      else:
        break
  f.seek(0, 0)
  f.truncate()
  f.write("".join(lines))
  f.close()

argc = len(sys.argv)
for i in range(1, argc):
  replaceInPlace(sys.argv[i])

--HG--
extra : rebase_source : 4b4a4047d82f2c205b9fad8d56dfc3f1afc0b045
2013-07-18 13:59:53 -04:00
Jeff Walden
6c81653318 Bug 891177 - Remove Vector.h's js/TemplateLib.h dependency by introducing mfbt/TemplateLib.h with the necessary bits. r=terrence
--HG--
extra : rebase_source : e84231171d6bd6c1e2de8201b8c9563375723d01
2013-07-08 12:42:13 -07:00
Jeff Walden
5805e8a35e Bug 891177 - Move leading/trailing-zero-bit counting functions, ceiling/floor log2 functions, and round-up-pow2 functions into MathAlgorithms.h. r=terrence
--HG--
extra : rebase_source : 8cfbd68b8cd4a0e21185dd864c7e827ccfa6b751
2013-07-03 15:46:51 -07:00
Jeff Walden
8a8be12d99 Bug 891177 - Move js::Swap to mozilla::Swap. r=terrence
--HG--
extra : rebase_source : 925bccd4fa3f95e1aa4e17d94ad5a443fc7a63aa
2013-07-03 15:57:33 -07:00
Jeff Walden
919f4b04c8 Bug 891177 - Add ReentrancyGuard.h as a helper class for asserting that use of a class is non-reentrant. r=terrence
--HG--
extra : rebase_source : 3751e523c0b0315697cb6e005dfd8ee625f6dd58
2013-07-02 17:47:08 -07:00
Jeff Walden
fe51d6bb86 Bug 891177 - Implement Move.h to define a move-construction interface. r=terrence
--HG--
extra : rebase_source : 45f9bb87fc0ee96ea35005ca0dcb263aa11745b8
2013-07-02 17:25:13 -07:00
Justin Lebar
de08e1432c Bug 820686 - Rename MOZ_NOT_REACHED() and JS_NOT_REACHED() to MOZ_ASSUME_NOT_REACHED(). r=waldo
This includes a mechanical renaming of MOZ_NOT_REACHED to MOZ_ASSUME_NOT_REACHED in JS.  Later patches in this queue clean up whitespace errors and so on.
2013-06-28 18:38:31 -07:00
Cykesiopka
06857ab4f5 Bug 831741 - Followup: Remove remaining __cplusplus bits from /js (with exceptions). r=jorendorff 2013-06-26 21:35:11 -04:00
Catalin Iacob
1544c37641 Bug 798914 (part 4) - Use newly introduced mozilla::MallocSizeOf in js. r=njn.
--HG--
extra : rebase_source : d1c063b94c7ec58729150cbea602bb4c9f2a0e24
2013-06-23 13:21:01 +02:00
Emanuel Hoogeveen
73cb5d6b4d Bug 883697 (part 1) - Make include guards consistent in js/ductwork/, js/ipc/ and js/public/. r=njn.
--HG--
extra : rebase_source : 34f5559ba6e64831905686e12356b70109d873a8
2013-06-19 17:59:09 -07:00
Dan Gohman
bf0503d164 Bug 875929 - Now that js_bitscan_ctz64 and js_bitscan_clz64 are implemented on all platforms, clean up some compatibility code which isn't needed anymore. r=evilpies 2013-06-05 07:39:10 -07:00
Dan Gohman
a41c2e0184 Bug 875929 - Generalize the code for materializing double constants. In particular, this new code handles 0x7ff8000000000000, a common NaN. To support this, implement js_bitscan_ctz64 for 32-bit targets. r=evilpies 2013-06-04 21:39:13 -07:00
Steve Fink
2e64712e21 Bug 872823 - implement oomAfterAllocations testing function
--HG--
extra : rebase_source : 9baca68d56f8b15e691f2154bd8aa6b6cea45845
2013-05-20 12:59:55 -07:00
Stephen Kraemer
7b93b707c5 Bug 836078 - Replace all gcc __GNUC__ version checks with MOZ_GCC_VERSION_AT_LEAST macro. r=dvander 2013-05-01 15:45:05 -04:00
Sean Stangl
3733f89aca Bug 860029 - Standardize Modelines in the JS Module. r=njn 2013-04-16 13:47:10 -07:00
Phil Ringnalda
2607292fa5 Back out a5a1dd3bd8ae (bug 860029) for stupidorange 2013-04-15 12:55:38 -07:00
Sean Stangl
ab9b6329c4 Bug 860029 - Standardize Modelines in the JS Module. r=njn 2013-04-15 11:33:03 -07:00
Phil Ringnalda
045ce0a190 Back out 5bf9771e1a28 (bug 860029) for bustage
CLOSED TREE
2013-04-11 19:55:37 -07:00
Sean Stangl
fe2fb42954 Bug 860029 - Standardize Modelines in the JS Module. DONTBUILD. r=njn 2013-04-11 18:48:59 -07:00
Benjamin Smedberg
44d51b87e6 Bug 858900 - Poison JSContext. r=luke 2013-04-11 07:48:09 -04:00
Jon Coppeard
b752526987 Bug 849273 - Investigate splitting the js and JS namespaces r=terrence
--HG--
extra : rebase_source : 2b131d0177f02e5f0e89398545481fcacbfde00f
2013-03-19 10:35:41 +00:00
Luke Wagner
e48f129191 Bug 840282 - OdinMonkey (sr=dmandelin)
--HG--
extra : rebase_source : 4a3869dca32755abb58bbd3d9a06599e61b397f2
2013-03-15 02:29:02 -07:00
Steve Fink
8979aa7655 Bug 668583 - Detect rope corruption earlier in opt builds. r=billm
--HG--
extra : rebase_source : 646e143f453f36c72c379dae521cc59b24fc5584
2013-02-12 11:07:26 -08:00
Luke Wagner
e42dd44ea4 Bug 832071 - Replace custom AutoDestroyAllocator with ScopedJSDeletePtr (and rename ScopedDeletePtr to ScopedJSDeletePtr) (r=dvander)
--HG--
extra : rebase_source : 84229d3a9453d3f4aab8a84583b6e0d1e0e3a0a4
2012-11-01 21:35:21 -07:00
Justin Lebar
1be8d05c35 Bug 827234 - Move Swap to js/public/Utility from js/src/jsutil.h. r=terrence 2013-01-08 11:04:19 +01:00
Jeff Walden
759a518344 Bug 752578 - Remove the JS guard object implementation. r=Ms2ger
--HG--
extra : rebase_source : 3802e20dc76c7b18001cf852f748099ccb493d2e
2012-12-27 11:20:22 -06:00
Jeff Walden
7146c23e80 Bug 820570 - Move mozilla::DebugOnly into DebugOnly.h to pare down the grab-baggish Util.h. r=Ms2ger 2012-12-14 18:58:45 -05:00
Terrence Cole
ab0d85ee35 Bug 807151 - Unexport |mozilla| from the |js| namespace; r=Waldo
Clang does not want to allow js::ion::Range and mozilla::Range simultaneously
when we have a |namespace js { using namespace mozilla; }| declaration.
2012-11-06 17:35:18 -08:00
Bill McCloskey
70a8d7ef1c Bug 807161 - Remove extern C and #ifdef __cplusplus from JSAPI (r=luke) 2012-10-30 18:28:34 -07:00
Terrence Cole
a67474905a Bug 793577 - Implement Return<T> for direct returns of unrooted GC pointers; r=billm r=njn
Return<T> wraps GC things that are returned from accessor methods.  The wrapper
helps to ensure correct rooting of the returned pointer and safe access while
unrooted.
2012-09-26 11:13:20 -07:00
Luke Wagner
b73ff50165 Bug 787291 - add pod_malloc<T> et al (r=billm) 2012-08-31 15:10:10 -07:00
Luke Wagner
002cf7abaa Bug 787246 - rm OffTheBooks/Foreground/UnwantedForeground gunk (r=billm) 2012-08-31 15:01:33 -07:00
Rafael Ávila de Espíndola
9e9d6d39b5 Bug 778301 - Remove old change for llvm.org/pr11003.
--HG--
extra : rebase_source : 41006c35798d0722a43b6c37bc0216a6c6064aa9
2012-07-28 08:04:45 -04:00
Terrence Cole
2fa03934cf Bug 776159 - Thread more Handles through jsarray; r=sfink
--HG--
extra : rebase_source : 31c8efb209a6f5a58709429cce4cc0675b537847
2012-07-20 16:22:00 -07:00
Jason Orendorff
6d6dba910d Bug 775896 - OrderedHashTable should have a hashShift field like HashTable. r=luke.
--HG--
extra : rebase_source : b45ff08f57aeef813df0c14472362527dfe2b07d
2012-07-25 12:43:29 -05:00
Jason Orendorff
bacf907839 Bug 743107 - Add OrderedHashTable. Change implementation of Map and Set to retain insertion order. r=luke.
--HG--
extra : rebase_source : 8b8d67ccd26494f884ba0b5d35e2f44a34296ed6
2012-07-03 16:33:38 -05:00
Nicholas Nethercote
f8cf077180 Bug 771378 (part 0) - Add ScopedFreePtr to Utility.h. r=jwalden.
--HG--
extra : rebase_source : b43cb64bb1175c4111903f5c30f533612daae841
2012-07-05 17:29:56 -07:00
Jeff Walden
09e6c025d8 Bug 763000 - Remove MOZ_Assert. r=Ms2ger, r=terrence, r=ted 2012-06-07 14:41:11 -07:00
Luke Wagner
1c9cf86093 Bug 763384 - Don't treat regexp syntax errors as OOM errors (r=njn) 2012-06-11 17:08:34 -07:00
Gervase Markham
ca171eec44 Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Boris Zbarsky
7e0db46628 Bug 748237. Only do the c++11 stuff for clang here, since otherwise we get scary warnings with gcc on android. r=luke 2012-04-26 00:43:00 -04:00