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 25 matching lines...) Expand all Loading... |
36 source->info.reset(info); | 36 source->info.reset(info); |
37 info->set_isolate(isolate); | 37 info->set_isolate(isolate); |
38 info->set_source_stream(source->source_stream.get()); | 38 info->set_source_stream(source->source_stream.get()); |
39 info->set_source_stream_encoding(source->encoding); | 39 info->set_source_stream_encoding(source->encoding); |
40 info->set_hash_seed(isolate->heap()->HashSeed()); | 40 info->set_hash_seed(isolate->heap()->HashSeed()); |
41 info->set_unicode_cache(&source_->unicode_cache); | 41 info->set_unicode_cache(&source_->unicode_cache); |
42 info->set_compile_options(options); | 42 info->set_compile_options(options); |
43 // Parse eagerly with ignition since we will compile eagerly. | 43 // Parse eagerly with ignition since we will compile eagerly. |
44 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)); |
45 | 45 |
46 if (options == ScriptCompiler::kProduceParserCache || | 46 source_->info->set_cached_data(&script_data_); |
47 options == ScriptCompiler::kProduceCodeCache) { | |
48 source_->info->set_cached_data(&script_data_); | |
49 } | |
50 // Parser needs to stay alive for finalizing the parsing on the main | 47 // Parser needs to stay alive for finalizing the parsing on the main |
51 // thread. | 48 // thread. |
52 source_->parser.reset(new Parser(source_->info.get())); | 49 source_->parser.reset(new Parser(source_->info.get())); |
53 source_->parser->DeserializeScopeChain(source_->info.get(), | 50 source_->parser->DeserializeScopeChain(source_->info.get(), |
54 MaybeHandle<ScopeInfo>()); | 51 MaybeHandle<ScopeInfo>()); |
55 } | 52 } |
56 | 53 |
57 | 54 |
58 void BackgroundParsingTask::Run() { | 55 void BackgroundParsingTask::Run() { |
59 DisallowHeapAllocation no_allocation; | 56 DisallowHeapAllocation no_allocation; |
(...skipping 17 matching lines...) Expand all Loading... |
77 script_data_->data(), script_data_->length(), | 74 script_data_->data(), script_data_->length(), |
78 ScriptCompiler::CachedData::BufferOwned)); | 75 ScriptCompiler::CachedData::BufferOwned)); |
79 script_data_->ReleaseDataOwnership(); | 76 script_data_->ReleaseDataOwnership(); |
80 delete script_data_; | 77 delete script_data_; |
81 script_data_ = nullptr; | 78 script_data_ = nullptr; |
82 } | 79 } |
83 source_->info->set_isolate(isolate); | 80 source_->info->set_isolate(isolate); |
84 } | 81 } |
85 } // namespace internal | 82 } // namespace internal |
86 } // namespace v8 | 83 } // namespace v8 |
OLD | NEW |