OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/background-parsing-task.h" | 5 #include "src/background-parsing-task.h" |
6 | 6 |
7 #include "src/debug/debug.h" | 7 #include "src/debug/debug.h" |
8 #include "src/parsing/parser.h" | 8 #include "src/parsing/parser.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 13 matching lines...) Expand all Loading... |
24 // thread cannot do anything with it anyway. We set it just before compilation | 24 // thread cannot do anything with it anyway. We set it just before compilation |
25 // on the foreground thread. | 25 // on the foreground thread. |
26 DCHECK(options == ScriptCompiler::kProduceParserCache || | 26 DCHECK(options == ScriptCompiler::kProduceParserCache || |
27 options == ScriptCompiler::kProduceCodeCache || | 27 options == ScriptCompiler::kProduceCodeCache || |
28 options == ScriptCompiler::kNoCompileOptions); | 28 options == ScriptCompiler::kNoCompileOptions); |
29 | 29 |
30 // Prepare the data for the internalization phase and compilation phase, which | 30 // Prepare the data for the internalization phase and compilation phase, which |
31 // will happen in the main thread after parsing. | 31 // will happen in the main thread after parsing. |
32 Zone* zone = new Zone(isolate->allocator()); | 32 Zone* zone = new Zone(isolate->allocator()); |
33 ParseInfo* info = new ParseInfo(zone); | 33 ParseInfo* info = new ParseInfo(zone); |
| 34 info->set_toplevel(); |
34 source->zone.reset(zone); | 35 source->zone.reset(zone); |
35 source->info.reset(info); | 36 source->info.reset(info); |
36 info->set_isolate(isolate); | 37 info->set_isolate(isolate); |
37 info->set_source_stream(source->source_stream.get()); | 38 info->set_source_stream(source->source_stream.get()); |
38 info->set_source_stream_encoding(source->encoding); | 39 info->set_source_stream_encoding(source->encoding); |
39 info->set_hash_seed(isolate->heap()->HashSeed()); | 40 info->set_hash_seed(isolate->heap()->HashSeed()); |
40 info->set_unicode_cache(&source_->unicode_cache); | 41 info->set_unicode_cache(&source_->unicode_cache); |
41 info->set_compile_options(options); | 42 info->set_compile_options(options); |
42 // Parse eagerly with ignition since we will compile eagerly. | 43 // Parse eagerly with ignition since we will compile eagerly. |
43 info->set_allow_lazy_parsing(!(i::FLAG_ignition && i::FLAG_ignition_eager)); | 44 info->set_allow_lazy_parsing(!(i::FLAG_ignition && i::FLAG_ignition_eager)); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 script_data_->data(), script_data_->length(), | 77 script_data_->data(), script_data_->length(), |
77 ScriptCompiler::CachedData::BufferOwned)); | 78 ScriptCompiler::CachedData::BufferOwned)); |
78 script_data_->ReleaseDataOwnership(); | 79 script_data_->ReleaseDataOwnership(); |
79 delete script_data_; | 80 delete script_data_; |
80 script_data_ = nullptr; | 81 script_data_ = nullptr; |
81 } | 82 } |
82 source_->info->set_isolate(isolate); | 83 source_->info->set_isolate(isolate); |
83 } | 84 } |
84 } // namespace internal | 85 } // namespace internal |
85 } // namespace v8 | 86 } // namespace v8 |
OLD | NEW |