| 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/class_finalizer.h" | 10 #include "vm/class_finalizer.h" |
| (...skipping 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1653 } | 1653 } |
| 1654 | 1654 |
| 1655 | 1655 |
| 1656 void EffectGraphVisitor::BuildTypeTest(ComparisonNode* node) { | 1656 void EffectGraphVisitor::BuildTypeTest(ComparisonNode* node) { |
| 1657 ASSERT(Token::IsTypeTestOperator(node->kind())); | 1657 ASSERT(Token::IsTypeTestOperator(node->kind())); |
| 1658 const AbstractType& type = node->right()->AsTypeNode()->type(); | 1658 const AbstractType& type = node->right()->AsTypeNode()->type(); |
| 1659 ASSERT(type.IsFinalized() && !type.IsMalformedOrMalbounded()); | 1659 ASSERT(type.IsFinalized() && !type.IsMalformedOrMalbounded()); |
| 1660 const bool negate_result = (node->kind() == Token::kISNOT); | 1660 const bool negate_result = (node->kind() == Token::kISNOT); |
| 1661 // All objects are instances of type T if Object type is a subtype of type T. | 1661 // All objects are instances of type T if Object type is a subtype of type T. |
| 1662 const Type& object_type = Type::Handle(Z, Type::ObjectType()); | 1662 const Type& object_type = Type::Handle(Z, Type::ObjectType()); |
| 1663 if (type.IsInstantiated() && object_type.IsSubtypeOf(type, NULL)) { | 1663 if (type.IsInstantiated() && |
| 1664 object_type.IsSubtypeOf(type, NULL, Heap::kOld)) { |
| 1664 // Must evaluate left side. | 1665 // Must evaluate left side. |
| 1665 EffectGraphVisitor for_left_value(owner()); | 1666 EffectGraphVisitor for_left_value(owner()); |
| 1666 node->left()->Visit(&for_left_value); | 1667 node->left()->Visit(&for_left_value); |
| 1667 Append(for_left_value); | 1668 Append(for_left_value); |
| 1668 ReturnDefinition(new(Z) ConstantInstr(Bool::Get(!negate_result))); | 1669 ReturnDefinition(new(Z) ConstantInstr(Bool::Get(!negate_result))); |
| 1669 return; | 1670 return; |
| 1670 } | 1671 } |
| 1671 ValueGraphVisitor for_left_value(owner()); | 1672 ValueGraphVisitor for_left_value(owner()); |
| 1672 node->left()->Visit(&for_left_value); | 1673 node->left()->Visit(&for_left_value); |
| 1673 Append(for_left_value); | 1674 Append(for_left_value); |
| (...skipping 3003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4677 Report::MessageF(Report::kBailout, | 4678 Report::MessageF(Report::kBailout, |
| 4678 Script::Handle(function.script()), | 4679 Script::Handle(function.script()), |
| 4679 function.token_pos(), | 4680 function.token_pos(), |
| 4680 "FlowGraphBuilder Bailout: %s %s", | 4681 "FlowGraphBuilder Bailout: %s %s", |
| 4681 String::Handle(function.name()).ToCString(), | 4682 String::Handle(function.name()).ToCString(), |
| 4682 reason); | 4683 reason); |
| 4683 UNREACHABLE(); | 4684 UNREACHABLE(); |
| 4684 } | 4685 } |
| 4685 | 4686 |
| 4686 } // namespace dart | 4687 } // namespace dart |
| OLD | NEW |