| 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/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 __ Bind(&compare_classes); | 224 __ Bind(&compare_classes); |
| 225 const Register kClassIdReg = ECX; | 225 const Register kClassIdReg = ECX; |
| 226 __ LoadClassId(kClassIdReg, kInstanceReg); | 226 __ LoadClassId(kClassIdReg, kInstanceReg); |
| 227 // If type is an interface, we can skip the class equality check. | 227 // If type is an interface, we can skip the class equality check. |
| 228 if (!type_class.is_interface()) { | 228 if (!type_class.is_interface()) { |
| 229 __ cmpl(kClassIdReg, Immediate(type_class.id())); | 229 __ cmpl(kClassIdReg, Immediate(type_class.id())); |
| 230 __ j(EQUAL, is_instance_lbl); | 230 __ j(EQUAL, is_instance_lbl); |
| 231 } | 231 } |
| 232 // Bool interface can be implemented only by core class Bool. | 232 // Bool interface can be implemented only by core class Bool. |
| 233 // (see ClassFinalizer::ResolveInterfaces for list of restricted interfaces). | 233 // (see ClassFinalizer::ResolveInterfaces for list of restricted interfaces). |
| 234 if (type.IsBoolInterface()) { | 234 if (type.IsBoolType()) { |
| 235 __ cmpl(kClassIdReg, Immediate(kBoolCid)); | 235 __ cmpl(kClassIdReg, Immediate(kBoolCid)); |
| 236 __ j(EQUAL, is_instance_lbl); | 236 __ j(EQUAL, is_instance_lbl); |
| 237 __ jmp(is_not_instance_lbl); | 237 __ jmp(is_not_instance_lbl); |
| 238 return false; | 238 return false; |
| 239 } | 239 } |
| 240 if (type.IsFunctionType()) { | 240 if (type.IsFunctionType()) { |
| 241 // Check if instance is a closure. | 241 // Check if instance is a closure. |
| 242 const Immediate raw_null = | 242 const Immediate raw_null = |
| 243 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 243 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 244 __ LoadClassById(EDI, kClassIdReg); | 244 __ LoadClassById(EDI, kClassIdReg); |
| (...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 __ popl(ECX); | 1310 __ popl(ECX); |
| 1311 __ popl(EAX); | 1311 __ popl(EAX); |
| 1312 } | 1312 } |
| 1313 | 1313 |
| 1314 | 1314 |
| 1315 #undef __ | 1315 #undef __ |
| 1316 | 1316 |
| 1317 } // namespace dart | 1317 } // namespace dart |
| 1318 | 1318 |
| 1319 #endif // defined TARGET_ARCH_IA32 | 1319 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |