Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1667)

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 9706032: Add Throw and ReThrow nodes. Rethrow not yet tested (bailout with untested), since it needs the try… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 5480)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1275,7 +1275,23 @@
void EffectGraphVisitor::VisitThrowNode(ThrowNode* node) {
- Bailout("EffectGraphVisitor::VisitThrowNode");
+ ValueGraphVisitor for_exception(owner(), temp_index());
+ node->exception()->Visit(&for_exception);
+ Append(for_exception);
+ if (node->stacktrace() == NULL) {
+ ThrowComp* comp =
+ new ThrowComp(node->id(), node->token_index(), for_exception.value());
+ AddInstruction(new DoInstr(comp));
+ } else {
+ ValueGraphVisitor for_stack_trace(owner(), temp_index() + 1);
+ node->stacktrace()->Visit(&for_stack_trace);
+ Append(for_stack_trace);
+ ReThrowComp* comp = new ReThrowComp(node->id(),
+ node->token_index(),
+ for_exception.value(),
+ for_stack_trace.value());
+ AddInstruction(new DoInstr(comp));
+ }
}
@@ -1514,6 +1530,22 @@
}
+void FlowGraphPrinter::VisitThrow(ThrowComp* comp) {
+ OS::Print("Throw(");
+ comp->exception()->Accept(this);
+ OS::Print(")");
+}
+
+
+void FlowGraphPrinter::VisitReThrow(ReThrowComp* comp) {
+ OS::Print("ReThrow(");
+ comp->exception()->Accept(this);
+ OS::Print(", ");
+ comp->stack_trace()->Accept(this);
+ OS::Print(")");
+}
+
+
void FlowGraphPrinter::VisitNativeLoadField(NativeLoadFieldComp* comp) {
OS::Print("NativeLoadField(");
comp->value()->Accept(this);
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698