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.h" | 9 #include "src/compiler.h" |
10 #include "src/global-handles.h" | 10 #include "src/global-handles.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 parse_info_->set_hash_seed(isolate_->heap()->HashSeed()); | 76 parse_info_->set_hash_seed(isolate_->heap()->HashSeed()); |
77 parse_info_->set_is_named_expression(shared->is_named_expression()); | 77 parse_info_->set_is_named_expression(shared->is_named_expression()); |
78 parse_info_->set_calls_eval(shared->scope_info()->CallsEval()); | 78 parse_info_->set_calls_eval(shared->scope_info()->CallsEval()); |
79 parse_info_->set_compiler_hints(shared->compiler_hints()); | 79 parse_info_->set_compiler_hints(shared->compiler_hints()); |
80 parse_info_->set_start_position(shared->start_position()); | 80 parse_info_->set_start_position(shared->start_position()); |
81 parse_info_->set_end_position(shared->end_position()); | 81 parse_info_->set_end_position(shared->end_position()); |
82 parse_info_->set_unicode_cache(unicode_cache_.get()); | 82 parse_info_->set_unicode_cache(unicode_cache_.get()); |
83 parse_info_->set_language_mode(shared->language_mode()); | 83 parse_info_->set_language_mode(shared->language_mode()); |
84 | 84 |
85 parser_.reset(new Parser(parse_info_.get())); | 85 parser_.reset(new Parser(parse_info_.get())); |
86 parser_->DeserializeScopeChain( | 86 parser_->InspectScopeChain( |
87 parse_info_.get(), handle(function_->context(), isolate_), | 87 parse_info_.get(), |
88 Scope::DeserializationMode::kDeserializeOffHeap); | 88 function_->context()->IsNativeContext() |
| 89 ? Handle<ScopeInfo>::null() |
| 90 : handle(function_->context()->scope_info(), isolate_)); |
89 | 91 |
90 Handle<String> name(String::cast(shared->name())); | 92 Handle<String> name(String::cast(shared->name())); |
91 parse_info_->set_function_name( | 93 parse_info_->set_function_name( |
92 parse_info_->ast_value_factory()->GetString(name)); | 94 parse_info_->ast_value_factory()->GetString(name)); |
93 status_ = CompileJobStatus::kReadyToParse; | 95 status_ = CompileJobStatus::kReadyToParse; |
94 } | 96 } |
95 | 97 |
96 void CompilerDispatcherJob::Parse() { | 98 void CompilerDispatcherJob::Parse() { |
97 DCHECK(can_parse_on_background_thread_ || | 99 DCHECK(can_parse_on_background_thread_ || |
98 ThreadId::Current().Equals(isolate_->thread_id())); | 100 ThreadId::Current().Equals(isolate_->thread_id())); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 if (!source_.is_null()) { | 257 if (!source_.is_null()) { |
256 i::GlobalHandles::Destroy(Handle<Object>::cast(source_).location()); | 258 i::GlobalHandles::Destroy(Handle<Object>::cast(source_).location()); |
257 source_ = Handle<String>::null(); | 259 source_ = Handle<String>::null(); |
258 } | 260 } |
259 | 261 |
260 status_ = CompileJobStatus::kInitial; | 262 status_ = CompileJobStatus::kInitial; |
261 } | 263 } |
262 | 264 |
263 } // namespace internal | 265 } // namespace internal |
264 } // namespace v8 | 266 } // namespace v8 |
OLD | NEW |