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

Unified Diff: src/lexer/lexer.cc

Issue 183853025: Experimental parser: cleanup after bleeding_edge merge (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 10 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 | « src/isolate.cc ('k') | src/lexer/lexer-shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lexer/lexer.cc
diff --git a/src/lexer/lexer.cc b/src/lexer/lexer.cc
index fd1b70dde3d2bfebf1225b461e93dab9aaabebe9..9171ab14fed9bb9d94da7f1a3abc521e789ab70c 100644
--- a/src/lexer/lexer.cc
+++ b/src/lexer/lexer.cc
@@ -172,9 +172,7 @@ Lexer<Char>::Lexer(UnicodeCache* unicode_cache,
int end_position)
: LexerBase(unicode_cache),
isolate_(source->GetIsolate()),
- // TODO(dcarney): don't need to allocate here, used stored positions
- source_handle_(isolate_->factory()->NewSubString(
- source, start_position, end_position)),
+ source_handle_(FlattenGetString(source)),
source_ptr_(NULL),
start_position_(start_position),
end_position_(end_position),
@@ -183,14 +181,15 @@ Lexer<Char>::Lexer(UnicodeCache* unicode_cache,
start_(NULL),
cursor_(NULL),
last_octal_end_(NULL) {
- ASSERT(source->IsFlat());
- fprintf(stderr, "%s %d %d %d %d %d\n",
- __func__, start_position_, end_position_,
- source->length(), source_handle_->length(),
- source->IsOneByteRepresentation());
UpdateBufferBasedOnHandle();
current_.beg_pos = current_.end_pos = next_.beg_pos = next_.end_pos = 0;
isolate_->lexer_gc_handler()->AddLexer(this);
+ // TODO(dcarney): move this to UpdateBufferBasedOnHandle
+ cursor_ = buffer_ + start_position;
+ buffer_end_ = buffer_ + end_position;
+ start_ = cursor_;
+ has_line_terminator_before_next_ = false;
+ has_multiline_comment_before_next_ = false;
}
« no previous file with comments | « src/isolate.cc ('k') | src/lexer/lexer-shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698