Revision: 16486
Author: [email protected]
Date: Mon Sep 2 17:03:32 2013 UTC
Log: Merged r16406, r16431 into 3.19 branch.
Delete HAbnormalExit. It does more harm than good.
Always visit branches during HGraph building
BUG=v8:2843,chromium:280333
[email protected]
Review URL: https://codereview.chromium.org/23548009
http://code.google.com/p/v8/source/detail?r=16486
Added:
/branches/3.19/test/mjsunit/regress/regress-2843.js
/branches/3.19/test/mjsunit/regress/regress-crbug-280333.js
Modified:
/branches/3.19/src/arm/lithium-arm.cc
/branches/3.19/src/hydrogen-environment-liveness.cc
/branches/3.19/src/hydrogen-instructions.h
/branches/3.19/src/hydrogen.cc
/branches/3.19/src/ia32/lithium-ia32.cc
/branches/3.19/src/mips/lithium-mips.cc
/branches/3.19/src/version.cc
/branches/3.19/src/x64/lithium-x64.cc
=======================================
--- /dev/null
+++ /branches/3.19/test/mjsunit/regress/regress-2843.js Mon Sep 2 17:03:32
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() {}));
=======================================
--- /dev/null
+++ /branches/3.19/test/mjsunit/regress/regress-crbug-280333.js Mon Sep 2
17:03:32 2013 UTC
@@ -0,0 +1,47 @@
+// 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 funky() { return false; }
+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.
+ if (fun()) {
+ return a;
+ }
+ return 0;
+}
+
+assertEquals(0, foo(1, funky));
+assertEquals(0, foo(1, funky));
+%OptimizeFunctionOnNextCall(foo);
+assertEquals(0, foo(1, funky));
+assertEquals(2, foo(1, function() { return true; }));
=======================================
--- /branches/3.19/src/arm/lithium-arm.cc Mon Aug 5 09:53:12 2013 UTC
+++ /branches/3.19/src/arm/lithium-arm.cc Mon Sep 2 17:03:32 2013 UTC
@@ -1882,13 +1882,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/3.19/src/hydrogen-environment-liveness.cc Mon Aug 5 09:53:12
2013 UTC
+++ /branches/3.19/src/hydrogen-environment-liveness.cc Mon Sep 2 17:03:32
2013 UTC
@@ -172,11 +172,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_->at(return_id));
- }
+ live->Union(*live_at_block_start_->at(return_id));
}
last_simulate_ = NULL;
break;
=======================================
--- /branches/3.19/src/hydrogen-instructions.h Mon Aug 19 11:18:02 2013 UTC
+++ /branches/3.19/src/hydrogen-instructions.h Mon Sep 2 17:03:32 2013 UTC
@@ -63,7 +63,6 @@
#define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \
- V(AbnormalExit) \
V(AccessArgumentsAt) \
V(Add) \
V(Allocate) \
@@ -1625,16 +1624,6 @@
};
-class HAbnormalExit: public HTemplateControlInstruction<0, 0> {
- public:
- virtual Representation RequiredInputRepresentation(int index) {
- return Representation::None();
- }
-
- DECLARE_CONCRETE_INSTRUCTION(AbnormalExit)
-};
-
-
class HUnaryOperation: public HTemplateInstruction<1> {
public:
explicit HUnaryOperation(HValue* value) {
=======================================
--- /branches/3.19/src/hydrogen.cc Tue Aug 13 12:02:58 2013 UTC
+++ /branches/3.19/src/hydrogen.cc Mon Sep 2 17:03:32 2013 UTC
@@ -3773,16 +3773,6 @@
if (value != NULL && value->CheckFlag(HValue::kIsArguments)) {
builder->Bailout("arguments object value in a test context");
}
- if (value->IsConstant()) {
- HConstant* constant_value = HConstant::cast(value);
- if (constant_value->BooleanValue()) {
- builder->current_block()->Goto(if_true(), builder->function_state());
- } else {
- builder->current_block()->Goto(if_false(),
builder->function_state());
- }
- builder->set_current_block(NULL);
- return;
- }
HBasicBlock* empty_true = builder->graph()->CreateBasicBlock();
HBasicBlock* empty_false = builder->graph()->CreateBasicBlock();
ToBooleanStub::Types expected(condition()->to_boolean_types());
@@ -6971,8 +6961,6 @@
instr->set_position(expr->position());
AddInstruction(instr);
Add<HSimulate>(expr->id());
- current_block()->FinishExit(new(zone()) HAbnormalExit);
- set_current_block(NULL);
}
=======================================
--- /branches/3.19/src/ia32/lithium-ia32.cc Mon Aug 5 09:53:12 2013 UTC
+++ /branches/3.19/src/ia32/lithium-ia32.cc Mon Sep 2 17:03:32 2013 UTC
@@ -1898,13 +1898,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/3.19/src/mips/lithium-mips.cc Mon Aug 5 09:53:12 2013 UTC
+++ /branches/3.19/src/mips/lithium-mips.cc Mon Sep 2 17:03:32 2013 UTC
@@ -1798,13 +1798,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/3.19/src/version.cc Mon Sep 2 14:36:37 2013 UTC
+++ /branches/3.19/src/version.cc Mon Sep 2 17:03:32 2013 UTC
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 19
#define BUILD_NUMBER 18
-#define PATCH_LEVEL 22
+#define PATCH_LEVEL 23
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 0
=======================================
--- /branches/3.19/src/x64/lithium-x64.cc Mon Aug 5 09:53:12 2013 UTC
+++ /branches/3.19/src/x64/lithium-x64.cc Mon Sep 2 17:03:32 2013 UTC
@@ -1804,13 +1804,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.