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

Unified Diff: src/compiler-dispatcher/compiler-dispatcher-job.cc

Issue 2314663002: Rework scanner-character-streams. (Closed)
Patch Set: Marja's feedback. Created 4 years, 3 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 | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler-dispatcher/compiler-dispatcher-job.cc
diff --git a/src/compiler-dispatcher/compiler-dispatcher-job.cc b/src/compiler-dispatcher/compiler-dispatcher-job.cc
index d6b570449f64e92541ed61ec6b3982dea9758479..413d242c675b9e4a4c89b4971e5618406ac6e56e 100644
--- a/src/compiler-dispatcher/compiler-dispatcher-job.cc
+++ b/src/compiler-dispatcher/compiler-dispatcher-job.cc
@@ -53,20 +53,15 @@ void CompilerDispatcherJob::PrepareToParseOnMainThread() {
DCHECK(script->type() != Script::TYPE_NATIVE);
Handle<String> source(String::cast(script->source()), isolate_);
- if (source->IsExternalTwoByteString()) {
- character_stream_.reset(new ExternalTwoByteStringUtf16CharacterStream(
- Handle<ExternalTwoByteString>::cast(source), shared->start_position(),
- shared->end_position()));
- } else if (source->IsExternalOneByteString()) {
- character_stream_.reset(new ExternalOneByteStringUtf16CharacterStream(
- Handle<ExternalOneByteString>::cast(source), shared->start_position(),
- shared->end_position()));
+ if (source->IsExternalTwoByteString() || source->IsExternalOneByteString()) {
+ character_stream_.reset(ScannerStream::For(source, shared->start_position(),
+ shared->end_position()));
} else {
source = String::Flatten(source);
// Have to globalize the reference here, so it survives between function
// calls.
source_ = Handle<String>::cast(isolate_->global_handles()->Create(*source));
- character_stream_.reset(new GenericStringUtf16CharacterStream(
+ character_stream_.reset(ScannerStream::For(
source_, shared->start_position(), shared->end_position()));
}
parse_info_.reset(new ParseInfo(zone_.get()));
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698