Bug 946405 - Tweak some anonymous namespacing in jsinfer.cpp and jsopcode.cpp to fix GCC build warnings about "has a field...whose type uses the anonymous namespace". r=jandem
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 04 Dec 2013 20:59:13 -0500
changeset 174488 687680c040585f58dae09b9463c09fab4f4705e5
parent 174487 48ee35b9297379163c103b220ca586c6263bd66d
child 174489 b6ca28b144b9a538d10ae58cfc0775f1eaca5424
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs946405
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 946405 - Tweak some anonymous namespacing in jsinfer.cpp and jsopcode.cpp to fix GCC build warnings about "has a field...whose type uses the anonymous namespace". r=jandem
js/src/jsinfer.cpp
js/src/jsopcode.cpp
--- a/js/src/jsinfer.cpp
+++ b/js/src/jsinfer.cpp
@@ -546,18 +546,16 @@ TypeSet::unionSets(TypeSet *a, TypeSet *
 static LifoAlloc *IonAlloc() {
 #ifdef JS_ION
     return jit::GetIonContext()->temp->lifoAlloc();
 #else
     MOZ_CRASH();
 #endif
 }
 
-namespace {
-
 // Superclass of all constraints generated during Ion compilation. These may
 // be allocated off the main thread, using the current Ion context's allocator.
 class CompilerConstraint
 {
   public:
     // Property being queried by the compiler.
     HeapTypeSetKey property;
 
@@ -571,18 +569,16 @@ class CompilerConstraint
         expected(property.maybeTypes() ? property.maybeTypes()->clone(IonAlloc()) : nullptr)
     {}
 
     // Generate the type constraint recording the assumption made by this
     // compilation. Returns true if the assumption originally made still holds.
     virtual bool generateTypeConstraint(JSContext *cx, RecompileInfo recompileInfo) = 0;
 };
 
-} // anonymous namespace
-
 class types::CompilerConstraintList
 {
   public:
     struct FrozenScript
     {
         JSScript *script;
         TemporaryTypeSet *thisTypes;
         TemporaryTypeSet *argTypes;
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -1451,16 +1451,17 @@ GetBlockChainAtPC(JSContext *cx, JSScrip
             break;
         if (offset <= note->start + note->length)
             blockChain = script->getObject(note->index);
     }
 
     return blockChain;
 }
 
+namespace {
 /*
  * The expression decompiler is invoked by error handling code to produce a
  * string representation of the erroring expression. As it's only a debugging
  * tool, it only supports basic expressions. For anything complicated, it simply
  * puts "(intermediate value)" into the error result.
  *
  * Here's the basic algorithm:
  *
@@ -1760,16 +1761,18 @@ ExpressionDecompiler::getOutput(char **r
     *res = cx->pod_malloc<char>(len + 1);
     if (!*res)
         return false;
     js_memcpy(*res, sprinter.stringAt(0), len);
     (*res)[len] = 0;
     return true;
 }
 
+}  // anonymous namespace
+
 static bool
 FindStartPC(JSContext *cx, ScriptFrameIter &iter, int spindex, int skipStackHits, Value v,
             jsbytecode **valuepc)
 {
     jsbytecode *current = *valuepc;
 
     if (spindex == JSDVG_IGNORE_STACK)
         return true;