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