| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/code_generator.h" | 8 #include "vm/code_generator.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1743 __ j(EQUAL, &done, Assembler::kNearJump); | 1743 __ j(EQUAL, &done, Assembler::kNearJump); |
| 1744 // Check if the type has type parameters, if not do the class comparison. | 1744 // Check if the type has type parameters, if not do the class comparison. |
| 1745 Label not_smi; | 1745 Label not_smi; |
| 1746 __ testl(EAX, Immediate(kSmiTagMask)); // Value is Smi? | 1746 __ testl(EAX, Immediate(kSmiTagMask)); // Value is Smi? |
| 1747 __ j(NOT_ZERO, ¬_smi, Assembler::kNearJump); | 1747 __ j(NOT_ZERO, ¬_smi, Assembler::kNearJump); |
| 1748 __ CompareObject(EDX, Type::ZoneHandle(Type::IntInterface())); | 1748 __ CompareObject(EDX, Type::ZoneHandle(Type::IntInterface())); |
| 1749 __ j(EQUAL, &done, Assembler::kNearJump); | 1749 __ j(EQUAL, &done, Assembler::kNearJump); |
| 1750 __ CompareObject(EDX, Type::ZoneHandle(Type::NumberInterface())); | 1750 __ CompareObject(EDX, Type::ZoneHandle(Type::NumberInterface())); |
| 1751 __ j(EQUAL, &done, Assembler::kNearJump); | 1751 __ j(EQUAL, &done, Assembler::kNearJump); |
| 1752 __ Bind(¬_smi); | 1752 __ Bind(¬_smi); |
| 1753 // The instantiated type parameter may not be a Type, but could be an |
| 1754 // InstantiatedType. It is therefore necessary to check its class. |
| 1755 __ movl(ECX, FieldAddress(EDX, Object::class_offset())); |
| 1756 __ CompareObject(ECX, Object::ZoneHandle(Object::type_class())); |
| 1757 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); |
| 1753 __ movl(EDX, FieldAddress(EDX, Type::type_class_offset())); | 1758 __ movl(EDX, FieldAddress(EDX, Type::type_class_offset())); |
| 1754 __ movl(ECX, FieldAddress(EDX, Class::type_parameters_offset())); | 1759 __ movl(ECX, FieldAddress(EDX, Class::type_parameters_offset())); |
| 1755 // Check that class of dst_type has no type parameters. | 1760 // Check that class of dst_type has no type parameters. |
| 1756 __ cmpl(ECX, raw_null); | 1761 __ cmpl(ECX, raw_null); |
| 1757 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); | 1762 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); |
| 1758 // We have a non-parameterized class in EDX, compare with class of | 1763 // We have a non-parameterized class in EDX, compare with class of |
| 1759 // value in EAX. EAX, EDX are preserved in stub. | 1764 // value in EAX. EAX, EDX are preserved in stub. |
| 1760 __ call(&StubCode::IsRawSubTypeLabel()); | 1765 __ call(&StubCode::IsRawSubTypeLabel()); |
| 1761 // Result in EBX: 1 is raw subtype. | 1766 // Result in EBX: 1 is raw subtype. |
| 1762 __ cmpl(EBX, Immediate(1)); | 1767 __ cmpl(EBX, Immediate(1)); |
| (...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2886 const Error& error = Error::Handle( | 2891 const Error& error = Error::Handle( |
| 2887 Parser::FormatError(script, token_index, "Error", format, args)); | 2892 Parser::FormatError(script, token_index, "Error", format, args)); |
| 2888 va_end(args); | 2893 va_end(args); |
| 2889 Isolate::Current()->long_jump_base()->Jump(1, error); | 2894 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2890 UNREACHABLE(); | 2895 UNREACHABLE(); |
| 2891 } | 2896 } |
| 2892 | 2897 |
| 2893 } // namespace dart | 2898 } // namespace dart |
| 2894 | 2899 |
| 2895 #endif // defined TARGET_ARCH_IA32 | 2900 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |