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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10071016: Eliminated last bailout (except for type checked mode) in the new compiler: generate type arguments… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/flow_graph_compiler_x64.h » ('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 6466)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -426,22 +426,36 @@
}
+void EffectGraphVisitor::BuildInstanceOf(ComparisonNode* node) {
+ ASSERT(Token::IsInstanceofOperator(node->kind()));
+ ArgumentGraphVisitor for_left_value(owner(), temp_index());
+ node->left()->Visit(&for_left_value);
+ Append(for_left_value);
+ const AbstractType& type = node->right()->AsTypeNode()->type();
+ ASSERT(type.IsFinalized() && !type.IsMalformed());
+ Value* type_arguments = NULL;
+ if (!type.IsInstantiated()) {
+ type_arguments = BuildInstantiatorTypeArguments(
+ node->token_index(), for_left_value.temp_index());
+ }
+ InstanceOfComp* instance_of = new InstanceOfComp(
+ node->id(),
+ node->token_index(),
+ owner()->try_index(),
+ for_left_value.value(),
+ type_arguments,
+ node->right()->AsTypeNode()->type(),
+ (node->kind() == Token::kISNOT));
+ ReturnComputation(instance_of);
+}
+
+
// <Expression> :: Comparison { kind: Token::Kind
// left: <Expression>
// right: <Expression> }
void EffectGraphVisitor::VisitComparisonNode(ComparisonNode* node) {
if (Token::IsInstanceofOperator(node->kind())) {
- ArgumentGraphVisitor for_left_value(owner(), temp_index());
- node->left()->Visit(&for_left_value);
- Append(for_left_value);
- InstanceOfComp* instance_of = new InstanceOfComp(
- node->id(),
- node->token_index(),
- owner()->try_index(),
- for_left_value.value(),
- node->right()->AsTypeNode()->type(),
- (node->kind() == Token::kISNOT));
- ReturnComputation(instance_of);
+ BuildInstanceOf(node);
return;
}
if ((node->kind() == Token::kEQ_STRICT) ||
@@ -2227,6 +2241,11 @@
OS::Print(" %s %s",
comp->negate_result() ? "ISNOT" : "IS",
String::Handle(comp->type().Name()).ToCString());
+ if (comp->type_arguments() != NULL) {
+ OS::Print(" (type-arg:");
+ comp->type_arguments()->Accept(this);
+ OS::Print(")");
+ }
}
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/flow_graph_compiler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698