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/global-handles.h" | 8 #include "src/global-handles.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 source_ = Handle<String>::cast(isolate_->global_handles()->Create(*source)); | 62 source_ = Handle<String>::cast(isolate_->global_handles()->Create(*source)); |
63 character_stream_.reset(new GenericStringUtf16CharacterStream( | 63 character_stream_.reset(new GenericStringUtf16CharacterStream( |
64 source_, shared->start_position(), shared->end_position())); | 64 source_, shared->start_position(), shared->end_position())); |
65 } | 65 } |
66 parse_info_.reset(new ParseInfo(zone_.get())); | 66 parse_info_.reset(new ParseInfo(zone_.get())); |
67 parse_info_->set_isolate(isolate_); | 67 parse_info_->set_isolate(isolate_); |
68 parse_info_->set_character_stream(character_stream_.get()); | 68 parse_info_->set_character_stream(character_stream_.get()); |
69 parse_info_->set_hash_seed(isolate_->heap()->HashSeed()); | 69 parse_info_->set_hash_seed(isolate_->heap()->HashSeed()); |
70 parse_info_->set_unicode_cache(unicode_cache_.get()); | 70 parse_info_->set_unicode_cache(unicode_cache_.get()); |
71 parser_.reset(new Parser(parse_info_.get())); | 71 parser_.reset(new Parser(parse_info_.get())); |
| 72 Scope* script_scope = parser_->NewScriptScope(); |
| 73 parse_info_->set_script_scope(script_scope); |
| 74 script_scope = Scope::DeserializeScopeChain( |
| 75 isolate_, zone_.get(), function_->context(), script_scope, |
| 76 parse_info_->ast_value_factory(), |
| 77 Scope::DeserializationMode::kDeserializeOffHeap); |
| 78 parser_->set_original_scope(script_scope); |
72 status_ = CompileJobStatus::kReadyToParse; | 79 status_ = CompileJobStatus::kReadyToParse; |
73 } | 80 } |
74 | 81 |
75 void CompilerDispatcherJob::Parse() { | 82 void CompilerDispatcherJob::Parse() { |
76 DCHECK(can_parse_on_background_thread_ || | 83 DCHECK(can_parse_on_background_thread_ || |
77 ThreadId::Current().Equals(isolate_->thread_id())); | 84 ThreadId::Current().Equals(isolate_->thread_id())); |
78 DCHECK(status() == CompileJobStatus::kReadyToParse); | 85 DCHECK(status() == CompileJobStatus::kReadyToParse); |
79 | 86 |
80 DisallowHeapAllocation no_allocation; | 87 DisallowHeapAllocation no_allocation; |
81 DisallowHandleAllocation no_handles; | 88 DisallowHandleAllocation no_handles; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 173 |
167 parse_info_->set_character_stream(nullptr); | 174 parse_info_->set_character_stream(nullptr); |
168 parse_info_->set_unicode_cache(nullptr); | 175 parse_info_->set_unicode_cache(nullptr); |
169 parser_.reset(); | 176 parser_.reset(); |
170 unicode_cache_.reset(); | 177 unicode_cache_.reset(); |
171 character_stream_.reset(); | 178 character_stream_.reset(); |
172 } | 179 } |
173 | 180 |
174 } // namespace internal | 181 } // namespace internal |
175 } // namespace v8 | 182 } // namespace v8 |
OLD | NEW |