OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 // checking whether the tested instance is a Smi. | 589 // checking whether the tested instance is a Smi. |
590 if (type.IsInstantiated()) { | 590 if (type.IsInstantiated()) { |
591 // A null object is only an instance of Object and dynamic, which has | 591 // A null object is only an instance of Object and dynamic, which has |
592 // already been checked above (if the type is instantiated). So we can | 592 // already been checked above (if the type is instantiated). So we can |
593 // return false here if the instance is null (and if the type is | 593 // return false here if the instance is null (and if the type is |
594 // instantiated). | 594 // instantiated). |
595 // We can only inline this null check if the type is instantiated at compile | 595 // We can only inline this null check if the type is instantiated at compile |
596 // time, since an uninstantiated type at compile time could be Object or | 596 // time, since an uninstantiated type at compile time could be Object or |
597 // dynamic at run time. | 597 // dynamic at run time. |
598 __ CompareObject(R0, Object::null_object(), PP); | 598 __ CompareObject(R0, Object::null_object(), PP); |
599 __ b(&is_not_instance, EQ); | 599 __ b(type.IsNullType() ? &is_instance : &is_not_instance, EQ); |
600 } | 600 } |
601 | 601 |
602 // Generate inline instanceof test. | 602 // Generate inline instanceof test. |
603 SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(); | 603 SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(); |
604 test_cache = GenerateInlineInstanceof(token_pos, type, | 604 test_cache = GenerateInlineInstanceof(token_pos, type, |
605 &is_instance, &is_not_instance); | 605 &is_instance, &is_not_instance); |
606 | 606 |
607 // test_cache is null if there is no fall-through. | 607 // test_cache is null if there is no fall-through. |
608 Label done; | 608 Label done; |
609 if (!test_cache.IsNull()) { | 609 if (!test_cache.IsNull()) { |
(...skipping 1194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1804 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1804 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
1805 __ PopDouble(reg); | 1805 __ PopDouble(reg); |
1806 } | 1806 } |
1807 | 1807 |
1808 | 1808 |
1809 #undef __ | 1809 #undef __ |
1810 | 1810 |
1811 } // namespace dart | 1811 } // namespace dart |
1812 | 1812 |
1813 #endif // defined TARGET_ARCH_ARM64 | 1813 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |