Bug 1428863 - Change a few TokenStream::* uses in AsmJS.cpp to TokenStreamShared::*, because TokenStream no longer has the meaning it's traditionally had. r=arai
authorJeff Walden <jwalden@mit.edu>
Sat, 23 Dec 2017 13:47:14 -0500
changeset 399886 98378bbaf80721b363d52d77601ca8738142da71
parent 399885 2a4be20ecde238347d030c522b2e24741ce8a3d4
child 399887 ae260591e20e49bbaab6b178fa10838531ada0bf
push id33279
push useraciure@mozilla.com
push dateThu, 18 Jan 2018 21:53:37 +0000
treeherdermozilla-central@cffb3cd9dbb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1428863
milestone59.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 1428863 - Change a few TokenStream::* uses in AsmJS.cpp to TokenStreamShared::*, because TokenStream no longer has the meaning it's traditionally had. r=arai
js/src/wasm/AsmJS.cpp
--- a/js/src/wasm/AsmJS.cpp
+++ b/js/src/wasm/AsmJS.cpp
@@ -759,17 +759,17 @@ NextNonEmptyStatement(ParseNode* pn)
 }
 
 static bool
 GetToken(AsmJSParser& parser, TokenKind* tkp)
 {
     auto& ts = parser.tokenStream;
     TokenKind tk;
     while (true) {
-        if (!ts.getToken(&tk, TokenStream::Operand))
+        if (!ts.getToken(&tk, TokenStreamShared::Operand))
             return false;
         if (tk != TokenKind::TOK_SEMI)
             break;
     }
     *tkp = tk;
     return true;
 }
 
@@ -778,17 +778,17 @@ PeekToken(AsmJSParser& parser, TokenKind
 {
     auto& ts = parser.tokenStream;
     TokenKind tk;
     while (true) {
         if (!ts.peekToken(&tk, TokenStream::Operand))
             return false;
         if (tk != TokenKind::TOK_SEMI)
             break;
-        ts.consumeKnownToken(TokenKind::TOK_SEMI, TokenStream::Operand);
+        ts.consumeKnownToken(TokenKind::TOK_SEMI, TokenStreamShared::Operand);
     }
     *tkp = tk;
     return true;
 }
 
 static bool
 ParseVarOrConstStatement(AsmJSParser& parser, ParseNode** var)
 {
@@ -2450,17 +2450,17 @@ class MOZ_STACK_CLASS ModuleValidator
             if (!funcName || !asmJSMetadata_->asmJSFuncNames.emplaceBack(Move(funcName)))
                 return nullptr;
         }
 
         uint32_t endBeforeCurly = tokenStream().anyCharsAccess().currentToken().pos.end;
         asmJSMetadata_->srcLength = endBeforeCurly - asmJSMetadata_->srcStart;
 
         TokenPos pos;
-        JS_ALWAYS_TRUE(tokenStream().peekTokenPos(&pos, TokenStream::Operand));
+        JS_ALWAYS_TRUE(tokenStream().peekTokenPos(&pos, TokenStreamShared::Operand));
         uint32_t endAfterCurly = pos.end;
         asmJSMetadata_->srcLengthWithRightBrace = endAfterCurly - asmJSMetadata_->srcStart;
 
         ScriptedCaller scriptedCaller;
         if (parser_.ss->filename()) {
             scriptedCaller.line = scriptedCaller.column = 0;  // unused
             scriptedCaller.filename = DuplicateString(parser_.ss->filename());
             if (!scriptedCaller.filename)
@@ -3843,17 +3843,17 @@ CheckModuleGlobal(ModuleValidator& m, Pa
 }
 
 static bool
 CheckModuleProcessingDirectives(ModuleValidator& m)
 {
     auto& ts = m.parser().tokenStream;
     while (true) {
         bool matched;
-        if (!ts.matchToken(&matched, TokenKind::TOK_STRING, TokenStream::Operand))
+        if (!ts.matchToken(&matched, TokenKind::TOK_STRING, TokenStreamShared::Operand))
             return false;
         if (!matched)
             return true;
 
         if (!IsIgnoredDirectiveName(m.cx(), ts.anyCharsAccess().currentToken().atom()))
             return m.failCurrentOffset("unsupported processing directive");
 
         TokenKind tt;
@@ -7173,24 +7173,24 @@ CheckStatement(FunctionValidator& f, Par
     return f.fail(stmt, "unexpected statement kind");
 }
 
 static bool
 ParseFunction(ModuleValidator& m, ParseNode** fnOut, unsigned* line)
 {
     auto& tokenStream = m.tokenStream();
 
-    tokenStream.consumeKnownToken(TokenKind::TOK_FUNCTION, TokenStream::Operand);
+    tokenStream.consumeKnownToken(TokenKind::TOK_FUNCTION, TokenStreamShared::Operand);
 
     auto& anyChars = tokenStream.anyCharsAccess();
     uint32_t toStringStart = anyChars.currentToken().pos.begin;
     *line = anyChars.srcCoords.lineNum(anyChars.currentToken().pos.end);
 
     TokenKind tk;
-    if (!tokenStream.getToken(&tk, TokenStream::Operand))
+    if (!tokenStream.getToken(&tk, TokenStreamShared::Operand))
         return false;
     if (tk == TokenKind::TOK_MUL)
         return m.failCurrentOffset("unexpected generator function");
     if (!TokenKindIsPossibleIdentifier(tk))
         return false;  // The regular parser will throw a SyntaxError, no need to m.fail.
 
     RootedPropertyName name(m.cx(), m.parser().bindingIdentifier(YieldIsName));
     if (!name)
@@ -8392,17 +8392,17 @@ class ModuleChars
 
   public:
     static uint32_t beginOffset(AsmJSParser& parser) {
         return parser.pc->functionBox()->functionNode->pn_pos.begin;
     }
 
     static uint32_t endOffset(AsmJSParser& parser) {
         TokenPos pos(0, 0);  // initialize to silence GCC warning
-        MOZ_ALWAYS_TRUE(parser.tokenStream.peekTokenPos(&pos, TokenStream::Operand));
+        MOZ_ALWAYS_TRUE(parser.tokenStream.peekTokenPos(&pos, TokenStreamShared::Operand));
         return pos.end;
     }
 };
 
 class ModuleCharsForStore : ModuleChars
 {
     uint32_t uncompressedSize_;
     uint32_t compressedSize_;