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