| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 // checking whether the tested instance is a Smi. | 606 // checking whether the tested instance is a Smi. |
| 607 if (type.IsInstantiated()) { | 607 if (type.IsInstantiated()) { |
| 608 // A null object is only an instance of Object and dynamic, which has | 608 // A null object is only an instance of Object and dynamic, which has |
| 609 // already been checked above (if the type is instantiated). So we can | 609 // already been checked above (if the type is instantiated). So we can |
| 610 // return false here if the instance is null (and if the type is | 610 // return false here if the instance is null (and if the type is |
| 611 // instantiated). | 611 // instantiated). |
| 612 // We can only inline this null check if the type is instantiated at compile | 612 // We can only inline this null check if the type is instantiated at compile |
| 613 // time, since an uninstantiated type at compile time could be Object or | 613 // time, since an uninstantiated type at compile time could be Object or |
| 614 // dynamic at run time. | 614 // dynamic at run time. |
| 615 __ cmpl(EAX, raw_null); | 615 __ cmpl(EAX, raw_null); |
| 616 __ j(EQUAL, &is_not_instance); | 616 __ j(EQUAL, type.IsNullType() ? &is_instance : &is_not_instance); |
| 617 } | 617 } |
| 618 | 618 |
| 619 // Generate inline instanceof test. | 619 // Generate inline instanceof test. |
| 620 SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(); | 620 SubtypeTestCache& test_cache = SubtypeTestCache::ZoneHandle(); |
| 621 test_cache = GenerateInlineInstanceof(token_pos, type, | 621 test_cache = GenerateInlineInstanceof(token_pos, type, |
| 622 &is_instance, &is_not_instance); | 622 &is_instance, &is_not_instance); |
| 623 | 623 |
| 624 // test_cache is null if there is no fall-through. | 624 // test_cache is null if there is no fall-through. |
| 625 Label done; | 625 Label done; |
| 626 if (!test_cache.IsNull()) { | 626 if (!test_cache.IsNull()) { |
| (...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1818 __ movups(reg, Address(ESP, 0)); | 1818 __ movups(reg, Address(ESP, 0)); |
| 1819 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1819 __ addl(ESP, Immediate(kFpuRegisterSize)); |
| 1820 } | 1820 } |
| 1821 | 1821 |
| 1822 | 1822 |
| 1823 #undef __ | 1823 #undef __ |
| 1824 | 1824 |
| 1825 } // namespace dart | 1825 } // namespace dart |
| 1826 | 1826 |
| 1827 #endif // defined TARGET_ARCH_IA32 | 1827 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |