| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
| (...skipping 1744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1755 } | 1755 } |
| 1756 | 1756 |
| 1757 | 1757 |
| 1758 // Check if an instance class is a subtype of class/interface using simple | 1758 // Check if an instance class is a subtype of class/interface using simple |
| 1759 // superchain and interface array traversal. Does not take type parameters into | 1759 // superchain and interface array traversal. Does not take type parameters into |
| 1760 // account. | 1760 // account. |
| 1761 // EAX: instance (preserved) | 1761 // EAX: instance (preserved) |
| 1762 // EDX: class/interface to test against (is class of instance a subtype of it). | 1762 // EDX: class/interface to test against (is class of instance a subtype of it). |
| 1763 // (preserved). | 1763 // (preserved). |
| 1764 // Result in EBX: 1 is subtype, 0 maybe not. | 1764 // Result in EBX: 1 is subtype, 0 maybe not. |
| 1765 // Destroys EBX, ECX. | 1765 // Destroys EBX, EDI, ECX. |
| 1766 void StubCode::GenerateIsRawSubTypeStub(Assembler* assembler) { | 1766 void StubCode::GenerateIsRawSubTypeStub(Assembler* assembler) { |
| 1767 const Immediate raw_null = | 1767 const Immediate raw_null = |
| 1768 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 1768 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 1769 Label test_class, not_found, found, class_loaded_in_ECX, smi_value; | 1769 Label test_class, not_found, found, class_loaded_in_ECX, smi_value; |
| 1770 __ EnterFrame(0); | 1770 __ EnterFrame(0); |
| 1771 __ testl(EAX, Immediate(kSmiTagMask)); | 1771 __ testl(EAX, Immediate(kSmiTagMask)); |
| 1772 __ j(ZERO, &smi_value, Assembler::kNearJump); | 1772 __ j(ZERO, &smi_value, Assembler::kNearJump); |
| 1773 __ movl(ECX, FieldAddress(EAX, Object::class_offset())); | 1773 __ movl(ECX, FieldAddress(EAX, Object::class_offset())); |
| 1774 __ jmp(&class_loaded_in_ECX, Assembler::kNearJump); | 1774 __ jmp(&class_loaded_in_ECX, Assembler::kNearJump); |
| 1775 __ Bind(&smi_value); | 1775 __ Bind(&smi_value); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1826 __ movl(ECX, FieldAddress(ECX, Class::super_type_offset())); | 1826 __ movl(ECX, FieldAddress(ECX, Class::super_type_offset())); |
| 1827 // The supertype of Object is a null object. | 1827 // The supertype of Object is a null object. |
| 1828 __ cmpl(ECX, raw_null); | 1828 __ cmpl(ECX, raw_null); |
| 1829 __ j(EQUAL, ¬_found, Assembler::kNearJump); | 1829 __ j(EQUAL, ¬_found, Assembler::kNearJump); |
| 1830 __ movl(ECX, FieldAddress(ECX, Type::type_class_offset())); | 1830 __ movl(ECX, FieldAddress(ECX, Type::type_class_offset())); |
| 1831 __ cmpl(EDX, ECX); | 1831 __ cmpl(EDX, ECX); |
| 1832 __ j(NOT_EQUAL, &super_loop, Assembler::kNearJump); | 1832 __ j(NOT_EQUAL, &super_loop, Assembler::kNearJump); |
| 1833 __ jmp(&found, Assembler::kNearJump); | 1833 __ jmp(&found, Assembler::kNearJump); |
| 1834 } | 1834 } |
| 1835 | 1835 |
| 1836 | |
| 1837 } // namespace dart | 1836 } // namespace dart |
| 1838 | 1837 |
| 1839 #endif // defined TARGET_ARCH_IA32 | 1838 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |