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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 // If type is instantiated and non-parameterized, we can inline code | 584 // If type is instantiated and non-parameterized, we can inline code |
585 // checking whether the tested instance is a Smi. | 585 // checking whether the tested instance is a Smi. |
586 if (type.IsInstantiated()) { | 586 if (type.IsInstantiated()) { |
587 // A null object is only an instance of Object and dynamic, which has | 587 // A null object is only an instance of Object and dynamic, which has |
588 // already been checked above (if the type is instantiated). So we can | 588 // already been checked above (if the type is instantiated). So we can |
589 // return false here if the instance is null (and if the type is | 589 // return false here if the instance is null (and if the type is |
590 // instantiated). | 590 // instantiated). |
591 // We can only inline this null check if the type is instantiated at compile | 591 // We can only inline this null check if the type is instantiated at compile |
592 // time, since an uninstantiated type at compile time could be Object or | 592 // time, since an uninstantiated type at compile time could be Object or |
593 // dynamic at run time. | 593 // dynamic at run time. |
594 __ BranchEqual(A0, Object::null_object(), &is_not_instance); | 594 __ BranchEqual(A0, Object::null_object(), |
| 595 type.IsNullType() ? &is_instance : &is_not_instance); |
595 } | 596 } |
596 | 597 |
597 // Generate inline instanceof test. | 598 // Generate inline instanceof test. |
598 SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(); | 599 SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(); |
599 test_cache = GenerateInlineInstanceof(token_pos, type, | 600 test_cache = GenerateInlineInstanceof(token_pos, type, |
600 &is_instance, &is_not_instance); | 601 &is_instance, &is_not_instance); |
601 | 602 |
602 // test_cache is null if there is no fall-through. | 603 // test_cache is null if there is no fall-through. |
603 Label done; | 604 Label done; |
604 if (!test_cache.IsNull()) { | 605 if (!test_cache.IsNull()) { |
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1826 __ AddImmediate(SP, kDoubleSize); | 1827 __ AddImmediate(SP, kDoubleSize); |
1827 } | 1828 } |
1828 | 1829 |
1829 | 1830 |
1830 #undef __ | 1831 #undef __ |
1831 | 1832 |
1832 | 1833 |
1833 } // namespace dart | 1834 } // namespace dart |
1834 | 1835 |
1835 #endif // defined TARGET_ARCH_MIPS | 1836 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |