| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 return false; | 225 return false; |
| 226 } | 226 } |
| 227 if (type.IsFunctionType()) { | 227 if (type.IsFunctionType()) { |
| 228 // Check if instance is a closure. | 228 // Check if instance is a closure. |
| 229 const Immediate raw_null = | 229 const Immediate raw_null = |
| 230 Immediate(reinterpret_cast<intptr_t>(Object::null())); | 230 Immediate(reinterpret_cast<intptr_t>(Object::null())); |
| 231 __ LoadClassById(EDI, kClassIdReg); | 231 __ LoadClassById(EDI, kClassIdReg); |
| 232 __ movl(EDI, FieldAddress(EDI, Class::signature_function_offset())); | 232 __ movl(EDI, FieldAddress(EDI, Class::signature_function_offset())); |
| 233 __ cmpl(EDI, raw_null); | 233 __ cmpl(EDI, raw_null); |
| 234 __ j(NOT_EQUAL, is_instance_lbl); | 234 __ j(NOT_EQUAL, is_instance_lbl); |
| 235 __ jmp(is_not_instance_lbl); | |
| 236 return false; | |
| 237 } | 235 } |
| 238 // Custom checking for numbers (Smi, Mint, Bigint and Double). | 236 // Custom checking for numbers (Smi, Mint, Bigint and Double). |
| 239 // Note that instance is not Smi (checked above). | 237 // Note that instance is not Smi (checked above). |
| 240 if (type.IsSubtypeOf(Type::Handle(Type::Number()), NULL)) { | 238 if (type.IsSubtypeOf(Type::Handle(Type::Number()), NULL)) { |
| 241 GenerateNumberTypeCheck( | 239 GenerateNumberTypeCheck( |
| 242 kClassIdReg, type, is_instance_lbl, is_not_instance_lbl); | 240 kClassIdReg, type, is_instance_lbl, is_not_instance_lbl); |
| 243 return false; | 241 return false; |
| 244 } | 242 } |
| 245 if (type.IsStringType()) { | 243 if (type.IsStringType()) { |
| 246 GenerateStringTypeCheck(kClassIdReg, is_instance_lbl, is_not_instance_lbl); | 244 GenerateStringTypeCheck(kClassIdReg, is_instance_lbl, is_not_instance_lbl); |
| (...skipping 1254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1501 __ popl(ECX); | 1499 __ popl(ECX); |
| 1502 __ popl(EAX); | 1500 __ popl(EAX); |
| 1503 } | 1501 } |
| 1504 | 1502 |
| 1505 | 1503 |
| 1506 #undef __ | 1504 #undef __ |
| 1507 | 1505 |
| 1508 } // namespace dart | 1506 } // namespace dart |
| 1509 | 1507 |
| 1510 #endif // defined TARGET_ARCH_IA32 | 1508 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |