| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 // interfaces. | 374 // interfaces. |
| 375 // Bool interface can be implemented only by core class Bool. | 375 // Bool interface can be implemented only by core class Bool. |
| 376 if (type.IsBoolType()) { | 376 if (type.IsBoolType()) { |
| 377 __ CompareImmediate(kClassIdReg, kBoolCid); | 377 __ CompareImmediate(kClassIdReg, kBoolCid); |
| 378 __ b(is_instance_lbl, EQ); | 378 __ b(is_instance_lbl, EQ); |
| 379 __ b(is_not_instance_lbl); | 379 __ b(is_not_instance_lbl); |
| 380 return false; | 380 return false; |
| 381 } | 381 } |
| 382 if (type.IsFunctionType()) { | 382 if (type.IsFunctionType()) { |
| 383 // Check if instance is a closure. | 383 // Check if instance is a closure. |
| 384 __ LoadClassById(R3, kClassIdReg); | 384 __ LoadClassById(R3, kClassIdReg, isolate()); |
| 385 __ ldr(R3, FieldAddress(R3, Class::signature_function_offset())); | 385 __ ldr(R3, FieldAddress(R3, Class::signature_function_offset())); |
| 386 __ CompareImmediate(R3, reinterpret_cast<int32_t>(Object::null())); | 386 __ CompareImmediate(R3, reinterpret_cast<int32_t>(Object::null())); |
| 387 __ b(is_instance_lbl, NE); | 387 __ b(is_instance_lbl, NE); |
| 388 } | 388 } |
| 389 // Custom checking for numbers (Smi, Mint, Bigint and Double). | 389 // Custom checking for numbers (Smi, Mint, Bigint and Double). |
| 390 // Note that instance is not Smi (checked above). | 390 // Note that instance is not Smi (checked above). |
| 391 if (type.IsSubtypeOf(Type::Handle(Type::Number()), NULL)) { | 391 if (type.IsSubtypeOf(Type::Handle(Type::Number()), NULL)) { |
| 392 GenerateNumberTypeCheck( | 392 GenerateNumberTypeCheck( |
| 393 kClassIdReg, type, is_instance_lbl, is_not_instance_lbl); | 393 kClassIdReg, type, is_instance_lbl, is_not_instance_lbl); |
| 394 return false; | 394 return false; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 409 // TODO(srdjan): Implement a quicker subtype check, as type test | 409 // TODO(srdjan): Implement a quicker subtype check, as type test |
| 410 // arrays can grow too high, but they may be useful when optimizing | 410 // arrays can grow too high, but they may be useful when optimizing |
| 411 // code (type-feedback). | 411 // code (type-feedback). |
| 412 RawSubtypeTestCache* FlowGraphCompiler::GenerateSubtype1TestCacheLookup( | 412 RawSubtypeTestCache* FlowGraphCompiler::GenerateSubtype1TestCacheLookup( |
| 413 intptr_t token_pos, | 413 intptr_t token_pos, |
| 414 const Class& type_class, | 414 const Class& type_class, |
| 415 Label* is_instance_lbl, | 415 Label* is_instance_lbl, |
| 416 Label* is_not_instance_lbl) { | 416 Label* is_not_instance_lbl) { |
| 417 __ Comment("Subtype1TestCacheLookup"); | 417 __ Comment("Subtype1TestCacheLookup"); |
| 418 const Register kInstanceReg = R0; | 418 const Register kInstanceReg = R0; |
| 419 __ LoadClass(R1, kInstanceReg, R2); | 419 __ LoadClass(R1, kInstanceReg, R2, isolate()); |
| 420 // R1: instance class. | 420 // R1: instance class. |
| 421 // Check immediate superclass equality. | 421 // Check immediate superclass equality. |
| 422 __ ldr(R2, FieldAddress(R1, Class::super_type_offset())); | 422 __ ldr(R2, FieldAddress(R1, Class::super_type_offset())); |
| 423 __ ldr(R2, FieldAddress(R2, Type::type_class_offset())); | 423 __ ldr(R2, FieldAddress(R2, Type::type_class_offset())); |
| 424 __ CompareObject(R2, type_class); | 424 __ CompareObject(R2, type_class); |
| 425 __ b(is_instance_lbl, EQ); | 425 __ b(is_instance_lbl, EQ); |
| 426 | 426 |
| 427 const Register kTypeArgumentsReg = kNoRegister; | 427 const Register kTypeArgumentsReg = kNoRegister; |
| 428 const Register kTempReg = kNoRegister; | 428 const Register kTempReg = kNoRegister; |
| 429 return GenerateCallSubtypeTestStub(kTestTypeOneArg, | 429 return GenerateCallSubtypeTestStub(kTestTypeOneArg, |
| (...skipping 1376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1806 DRegister dreg = EvenDRegisterOf(reg); | 1806 DRegister dreg = EvenDRegisterOf(reg); |
| 1807 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); | 1807 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); |
| 1808 } | 1808 } |
| 1809 | 1809 |
| 1810 | 1810 |
| 1811 #undef __ | 1811 #undef __ |
| 1812 | 1812 |
| 1813 } // namespace dart | 1813 } // namespace dart |
| 1814 | 1814 |
| 1815 #endif // defined TARGET_ARCH_ARM | 1815 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |