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 #include "src/debug/debug.h" | 6 #include "src/debug/debug.h" |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // background thread. | 54 // background thread. |
55 uintptr_t stack_limit = | 55 uintptr_t stack_limit = |
56 reinterpret_cast<uintptr_t>(&stack_limit) - stack_size_ * KB; | 56 reinterpret_cast<uintptr_t>(&stack_limit) - stack_size_ * KB; |
57 source_->parser->set_stack_limit(stack_limit); | 57 source_->parser->set_stack_limit(stack_limit); |
58 | 58 |
59 // Nullify the Isolate temporarily so that the background parser doesn't | 59 // Nullify the Isolate temporarily so that the background parser doesn't |
60 // accidentally use it. | 60 // accidentally use it. |
61 Isolate* isolate = source_->info->isolate(); | 61 Isolate* isolate = source_->info->isolate(); |
62 source_->info->set_isolate(nullptr); | 62 source_->info->set_isolate(nullptr); |
63 | 63 |
| 64 source_->parser->DeserializeScopeChain( |
| 65 source_->info.get(), Handle<Context>::null(), |
| 66 Scope::DeserializationMode::kDeserializeOffHeap); |
64 source_->parser->ParseOnBackground(source_->info.get()); | 67 source_->parser->ParseOnBackground(source_->info.get()); |
65 | 68 |
66 if (script_data_ != nullptr) { | 69 if (script_data_ != nullptr) { |
67 source_->cached_data.reset(new ScriptCompiler::CachedData( | 70 source_->cached_data.reset(new ScriptCompiler::CachedData( |
68 script_data_->data(), script_data_->length(), | 71 script_data_->data(), script_data_->length(), |
69 ScriptCompiler::CachedData::BufferOwned)); | 72 ScriptCompiler::CachedData::BufferOwned)); |
70 script_data_->ReleaseDataOwnership(); | 73 script_data_->ReleaseDataOwnership(); |
71 delete script_data_; | 74 delete script_data_; |
72 script_data_ = nullptr; | 75 script_data_ = nullptr; |
73 } | 76 } |
74 source_->info->set_isolate(isolate); | 77 source_->info->set_isolate(isolate); |
75 } | 78 } |
76 } // namespace internal | 79 } // namespace internal |
77 } // namespace v8 | 80 } // namespace v8 |
OLD | NEW |