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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 parse_info_->set_script(script); | 145 parse_info_->set_script(script); |
146 Handle<ScopeInfo> outer_scope_info( | 146 Handle<ScopeInfo> outer_scope_info( |
147 handle(ScopeInfo::cast(shared_->outer_scope_info()))); | 147 handle(ScopeInfo::cast(shared_->outer_scope_info()))); |
148 if (outer_scope_info->length() > 0) { | 148 if (outer_scope_info->length() > 0) { |
149 parse_info_->set_outer_scope_info(outer_scope_info); | 149 parse_info_->set_outer_scope_info(outer_scope_info); |
150 } | 150 } |
151 parse_info_->set_shared_info(shared_); | 151 parse_info_->set_shared_info(shared_); |
152 | 152 |
153 { | 153 { |
154 // Create a canonical handle scope if compiling ignition bytecode. This is | 154 // Create a canonical handle scope for compiling Ignition bytecode. This |
155 // required by the constant array builder to de-duplicate objects without | 155 // is required by the constant array builder to de-duplicate objects |
156 // dereferencing handles. | 156 // without dereferencing handles. |
157 std::unique_ptr<CanonicalHandleScope> canonical; | 157 CanonicalHandleScope canonical(isolate_); |
158 if (FLAG_ignition) canonical.reset(new CanonicalHandleScope(isolate_)); | |
159 | 158 |
160 // Do the parsing tasks which need to be done on the main thread. This | 159 // Do the parsing tasks which need to be done on the main thread. This |
161 // will also handle parse errors. | 160 // will also handle parse errors. |
162 parser_->Internalize(isolate_, script, parse_info_->literal() == nullptr); | 161 parser_->Internalize(isolate_, script, parse_info_->literal() == nullptr); |
163 } | 162 } |
164 parser_->HandleSourceURLComments(isolate_, script); | 163 parser_->HandleSourceURLComments(isolate_, script); |
165 | 164 |
166 parse_info_->set_character_stream(nullptr); | 165 parse_info_->set_character_stream(nullptr); |
167 parse_info_->set_unicode_cache(nullptr); | 166 parse_info_->set_unicode_cache(nullptr); |
168 parser_.reset(); | 167 parser_.reset(); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 if (!source_.is_null()) { | 258 if (!source_.is_null()) { |
260 i::GlobalHandles::Destroy(Handle<Object>::cast(source_).location()); | 259 i::GlobalHandles::Destroy(Handle<Object>::cast(source_).location()); |
261 source_ = Handle<String>::null(); | 260 source_ = Handle<String>::null(); |
262 } | 261 } |
263 | 262 |
264 status_ = CompileJobStatus::kInitial; | 263 status_ = CompileJobStatus::kInitial; |
265 } | 264 } |
266 | 265 |
267 } // namespace internal | 266 } // namespace internal |
268 } // namespace v8 | 267 } // namespace v8 |
OLD | NEW |