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

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

Issue 12317013: Strengthen type assertions post-dominated by checks during type propagation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 return this; 1104 return this;
1105 } 1105 }
1106 1106
1107 1107
1108 Definition* AssertAssignableInstr::Canonicalize(FlowGraphOptimizer* optimizer) { 1108 Definition* AssertAssignableInstr::Canonicalize(FlowGraphOptimizer* optimizer) {
1109 if (FLAG_eliminate_type_checks && 1109 if (FLAG_eliminate_type_checks &&
1110 value()->Type()->IsAssignableTo(dst_type())) { 1110 value()->Type()->IsAssignableTo(dst_type())) {
1111 return value()->definition(); 1111 return value()->definition();
1112 } 1112 }
1113 1113
1114 // (3) For uninstantiated target types: If the instantiator type arguments 1114 // For uninstantiated target types: If the instantiator type arguments
1115 // are constant, instantiate the target type here. 1115 // are constant, instantiate the target type here.
1116 if (dst_type().IsInstantiated()) return this; 1116 if (dst_type().IsInstantiated()) return this;
1117 1117
1118 ConstantInstr* constant_type_args = 1118 ConstantInstr* constant_type_args =
1119 instantiator_type_arguments()->definition()->AsConstant(); 1119 instantiator_type_arguments()->definition()->AsConstant();
1120 if (constant_type_args != NULL && 1120 if (constant_type_args != NULL &&
1121 !constant_type_args->value().IsNull() && 1121 !constant_type_args->value().IsNull() &&
1122 constant_type_args->value().IsTypeArguments()) { 1122 constant_type_args->value().IsTypeArguments()) {
1123 const TypeArguments& instantiator_type_args = 1123 const TypeArguments& instantiator_type_args =
1124 TypeArguments::Cast(constant_type_args->value()); 1124 TypeArguments::Cast(constant_type_args->value());
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after
2201 default: 2201 default:
2202 UNREACHABLE(); 2202 UNREACHABLE();
2203 } 2203 }
2204 return kPowRuntimeEntry; 2204 return kPowRuntimeEntry;
2205 } 2205 }
2206 2206
2207 2207
2208 #undef __ 2208 #undef __
2209 2209
2210 } // namespace dart 2210 } // namespace dart
OLDNEW
« runtime/vm/flow_graph_type_propagator.cc ('K') | « runtime/vm/flow_graph_type_propagator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698