| 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 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1316 if (!shared->OptimizedCodeMapIsCleared()) { | 1316 if (!shared->OptimizedCodeMapIsCleared()) { |
| 1317 shared->ClearOptimizedCodeMap(); | 1317 shared->ClearOptimizedCodeMap(); |
| 1318 } | 1318 } |
| 1319 } | 1319 } |
| 1320 } | 1320 } |
| 1321 | 1321 |
| 1322 // Make sure we abort incremental marking. | 1322 // Make sure we abort incremental marking. |
| 1323 isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask, | 1323 isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask, |
| 1324 "prepare for break points"); | 1324 "prepare for break points"); |
| 1325 | 1325 |
| 1326 bool is_interpreted = shared->IsInterpreted(); | 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_generator(); |
| 1335 | 1335 |
| 1336 while ((obj = iterator.next())) { | 1336 while ((obj = iterator.next())) { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1525 | 1525 |
| 1526 // Return if we already have the debug info for shared. | 1526 // Return if we already have the debug info for shared. |
| 1527 if (shared->HasDebugInfo()) return true; | 1527 if (shared->HasDebugInfo()) return true; |
| 1528 | 1528 |
| 1529 if (function.is_null()) { | 1529 if (function.is_null()) { |
| 1530 DCHECK(shared->HasDebugCode()); | 1530 DCHECK(shared->HasDebugCode()); |
| 1531 } else if (!Compiler::Compile(function, Compiler::CLEAR_EXCEPTION)) { | 1531 } else if (!Compiler::Compile(function, Compiler::CLEAR_EXCEPTION)) { |
| 1532 return false; | 1532 return false; |
| 1533 } | 1533 } |
| 1534 | 1534 |
| 1535 if (shared->IsInterpreted()) { | 1535 if (shared->HasBytecodeArray()) { |
| 1536 // To prepare bytecode for debugging, we already need to have the debug | 1536 // To prepare bytecode for debugging, we already need to have the debug |
| 1537 // info (containing the debug copy) upfront, but since we do not recompile, | 1537 // info (containing the debug copy) upfront, but since we do not recompile, |
| 1538 // preparing for break points cannot fail. | 1538 // preparing for break points cannot fail. |
| 1539 CreateDebugInfo(shared); | 1539 CreateDebugInfo(shared); |
| 1540 CHECK(PrepareFunctionForBreakPoints(shared)); | 1540 CHECK(PrepareFunctionForBreakPoints(shared)); |
| 1541 } else { | 1541 } else { |
| 1542 if (!PrepareFunctionForBreakPoints(shared)) return false; | 1542 if (!PrepareFunctionForBreakPoints(shared)) return false; |
| 1543 CreateDebugInfo(shared); | 1543 CreateDebugInfo(shared); |
| 1544 } | 1544 } |
| 1545 return true; | 1545 return true; |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2586 } | 2586 } |
| 2587 | 2587 |
| 2588 | 2588 |
| 2589 void LockingCommandMessageQueue::Clear() { | 2589 void LockingCommandMessageQueue::Clear() { |
| 2590 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2590 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
| 2591 queue_.Clear(); | 2591 queue_.Clear(); |
| 2592 } | 2592 } |
| 2593 | 2593 |
| 2594 } // namespace internal | 2594 } // namespace internal |
| 2595 } // namespace v8 | 2595 } // namespace v8 |
| OLD | NEW |