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 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 | 9 |
10 BackgroundParsingTask::BackgroundParsingTask( | 10 BackgroundParsingTask::BackgroundParsingTask( |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 | 47 |
48 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit) - stack_size_ * KB; | 48 uintptr_t limit = reinterpret_cast<uintptr_t>(&limit) - stack_size_ * KB; |
49 Parser::ParseInfo parse_info = {limit, source_->hash_seed, | 49 Parser::ParseInfo parse_info = {limit, source_->hash_seed, |
50 &source_->unicode_cache}; | 50 &source_->unicode_cache}; |
51 | 51 |
52 // Parser needs to stay alive for finalizing the parsing on the main | 52 // Parser needs to stay alive for finalizing the parsing on the main |
53 // thread. Passing &parse_info is OK because Parser doesn't store it. | 53 // thread. Passing &parse_info is OK because Parser doesn't store it. |
54 source_->parser.Reset(new Parser(source_->info.get(), &parse_info)); | 54 source_->parser.Reset(new Parser(source_->info.get(), &parse_info)); |
55 source_->parser->set_allow_lazy(source_->allow_lazy); | 55 source_->parser->set_allow_lazy(source_->allow_lazy); |
56 source_->parser->ParseOnBackground(); | 56 source_->parser->ParseOnBackground(source_->info.get()); |
57 | 57 |
58 if (script_data != NULL) { | 58 if (script_data != NULL) { |
59 source_->cached_data.Reset(new ScriptCompiler::CachedData( | 59 source_->cached_data.Reset(new ScriptCompiler::CachedData( |
60 script_data->data(), script_data->length(), | 60 script_data->data(), script_data->length(), |
61 ScriptCompiler::CachedData::BufferOwned)); | 61 ScriptCompiler::CachedData::BufferOwned)); |
62 script_data->ReleaseDataOwnership(); | 62 script_data->ReleaseDataOwnership(); |
63 delete script_data; | 63 delete script_data; |
64 } | 64 } |
65 } | 65 } |
66 } | 66 } |
67 } // namespace v8::internal | 67 } // namespace v8::internal |
OLD | NEW |