OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler-dispatcher/compiler-dispatcher-job.h" | 5 #include "src/compiler-dispatcher/compiler-dispatcher-job.h" |
6 | 6 |
7 #include "src/assert-scope.h" | 7 #include "src/assert-scope.h" |
8 #include "src/compilation-info.h" | 8 #include "src/compilation-info.h" |
9 #include "src/compiler-dispatcher/compiler-dispatcher-tracer.h" | 9 #include "src/compiler-dispatcher/compiler-dispatcher-tracer.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 status_ == CompileJobStatus::kDone); | 43 status_ == CompileJobStatus::kDone); |
44 i::GlobalHandles::Destroy(Handle<Object>::cast(shared_).location()); | 44 i::GlobalHandles::Destroy(Handle<Object>::cast(shared_).location()); |
45 } | 45 } |
46 | 46 |
47 void CompilerDispatcherJob::PrepareToParseOnMainThread() { | 47 void CompilerDispatcherJob::PrepareToParseOnMainThread() { |
48 DCHECK(ThreadId::Current().Equals(isolate_->thread_id())); | 48 DCHECK(ThreadId::Current().Equals(isolate_->thread_id())); |
49 DCHECK(status() == CompileJobStatus::kInitial); | 49 DCHECK(status() == CompileJobStatus::kInitial); |
50 COMPILER_DISPATCHER_TRACE_SCOPE(tracer_, kPrepareToParse); | 50 COMPILER_DISPATCHER_TRACE_SCOPE(tracer_, kPrepareToParse); |
51 HandleScope scope(isolate_); | 51 HandleScope scope(isolate_); |
52 unicode_cache_.reset(new UnicodeCache()); | 52 unicode_cache_.reset(new UnicodeCache()); |
53 zone_.reset(new Zone(isolate_->allocator())); | 53 zone_.reset(new Zone(isolate_->allocator(), ZONE_NAME)); |
54 Handle<Script> script(Script::cast(shared_->script()), isolate_); | 54 Handle<Script> script(Script::cast(shared_->script()), isolate_); |
55 DCHECK(script->type() != Script::TYPE_NATIVE); | 55 DCHECK(script->type() != Script::TYPE_NATIVE); |
56 | 56 |
57 Handle<String> source(String::cast(script->source()), isolate_); | 57 Handle<String> source(String::cast(script->source()), isolate_); |
58 if (source->IsExternalTwoByteString() || source->IsExternalOneByteString()) { | 58 if (source->IsExternalTwoByteString() || source->IsExternalOneByteString()) { |
59 character_stream_.reset(ScannerStream::For( | 59 character_stream_.reset(ScannerStream::For( |
60 source, shared_->start_position(), shared_->end_position())); | 60 source, shared_->start_position(), shared_->end_position())); |
61 } else { | 61 } else { |
62 source = String::Flatten(source); | 62 source = String::Flatten(source); |
63 // Have to globalize the reference here, so it survives between function | 63 // Have to globalize the reference here, so it survives between function |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 if (!source_.is_null()) { | 259 if (!source_.is_null()) { |
260 i::GlobalHandles::Destroy(Handle<Object>::cast(source_).location()); | 260 i::GlobalHandles::Destroy(Handle<Object>::cast(source_).location()); |
261 source_ = Handle<String>::null(); | 261 source_ = Handle<String>::null(); |
262 } | 262 } |
263 | 263 |
264 status_ = CompileJobStatus::kInitial; | 264 status_ = CompileJobStatus::kInitial; |
265 } | 265 } |
266 | 266 |
267 } // namespace internal | 267 } // namespace internal |
268 } // namespace v8 | 268 } // namespace v8 |
OLD | NEW |