diff --git a/src/builtins.h b/src/builtins.h index 4b50b43bb3..3ca397e63a 100644 --- a/src/builtins.h +++ b/src/builtins.h @@ -221,31 +221,31 @@ enum BuiltinExtraArguments { #ifdef ENABLE_DEBUGGER_SUPPORT // Define list of builtins used by the debugger implemented in assembly. -#define BUILTIN_LIST_DEBUG_A(V) \ - V(Return_DebugBreak, BUILTIN, DEBUG_BREAK, \ - Code::kNoExtraICState) \ - V(CallFunctionStub_DebugBreak, BUILTIN, DEBUG_BREAK, \ - Code::kNoExtraICState) \ - V(CallFunctionStub_Recording_DebugBreak, BUILTIN, DEBUG_BREAK, \ - Code::kNoExtraICState) \ - V(CallConstructStub_DebugBreak, BUILTIN, DEBUG_BREAK, \ - Code::kNoExtraICState) \ - V(CallConstructStub_Recording_DebugBreak, BUILTIN, DEBUG_BREAK, \ - Code::kNoExtraICState) \ - V(LoadIC_DebugBreak, LOAD_IC, DEBUG_BREAK, \ - Code::kNoExtraICState) \ - V(KeyedLoadIC_DebugBreak, KEYED_LOAD_IC, DEBUG_BREAK, \ - Code::kNoExtraICState) \ - V(StoreIC_DebugBreak, STORE_IC, DEBUG_BREAK, \ - Code::kNoExtraICState) \ - V(KeyedStoreIC_DebugBreak, KEYED_STORE_IC, DEBUG_BREAK, \ - Code::kNoExtraICState) \ - V(Slot_DebugBreak, BUILTIN, DEBUG_BREAK, \ - Code::kNoExtraICState) \ - V(PlainReturn_LiveEdit, BUILTIN, DEBUG_BREAK, \ - Code::kNoExtraICState) \ - V(FrameDropper_LiveEdit, BUILTIN, DEBUG_BREAK, \ - Code::kNoExtraICState) +#define BUILTIN_LIST_DEBUG_A(V) \ + V(Return_DebugBreak, BUILTIN, DEBUG_STUB, \ + DEBUG_BREAK) \ + V(CallFunctionStub_DebugBreak, BUILTIN, DEBUG_STUB, \ + DEBUG_BREAK) \ + V(CallFunctionStub_Recording_DebugBreak, BUILTIN, DEBUG_STUB, \ + DEBUG_BREAK) \ + V(CallConstructStub_DebugBreak, BUILTIN, DEBUG_STUB, \ + DEBUG_BREAK) \ + V(CallConstructStub_Recording_DebugBreak, BUILTIN, DEBUG_STUB, \ + DEBUG_BREAK) \ + V(LoadIC_DebugBreak, LOAD_IC, DEBUG_STUB, \ + DEBUG_BREAK) \ + V(KeyedLoadIC_DebugBreak, KEYED_LOAD_IC, DEBUG_STUB, \ + DEBUG_BREAK) \ + V(StoreIC_DebugBreak, STORE_IC, DEBUG_STUB, \ + DEBUG_BREAK) \ + V(KeyedStoreIC_DebugBreak, KEYED_STORE_IC, DEBUG_STUB, \ + DEBUG_BREAK) \ + V(Slot_DebugBreak, BUILTIN, DEBUG_STUB, \ + DEBUG_BREAK) \ + V(PlainReturn_LiveEdit, BUILTIN, DEBUG_STUB, \ + DEBUG_BREAK) \ + V(FrameDropper_LiveEdit, BUILTIN, DEBUG_STUB, \ + DEBUG_BREAK) #else #define BUILTIN_LIST_DEBUG_A(V) #endif diff --git a/src/debug.cc b/src/debug.cc index 17897dd7f0..1524349210 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1587,7 +1587,7 @@ bool Debug::StepNextContinue(BreakLocationIterator* break_location_iterator, // object. bool Debug::IsDebugBreak(Address addr) { Code* code = Code::GetCodeFromTargetAddress(addr); - return code->ic_state() == DEBUG_BREAK; + return code->is_debug_break(); } diff --git a/src/ic.cc b/src/ic.cc index 0db9aa5620..ba68bebd52 100644 --- a/src/ic.cc +++ b/src/ic.cc @@ -52,8 +52,7 @@ char IC::TransitionMarkFromState(IC::State state) { // We never see the debugger states here, because the state is // computed from the original code - not the patched code. Let // these cases fall through to the unreachable code below. - case DEBUG_BREAK: break; - case DEBUG_PREPARE_STEP_IN: break; + case DEBUG_STUB: break; } UNREACHABLE(); return 0; @@ -347,7 +346,7 @@ void IC::Clear(Address address) { Code* target = GetTargetAtAddress(address); // Don't clear debug break inline cache as it will remove the break point. - if (target->ic_state() == DEBUG_BREAK) return; + if (target->is_debug_break()) return; switch (target->kind()) { case Code::LOAD_IC: return LoadIC::Clear(address, target); @@ -770,8 +769,7 @@ void CallICBase::UpdateCaches(LookupResult* lookup, isolate()->stub_cache()->Set(*name, cache_object->map(), *code); break; } - case DEBUG_BREAK: - case DEBUG_PREPARE_STEP_IN: + case DEBUG_STUB: break; case POLYMORPHIC: UNREACHABLE(); @@ -1066,8 +1064,7 @@ void LoadIC::UpdateCaches(LookupResult* lookup, // GenerateMonomorphicCacheProbe. isolate()->stub_cache()->Set(*name, receiver->map(), *code); break; - case DEBUG_BREAK: - case DEBUG_PREPARE_STEP_IN: + case DEBUG_STUB: break; case POLYMORPHIC: UNREACHABLE(); @@ -1339,8 +1336,7 @@ void KeyedLoadIC::UpdateCaches(LookupResult* lookup, } break; case MEGAMORPHIC: - case DEBUG_BREAK: - case DEBUG_PREPARE_STEP_IN: + case DEBUG_STUB: break; case MONOMORPHIC_PROTOTYPE_FAILURE: UNREACHABLE(); @@ -1615,8 +1611,7 @@ void StoreIC::UpdateCaches(LookupResult* lookup, // Update the stub cache. isolate()->stub_cache()->Set(*name, receiver->map(), *code); break; - case DEBUG_BREAK: - case DEBUG_PREPARE_STEP_IN: + case DEBUG_STUB: break; case POLYMORPHIC: UNREACHABLE(); @@ -1667,8 +1662,7 @@ void KeyedIC::GetReceiverMapsForStub(Handle stub, case UNINITIALIZED: case PREMONOMORPHIC: case MONOMORPHIC_PROTOTYPE_FAILURE: - case DEBUG_BREAK: - case DEBUG_PREPARE_STEP_IN: + case DEBUG_STUB: UNREACHABLE(); break; } @@ -2114,8 +2108,7 @@ void KeyedStoreIC::UpdateCaches(LookupResult* lookup, } break; case MEGAMORPHIC: - case DEBUG_BREAK: - case DEBUG_PREPARE_STEP_IN: + case DEBUG_STUB: break; case MONOMORPHIC_PROTOTYPE_FAILURE: UNREACHABLE(); diff --git a/src/liveedit.cc b/src/liveedit.cc index a981f47b12..2502ae688a 100644 --- a/src/liveedit.cc +++ b/src/liveedit.cc @@ -1663,7 +1663,7 @@ static const char* DropFrames(Vector frames, Code* pre_top_frame_code = pre_top_frame->LookupCode(); bool frame_has_padding; if (pre_top_frame_code->is_inline_cache_stub() && - pre_top_frame_code->ic_state() == DEBUG_BREAK) { + pre_top_frame_code->is_debug_break()) { // OK, we can drop inline cache calls. *mode = Debug::FRAME_DROPPED_IN_IC_CALL; frame_has_padding = Debug::FramePaddingLayout::kIsSupported; diff --git a/src/objects-inl.h b/src/objects-inl.h index 658214a229..f21355ec4b 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -3418,14 +3418,13 @@ InlineCacheState Code::ic_state() { // a call to code object has been replaced with a debug break call. ASSERT(is_inline_cache_stub() || result == UNINITIALIZED || - result == DEBUG_BREAK || - result == DEBUG_PREPARE_STEP_IN); + result == DEBUG_STUB); return result; } Code::ExtraICState Code::extra_ic_state() { - ASSERT(is_inline_cache_stub()); + ASSERT(is_inline_cache_stub() || ic_state() == DEBUG_STUB); return ExtractExtraICStateFromFlags(flags()); } @@ -3676,6 +3675,11 @@ bool Code::is_inline_cache_stub() { } +bool Code::is_debug_break() { + return ic_state() == DEBUG_STUB && extra_ic_state() == DEBUG_BREAK; +} + + Code::Flags Code::ComputeFlags(Kind kind, InlineCacheState ic_state, ExtraICState extra_ic_state, diff --git a/src/objects.cc b/src/objects.cc index 2d8626be72..1d7ceb06d4 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -9036,8 +9036,7 @@ const char* Code::ICState2String(InlineCacheState state) { case MONOMORPHIC_PROTOTYPE_FAILURE: return "MONOMORPHIC_PROTOTYPE_FAILURE"; case POLYMORPHIC: return "POLYMORPHIC"; case MEGAMORPHIC: return "MEGAMORPHIC"; - case DEBUG_BREAK: return "DEBUG_BREAK"; - case DEBUG_PREPARE_STEP_IN: return "DEBUG_PREPARE_STEP_IN"; + case DEBUG_STUB: return "DEBUG_STUB"; } UNREACHABLE(); return NULL; diff --git a/src/objects.h b/src/objects.h index 79f1f1d52b..6b137cdd1c 100644 --- a/src/objects.h +++ b/src/objects.h @@ -178,6 +178,12 @@ enum TransitionFlag { }; +enum DebugExtraICState { + DEBUG_BREAK, + DEBUG_PREPARE_STEP_IN +}; + + // Indicates whether the transition is simple: the target map of the transition // either extends the current map with a new property, or it modifies the // property that was added last to the current map. @@ -4311,6 +4317,7 @@ class Code: public HeapObject { // Testers for IC stub kinds. inline bool is_inline_cache_stub(); + inline bool is_debug_break(); inline bool is_load_stub() { return kind() == LOAD_IC; } inline bool is_keyed_load_stub() { return kind() == KEYED_LOAD_IC; } inline bool is_store_stub() { return kind() == STORE_IC; } diff --git a/src/stub-cache.cc b/src/stub-cache.cc index bfed6bbac7..1f954edfa7 100644 --- a/src/stub-cache.cc +++ b/src/stub-cache.cc @@ -909,7 +909,7 @@ Handle StubCache::ComputeCallDebugBreak(int argc, // Extra IC state is irrelevant for debug break ICs. They jump to // the actual call ic to carry out the work. Code::Flags flags = - Code::ComputeFlags(kind, DEBUG_BREAK, Code::kNoExtraICState, + Code::ComputeFlags(kind, DEBUG_STUB, DEBUG_BREAK, Code::NORMAL, argc); Handle cache = isolate_->factory()->non_monomorphic_cache(); @@ -928,7 +928,7 @@ Handle StubCache::ComputeCallDebugPrepareStepIn(int argc, // Extra IC state is irrelevant for debug break ICs. They jump to // the actual call ic to carry out the work. Code::Flags flags = - Code::ComputeFlags(kind, DEBUG_PREPARE_STEP_IN, Code::kNoExtraICState, + Code::ComputeFlags(kind, DEBUG_STUB, DEBUG_PREPARE_STEP_IN, Code::NORMAL, argc); Handle cache = isolate_->factory()->non_monomorphic_cache(); diff --git a/src/v8globals.h b/src/v8globals.h index 085d67b118..807be30df1 100644 --- a/src/v8globals.h +++ b/src/v8globals.h @@ -263,9 +263,8 @@ enum InlineCacheState { POLYMORPHIC, // Many receiver types have been seen. MEGAMORPHIC, - // Special states for debug break or step in prepare stubs. - DEBUG_BREAK, - DEBUG_PREPARE_STEP_IN + // Special state for debug break or step in prepare stubs. + DEBUG_STUB };