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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1243 // Flush all optimized code maps. Note that the below heap iteration does not | 1243 // Flush all optimized code maps. Note that the below heap iteration does not |
1244 // cover this, because the given function might have been inlined into code | 1244 // cover this, because the given function might have been inlined into code |
1245 // for which no JSFunction exists. | 1245 // for which no JSFunction exists. |
1246 { | 1246 { |
1247 SharedFunctionInfo::Iterator iterator(isolate_); | 1247 SharedFunctionInfo::Iterator iterator(isolate_); |
1248 while (SharedFunctionInfo* shared = iterator.Next()) { | 1248 while (SharedFunctionInfo* shared = iterator.Next()) { |
1249 shared->ClearCodeFromOptimizedCodeMap(); | 1249 shared->ClearCodeFromOptimizedCodeMap(); |
1250 } | 1250 } |
1251 } | 1251 } |
1252 | 1252 |
| 1253 // The native context also has a list of OSR'd optimized code. Clear it. |
| 1254 isolate_->ClearOSROptimizedCode(); |
| 1255 |
1253 // Make sure we abort incremental marking. | 1256 // Make sure we abort incremental marking. |
1254 isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask, | 1257 isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask, |
1255 GarbageCollectionReason::kDebugger); | 1258 GarbageCollectionReason::kDebugger); |
1256 | 1259 |
1257 DCHECK(shared->is_compiled()); | 1260 DCHECK(shared->is_compiled()); |
1258 bool baseline_exists = shared->HasBaselineCode(); | 1261 bool baseline_exists = shared->HasBaselineCode(); |
1259 | 1262 |
1260 { | 1263 { |
1261 // TODO(yangguo): with bytecode, we still walk the heap to find all | 1264 // TODO(yangguo): with bytecode, we still walk the heap to find all |
1262 // optimized code for the function to deoptimize. We can probably be | 1265 // optimized code for the function to deoptimize. We can probably be |
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2498 logger_->DebugEvent("Put", message.text()); | 2501 logger_->DebugEvent("Put", message.text()); |
2499 } | 2502 } |
2500 | 2503 |
2501 void LockingCommandMessageQueue::Clear() { | 2504 void LockingCommandMessageQueue::Clear() { |
2502 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2505 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
2503 queue_.Clear(); | 2506 queue_.Clear(); |
2504 } | 2507 } |
2505 | 2508 |
2506 } // namespace internal | 2509 } // namespace internal |
2507 } // namespace v8 | 2510 } // namespace v8 |
OLD | NEW |