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

Unified Diff: runtime/vm/parser.cc

Issue 10310132: Remove TuckTemp, PickTemp, use temporary locals instead. (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
« no previous file with comments | « runtime/vm/parser.h ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 7560)
+++ runtime/vm/parser.cc (working copy)
@@ -7404,14 +7404,32 @@
factory_param->Add(list);
AbstractTypeArguments& canonical_type_arguments =
AbstractTypeArguments::ZoneHandle(type_arguments.Canonicalize());
- return new ConstructorCallNode(literal_pos,
- canonical_type_arguments,
- list_literal_factory,
- factory_param);
+ return CreateConstructorCallNode(literal_pos,
+ canonical_type_arguments,
+ list_literal_factory,
+ factory_param);
}
}
+ConstructorCallNode* Parser::CreateConstructorCallNode(
+ intptr_t token_index,
+ const AbstractTypeArguments& type_arguments,
+ const Function& constructor,
+ ArgumentListNode* arguments) {
+ if (!type_arguments.IsNull() && !type_arguments.IsInstantiated()) {
+ EnsureExpressionTemp();
+ }
+ LocalVariable* allocated =
+ CreateTempConstVariable(token_index, token_index, "alloc");
+ return new ConstructorCallNode(token_index,
+ type_arguments,
+ constructor,
+ arguments,
+ *allocated);
+}
+
+
static void AddKeyValuePair(ArrayNode* pairs,
bool is_const,
AstNode* key,
@@ -7608,10 +7626,10 @@
}
ArgumentListNode* factory_param = new ArgumentListNode(literal_pos);
factory_param->Add(kv_pairs);
- return new ConstructorCallNode(literal_pos,
- map_type_arguments,
- map_literal_factory,
- factory_param);
+ return CreateConstructorCallNode(literal_pos,
+ map_type_arguments,
+ map_literal_factory,
+ factory_param);
}
}
@@ -7874,7 +7892,7 @@
}
// If the type argument vector is not instantiated, we verify in checked
// mode at runtime that it is within its declared bounds.
- new_object = new ConstructorCallNode(
+ new_object = CreateConstructorCallNode(
new_pos, type_arguments, constructor, arguments);
}
return new_object;
« no previous file with comments | « runtime/vm/parser.h ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698