| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 const String& dst_name) { | 1238 const String& dst_name) { |
| 1239 ASSERT(!dst_type.IsNull()); | 1239 ASSERT(!dst_type.IsNull()); |
| 1240 ASSERT(dst_type.IsFinalized()); | 1240 ASSERT(dst_type.IsFinalized()); |
| 1241 | 1241 |
| 1242 // If the destination type is malformed or malbounded, a dynamic type error | 1242 // If the destination type is malformed or malbounded, a dynamic type error |
| 1243 // must be thrown at run time. | 1243 // must be thrown at run time. |
| 1244 if (dst_type.IsMalformedOrMalbounded()) { | 1244 if (dst_type.IsMalformedOrMalbounded()) { |
| 1245 return false; | 1245 return false; |
| 1246 } | 1246 } |
| 1247 | 1247 |
| 1248 // Any type is more specific than the dynamic type and than the Object type. | 1248 // Any type is more specific than the dynamic type, the Object type, or void. |
| 1249 if (dst_type.IsDynamicType() || dst_type.IsObjectType()) { | 1249 if (dst_type.IsDynamicType() || dst_type.IsObjectType() || |
| 1250 dst_type.IsVoidType()) { |
| 1250 return true; | 1251 return true; |
| 1251 } | 1252 } |
| 1252 | 1253 |
| 1253 // Do not perform type check elimination if this optimization is turned off. | 1254 // Do not perform type check elimination if this optimization is turned off. |
| 1254 if (!FLAG_eliminate_type_checks) { | 1255 if (!FLAG_eliminate_type_checks) { |
| 1255 return false; | 1256 return false; |
| 1256 } | 1257 } |
| 1257 | 1258 |
| 1258 // If nothing is known about the value, as is the case for passed-in | 1259 // If nothing is known about the value, as is the case for passed-in |
| 1259 // parameters, and since dst_type is not one of the tested cases above, then | 1260 // parameters, and since dst_type is not one of the tested cases above, then |
| (...skipping 3130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4390 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks); | 4391 graph_entry_->PruneUnreachable(graph_entry_, NULL, osr_id_, block_marks); |
| 4391 ASSERT(found); | 4392 ASSERT(found); |
| 4392 } | 4393 } |
| 4393 | 4394 |
| 4394 | 4395 |
| 4395 void FlowGraphBuilder::Bailout(const char* reason) const { | 4396 void FlowGraphBuilder::Bailout(const char* reason) const { |
| 4396 parsed_function_.Bailout("FlowGraphBuilder", reason); | 4397 parsed_function_.Bailout("FlowGraphBuilder", reason); |
| 4397 } | 4398 } |
| 4398 | 4399 |
| 4399 } // namespace dart | 4400 } // namespace dart |
| OLD | NEW |