summaryrefslogtreecommitdiffstats
path: root/src/debug.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/debug.cc')
-rw-r--r--src/debug.cc30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/debug.cc b/src/debug.cc
index 36913337..093f38ee 100644
--- a/src/debug.cc
+++ b/src/debug.cc
@@ -477,6 +477,21 @@ void BreakLocationIterator::SetDebugBreakAtIC() {
// calling convention used by the call site.
Handle<Code> dbgbrk_code(Debug::FindDebugBreak(code, mode));
rinfo()->set_target_address(dbgbrk_code->entry());
+
+ // For stubs that refer back to an inlined version clear the cached map for
+ // the inlined case to always go through the IC. As long as the break point
+ // is set the patching performed by the runtime system will take place in
+ // the code copy and will therefore have no effect on the running code
+ // keeping it from using the inlined code.
+ if (code->is_keyed_load_stub()) {
+ KeyedLoadIC::ClearInlinedVersion(pc());
+ } else if (code->is_keyed_store_stub()) {
+ KeyedStoreIC::ClearInlinedVersion(pc());
+ } else if (code->is_load_stub()) {
+ LoadIC::ClearInlinedVersion(pc());
+ } else if (code->is_store_stub()) {
+ StoreIC::ClearInlinedVersion(pc());
+ }
}
}
@@ -484,6 +499,20 @@ void BreakLocationIterator::SetDebugBreakAtIC() {
void BreakLocationIterator::ClearDebugBreakAtIC() {
// Patch the code to the original invoke.
rinfo()->set_target_address(original_rinfo()->target_address());
+
+ RelocInfo::Mode mode = rmode();
+ if (RelocInfo::IsCodeTarget(mode)) {
+ AssertNoAllocation nogc;
+ Address target = original_rinfo()->target_address();
+ Code* code = Code::GetCodeFromTargetAddress(target);
+
+ // Restore the inlined version of keyed stores to get back to the
+ // fast case. We need to patch back the keyed store because no
+ // patching happens when running normally. For keyed loads, the
+ // map check will get patched back when running normally after ICs
+ // have been cleared at GC.
+ if (code->is_keyed_store_stub()) KeyedStoreIC::RestoreInlinedVersion(pc());
+ }
}
@@ -814,7 +843,6 @@ bool Debug::Load() {
HandleScope scope(isolate_);
Handle<Context> context =
isolate_->bootstrapper()->CreateEnvironment(
- isolate_,
Handle<Object>::null(),
v8::Handle<ObjectTemplate>(),
NULL);