Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: src/lexer/experimental-scanner.h

Issue 138123002: Experimental lexer: reset literals if the source was moved by GC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lexer/experimental-scanner.h
diff --git a/src/lexer/experimental-scanner.h b/src/lexer/experimental-scanner.h
index e0671e25cef037431a6f7bf298a0b2ebf9aa23a2..562d814643a1c5e7c8e6910761981da32d3daa94 100644
--- a/src/lexer/experimental-scanner.h
+++ b/src/lexer/experimental-scanner.h
@@ -254,6 +254,11 @@ class ScannerBase {
virtual void Scan() = 0;
virtual bool FillLiteral(const TokenDesc& token, LiteralDesc* literal) = 0;
+ void ResetLiterals() {
+ current_literal_->beg_pos = -1;
+ next_literal_->beg_pos = -1;
+ }
+
Isolate* isolate_;
UnicodeCache* unicode_cache_;
@@ -318,11 +323,14 @@ class ExperimentalScanner : public ScannerBase {
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;
+ last_octal_end_ = buffer_ + last_octal_end_offset;
+ ResetLiterals();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698