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 | |
1256 // Make sure we abort incremental marking. | 1253 // Make sure we abort incremental marking. |
1257 isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask, | 1254 isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask, |
1258 GarbageCollectionReason::kDebugger); | 1255 GarbageCollectionReason::kDebugger); |
1259 | 1256 |
1260 DCHECK(shared->is_compiled()); | 1257 DCHECK(shared->is_compiled()); |
1261 bool baseline_exists = shared->HasBaselineCode(); | 1258 bool baseline_exists = shared->HasBaselineCode(); |
1262 | 1259 |
1263 { | 1260 { |
1264 // TODO(yangguo): with bytecode, we still walk the heap to find all | 1261 // TODO(yangguo): with bytecode, we still walk the heap to find all |
1265 // optimized code for the function to deoptimize. We can probably be | 1262 // optimized code for the function to deoptimize. We can probably be |
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2501 logger_->DebugEvent("Put", message.text()); | 2498 logger_->DebugEvent("Put", message.text()); |
2502 } | 2499 } |
2503 | 2500 |
2504 void LockingCommandMessageQueue::Clear() { | 2501 void LockingCommandMessageQueue::Clear() { |
2505 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2502 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
2506 queue_.Clear(); | 2503 queue_.Clear(); |
2507 } | 2504 } |
2508 | 2505 |
2509 } // namespace internal | 2506 } // namespace internal |
2510 } // namespace v8 | 2507 } // namespace v8 |
OLD | NEW |