| 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 // See ClassFinalizer::ResolveSuperTypeAndInterfaces for list of restricted | 365 // See ClassFinalizer::ResolveSuperTypeAndInterfaces for list of restricted |
| 366 // interfaces. | 366 // interfaces. |
| 367 // Bool interface can be implemented only by core class Bool. | 367 // Bool interface can be implemented only by core class Bool. |
| 368 if (type.IsBoolType()) { | 368 if (type.IsBoolType()) { |
| 369 __ BranchEqual(kClassIdReg, kBoolCid, is_instance_lbl); | 369 __ BranchEqual(kClassIdReg, kBoolCid, is_instance_lbl); |
| 370 __ b(is_not_instance_lbl); | 370 __ b(is_not_instance_lbl); |
| 371 return false; | 371 return false; |
| 372 } | 372 } |
| 373 if (type.IsFunctionType()) { | 373 if (type.IsFunctionType()) { |
| 374 // Check if instance is a closure. | 374 // Check if instance is a closure. |
| 375 __ LoadClassById(T1, kClassIdReg); | 375 __ LoadClassById(T1, kClassIdReg, isolate()); |
| 376 __ lw(T1, FieldAddress(T1, Class::signature_function_offset())); | 376 __ lw(T1, FieldAddress(T1, Class::signature_function_offset())); |
| 377 __ BranchNotEqual(T1, reinterpret_cast<int32_t>(Object::null()), | 377 __ BranchNotEqual(T1, reinterpret_cast<int32_t>(Object::null()), |
| 378 is_instance_lbl); | 378 is_instance_lbl); |
| 379 } | 379 } |
| 380 // Custom checking for numbers (Smi, Mint, Bigint and Double). | 380 // Custom checking for numbers (Smi, Mint, Bigint and Double). |
| 381 // Note that instance is not Smi (checked above). | 381 // Note that instance is not Smi (checked above). |
| 382 if (type.IsSubtypeOf(Type::Handle(Type::Number()), NULL)) { | 382 if (type.IsSubtypeOf(Type::Handle(Type::Number()), NULL)) { |
| 383 GenerateNumberTypeCheck( | 383 GenerateNumberTypeCheck( |
| 384 kClassIdReg, type, is_instance_lbl, is_not_instance_lbl); | 384 kClassIdReg, type, is_instance_lbl, is_not_instance_lbl); |
| 385 return false; | 385 return false; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 401 // arrays can grow too high, but they may be useful when optimizing | 401 // arrays can grow too high, but they may be useful when optimizing |
| 402 // code (type-feedback). | 402 // code (type-feedback). |
| 403 RawSubtypeTestCache* FlowGraphCompiler::GenerateSubtype1TestCacheLookup( | 403 RawSubtypeTestCache* FlowGraphCompiler::GenerateSubtype1TestCacheLookup( |
| 404 intptr_t token_pos, | 404 intptr_t token_pos, |
| 405 const Class& type_class, | 405 const Class& type_class, |
| 406 Label* is_instance_lbl, | 406 Label* is_instance_lbl, |
| 407 Label* is_not_instance_lbl) { | 407 Label* is_not_instance_lbl) { |
| 408 __ TraceSimMsg("Subtype1TestCacheLookup"); | 408 __ TraceSimMsg("Subtype1TestCacheLookup"); |
| 409 __ Comment("Subtype1TestCacheLookup"); | 409 __ Comment("Subtype1TestCacheLookup"); |
| 410 const Register kInstanceReg = A0; | 410 const Register kInstanceReg = A0; |
| 411 __ LoadClass(T0, kInstanceReg); | 411 __ LoadClass(T0, kInstanceReg, isolate()); |
| 412 // T0: instance class. | 412 // T0: instance class. |
| 413 // Check immediate superclass equality. | 413 // Check immediate superclass equality. |
| 414 __ lw(T0, FieldAddress(T0, Class::super_type_offset())); | 414 __ lw(T0, FieldAddress(T0, Class::super_type_offset())); |
| 415 __ lw(T0, FieldAddress(T0, Type::type_class_offset())); | 415 __ lw(T0, FieldAddress(T0, Type::type_class_offset())); |
| 416 __ BranchEqual(T0, type_class, is_instance_lbl); | 416 __ BranchEqual(T0, type_class, is_instance_lbl); |
| 417 | 417 |
| 418 const Register kTypeArgumentsReg = kNoRegister; | 418 const Register kTypeArgumentsReg = kNoRegister; |
| 419 const Register kTempReg = kNoRegister; | 419 const Register kTempReg = kNoRegister; |
| 420 return GenerateCallSubtypeTestStub(kTestTypeOneArg, | 420 return GenerateCallSubtypeTestStub(kTestTypeOneArg, |
| 421 kInstanceReg, | 421 kInstanceReg, |
| (...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 __ AddImmediate(SP, kDoubleSize); | 1799 __ AddImmediate(SP, kDoubleSize); |
| 1800 } | 1800 } |
| 1801 | 1801 |
| 1802 | 1802 |
| 1803 #undef __ | 1803 #undef __ |
| 1804 | 1804 |
| 1805 | 1805 |
| 1806 } // namespace dart | 1806 } // namespace dart |
| 1807 | 1807 |
| 1808 #endif // defined TARGET_ARCH_MIPS | 1808 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |