Revision: 16406
Author:   [email protected]
Date:     Wed Aug 28 15:00:30 2013 UTC
Log:      Delete HAbnormalExit. It does more harm than good.

BUG=v8:2843
[email protected]

Review URL: https://codereview.chromium.org/23462007
http://code.google.com/p/v8/source/detail?r=16406

Added:
 /branches/bleeding_edge/test/mjsunit/regress/regress-2843.js
Modified:
 /branches/bleeding_edge/src/arm/lithium-arm.cc
 /branches/bleeding_edge/src/hydrogen-environment-liveness.cc
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /branches/bleeding_edge/src/hydrogen.cc
 /branches/bleeding_edge/src/ia32/lithium-ia32.cc
 /branches/bleeding_edge/src/mips/lithium-mips.cc
 /branches/bleeding_edge/src/x64/lithium-x64.cc

=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-2843.js Wed Aug 28 15:00:30 2013 UTC
@@ -0,0 +1,45 @@
+// 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: --allow-natives-syntax
+
+function bailout() { throw "bailout"; }
+var global;
+
+function foo(x, fun) {
+  var a = x + 1;
+  var b = x + 2;  // Need another Simulate to fold the first one into.
+  global = true;  // Need a side effect to deopt to.
+  fun();
+  return a;
+}
+
+assertThrows("foo(1, bailout)");
+assertThrows("foo(1, bailout)");
+%OptimizeFunctionOnNextCall(foo);
+assertThrows("foo(1, bailout)");
+assertEquals(2, foo(1, function() {}));
=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.cc Wed Aug 28 14:16:57 2013 UTC +++ /branches/bleeding_edge/src/arm/lithium-arm.cc Wed Aug 28 15:00:30 2013 UTC
@@ -1870,13 +1870,6 @@
   UNREACHABLE();
   return NULL;
 }
-
-
-LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
-  // The control instruction marking the end of a block that completed
-  // abruptly (e.g., threw an exception).  There is nothing specific to do.
-  return NULL;
-}


 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
=======================================
--- /branches/bleeding_edge/src/hydrogen-environment-liveness.cc Tue Jul 23 13:35:10 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-environment-liveness.cc Wed Aug 28 15:00:30 2013 UTC
@@ -163,11 +163,7 @@
       live->Clear();
       for (int i = 0; i < enter->return_targets()->length(); ++i) {
         int return_id = enter->return_targets()->at(i)->block_id();
-        // When an AbnormalExit is involved, it can happen that the return
-        // target block doesn't actually exist.
-        if (return_id < live_at_block_start_.length()) {
-          live->Union(*live_at_block_start_[return_id]);
-        }
+        live->Union(*live_at_block_start_[return_id]);
       }
       last_simulate_ = NULL;
       break;
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Wed Aug 28 14:16:57 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Wed Aug 28 15:00:30 2013 UTC
@@ -63,7 +63,6 @@


 #define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V)  \
-  V(AbnormalExit)                              \
   V(AccessArgumentsAt)                         \
   V(Add)                                       \
   V(Allocate)                                  \
@@ -1443,16 +1442,6 @@
 };


-class HAbnormalExit V8_FINAL : public HTemplateControlInstruction<0, 0> {
- public:
- virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
-    return Representation::None();
-  }
-
-  DECLARE_CONCRETE_INSTRUCTION(AbnormalExit)
-};
-
-
 class HUnaryOperation : public HTemplateInstruction<1> {
  public:
   HUnaryOperation(HValue* value, HType type = HType::Tagged())
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Wed Aug 28 14:32:08 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Wed Aug 28 15:00:30 2013 UTC
@@ -5406,8 +5406,6 @@
   HThrow* instr = Add<HThrow>(value);
   instr->set_position(expr->position());
   Add<HSimulate>(expr->id());
-  current_block()->FinishExit(new(zone()) HAbnormalExit);
-  set_current_block(NULL);
 }


=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.cc Wed Aug 28 14:16:57 2013 UTC +++ /branches/bleeding_edge/src/ia32/lithium-ia32.cc Wed Aug 28 15:00:30 2013 UTC
@@ -1884,13 +1884,6 @@
   UNREACHABLE();
   return NULL;
 }
-
-
-LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
-  // The control instruction marking the end of a block that completed
-  // abruptly (e.g., threw an exception).  There is nothing specific to do.
-  return NULL;
-}


 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
=======================================
--- /branches/bleeding_edge/src/mips/lithium-mips.cc Wed Aug 28 14:16:57 2013 UTC +++ /branches/bleeding_edge/src/mips/lithium-mips.cc Wed Aug 28 15:00:30 2013 UTC
@@ -1789,13 +1789,6 @@
   UNREACHABLE();
   return NULL;
 }
-
-
-LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
-  // The control instruction marking the end of a block that completed
-  // abruptly (e.g., threw an exception).  There is nothing specific to do.
-  return NULL;
-}


 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {
=======================================
--- /branches/bleeding_edge/src/x64/lithium-x64.cc Wed Aug 28 14:16:57 2013 UTC +++ /branches/bleeding_edge/src/x64/lithium-x64.cc Wed Aug 28 15:00:30 2013 UTC
@@ -1787,13 +1787,6 @@
   UNREACHABLE();
   return NULL;
 }
-
-
-LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) {
-  // The control instruction marking the end of a block that completed
-  // abruptly (e.g., threw an exception).  There is nothing specific to do.
-  return NULL;
-}


 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) {

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