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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 14672035: Further improve and simplify IL for building constructor type arguments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: rebased Created 7 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 | « no previous file | runtime/vm/intermediate_language_arm.cc » ('j') | runtime/vm/intermediate_language_arm.cc » ('J')
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 22926)
+++ runtime/vm/flow_graph_builder.cc (working copy)
@@ -2283,18 +2283,25 @@
const LocalVariable& temp = *owner()->parsed_function().expression_temp_var();
const Class& instantiator_class = Class::Handle(
owner()->parsed_function().function().Owner());
- Value* instantiator_type_arguments = BuildInstantiatorTypeArguments(
+ Value* type_arguments_val = BuildInstantiatorTypeArguments(
node->token_pos(), instantiator_class, NULL);
- Value* stored_instantiator =
- Bind(BuildStoreTemp(temp, instantiator_type_arguments));
- Value* type_arguments_val = Bind(
- new ExtractConstructorTypeArgumentsInstr(
- node->token_pos(),
- node->type_arguments(),
- instantiator_class,
- stored_instantiator));
+ const bool use_instantiator_type_args =
+ node->type_arguments().IsUninstantiatedIdentity() ||
+ node->type_arguments().CanShareInstantiatorTypeArguments(
+ instantiator_class);
+ if (!use_instantiator_type_args) {
+ type_arguments_val =
+ Bind(BuildStoreTemp(temp, type_arguments_val));
+ type_arguments_val = Bind(
+ new ExtractConstructorTypeArgumentsInstr(
+ node->token_pos(),
+ node->type_arguments(),
+ instantiator_class,
+ type_arguments_val));
+ }
+
if (call_arguments != NULL) {
ASSERT(type_arguments == NULL);
call_arguments->Add(PushArgument(type_arguments_val));
@@ -2303,11 +2310,18 @@
*type_arguments = type_arguments_val;
}
- Value* load_instantiator = Bind(BuildLoadLocal(temp));
- Value* instantiator_val =
- Bind(new ExtractConstructorInstantiatorInstr(node,
- instantiator_class,
- load_instantiator));
+ Value* instantiator_val = NULL;
+ if (!use_instantiator_type_args) {
+ instantiator_val = Bind(BuildLoadLocal(temp));
+ instantiator_val =
+ Bind(new ExtractConstructorInstantiatorInstr(node,
+ instantiator_class,
+ instantiator_val));
+ } else {
+ // No instantiator required.
+ instantiator_val = Bind(new ConstantInstr(
+ Smi::ZoneHandle(Smi::New(StubCode::kNoInstantiator))));
+ }
if (call_arguments != NULL) {
ASSERT(instantiator == NULL);
« no previous file with comments | « no previous file | runtime/vm/intermediate_language_arm.cc » ('j') | runtime/vm/intermediate_language_arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698