Chromium Code Reviews| 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 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1538 } | 1538 } |
| 1539 // Compare if the classes are equal. | 1539 // Compare if the classes are equal. |
| 1540 __ Bind(&compare_classes); | 1540 __ Bind(&compare_classes); |
| 1541 // If dst_type is an interface, we can skip the class equality check, | 1541 // If dst_type is an interface, we can skip the class equality check, |
| 1542 // because instances cannot be of an interface type. | 1542 // because instances cannot be of an interface type. |
| 1543 if (!dst_type_class.is_interface()) { | 1543 if (!dst_type_class.is_interface()) { |
| 1544 __ movl(ECX, FieldAddress(EAX, Object::class_offset())); | 1544 __ movl(ECX, FieldAddress(EAX, Object::class_offset())); |
| 1545 TestClassAndJump(dst_type_class, &done); // Uses ECX. | 1545 TestClassAndJump(dst_type_class, &done); // Uses ECX. |
| 1546 // Check superclass | 1546 // Check superclass |
| 1547 __ movl(ECX, FieldAddress(ECX, Class::super_type_offset())); | 1547 __ movl(ECX, FieldAddress(ECX, Class::super_type_offset())); |
| 1548 // Note that supertypes can't be NULL as every Dart instance has | |
| 1549 // as supertype class Object. | |
|
regis
2012/03/27 20:18:02
Does that include a Dart instance of type Object?
srdjan
2012/03/27 20:43:40
Good point, I thought that we cannot allocate inst
srdjan
2012/03/27 20:47:09
Object.super_type is null, i.e., null object which
| |
| 1548 __ movl(ECX, FieldAddress(ECX, Type::type_class_offset())); | 1550 __ movl(ECX, FieldAddress(ECX, Type::type_class_offset())); |
| 1549 TestClassAndJump(dst_type_class, &done); // Uses ECX. | 1551 TestClassAndJump(dst_type_class, &done); // Uses ECX. |
| 1550 } else { | 1552 } else { |
| 1551 // However, for specific core library interfaces, we can check for | 1553 // However, for specific core library interfaces, we can check for |
| 1552 // specific core library classes. | 1554 // specific core library classes. |
| 1553 Error& malformed_error = Error::Handle(); | 1555 Error& malformed_error = Error::Handle(); |
| 1554 if (dst_type.IsBoolInterface()) { | 1556 if (dst_type.IsBoolInterface()) { |
| 1555 __ movl(ECX, FieldAddress(EAX, Object::class_offset())); | 1557 __ movl(ECX, FieldAddress(EAX, Object::class_offset())); |
| 1556 const Class& bool_class = Class::ZoneHandle( | 1558 const Class& bool_class = Class::ZoneHandle( |
| 1557 Isolate::Current()->object_store()->bool_class()); | 1559 Isolate::Current()->object_store()->bool_class()); |
| (...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2729 const Error& error = Error::Handle( | 2731 const Error& error = Error::Handle( |
| 2730 Parser::FormatError(script, token_index, "Error", format, args)); | 2732 Parser::FormatError(script, token_index, "Error", format, args)); |
| 2731 va_end(args); | 2733 va_end(args); |
| 2732 Isolate::Current()->long_jump_base()->Jump(1, error); | 2734 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2733 UNREACHABLE(); | 2735 UNREACHABLE(); |
| 2734 } | 2736 } |
| 2735 | 2737 |
| 2736 } // namespace dart | 2738 } // namespace dart |
| 2737 | 2739 |
| 2738 #endif // defined TARGET_ARCH_IA32 | 2740 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |