Revision: 16992
Author: yang...@chromium.org
Date: Fri Sep 27 13:48:19 2013 UTC
Log: Finish control flow after throw if not inlined.
R=jkumme...@chromium.org
BUG=v8:2868
Review URL: https://codereview.chromium.org/24768002
http://code.google.com/p/v8/source/detail?r=16992
Modified:
/branches/bleeding_edge/src/arm/lithium-arm.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
=======================================
--- /branches/bleeding_edge/src/arm/lithium-arm.cc Tue Sep 24 10:40:03 2013
UTC
+++ /branches/bleeding_edge/src/arm/lithium-arm.cc Fri Sep 27 13:48:19 2013
UTC
@@ -1883,6 +1883,13 @@
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-instructions.h Thu Sep 26 16:25:57
2013 UTC
+++ /branches/bleeding_edge/src/hydrogen-instructions.h Fri Sep 27 13:48:19
2013 UTC
@@ -64,6 +64,7 @@
#define HYDROGEN_CONCRETE_INSTRUCTION_LIST(V) \
+ V(AbnormalExit) \
V(AccessArgumentsAt) \
V(Add) \
V(Allocate) \
@@ -1457,6 +1458,16 @@
};
+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 Fri Sep 27 13:38:04 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc Fri Sep 27 13:48:19 2013 UTC
@@ -5491,6 +5491,14 @@
HThrow* instr = Add<HThrow>(value);
instr->set_position(expr->position());
Add<HSimulate>(expr->id());
+
+ // If the throw definitely exits the function, we can finish with a dummy
+ // control flow at this point. This is not the case if the throw is
inside
+ // an inlined function which may be replaced.
+ if (call_context() == NULL) {
+ current_block()->FinishExit(new(zone()) HAbnormalExit);
+ set_current_block(NULL);
+ }
}
=======================================
--- /branches/bleeding_edge/src/ia32/lithium-ia32.cc Mon Sep 23 18:57:32
2013 UTC
+++ /branches/bleeding_edge/src/ia32/lithium-ia32.cc Fri Sep 27 13:48:19
2013 UTC
@@ -1881,6 +1881,13 @@
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 Sep 25 20:42:26
2013 UTC
+++ /branches/bleeding_edge/src/mips/lithium-mips.cc Fri Sep 27 13:48:19
2013 UTC
@@ -1784,6 +1784,13 @@
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 Mon Sep 23 18:57:32 2013
UTC
+++ /branches/bleeding_edge/src/x64/lithium-x64.cc Fri Sep 27 13:48:19 2013
UTC
@@ -1778,6 +1778,13 @@
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
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.