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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 10446019: - Port AssertBool and AssertAssigneable to new location template. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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
Index: runtime/vm/flow_graph_builder.cc
===================================================================
--- runtime/vm/flow_graph_builder.cc (revision 7952)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -581,6 +581,7 @@
}
+// instantiator_type_arguments are on TOS, instantiator is at TOS + 1.
regis 2012/05/24 19:56:18 extra space
srdjan 2012/05/24 20:24:44 That comment has been removed, forgot to upload. :
void EffectGraphVisitor::BuildTypecheckArguments(
intptr_t token_index,
Value** instantiator_result,
@@ -594,6 +595,7 @@
instantiator = BuildInstantiator();
if (instantiator == NULL) {
// No instantiator when inside factory.
+ instantiator = BuildNullValue();
instantiator_type_arguments =
BuildInstantiatorTypeArguments(token_index, NULL);
} else {
@@ -614,6 +616,13 @@
}
+Value* EffectGraphVisitor::BuildNullValue() {
+ BindInstr* instr = new BindInstr(new ConstantVal(Object::ZoneHandle()));
+ AddInstruction(instr);
+ return new UseVal(instr);
+}
+
+
// Used for testing incoming arguments.
AssertAssignableComp* EffectGraphVisitor::BuildAssertAssignable(
intptr_t token_index,
@@ -623,7 +632,10 @@
// Build the type check computation.
Value* instantiator = NULL;
Value* instantiator_type_arguments = NULL;
- if (!dst_type.IsInstantiated()) {
+ if (dst_type.IsInstantiated()) {
+ instantiator = BuildNullValue();
+ instantiator_type_arguments = BuildNullValue();
+ } else {
BuildTypecheckArguments(token_index,
&instantiator,
&instantiator_type_arguments);

Powered by Google App Engine
This is Rietveld 408576698