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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
9 | 9 |
10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
(...skipping 1518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1529 } | 1529 } |
1530 | 1530 |
1531 | 1531 |
1532 // Return type quickly for simple types (not parameterized and not signature). | 1532 // Return type quickly for simple types (not parameterized and not signature). |
1533 void Intrinsifier::ObjectRuntimeType(Assembler* assembler) { | 1533 void Intrinsifier::ObjectRuntimeType(Assembler* assembler) { |
1534 Label fall_through; | 1534 Label fall_through; |
1535 __ movq(RAX, Address(RSP, + 1 * kWordSize)); | 1535 __ movq(RAX, Address(RSP, + 1 * kWordSize)); |
1536 __ LoadClassIdMayBeSmi(RCX, RAX); | 1536 __ LoadClassIdMayBeSmi(RCX, RAX); |
1537 | 1537 |
1538 // RCX: untagged cid of instance (RAX). | 1538 // RCX: untagged cid of instance (RAX). |
| 1539 __ cmpq(RCX, Immediate(kClosureCid)); |
| 1540 __ j(EQUAL, &fall_through, Assembler::kNearJump); // Instance is a closure. |
| 1541 |
1539 __ LoadClassById(RDI, RCX); | 1542 __ LoadClassById(RDI, RCX); |
1540 // RDI: class of instance (RAX). | 1543 // RDI: class of instance (RAX). |
1541 __ movq(RCX, FieldAddress(RDI, Class::signature_function_offset())); | |
1542 __ CompareObject(RCX, Object::null_object()); | |
1543 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); | |
1544 | 1544 |
1545 __ movzxw(RCX, FieldAddress(RDI, Class::num_type_arguments_offset())); | 1545 __ movzxw(RCX, FieldAddress(RDI, Class::num_type_arguments_offset())); |
1546 __ cmpq(RCX, Immediate(0)); | 1546 __ cmpq(RCX, Immediate(0)); |
1547 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); | 1547 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); |
1548 __ movq(RAX, FieldAddress(RDI, Class::canonical_types_offset())); | 1548 __ movq(RAX, FieldAddress(RDI, Class::canonical_types_offset())); |
1549 __ CompareObject(RAX, Object::null_object()); | 1549 __ CompareObject(RAX, Object::null_object()); |
1550 __ j(EQUAL, &fall_through, Assembler::kNearJump); // Not yet set. | 1550 __ j(EQUAL, &fall_through, Assembler::kNearJump); // Not yet set. |
1551 __ ret(); | 1551 __ ret(); |
1552 | 1552 |
1553 __ Bind(&fall_through); | 1553 __ Bind(&fall_through); |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2108 __ LoadIsolate(RAX); | 2108 __ LoadIsolate(RAX); |
2109 __ movq(RAX, Address(RAX, Isolate::current_tag_offset())); | 2109 __ movq(RAX, Address(RAX, Isolate::current_tag_offset())); |
2110 __ ret(); | 2110 __ ret(); |
2111 } | 2111 } |
2112 | 2112 |
2113 #undef __ | 2113 #undef __ |
2114 | 2114 |
2115 } // namespace dart | 2115 } // namespace dart |
2116 | 2116 |
2117 #endif // defined TARGET_ARCH_X64 | 2117 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |