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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 9699090: Make Throw and ReThrow instructions instead of computations. That way they can terminate a basic bl… (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 5537)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -1274,6 +1274,10 @@
// nodes: <Statement>*
// label: SourceLabel }
void EffectGraphVisitor::VisitSequenceNode(SequenceNode* node) {
+ if (FLAG_enable_type_checks &&
+ (node == owner()->parsed_function().node_sequence())) {
+ Bailout("VisitSequenceNode GenerateArgumentTypeChecks()");
+ }
if ((node->scope() != NULL) &&
(node->scope()->num_context_variables() != 0)) {
Bailout("Sequence needs a context. Gotta have a context.");
@@ -1301,20 +1305,21 @@
ValueGraphVisitor for_exception(owner(), temp_index());
node->exception()->Visit(&for_exception);
Append(for_exception);
+ Instruction* instr = NULL;
if (node->stacktrace() == NULL) {
- ThrowComp* comp =
- new ThrowComp(node->id(), node->token_index(), for_exception.value());
- AddInstruction(new DoInstr(comp));
+ instr = new ThrowInstr(
+ node->id(), node->token_index(), for_exception.value());
} 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));
+ instr = new ReThrowInstr(node->id(),
+ node->token_index(),
+ for_exception.value(),
+ for_stack_trace.value());
}
+ AddInstruction(instr);
+ CloseFragment();
}
@@ -1553,22 +1558,6 @@
}
-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);
@@ -1640,6 +1629,22 @@
}
+void FlowGraphPrinter::VisitThrow(ThrowInstr* instr) {
+ OS::Print("Throw(");
+ instr->exception()->Accept(this);
+ OS::Print(")");
+}
+
+
+void FlowGraphPrinter::VisitReThrow(ReThrowInstr* instr) {
+ OS::Print("ReThrow(");
+ instr->exception()->Accept(this);
+ OS::Print(", ");
+ instr->stack_trace()->Accept(this);
+ OS::Print(")");
+}
+
+
void FlowGraphPrinter::VisitBranch(BranchInstr* instr) {
OS::Print(" if ");
instr->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