| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 // interfaces. | 361 // interfaces. |
| 362 // Bool interface can be implemented only by core class Bool. | 362 // Bool interface can be implemented only by core class Bool. |
| 363 if (type.IsBoolType()) { | 363 if (type.IsBoolType()) { |
| 364 __ CompareImmediate(kClassIdReg, kBoolCid, PP); | 364 __ CompareImmediate(kClassIdReg, kBoolCid, PP); |
| 365 __ b(is_instance_lbl, EQ); | 365 __ b(is_instance_lbl, EQ); |
| 366 __ b(is_not_instance_lbl); | 366 __ b(is_not_instance_lbl); |
| 367 return false; | 367 return false; |
| 368 } | 368 } |
| 369 if (type.IsFunctionType()) { | 369 if (type.IsFunctionType()) { |
| 370 // Check if instance is a closure. | 370 // Check if instance is a closure. |
| 371 __ LoadClassById(R3, kClassIdReg, PP); | 371 __ LoadClassById(R3, kClassIdReg, isolate(), PP); |
| 372 __ LoadFieldFromOffset(R3, R3, Class::signature_function_offset(), PP); | 372 __ LoadFieldFromOffset(R3, R3, Class::signature_function_offset(), PP); |
| 373 __ CompareObject(R3, Object::null_object(), PP); | 373 __ CompareObject(R3, Object::null_object(), PP); |
| 374 __ b(is_instance_lbl, NE); | 374 __ b(is_instance_lbl, NE); |
| 375 } | 375 } |
| 376 // Custom checking for numbers (Smi, Mint, Bigint and Double). | 376 // Custom checking for numbers (Smi, Mint, Bigint and Double). |
| 377 // Note that instance is not Smi (checked above). | 377 // Note that instance is not Smi (checked above). |
| 378 if (type.IsSubtypeOf(Type::Handle(Type::Number()), NULL)) { | 378 if (type.IsSubtypeOf(Type::Handle(Type::Number()), NULL)) { |
| 379 GenerateNumberTypeCheck( | 379 GenerateNumberTypeCheck( |
| 380 kClassIdReg, type, is_instance_lbl, is_not_instance_lbl); | 380 kClassIdReg, type, is_instance_lbl, is_not_instance_lbl); |
| 381 return false; | 381 return false; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 396 // TODO(srdjan): Implement a quicker subtype check, as type test | 396 // TODO(srdjan): Implement a quicker subtype check, as type test |
| 397 // arrays can grow too high, but they may be useful when optimizing | 397 // arrays can grow too high, but they may be useful when optimizing |
| 398 // code (type-feedback). | 398 // code (type-feedback). |
| 399 RawSubtypeTestCache* FlowGraphCompiler::GenerateSubtype1TestCacheLookup( | 399 RawSubtypeTestCache* FlowGraphCompiler::GenerateSubtype1TestCacheLookup( |
| 400 intptr_t token_pos, | 400 intptr_t token_pos, |
| 401 const Class& type_class, | 401 const Class& type_class, |
| 402 Label* is_instance_lbl, | 402 Label* is_instance_lbl, |
| 403 Label* is_not_instance_lbl) { | 403 Label* is_not_instance_lbl) { |
| 404 __ Comment("Subtype1TestCacheLookup"); | 404 __ Comment("Subtype1TestCacheLookup"); |
| 405 const Register kInstanceReg = R0; | 405 const Register kInstanceReg = R0; |
| 406 __ LoadClass(R1, kInstanceReg, PP); | 406 __ LoadClass(R1, kInstanceReg, isolate(), PP); |
| 407 // R1: instance class. | 407 // R1: instance class. |
| 408 // Check immediate superclass equality. | 408 // Check immediate superclass equality. |
| 409 __ LoadFieldFromOffset(R2, R1, Class::super_type_offset(), PP); | 409 __ LoadFieldFromOffset(R2, R1, Class::super_type_offset(), PP); |
| 410 __ LoadFieldFromOffset(R2, R2, Type::type_class_offset(), PP); | 410 __ LoadFieldFromOffset(R2, R2, Type::type_class_offset(), PP); |
| 411 __ CompareObject(R2, type_class, PP); | 411 __ CompareObject(R2, type_class, PP); |
| 412 __ b(is_instance_lbl, EQ); | 412 __ b(is_instance_lbl, EQ); |
| 413 | 413 |
| 414 const Register kTypeArgumentsReg = kNoRegister; | 414 const Register kTypeArgumentsReg = kNoRegister; |
| 415 const Register kTempReg = kNoRegister; | 415 const Register kTempReg = kNoRegister; |
| 416 return GenerateCallSubtypeTestStub(kTestTypeOneArg, | 416 return GenerateCallSubtypeTestStub(kTestTypeOneArg, |
| (...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1767 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1767 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
| 1768 __ PopDouble(reg); | 1768 __ PopDouble(reg); |
| 1769 } | 1769 } |
| 1770 | 1770 |
| 1771 | 1771 |
| 1772 #undef __ | 1772 #undef __ |
| 1773 | 1773 |
| 1774 } // namespace dart | 1774 } // namespace dart |
| 1775 | 1775 |
| 1776 #endif // defined TARGET_ARCH_ARM64 | 1776 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |