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

Side by Side Diff: runtime/vm/flow_graph_optimizer.cc

Issue 14238036: Improve type optimization reusing the type argument vector of the instantiator (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/flow_graph_optimizer.h" 5 #include "vm/flow_graph_optimizer.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/cha.h" 8 #include "vm/cha.h"
9 #include "vm/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 4534 matching lines...) Expand 10 before | Expand all | Expand 10 after
4545 SetValue(instr, non_constant_); 4545 SetValue(instr, non_constant_);
4546 return; 4546 return;
4547 } 4547 }
4548 if (IsConstant(object)) { 4548 if (IsConstant(object)) {
4549 const intptr_t len = instr->type_arguments().Length(); 4549 const intptr_t len = instr->type_arguments().Length();
4550 if (instr->type_arguments().IsRawInstantiatedRaw(len) && 4550 if (instr->type_arguments().IsRawInstantiatedRaw(len) &&
4551 object.IsNull()) { 4551 object.IsNull()) {
4552 SetValue(instr, object); 4552 SetValue(instr, object);
4553 return; 4553 return;
4554 } 4554 }
4555 if (instr->type_arguments().IsUninstantiatedIdentity() && 4555 if (instr->type_arguments().IsUninstantiatedIdentity()) {
4556 !object.IsNull() &&
4557 object.IsTypeArguments() &&
4558 (TypeArguments::Cast(object).Length() == len)) {
4559 SetValue(instr, object); 4556 SetValue(instr, object);
4560 return; 4557 return;
4561 } 4558 }
4562 SetValue(instr, non_constant_); 4559 SetValue(instr, non_constant_);
4563 } 4560 }
4564 } 4561 }
4565 4562
4566 4563
4567 void ConstantPropagator::VisitExtractConstructorTypeArguments( 4564 void ConstantPropagator::VisitExtractConstructorTypeArguments(
4568 ExtractConstructorTypeArgumentsInstr* instr) { 4565 ExtractConstructorTypeArgumentsInstr* instr) {
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after
5382 if (changed) { 5379 if (changed) {
5383 // We may have changed the block order and the dominator tree. 5380 // We may have changed the block order and the dominator tree.
5384 flow_graph->DiscoverBlocks(); 5381 flow_graph->DiscoverBlocks();
5385 GrowableArray<BitVector*> dominance_frontier; 5382 GrowableArray<BitVector*> dominance_frontier;
5386 flow_graph->ComputeDominators(&dominance_frontier); 5383 flow_graph->ComputeDominators(&dominance_frontier);
5387 } 5384 }
5388 } 5385 }
5389 5386
5390 5387
5391 } // namespace dart 5388 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698