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

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

Issue 1528873002: VM: Use read-only handle Object::dynamic_type() where possible. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_builder.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/constant_propagator.h" 5 #include "vm/constant_propagator.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/flow_graph_builder.h" 8 #include "vm/flow_graph_builder.h"
9 #include "vm/flow_graph_compiler.h" 9 #include "vm/flow_graph_compiler.h"
10 #include "vm/flow_graph_range_analysis.h" 10 #include "vm/flow_graph_range_analysis.h"
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 void ConstantPropagator::VisitInstantiateType(InstantiateTypeInstr* instr) { 860 void ConstantPropagator::VisitInstantiateType(InstantiateTypeInstr* instr) {
861 const Object& object = 861 const Object& object =
862 instr->instantiator()->definition()->constant_value(); 862 instr->instantiator()->definition()->constant_value();
863 if (IsNonConstant(object)) { 863 if (IsNonConstant(object)) {
864 SetValue(instr, non_constant_); 864 SetValue(instr, non_constant_);
865 return; 865 return;
866 } 866 }
867 if (IsConstant(object)) { 867 if (IsConstant(object)) {
868 if (instr->type().IsTypeParameter()) { 868 if (instr->type().IsTypeParameter()) {
869 if (object.IsNull()) { 869 if (object.IsNull()) {
870 SetValue(instr, Type::ZoneHandle(Z, Type::DynamicType())); 870 SetValue(instr, Object::dynamic_type());
871 return; 871 return;
872 } 872 }
873 // We could try to instantiate the type parameter and return it if no 873 // We could try to instantiate the type parameter and return it if no
874 // malformed error is reported. 874 // malformed error is reported.
875 } 875 }
876 SetValue(instr, non_constant_); 876 SetValue(instr, non_constant_);
877 } 877 }
878 } 878 }
879 879
880 880
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 graph_->MergeBlocks(); 1683 graph_->MergeBlocks();
1684 GrowableArray<BitVector*> dominance_frontier; 1684 GrowableArray<BitVector*> dominance_frontier;
1685 graph_->ComputeDominators(&dominance_frontier); 1685 graph_->ComputeDominators(&dominance_frontier);
1686 1686
1687 if (FLAG_trace_constant_propagation) { 1687 if (FLAG_trace_constant_propagation) {
1688 FlowGraphPrinter::PrintGraph("After CP", graph_); 1688 FlowGraphPrinter::PrintGraph("After CP", graph_);
1689 } 1689 }
1690 } 1690 }
1691 1691
1692 } // namespace dart 1692 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698