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

Unified Diff: runtime/vm/debugger_x64.cc

Issue 339183010: Specialize breakpoint stubs by set of live registers of the stubs they are intercepting. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/debugger_x64.cc
diff --git a/runtime/vm/debugger_x64.cc b/runtime/vm/debugger_x64.cc
index 171a0b39d00112d25404a152e6261b9b731e6d7a..54565f156940374c5ec7c39d088d0917b2e92954 100644
--- a/runtime/vm/debugger_x64.cc
+++ b/runtime/vm/debugger_x64.cc
@@ -55,15 +55,33 @@ void CodeBreakpoint::PatchCode() {
WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
switch (breakpoint_kind_) {
case PcDescriptors::kIcCall:
- case PcDescriptors::kUnoptStaticCall:
- case PcDescriptors::kRuntimeCall:
+ case PcDescriptors::kUnoptStaticCall: {
+ int32_t offset = CodePatcher::GetPoolOffsetAt(pc_);
+ ASSERT((offset > 0) && ((offset % 8) == 7));
+ saved_value_ = static_cast<uword>(offset);
+ const uint32_t stub_offset =
+ InstructionPattern::OffsetFromPPIndex(
+ Assembler::kICCallBreakpointCPIndex);
+ CodePatcher::SetPoolOffsetAt(pc_, stub_offset);
Florian Schneider 2014/06/30 09:00:40 Why use the constant pool here? So ARM and MIPS h
rmacnak 2014/07/01 01:08:51 Not sure. Was introduced in https://codereview.chr
rmacnak 2014/07/09 21:23:46 The difference is x64/arm64 reuse constant pool en
+ break;
+ }
case PcDescriptors::kClosureCall: {
int32_t offset = CodePatcher::GetPoolOffsetAt(pc_);
ASSERT((offset > 0) && ((offset % 8) == 7));
saved_value_ = static_cast<uword>(offset);
const uint32_t stub_offset =
InstructionPattern::OffsetFromPPIndex(
- Assembler::kBreakpointRuntimeCPIndex);
+ Assembler::kClosureCallBreakpointCPIndex);
+ CodePatcher::SetPoolOffsetAt(pc_, stub_offset);
+ break;
+ }
+ case PcDescriptors::kRuntimeCall: {
+ int32_t offset = CodePatcher::GetPoolOffsetAt(pc_);
+ ASSERT((offset > 0) && ((offset % 8) == 7));
+ saved_value_ = static_cast<uword>(offset);
+ const uint32_t stub_offset =
+ InstructionPattern::OffsetFromPPIndex(
+ Assembler::kRuntimeCallBreakpointCPIndex);
CodePatcher::SetPoolOffsetAt(pc_, stub_offset);
break;
}

Powered by Google App Engine
This is Rietveld 408576698