OLD | NEW |
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/globals.h" // Needed here to get TARGET_ARCH_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
7 | 7 |
8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 // as they throw an exception. | 639 // as they throw an exception. |
640 void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos, | 640 void FlowGraphCompiler::GenerateAssertAssignable(intptr_t token_pos, |
641 intptr_t deopt_id, | 641 intptr_t deopt_id, |
642 const AbstractType& dst_type, | 642 const AbstractType& dst_type, |
643 const String& dst_name, | 643 const String& dst_name, |
644 LocationSummary* locs) { | 644 LocationSummary* locs) { |
645 ASSERT(token_pos >= 0); | 645 ASSERT(token_pos >= 0); |
646 ASSERT(!dst_type.IsNull()); | 646 ASSERT(!dst_type.IsNull()); |
647 ASSERT(dst_type.IsFinalized()); | 647 ASSERT(dst_type.IsFinalized()); |
648 // Assignable check is skipped in FlowGraphBuilder, not here. | 648 // Assignable check is skipped in FlowGraphBuilder, not here. |
649 ASSERT(dst_type.IsMalformed() || dst_type.IsMalbounded() || | 649 ASSERT(dst_type.IsMalformedOrMalbounded() || |
650 (!dst_type.IsDynamicType() && !dst_type.IsObjectType())); | 650 (!dst_type.IsDynamicType() && !dst_type.IsObjectType())); |
651 // Preserve instantiator (R2) and its type arguments (R1). | 651 // Preserve instantiator (R2) and its type arguments (R1). |
652 __ PushList((1 << R1) | (1 << R2)); | 652 __ PushList((1 << R1) | (1 << R2)); |
653 // A null object is always assignable and is returned as result. | 653 // A null object is always assignable and is returned as result. |
654 Label is_assignable, runtime_call; | 654 Label is_assignable, runtime_call; |
655 __ CompareImmediate(R0, reinterpret_cast<int32_t>(Object::null())); | 655 __ CompareImmediate(R0, reinterpret_cast<int32_t>(Object::null())); |
656 __ b(&is_assignable, EQ); | 656 __ b(&is_assignable, EQ); |
657 | 657 |
658 if (!FLAG_eliminate_type_checks || dst_type.IsMalformed()) { | 658 if (!FLAG_eliminate_type_checks || dst_type.IsMalformed()) { |
659 // If type checks are not eliminated during the graph building then | 659 // If type checks are not eliminated during the graph building then |
660 // a transition sentinel can be seen here. | 660 // a transition sentinel can be seen here. |
661 __ CompareObject(R0, Object::transition_sentinel()); | 661 __ CompareObject(R0, Object::transition_sentinel()); |
662 __ b(&is_assignable, EQ); | 662 __ b(&is_assignable, EQ); |
663 } | 663 } |
664 | 664 |
665 // Generate throw new TypeError() if the type is malformed or malbounded. | 665 // Generate throw new TypeError() if the type is malformed or malbounded. |
666 if (dst_type.IsMalformed() || dst_type.IsMalbounded()) { | 666 if (dst_type.IsMalformedOrMalbounded()) { |
667 __ PushObject(Object::ZoneHandle()); // Make room for the result. | 667 __ PushObject(Object::ZoneHandle()); // Make room for the result. |
668 __ Push(R0); // Push the source object. | 668 __ Push(R0); // Push the source object. |
669 __ PushObject(dst_name); // Push the name of the destination. | 669 __ PushObject(dst_name); // Push the name of the destination. |
670 __ PushObject(dst_type); // Push the type of the destination. | 670 __ PushObject(dst_type); // Push the type of the destination. |
671 GenerateRuntimeCall(token_pos, | 671 GenerateRuntimeCall(token_pos, |
672 deopt_id, | 672 deopt_id, |
673 kBadTypeErrorRuntimeEntry, | 673 kBadTypeErrorRuntimeEntry, |
674 3, | 674 3, |
675 locs); | 675 locs); |
676 // We should never return here. | 676 // We should never return here. |
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1873 DRegister dreg = EvenDRegisterOf(reg); | 1873 DRegister dreg = EvenDRegisterOf(reg); |
1874 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); | 1874 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); |
1875 } | 1875 } |
1876 | 1876 |
1877 | 1877 |
1878 #undef __ | 1878 #undef __ |
1879 | 1879 |
1880 } // namespace dart | 1880 } // namespace dart |
1881 | 1881 |
1882 #endif // defined TARGET_ARCH_ARM | 1882 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |