Revision: 13352
Author:   [email protected]
Date:     Thu Jan 10 06:15:12 2013
Log: Combine DEBUG_BREAK and DEBUG_PREPARE_STEP_IN into one IC stub kind DEBUG_STUB, encoding DEBUG_BREAK and DEBUG_PREPARE_STEP_IN as extra ic state.

Review URL: https://chromiumcodereview.appspot.com/11821049
http://code.google.com/p/v8/source/detail?r=13352

Modified:
 /branches/bleeding_edge/src/builtins.h
 /branches/bleeding_edge/src/debug.cc
 /branches/bleeding_edge/src/ic.cc
 /branches/bleeding_edge/src/liveedit.cc
 /branches/bleeding_edge/src/objects-inl.h
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/objects.h
 /branches/bleeding_edge/src/stub-cache.cc
 /branches/bleeding_edge/src/v8globals.h

=======================================
--- /branches/bleeding_edge/src/builtins.h      Mon Jan  7 02:06:11 2013
+++ /branches/bleeding_edge/src/builtins.h      Thu Jan 10 06:15:12 2013
@@ -221,31 +221,31 @@

 #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
=======================================
--- /branches/bleeding_edge/src/debug.cc        Mon Dec 17 07:56:16 2012
+++ /branches/bleeding_edge/src/debug.cc        Thu Jan 10 06:15:12 2013
@@ -1587,7 +1587,7 @@
 // object.
 bool Debug::IsDebugBreak(Address addr) {
   Code* code = Code::GetCodeFromTargetAddress(addr);
-  return code->ic_state() == DEBUG_BREAK;
+  return code->is_debug_break();
 }


=======================================
--- /branches/bleeding_edge/src/ic.cc   Tue Jan  8 04:01:51 2013
+++ /branches/bleeding_edge/src/ic.cc   Thu Jan 10 06:15:12 2013
@@ -52,8 +52,7 @@
     // 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 @@
   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 @@
       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 @@
       // 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 @@
       }
       break;
     case MEGAMORPHIC:
-    case DEBUG_BREAK:
-    case DEBUG_PREPARE_STEP_IN:
+    case DEBUG_STUB:
       break;
     case MONOMORPHIC_PROTOTYPE_FAILURE:
       UNREACHABLE();
@@ -1615,8 +1611,7 @@
       // 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 @@
       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 @@
       }
       break;
     case MEGAMORPHIC:
-    case DEBUG_BREAK:
-    case DEBUG_PREPARE_STEP_IN:
+    case DEBUG_STUB:
       break;
     case MONOMORPHIC_PROTOTYPE_FAILURE:
       UNREACHABLE();
=======================================
--- /branches/bleeding_edge/src/liveedit.cc     Mon Dec 17 07:56:16 2012
+++ /branches/bleeding_edge/src/liveedit.cc     Thu Jan 10 06:15:12 2013
@@ -1663,7 +1663,7 @@
   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;
=======================================
--- /branches/bleeding_edge/src/objects-inl.h   Wed Jan  9 07:47:53 2013
+++ /branches/bleeding_edge/src/objects-inl.h   Thu Jan 10 06:15:12 2013
@@ -3418,14 +3418,13 @@
   // 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());
 }

@@ -3674,6 +3673,11 @@
   Kind kind = this->kind();
   return kind >= FIRST_IC_KIND && kind <= LAST_IC_KIND;
 }
+
+
+bool Code::is_debug_break() {
+  return ic_state() == DEBUG_STUB && extra_ic_state() == DEBUG_BREAK;
+}


 Code::Flags Code::ComputeFlags(Kind kind,
=======================================
--- /branches/bleeding_edge/src/objects.cc      Wed Jan  9 07:47:53 2013
+++ /branches/bleeding_edge/src/objects.cc      Thu Jan 10 06:15:12 2013
@@ -9036,8 +9036,7 @@
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;
=======================================
--- /branches/bleeding_edge/src/objects.h       Wed Jan  9 07:47:53 2013
+++ /branches/bleeding_edge/src/objects.h       Thu Jan 10 06:15:12 2013
@@ -178,6 +178,12 @@
 };


+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 @@

   // 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; }
=======================================
--- /branches/bleeding_edge/src/stub-cache.cc   Tue Dec  4 05:45:48 2012
+++ /branches/bleeding_edge/src/stub-cache.cc   Thu Jan 10 06:15:12 2013
@@ -909,7 +909,7 @@
   // 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<UnseededNumberDictionary> cache =
       isolate_->factory()->non_monomorphic_cache();
@@ -928,7 +928,7 @@
   // 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<UnseededNumberDictionary> cache =
       isolate_->factory()->non_monomorphic_cache();
=======================================
--- /branches/bleeding_edge/src/v8globals.h     Mon Jan  7 07:36:26 2013
+++ /branches/bleeding_edge/src/v8globals.h     Thu Jan 10 06:15:12 2013
@@ -263,9 +263,8 @@
   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
 };


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to