| 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 1109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 bool Debug::PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared) { | 1120 bool Debug::PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared) { |
| 1121 DCHECK(shared->is_compiled()); | 1121 DCHECK(shared->is_compiled()); |
| 1122 | 1122 |
| 1123 if (isolate_->concurrent_recompilation_enabled()) { | 1123 if (isolate_->concurrent_recompilation_enabled()) { |
| 1124 isolate_->optimizing_compile_dispatcher()->Flush(); | 1124 isolate_->optimizing_compile_dispatcher()->Flush(); |
| 1125 } | 1125 } |
| 1126 | 1126 |
| 1127 List<Handle<JSFunction> > functions; | 1127 List<Handle<JSFunction> > functions; |
| 1128 List<Handle<JSGeneratorObject> > suspended_generators; | 1128 List<Handle<JSGeneratorObject> > suspended_generators; |
| 1129 | 1129 |
| 1130 // Flush all optimized code maps. Note that the below heap iteration does not | 1130 // Flush all optimized code. Note that the below heap iteration does not |
| 1131 // cover this, because the given function might have been inlined into code | 1131 // cover this, because the given function might have been inlined into code |
| 1132 // for which no JSFunction exists. | 1132 // for which no JSFunction exists. |
| 1133 { | 1133 { |
| 1134 SharedFunctionInfo::Iterator iterator(isolate_); | 1134 SharedFunctionInfo::Iterator iterator(isolate_); |
| 1135 while (SharedFunctionInfo* shared = iterator.Next()) { | 1135 while (SharedFunctionInfo* shared = iterator.Next()) { |
| 1136 if (!shared->OptimizedCodeMapIsCleared()) { | 1136 shared->ClearCodeFromOptimizedCodeMap(); |
| 1137 shared->ClearOptimizedCodeMap(); | |
| 1138 } | |
| 1139 } | 1137 } |
| 1140 } | 1138 } |
| 1141 | 1139 |
| 1142 // Make sure we abort incremental marking. | 1140 // Make sure we abort incremental marking. |
| 1143 isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask, | 1141 isolate_->heap()->CollectAllGarbage(Heap::kMakeHeapIterableMask, |
| 1144 "prepare for break points"); | 1142 "prepare for break points"); |
| 1145 | 1143 |
| 1146 { | 1144 { |
| 1147 HeapIterator iterator(isolate_->heap()); | 1145 HeapIterator iterator(isolate_->heap()); |
| 1148 HeapObject* obj; | 1146 HeapObject* obj; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1170 } | 1168 } |
| 1171 } | 1169 } |
| 1172 | 1170 |
| 1173 if (!shared->HasDebugCode()) { | 1171 if (!shared->HasDebugCode()) { |
| 1174 DCHECK(functions.length() > 0); | 1172 DCHECK(functions.length() > 0); |
| 1175 if (!Compiler::CompileDebugCode(functions.first())) return false; | 1173 if (!Compiler::CompileDebugCode(functions.first())) return false; |
| 1176 } | 1174 } |
| 1177 | 1175 |
| 1178 for (Handle<JSFunction> const function : functions) { | 1176 for (Handle<JSFunction> const function : functions) { |
| 1179 function->ReplaceCode(shared->code()); | 1177 function->ReplaceCode(shared->code()); |
| 1178 JSFunction::EnsureLiterals(function); |
| 1180 } | 1179 } |
| 1181 | 1180 |
| 1182 for (Handle<JSGeneratorObject> const generator_obj : suspended_generators) { | 1181 for (Handle<JSGeneratorObject> const generator_obj : suspended_generators) { |
| 1183 int index = generator_obj->continuation(); | 1182 int index = generator_obj->continuation(); |
| 1184 int pc_offset = ComputePcOffsetFromContinuationIndex(shared->code(), index); | 1183 int pc_offset = ComputePcOffsetFromContinuationIndex(shared->code(), index); |
| 1185 generator_obj->set_continuation(pc_offset); | 1184 generator_obj->set_continuation(pc_offset); |
| 1186 } | 1185 } |
| 1187 | 1186 |
| 1188 // Update PCs on the stack to point to recompiled code. | 1187 // Update PCs on the stack to point to recompiled code. |
| 1189 RedirectActiveFunctions redirect_visitor(*shared); | 1188 RedirectActiveFunctions redirect_visitor(*shared); |
| (...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2427 } | 2426 } |
| 2428 | 2427 |
| 2429 | 2428 |
| 2430 void LockingCommandMessageQueue::Clear() { | 2429 void LockingCommandMessageQueue::Clear() { |
| 2431 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2430 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
| 2432 queue_.Clear(); | 2431 queue_.Clear(); |
| 2433 } | 2432 } |
| 2434 | 2433 |
| 2435 } // namespace internal | 2434 } // namespace internal |
| 2436 } // namespace v8 | 2435 } // namespace v8 |
| OLD | NEW |