Revision: 16269
Author:   [email protected]
Date:     Thu Aug 22 12:16:00 2013 UTC
Log: Never clear debug-stub call ICs. Make a clear distinction between is_debug_stub
used everywhere but the debugger, and IsDebugBreak, used by the debugger.

[email protected]

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

Added:
 /branches/bleeding_edge/test/mjsunit/regress/debug-prepare-step-in.js
Modified:
 /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.h
 /branches/bleeding_edge/src/runtime.cc
 /branches/bleeding_edge/src/runtime.h

=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/regress/debug-prepare-step-in.js Thu Aug 22 12:16:00 2013 UTC
@@ -0,0 +1,54 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+//       notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+//       copyright notice, this list of conditions and the following
+//       disclaimer in the documentation and/or other materials provided
+//       with the distribution.
+//     * Neither the name of Google Inc. nor the names of its
+//       contributors may be used to endorse or promote products derived
+//       from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug --allow-natives-syntax --expose-gc
+// Get the Debug object exposed from the debug context global object.
+Debug = debug.Debug
+
+function breakListener(event, exec_state, event_data, data) {
+  exec_state.prepareStep(Debug.StepAction.StepIn, 1);
+}
+
+Debug.setListener(breakListener);
+
+var o = {x:function() { return 10; }};
+
+function f(o) {
+  var m = "x";
+  o[m]();
+}
+
+Debug.setBreakPoint(f, 2, 0);
+
+f(o);
+
+%NotifyContextDisposed();
+function g() {
+  gc();
+}
+
+g();
=======================================
--- /branches/bleeding_edge/src/debug.cc        Wed Aug  7 12:27:22 2013 UTC
+++ /branches/bleeding_edge/src/debug.cc        Thu Aug 22 12:16:00 2013 UTC
@@ -1627,7 +1627,7 @@
 // object.
 bool Debug::IsDebugBreak(Address addr) {
   Code* code = Code::GetCodeFromTargetAddress(addr);
-  return code->is_debug_break();
+  return code->is_debug_stub() && code->extra_ic_state() == DEBUG_BREAK;
 }


=======================================
--- /branches/bleeding_edge/src/ic.cc   Mon Aug 19 22:12:46 2013 UTC
+++ /branches/bleeding_edge/src/ic.cc   Thu Aug 22 12:16:00 2013 UTC
@@ -379,7 +379,7 @@
   Code* target = GetTargetAtAddress(address);

// Don't clear debug break inline cache as it will remove the break point.
-  if (target->is_debug_break()) return;
+  if (target->is_debug_stub()) return;

   switch (target->kind()) {
     case Code::LOAD_IC: return LoadIC::Clear(address, target);
=======================================
--- /branches/bleeding_edge/src/liveedit.cc     Wed Aug  7 09:33:09 2013 UTC
+++ /branches/bleeding_edge/src/liveedit.cc     Thu Aug 22 12:16:00 2013 UTC
@@ -1691,7 +1691,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->is_debug_break()) {
+      pre_top_frame_code->is_debug_stub()) {
     // 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   Mon Aug 19 12:32:50 2013 UTC
+++ /branches/bleeding_edge/src/objects-inl.h   Thu Aug 22 12:16:00 2013 UTC
@@ -4084,8 +4084,8 @@
 }


-bool Code::is_debug_break() {
-  return ic_state() == DEBUG_STUB && extra_ic_state() == DEBUG_BREAK;
+bool Code::is_debug_stub() {
+  return ic_state() == DEBUG_STUB;
 }


=======================================
--- /branches/bleeding_edge/src/objects.h       Tue Aug 20 10:52:23 2013 UTC
+++ /branches/bleeding_edge/src/objects.h       Thu Aug 22 12:16:00 2013 UTC
@@ -4911,7 +4911,7 @@

   // Testers for IC stub kinds.
   inline bool is_inline_cache_stub();
-  inline bool is_debug_break();
+  inline bool is_debug_stub();
   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/runtime.cc      Tue Aug 20 11:14:56 2013 UTC
+++ /branches/bleeding_edge/src/runtime.cc      Thu Aug 22 12:16:00 2013 UTC
@@ -14151,6 +14151,14 @@
   FlattenString(str);
   return isolate->heap()->undefined_value();
 }
+
+
+RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyContextDisposed) {
+  HandleScope scope(isolate);
+  ASSERT(args.length() == 0);
+  isolate->heap()->NotifyContextDisposed();
+  return isolate->heap()->undefined_value();
+}


 RUNTIME_FUNCTION(MaybeObject*, Runtime_MigrateInstance) {
=======================================
--- /branches/bleeding_edge/src/runtime.h       Tue Aug 20 08:46:36 2013 UTC
+++ /branches/bleeding_edge/src/runtime.h       Thu Aug 22 12:16:00 2013 UTC
@@ -111,6 +111,7 @@
   F(DebugPrepareStepInIfStepping, 1, 1) \
   F(FlattenString, 1, 1) \
   F(MigrateInstance, 1, 1) \
+  F(NotifyContextDisposed, 0, 1) \
   \
   /* Array join support */ \
   F(PushIfAbsent, 2, 1) \

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to