Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: src/debug.cc

Issue 1014373002: Vector ICs: Clear the vector ic slots appropriately during debugging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/debug-stepframe-clearing.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/v8.h" 5 #include "src/v8.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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 314
315 if (IsExit()) { 315 if (IsExit()) {
316 // Restore the frame exit code with a break point. 316 // Restore the frame exit code with a break point.
317 RestoreFromOriginal(Assembler::kJSReturnSequenceLength); 317 RestoreFromOriginal(Assembler::kJSReturnSequenceLength);
318 } else if (IsDebugBreakSlot()) { 318 } else if (IsDebugBreakSlot()) {
319 // Restore the code in the break slot. 319 // Restore the code in the break slot.
320 RestoreFromOriginal(Assembler::kDebugBreakSlotLength); 320 RestoreFromOriginal(Assembler::kDebugBreakSlotLength);
321 } else { 321 } else {
322 // Restore the IC call. 322 // Restore the IC call.
323 rinfo().set_target_address(original_rinfo().target_address()); 323 rinfo().set_target_address(original_rinfo().target_address());
324 // Some ICs store data in the feedback vector. Clear this to ensure we
325 // won't miss future stepping requirements.
326 SharedFunctionInfo* shared = debug_info_->shared();
327 shared->feedback_vector()->ClearICSlots(shared);
324 } 328 }
325 DCHECK(!IsDebugBreak()); 329 DCHECK(!IsDebugBreak());
326 } 330 }
327 331
328 332
329 void BreakLocation::RestoreFromOriginal(int length_in_bytes) { 333 void BreakLocation::RestoreFromOriginal(int length_in_bytes) {
330 memcpy(pc(), original_pc(), length_in_bytes); 334 memcpy(pc(), original_pc(), length_in_bytes);
331 CpuFeatures::FlushICache(pc(), length_in_bytes); 335 CpuFeatures::FlushICache(pc(), length_in_bytes);
332 } 336 }
333 337
(...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after
2111 2115
2112 // There will be at least one break point when we are done. 2116 // There will be at least one break point when we are done.
2113 has_break_points_ = true; 2117 has_break_points_ = true;
2114 2118
2115 // Ensure function is compiled. Return false if this failed. 2119 // Ensure function is compiled. Return false if this failed.
2116 if (!function.is_null() && 2120 if (!function.is_null() &&
2117 !Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) { 2121 !Compiler::EnsureCompiled(function, CLEAR_EXCEPTION)) {
2118 return false; 2122 return false;
2119 } 2123 }
2120 2124
2125 // Make sure IC state is clean.
2126 shared->code()->ClearInlineCaches();
2127 shared->feedback_vector()->ClearICSlots(*shared);
2128
2121 // Create the debug info object. 2129 // Create the debug info object.
2122 Handle<DebugInfo> debug_info = isolate->factory()->NewDebugInfo(shared); 2130 Handle<DebugInfo> debug_info = isolate->factory()->NewDebugInfo(shared);
2123 2131
2124 // Add debug info to the list. 2132 // Add debug info to the list.
2125 DebugInfoListNode* node = new DebugInfoListNode(*debug_info); 2133 DebugInfoListNode* node = new DebugInfoListNode(*debug_info);
2126 node->set_next(debug_info_list_); 2134 node->set_next(debug_info_list_);
2127 debug_info_list_ = node; 2135 debug_info_list_ = node;
2128 2136
2129 return true; 2137 return true;
2130 } 2138 }
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after
3382 logger_->DebugEvent("Put", message.text()); 3390 logger_->DebugEvent("Put", message.text());
3383 } 3391 }
3384 3392
3385 3393
3386 void LockingCommandMessageQueue::Clear() { 3394 void LockingCommandMessageQueue::Clear() {
3387 base::LockGuard<base::Mutex> lock_guard(&mutex_); 3395 base::LockGuard<base::Mutex> lock_guard(&mutex_);
3388 queue_.Clear(); 3396 queue_.Clear();
3389 } 3397 }
3390 3398
3391 } } // namespace v8::internal 3399 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/debug-stepframe-clearing.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698