Bug 1247104 - BaldrMonkey: Enclose most of WasmText.cpp in anonymous namespaces. r=luke
authorDan Gohman <sunfish@mozilla.com>
Thu, 11 Feb 2016 14:49:55 -0800
changeset 330575 a3b4e84a812fa570188911d2596b0709bad1874e
parent 330574 cd93d21491eaaee4fd7c6118f060cca1362ff9c9
child 330576 5469639356d344f45cf7e611165eea47c043d88a
push id10773
push userjyavenard@mozilla.com
push dateThu, 11 Feb 2016 23:46:51 +0000
reviewersluke
bugs1247104
milestone47.0a1
Bug 1247104 - BaldrMonkey: Enclose most of WasmText.cpp in anonymous namespaces. r=luke
js/src/asmjs/WasmText.cpp
--- a/js/src/asmjs/WasmText.cpp
+++ b/js/src/asmjs/WasmText.cpp
@@ -42,16 +42,18 @@ using mozilla::Maybe;
 using mozilla::PositiveInfinity;
 using mozilla::SpecificNaN;
 
 static const unsigned AST_LIFO_DEFAULT_CHUNK_SIZE = 4096;
 
 /*****************************************************************************/
 // wasm AST
 
+namespace {
+
 class WasmAstExpr;
 
 template <class T>
 using WasmAstVector = mozilla::Vector<T, 0, LifoAllocPolicy<Fallible>>;
 
 template <class K, class V, class HP>
 using WasmAstHashMap = HashMap<K, V, HP, LifoAllocPolicy<Fallible>>;
 
@@ -462,19 +464,23 @@ class WasmAstConversionOperator final : 
       : WasmAstExpr(Kind),
         expr_(expr), op_(op)
     {}
 
     Expr expr() const { return expr_; }
     WasmAstExpr* op() const { return op_; }
 };
 
+} // end anonymous namespace
+
 /*****************************************************************************/
 // wasm text token stream
 
+namespace {
+
 class WasmToken
 {
   public:
     enum FloatLiteralKind
     {
         HexNumber,
         DecNumber,
         Infinity,
@@ -1476,20 +1482,23 @@ WasmToken WasmTokenStream::next()
 
       default:
         break;
     }
 
     return fail(begin);
 }
 
+} // end anonymous namespace
 
 /*****************************************************************************/
 // wasm text format parser
 
+namespace {
+
 struct WasmParseContext
 {
     WasmTokenStream ts;
     LifoAlloc& lifo;
     UniqueChars* error;
     DtoaState* dtoaState;
 
     WasmParseContext(const char16_t* text, LifoAlloc& lifo, UniqueChars* error)
@@ -2208,16 +2217,18 @@ ParseModule(const char16_t* text, LifoAl
     if (!c.ts.match(WasmToken::CloseParen, c.error))
         return nullptr;
     if (!c.ts.match(WasmToken::EndOfFile, c.error))
         return nullptr;
 
     return module;
 }
 
+} // end anonymous namespace
+
 /*****************************************************************************/
 // wasm function body serialization
 
 static bool
 EncodeExpr(Encoder& e, WasmAstExpr& expr);
 
 static bool
 EncodeBlock(Encoder& e, WasmAstBlock& b)