Revision: 19951
Author:   [email protected]
Date:     Fri Mar 14 20:36:21 2014 UTC
Log:      Experimental parser: fix build after merge

[email protected]

BUG=

Review URL: https://codereview.chromium.org/196473026
http://code.google.com/p/v8/source/detail?r=19951

Modified:
 /branches/experimental/parser/src/lexer/lexer-shell.cc
 /branches/experimental/parser/src/lexer/lexer.cc

=======================================
--- /branches/experimental/parser/src/lexer/lexer-shell.cc Tue Mar 11 12:27:04 2014 UTC +++ /branches/experimental/parser/src/lexer/lexer-shell.cc Fri Mar 14 20:36:21 2014 UTC
@@ -218,19 +218,23 @@
   // The location of the latest octal position when the token was seen.
   int octal_beg;
   int octal_end;
-  TokenWithLocation(Token::Value token, Scanner* scanner) : value(token) {
+  TokenWithLocation(Token::Value token,
+                    Scanner* scanner,
+                    Handle<String> literal_string)
+      : value(token) {
     beg = scanner->location().beg_pos;
     end = scanner->location().end_pos;
     octal_beg = scanner->octal_position().beg_pos;
     octal_end = scanner->octal_position().end_pos;
     is_one_byte = false;
     literal_length = 0;
-    if (HasLiteral(token)) {
-      is_one_byte = scanner->is_literal_ascii();
-      if (scanner->is_literal_ascii()) {
-        Copy(scanner->literal_ascii_string(), &literal, &literal_length);
+    if (!literal_string.is_null()) {
+      DisallowHeapAllocation no_alloc;
+      String::FlatContent content = literal_string->GetFlatContent();
+      if (content.IsAscii()) {
+        Copy(content.ToOneByteVector(), &literal, &literal_length);
       } else {
-        Copy(scanner->literal_utf16_string(), &literal, &literal_length);
+        Copy(content.ToUC16Vector(), &literal, &literal_length);
       }
     }
   }
@@ -298,14 +302,12 @@
   Token::Value token;
   do {
     token = scanner.Next();
+    Handle<String> literal;
+    if (HasLiteral(token)) {
+      literal = scanner.AllocateInternalizedString(isolate);
+    }
     if (settings.print_tokens) {
-      tokens.push_back(new TokenWithLocation(token, &scanner));
-    } else if (HasLiteral(token)) {
-      if (scanner.is_literal_ascii()) {
-        scanner.literal_ascii_string();
-      } else {
-        scanner.literal_utf16_string();
-      }
+      tokens.push_back(new TokenWithLocation(token, &scanner, literal));
     }
     if (token == Token::ILLEGAL && settings.break_after_illegal) break;
   } while (token != Token::EOS);
=======================================
--- /branches/experimental/parser/src/lexer/lexer.cc Wed Mar 5 14:15:39 2014 UTC +++ /branches/experimental/parser/src/lexer/lexer.cc Fri Mar 14 20:36:21 2014 UTC
@@ -511,7 +511,7 @@


 void LexerBase::LiteralDesc::SetStringFromLiteralBuffer() {
-  is_one_byte_ = buffer.is_ascii();
+  is_one_byte_ = buffer.is_one_byte();
   is_in_buffer_ = true;
   length = buffer.length();
   if (is_one_byte_) {
@@ -519,9 +519,9 @@
       one_byte_string_.Dispose();
     }
     is_one_byte_string_owned_ = false;
-    one_byte_string_ = Vector<const uint8_t>::cast(buffer.ascii_literal());
+    one_byte_string_ = buffer.one_byte_literal();
   } else {
-    two_byte_string_ = buffer.utf16_literal();
+    two_byte_string_ = buffer.two_byte_literal();
   }
 }

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to