Backed out changeset de236ed88685 (bug 1351107) to hopefully fixing rooting hazard. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 29 Apr 2017 12:51:52 +0200
changeset 355785 53672c48392add5e976edd062af5abfa45f48818
parent 355784 a55987f8d963b51d62d853c6d2400bf1df8c8ede
child 355786 e6343ab01a43a330302c7f05ef98ea73a953f1a9
push id31740
push userarchaeopteryx@coole-files.de
push dateSat, 29 Apr 2017 19:31:26 +0000
treeherdermozilla-central@2fe636103d71 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1351107
milestone55.0a1
backs outde236ed8868530f29594ce362d30cc5541690a6f
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
Backed out changeset de236ed88685 (bug 1351107) to hopefully fixing rooting hazard. r=backout
js/src/frontend/TokenStream.cpp
js/src/frontend/TokenStream.h
js/src/vm/Unicode.h
--- a/js/src/frontend/TokenStream.cpp
+++ b/js/src/frontend/TokenStream.cpp
@@ -495,17 +495,17 @@ TokenStream::getChar(int32_t* cp)
         if (MOZ_UNLIKELY(c == '\r')) {
             // If it's a \r\n sequence: treat as a single EOL, skip over the \n.
             if (MOZ_LIKELY(userbuf.hasRawChars()))
                 userbuf.matchRawChar('\n');
 
             break;
         }
 
-        if (MOZ_UNLIKELY(c == unicode::LINE_SEPARATOR || c == unicode::PARA_SEPARATOR))
+        if (MOZ_UNLIKELY(c == LINE_SEPARATOR || c == PARA_SEPARATOR))
             break;
 
         *cp = c;
         return true;
     } while (false);
 
     if (!updateLineInfoForEOL())
         return false;
@@ -1320,17 +1320,17 @@ TokenStream::getTokenInternal(TokenKind*
 
     c = userbuf.getRawChar();
     MOZ_ASSERT(c != EOF);
 
     // Chars not in the range 0..127 are rare.  Getting them out of the way
     // early allows subsequent checking to be faster.
     if (MOZ_UNLIKELY(c >= 128)) {
         if (unicode::IsSpaceOrBOM2(c)) {
-            if (c == unicode::LINE_SEPARATOR || c == unicode::PARA_SEPARATOR) {
+            if (c == LINE_SEPARATOR || c == PARA_SEPARATOR) {
                 if (!updateLineInfoForEOL())
                     goto error;
 
                 updateFlagsForEOL();
             }
 
             goto retry;
         }
--- a/js/src/frontend/TokenStream.h
+++ b/js/src/frontend/TokenStream.h
@@ -24,17 +24,16 @@
 #include "jspubtd.h"
 
 #include "frontend/TokenKind.h"
 #include "js/UniquePtr.h"
 #include "js/Vector.h"
 #include "vm/ErrorReporting.h"
 #include "vm/RegExpObject.h"
 #include "vm/String.h"
-#include "vm/Unicode.h"
 
 struct KeywordInfo;
 
 namespace js {
 namespace frontend {
 
 struct TokenPos {
     uint32_t    begin;  // Offset of the token's first char.
@@ -264,16 +263,22 @@ class StrictModeGetter {
     virtual bool strictMode() = 0;
 };
 
 class TokenStreamBase
 {
   protected:
     TokenStreamBase(JSContext* cx, const ReadOnlyCompileOptions& options, StrictModeGetter* smg);
 
+    // Unicode separators that are treated as line terminators, in addition to \n, \r.
+    enum {
+        LINE_SEPARATOR = 0x2028,
+        PARA_SEPARATOR = 0x2029
+    };
+
     static const size_t ntokens = 4;                // 1 current + 2 lookahead, rounded
                                                     // to power of 2 to avoid divmod by 3
     static const unsigned maxLookahead = 2;
     static const unsigned ntokensMask = ntokens - 1;
 
   public:
     // Accessors.
     const Token& currentToken() const { return tokens[cursor]; }
@@ -994,20 +999,17 @@ class MOZ_STACK_CLASS TokenStream final 
 #ifdef DEBUG
         // Poison the TokenBuf so it cannot be accessed again.
         void poison() {
             ptr = nullptr;
         }
 #endif
 
         static bool isRawEOLChar(int32_t c) {
-            return c == '\n' ||
-                   c == '\r' ||
-                   c == unicode::LINE_SEPARATOR ||
-                   c == unicode::PARA_SEPARATOR;
+            return c == '\n' || c == '\r' || c == LINE_SEPARATOR || c == PARA_SEPARATOR;
         }
 
         // Returns the offset of the next EOL, but stops once 'max' characters
         // have been scanned (*including* the char at startOffset_).
         size_t findEOLMax(size_t start, size_t max);
 
       private:
         const CharT* base_;          // base of buffer
--- a/js/src/vm/Unicode.h
+++ b/js/src/vm/Unicode.h
@@ -58,28 +58,26 @@ namespace unicode {
 
 namespace CharFlag {
     const uint8_t SPACE = 1 << 0;
     const uint8_t UNICODE_ID_START = 1 << 1;
     const uint8_t UNICODE_ID_CONTINUE_ONLY = 1 << 2;
     const uint8_t UNICODE_ID_CONTINUE = UNICODE_ID_START + UNICODE_ID_CONTINUE_ONLY;
 }
 
-constexpr char16_t NO_BREAK_SPACE = 0x00A0;
-constexpr char16_t MICRO_SIGN = 0x00B5;
-constexpr char16_t LATIN_SMALL_LETTER_SHARP_S = 0x00DF;
-constexpr char16_t LATIN_SMALL_LETTER_Y_WITH_DIAERESIS = 0x00FF;
-constexpr char16_t LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE = 0x0130;
-constexpr char16_t LINE_SEPARATOR = 0x2028;
-constexpr char16_t PARA_SEPARATOR = 0x2029;
-constexpr char16_t COMBINING_DOT_ABOVE = 0x0307;
-constexpr char16_t GREEK_CAPITAL_LETTER_SIGMA = 0x03A3;
-constexpr char16_t GREEK_SMALL_LETTER_FINAL_SIGMA = 0x03C2;
-constexpr char16_t GREEK_SMALL_LETTER_SIGMA = 0x03C3;
-constexpr char16_t BYTE_ORDER_MARK2 = 0xFFFE;
+const char16_t NO_BREAK_SPACE = 0x00A0;
+const char16_t MICRO_SIGN = 0x00B5;
+const char16_t LATIN_SMALL_LETTER_SHARP_S = 0x00DF;
+const char16_t LATIN_SMALL_LETTER_Y_WITH_DIAERESIS = 0x00FF;
+const char16_t LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE = 0x0130;
+const char16_t COMBINING_DOT_ABOVE = 0x0307;
+const char16_t GREEK_CAPITAL_LETTER_SIGMA = 0x03A3;
+const char16_t GREEK_SMALL_LETTER_FINAL_SIGMA = 0x03C2;
+const char16_t GREEK_SMALL_LETTER_SIGMA = 0x03C3;
+const char16_t BYTE_ORDER_MARK2 = 0xFFFE;
 
 const char16_t LeadSurrogateMin = 0xD800;
 const char16_t LeadSurrogateMax = 0xDBFF;
 const char16_t TrailSurrogateMin = 0xDC00;
 const char16_t TrailSurrogateMax = 0xDFFF;
 
 const uint32_t UTF16Max = 0xFFFF;
 const uint32_t NonBMPMin = 0x10000;