Bug 1373525 - js/wasm: Remove unused member functions of WasmTokenStream and Resolver. r=luke
authorChris Peterson <cpeterson@mozilla.com>
Sun, 11 Jun 2017 00:41:32 -0700
changeset 414168 6275675d2e5f63a6f38cf7e21c68f77fd402994e
parent 414167 5b2269c9a15dcf67de271cffb882b569d3c5ef8f
child 414169 cda636d722f2e20556b92ae27831fc5123ca9e31
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1373525
milestone56.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 1373525 - js/wasm: Remove unused member functions of WasmTokenStream and Resolver. r=luke js/src/wasm/WasmIonCompile.cpp:1181:25 [-Wunused-member-function] unused member function 'peekPushedDef' js/src/wasm/WasmIonCompile.cpp:1547:10: unused member function 'done' [-Wunused-member-function] js/src/wasm/WasmTextToBinary.cpp:609:13 [-Wunused-member-function] unused member function 'getIfText' js/src/wasm/WasmTextToBinary.cpp:1486:10 [-Wunused-member-function] unused member function 'fail' js/src/wasm/WasmTextToBinary.cpp:3394:10 [-Wunused-member-function] unused member function 'resolveName' js/src/wasm/WasmTextToBinary.cpp:3450:5 [-Wunused-member-function] unused member function 'registerImportName' js/src/wasm/WasmTextToBinary.cpp:3476:5 [-Wunused-member-function] unused member function 'resolveImport' MozReview-Commit-ID: DLb2ZNN0duk
js/src/wasm/WasmIonCompile.cpp
js/src/wasm/WasmTextToBinary.cpp
--- a/js/src/wasm/WasmIonCompile.cpp
+++ b/js/src/wasm/WasmIonCompile.cpp
@@ -1173,22 +1173,16 @@ class FunctionCompiler
   private:
     static bool hasPushed(MBasicBlock* block)
     {
         uint32_t numPushed = block->stackDepth() - block->info().firstStackSlot();
         MOZ_ASSERT(numPushed == 0 || numPushed == 1);
         return numPushed;
     }
 
-    static MDefinition* peekPushedDef(MBasicBlock* block)
-    {
-        MOZ_ASSERT(hasPushed(block));
-        return block->getSlot(block->stackDepth() - 1);
-    }
-
   public:
     void pushDef(MDefinition* def)
     {
         if (inDeadCode())
             return;
         MOZ_ASSERT(!hasPushed(curBlock_));
         if (def && def->type() != MIRType::None)
             curBlock_->push(def);
@@ -1545,17 +1539,19 @@ class FunctionCompiler
     /************************************************************ DECODING ***/
 
     uint32_t readCallSiteLineOrBytecode() {
         if (!func_.callSiteLineNums().empty())
             return func_.callSiteLineNums()[lastReadCallSite_++];
         return iter_.lastOpcodeOffset();
     }
 
+#if DEBUG
     bool done() const { return iter_.done(); }
+#endif
 
     /*************************************************************************/
   private:
     bool newBlock(MBasicBlock* pred, MBasicBlock** block)
     {
         *block = MBasicBlock::New(mirGraph(), info(), pred, MBasicBlock::NORMAL);
         if (!*block)
             return false;
--- a/js/src/wasm/WasmTextToBinary.cpp
+++ b/js/src/wasm/WasmTextToBinary.cpp
@@ -601,22 +601,16 @@ class WasmTokenStream
         return false;
     }
     AstName getIfName() {
         WasmToken token;
         if (getIf(WasmToken::Name, &token))
             return token.name();
         return AstName();
     }
-    AstName getIfText() {
-        WasmToken token;
-        if (getIf(WasmToken::Text, &token))
-            return token.text();
-        return AstName();
-    }
     bool getIfRef(AstRef* ref) {
         WasmToken token = peek();
         if (token.kind() == WasmToken::Name || token.kind() == WasmToken::Index)
             return matchRef(ref, nullptr);
         return false;
     }
     bool getIfOpcode(WasmToken* token) {
         *token = peek();
@@ -1478,20 +1472,16 @@ struct WasmParseContext
 
     WasmParseContext(const char16_t* text, LifoAlloc& lifo, UniqueChars* error)
       : ts(text, error),
         lifo(lifo),
         error(error),
         dtoaState(NewDtoaState())
     {}
 
-    bool fail(const char* message) {
-        error->reset(js_strdup(message));
-        return false;
-    }
     ~WasmParseContext() {
         DestroyDtoaState(dtoaState);
     }
 };
 
 } // end anonymous namespace
 
 static AstExpr*
@@ -3386,24 +3376,16 @@ class Resolver
         if (!p) {
             if (!map.add(p, name, index))
                 return false;
         } else {
             return false;
         }
         return true;
     }
-    bool resolveName(AstNameMap& map, AstName name, size_t* index) {
-        AstNameMap::Ptr p = map.lookup(name);
-        if (p) {
-            *index = p->value();
-            return true;
-        }
-        return false;
-    }
     bool resolveRef(AstNameMap& map, AstRef& ref) {
         AstNameMap::Ptr p = map.lookup(ref.name());
         if (p) {
             ref.setIndex(p->value());
             return true;
         }
         return false;
     }
@@ -3442,17 +3424,16 @@ class Resolver
 
 #define REGISTER(what, map)                                    \
     bool register##what##Name(AstName name, size_t index) {    \
         return name.empty() || registerName(map, name, index); \
     }
 
     REGISTER(Sig, sigMap_)
     REGISTER(Func, funcMap_)
-    REGISTER(Import, importMap_)
     REGISTER(Var, varMap_)
     REGISTER(Global, globalMap_)
     REGISTER(Table, tableMap_)
     REGISTER(Memory, memoryMap_)
 
 #undef REGISTER
 
     bool pushTarget(AstName name) {
@@ -3468,17 +3449,16 @@ class Resolver
         MOZ_ASSERT(!ref.isInvalid());                     \
         if (!ref.name().empty() && !resolveRef(map, ref)) \
             return failResolveLabel(#label, ref.name());  \
         return true;                                      \
     }
 
     RESOLVE(sigMap_, Signature)
     RESOLVE(funcMap_, Function)
-    RESOLVE(importMap_, Import)
     RESOLVE(varMap_, Local)
     RESOLVE(globalMap_, Global)
     RESOLVE(tableMap_, Table)
     RESOLVE(memoryMap_, Memory)
 
 #undef RESOLVE
 
     bool resolveBranchTarget(AstRef& ref) {