OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/debug/debug.h" | 5 #include "src/debug/debug.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1324 "prepare for break points"); | 1324 "prepare for break points"); |
1325 | 1325 |
1326 bool is_interpreted = shared->HasBytecodeArray(); | 1326 bool is_interpreted = shared->HasBytecodeArray(); |
1327 | 1327 |
1328 { | 1328 { |
1329 // TODO(yangguo): with bytecode, we still walk the heap to find all | 1329 // TODO(yangguo): with bytecode, we still walk the heap to find all |
1330 // optimized code for the function to deoptimize. We can probably be | 1330 // optimized code for the function to deoptimize. We can probably be |
1331 // smarter here and avoid the heap walk. | 1331 // smarter here and avoid the heap walk. |
1332 HeapIterator iterator(isolate_->heap()); | 1332 HeapIterator iterator(isolate_->heap()); |
1333 HeapObject* obj; | 1333 HeapObject* obj; |
1334 bool include_generators = !is_interpreted && shared->is_generator(); | 1334 bool include_generators = !is_interpreted && shared->is_resumable(); |
caitp (gmail)
2016/05/20 13:35:56
I imagine this fixes what could have been broken d
Dan Ehrenberg
2016/05/20 14:59:19
Seems like this will come up if you add a breakpoi
| |
1335 | 1335 |
1336 while ((obj = iterator.next())) { | 1336 while ((obj = iterator.next())) { |
1337 if (obj->IsJSFunction()) { | 1337 if (obj->IsJSFunction()) { |
1338 JSFunction* function = JSFunction::cast(obj); | 1338 JSFunction* function = JSFunction::cast(obj); |
1339 if (!function->Inlines(*shared)) continue; | 1339 if (!function->Inlines(*shared)) continue; |
1340 if (function->code()->kind() == Code::OPTIMIZED_FUNCTION) { | 1340 if (function->code()->kind() == Code::OPTIMIZED_FUNCTION) { |
1341 Deoptimizer::DeoptimizeFunction(function); | 1341 Deoptimizer::DeoptimizeFunction(function); |
1342 } | 1342 } |
1343 if (is_interpreted) continue; | 1343 if (is_interpreted) continue; |
1344 if (function->shared() == *shared) functions.Add(handle(function)); | 1344 if (function->shared() == *shared) functions.Add(handle(function)); |
1345 } else if (include_generators && obj->IsJSGeneratorObject()) { | 1345 } else if (include_generators && obj->IsJSGeneratorObject()) { |
1346 // This case handles async functions as well, as they use generator | |
1347 // objects for in-progress async function execution. | |
1346 JSGeneratorObject* generator_obj = JSGeneratorObject::cast(obj); | 1348 JSGeneratorObject* generator_obj = JSGeneratorObject::cast(obj); |
1347 if (!generator_obj->is_suspended()) continue; | 1349 if (!generator_obj->is_suspended()) continue; |
1348 JSFunction* function = generator_obj->function(); | 1350 JSFunction* function = generator_obj->function(); |
1349 if (!function->Inlines(*shared)) continue; | 1351 if (!function->Inlines(*shared)) continue; |
1350 int pc_offset = generator_obj->continuation(); | 1352 int pc_offset = generator_obj->continuation(); |
1351 int index = | 1353 int index = |
1352 ComputeContinuationIndexFromPcOffset(function->code(), pc_offset); | 1354 ComputeContinuationIndexFromPcOffset(function->code(), pc_offset); |
1353 generator_obj->set_continuation(index); | 1355 generator_obj->set_continuation(index); |
1354 suspended_generators.Add(handle(generator_obj)); | 1356 suspended_generators.Add(handle(generator_obj)); |
1355 } | 1357 } |
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2586 } | 2588 } |
2587 | 2589 |
2588 | 2590 |
2589 void LockingCommandMessageQueue::Clear() { | 2591 void LockingCommandMessageQueue::Clear() { |
2590 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2592 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
2591 queue_.Clear(); | 2593 queue_.Clear(); |
2592 } | 2594 } |
2593 | 2595 |
2594 } // namespace internal | 2596 } // namespace internal |
2595 } // namespace v8 | 2597 } // namespace v8 |
OLD | NEW |