Revision: 18607
Author:   [email protected]
Date:     Wed Jan 15 08:23:00 2014 UTC
Log:      Experimental parser: make marker local

[email protected]

BUG=

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

Modified:
 /branches/experimental/parser/src/lexer/experimental-scanner.h
 /branches/experimental/parser/tools/lexer_generator/code_generator.jinja

=======================================
--- /branches/experimental/parser/src/lexer/experimental-scanner.h Tue Jan 14 13:13:30 2014 UTC +++ /branches/experimental/parser/src/lexer/experimental-scanner.h Wed Jan 15 08:23:00 2014 UTC
@@ -292,7 +292,6 @@
         buffer_end_(NULL),
         start_(NULL),
         cursor_(NULL),
-        marker_(NULL),
         last_octal_end_(NULL) {
     ASSERT(source->IsFlat());
     UpdateBufferBasedOnHandle();
@@ -322,13 +321,11 @@
     if (new_buffer != buffer_) {
       int start_offset = start_ - buffer_;
       int cursor_offset = cursor_ - buffer_;
-      int marker_offset = marker_ - buffer_;
       int last_octal_end_offset = last_octal_end_ - buffer_;
       buffer_ = new_buffer;
       buffer_end_ = buffer_ + source_handle_->length();
       start_ = buffer_ + start_offset;
       cursor_ = buffer_ + cursor_offset;
-      marker_ = buffer_ + marker_offset;
       if (last_octal_end_ != NULL) {
         last_octal_end_ = buffer_ + last_octal_end_offset;
       }
@@ -373,7 +370,6 @@
   const Char* buffer_end_;
   const Char* start_;
   const Char* cursor_;
-  const Char* marker_;

   // Where we have seen the last octal number or an octal escape inside a
   // string. Used by octal_position().
@@ -385,7 +381,6 @@
 void ExperimentalScanner<Char>::SeekForward(int pos) {
   cursor_ = buffer_ + pos;
   start_ = cursor_;
-  marker_ = cursor_;
   has_line_terminator_before_next_ = false;
   has_multiline_comment_before_next_ = false;
   Scan();  // Fills in next_.
=======================================
--- /branches/experimental/parser/tools/lexer_generator/code_generator.jinja Tue Jan 14 13:01:46 2014 UTC +++ /branches/experimental/parser/tools/lexer_generator/code_generator.jinja Wed Jan 15 08:23:00 2014 UTC
@@ -72,7 +72,7 @@
   {% if type == 'store_token' %}
     stored_token = Token::{{value}};
   {% elif type == 'set_marker' %}
-    marker_ = cursor_ - {{value}};
+    marker = cursor_ - {{value}};
   {% elif type == 'set_has_escapes' %}
     next_.has_escapes = true;
   {% elif type == 'octal_inside_string' %}
@@ -101,7 +101,7 @@
   {% if type == 'terminate' %}
     {{dispatch_match_action('backtrack', ('1', 'EOS'))}}
   {% elif type == 'terminate_illegal' %}
-    start_ = marker_;
+    start_ = marker;
     {{dispatch_match_action('backtrack', ('1', 'ILLEGAL'))}}
   {% elif type == 'skip' %}
     RESET_START();
@@ -322,6 +322,7 @@
   // Setup environment.
   next_.has_escapes = false;
   Token::Value stored_token;
+  const {{char_type}} * marker;
   {{char_type}} primary_char;
   READ_CURSOR();

@@ -343,6 +344,8 @@
   if (false) {
     // force use of stored_token
     stored_token = Token::ILLEGAL;
+    // force use of marker
+    marker = NULL;
     // force use of state_entry_0
     goto state_entry_0;
   }

--
--
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/groups/opt_out.

Reply via email to