OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "src/background-parsing-task.h" |
| 6 |
| 7 #include "src/parser.h" |
| 8 |
| 9 namespace v8 { |
| 10 namespace internal { |
| 11 |
| 12 static const int kBackgroundParserThreadStackSize = 64 * KB; |
| 13 |
| 14 void BackgroundParsingTask::Run() { |
| 15 uintptr_t limit = |
| 16 reinterpret_cast<uintptr_t>(&limit) - kBackgroundParserThreadStackSize; |
| 17 Parser parser(source_->info, limit, hash_seed_); |
| 18 parser.set_allow_lazy(allow_lazy_); |
| 19 parser.ParseOnBackground(); |
| 20 |
| 21 if (script_data_ != NULL) { |
| 22 source_->cached_data = new ScriptCompiler::CachedData( |
| 23 script_data_->data(), script_data_->length(), |
| 24 ScriptCompiler::CachedData::BufferOwned); |
| 25 script_data_->ReleaseDataOwnership(); |
| 26 delete script_data_; |
| 27 script_data_ = NULL; |
| 28 } |
| 29 } |
| 30 } |
| 31 } // namespace v8::internal |
OLD | NEW |