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 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1619 | 1619 |
1620 | 1620 |
1621 void EffectGraphVisitor::BuildTypeTest(ComparisonNode* node) { | 1621 void EffectGraphVisitor::BuildTypeTest(ComparisonNode* node) { |
1622 ASSERT(Token::IsTypeTestOperator(node->kind())); | 1622 ASSERT(Token::IsTypeTestOperator(node->kind())); |
1623 const AbstractType& type = node->right()->AsTypeNode()->type(); | 1623 const AbstractType& type = node->right()->AsTypeNode()->type(); |
1624 ASSERT(type.IsFinalized() && !type.IsMalformedOrMalbounded()); | 1624 ASSERT(type.IsFinalized() && !type.IsMalformedOrMalbounded()); |
1625 const bool negate_result = (node->kind() == Token::kISNOT); | 1625 const bool negate_result = (node->kind() == Token::kISNOT); |
1626 // All objects are instances of type T if Object type is a subtype of type T. | 1626 // All objects are instances of type T if Object type is a subtype of type T. |
1627 const Type& object_type = Type::Handle(Z, Type::ObjectType()); | 1627 const Type& object_type = Type::Handle(Z, Type::ObjectType()); |
1628 if (type.IsInstantiated() && | 1628 if (type.IsInstantiated() && |
1629 object_type.IsSubtypeOf(type, NULL, Heap::kOld)) { | 1629 object_type.IsSubtypeOf(type, NULL, NULL, Heap::kOld)) { |
1630 // Must evaluate left side. | 1630 // Must evaluate left side. |
1631 EffectGraphVisitor for_left_value(owner()); | 1631 EffectGraphVisitor for_left_value(owner()); |
1632 node->left()->Visit(&for_left_value); | 1632 node->left()->Visit(&for_left_value); |
1633 Append(for_left_value); | 1633 Append(for_left_value); |
1634 ReturnDefinition(new(Z) ConstantInstr(Bool::Get(!negate_result))); | 1634 ReturnDefinition(new(Z) ConstantInstr(Bool::Get(!negate_result))); |
1635 return; | 1635 return; |
1636 } | 1636 } |
1637 ValueGraphVisitor for_left_value(owner()); | 1637 ValueGraphVisitor for_left_value(owner()); |
1638 node->left()->Visit(&for_left_value); | 1638 node->left()->Visit(&for_left_value); |
1639 Append(for_left_value); | 1639 Append(for_left_value); |
(...skipping 3028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4668 Script::Handle(function.script()), | 4668 Script::Handle(function.script()), |
4669 function.token_pos(), | 4669 function.token_pos(), |
4670 Report::AtLocation, | 4670 Report::AtLocation, |
4671 "FlowGraphBuilder Bailout: %s %s", | 4671 "FlowGraphBuilder Bailout: %s %s", |
4672 String::Handle(function.name()).ToCString(), | 4672 String::Handle(function.name()).ToCString(), |
4673 reason); | 4673 reason); |
4674 UNREACHABLE(); | 4674 UNREACHABLE(); |
4675 } | 4675 } |
4676 | 4676 |
4677 } // namespace dart | 4677 } // namespace dart |
OLD | NEW |