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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 SubtypeTestCache::ZoneHandle(zone(), | 488 SubtypeTestCache::ZoneHandle(zone(), |
489 GenerateCallSubtypeTestStub(kTestTypeThreeArgs, | 489 GenerateCallSubtypeTestStub(kTestTypeThreeArgs, |
490 kInstanceReg, | 490 kInstanceReg, |
491 kTypeArgumentsReg, | 491 kTypeArgumentsReg, |
492 kTempReg, | 492 kTempReg, |
493 is_instance_lbl, | 493 is_instance_lbl, |
494 is_not_instance_lbl)); | 494 is_not_instance_lbl)); |
495 __ Bind(&fall_through); | 495 __ Bind(&fall_through); |
496 return type_test_cache.raw(); | 496 return type_test_cache.raw(); |
497 } | 497 } |
498 if (type.IsType()) { | 498 if (type.IsType() || type.IsFunctionType()) { |
499 const Register kInstanceReg = A0; | 499 const Register kInstanceReg = A0; |
500 const Register kTypeArgumentsReg = A1; | 500 const Register kTypeArgumentsReg = A1; |
501 __ andi(CMPRES1, kInstanceReg, Immediate(kSmiTagMask)); | 501 __ andi(CMPRES1, kInstanceReg, Immediate(kSmiTagMask)); |
502 __ beq(CMPRES1, ZR, is_not_instance_lbl); // Is instance Smi? | 502 __ beq(CMPRES1, ZR, is_not_instance_lbl); // Is instance Smi? |
503 __ lw(kTypeArgumentsReg, Address(SP, 0)); // Instantiator type args. | 503 __ lw(kTypeArgumentsReg, Address(SP, 0)); // Instantiator type args. |
504 // Uninstantiated type class is known at compile time, but the type | 504 // Uninstantiated type class is known at compile time, but the type |
505 // arguments are determined at runtime by the instantiator. | 505 // arguments are determined at runtime by the instantiator. |
506 const Register kTempReg = kNoRegister; | 506 const Register kTempReg = kNoRegister; |
507 return GenerateCallSubtypeTestStub(kTestTypeThreeArgs, | 507 return GenerateCallSubtypeTestStub(kTestTypeThreeArgs, |
508 kInstanceReg, | 508 kInstanceReg, |
(...skipping 1389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1898 __ AddImmediate(SP, kDoubleSize); | 1898 __ AddImmediate(SP, kDoubleSize); |
1899 } | 1899 } |
1900 | 1900 |
1901 | 1901 |
1902 #undef __ | 1902 #undef __ |
1903 | 1903 |
1904 | 1904 |
1905 } // namespace dart | 1905 } // namespace dart |
1906 | 1906 |
1907 #endif // defined TARGET_ARCH_MIPS | 1907 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |