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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 case 2: return TIMES_2; | 527 case 2: return TIMES_2; |
528 case 4: return TIMES_4; | 528 case 4: return TIMES_4; |
529 case 8: return TIMES_8; | 529 case 8: return TIMES_8; |
530 case 16: return TIMES_16; | 530 case 16: return TIMES_16; |
531 } | 531 } |
532 UNREACHABLE(); | 532 UNREACHABLE(); |
533 return static_cast<ScaleFactor>(0); | 533 return static_cast<ScaleFactor>(0); |
534 }; | 534 }; |
535 | 535 |
536 | 536 |
537 #define TYPEDDATA_ALLOCATOR(clazz) \ | 537 #define TYPED_DATA_ALLOCATOR(clazz) \ |
538 bool Intrinsifier::TypedData_##clazz##_new(Assembler* assembler) { \ | 538 bool Intrinsifier::TypedData_##clazz##_new(Assembler* assembler) { \ |
539 intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid); \ | 539 intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid); \ |
540 intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid); \ | 540 intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid); \ |
541 ScaleFactor scale = GetScaleFactor(size); \ | 541 ScaleFactor scale = GetScaleFactor(size); \ |
542 TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, scale); \ | 542 TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, scale); \ |
543 return false; \ | 543 return false; \ |
544 } \ | 544 } \ |
545 bool Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) { \ | 545 bool Intrinsifier::TypedData_##clazz##_factory(Assembler* assembler) { \ |
546 intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid); \ | 546 intptr_t size = TypedData::ElementSizeInBytes(kTypedData##clazz##Cid); \ |
547 intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid); \ | 547 intptr_t max_len = TypedData::MaxElements(kTypedData##clazz##Cid); \ |
548 ScaleFactor scale = GetScaleFactor(size); \ | 548 ScaleFactor scale = GetScaleFactor(size); \ |
549 TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, scale); \ | 549 TYPED_ARRAY_ALLOCATION(TypedData, kTypedData##clazz##Cid, max_len, scale); \ |
550 return false; \ | 550 return false; \ |
551 } | 551 } |
552 CLASS_LIST_TYPED_DATA(TYPEDDATA_ALLOCATOR) | 552 CLASS_LIST_TYPED_DATA(TYPED_DATA_ALLOCATOR) |
553 #undef TYPEDDATA_ALLOCATOR | 553 #undef TYPED_DATA_ALLOCATOR |
554 | 554 |
555 | 555 |
556 // Tests if two top most arguments are smis, jumps to label not_smi if not. | 556 // Tests if two top most arguments are smis, jumps to label not_smi if not. |
557 // Topmost argument is in RAX. | 557 // Topmost argument is in RAX. |
558 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) { | 558 static void TestBothArgumentsSmis(Assembler* assembler, Label* not_smi) { |
559 __ movq(RAX, Address(RSP, + 1 * kWordSize)); | 559 __ movq(RAX, Address(RSP, + 1 * kWordSize)); |
560 __ movq(RCX, Address(RSP, + 2 * kWordSize)); | 560 __ movq(RCX, Address(RSP, + 2 * kWordSize)); |
561 __ orq(RCX, RAX); | 561 __ orq(RCX, RAX); |
562 __ testq(RCX, Immediate(kSmiTagMask)); | 562 __ testq(RCX, Immediate(kSmiTagMask)); |
563 __ j(NOT_ZERO, not_smi); | 563 __ j(NOT_ZERO, not_smi); |
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1598 __ Bind(&fall_through); | 1598 __ Bind(&fall_through); |
1599 return false; | 1599 return false; |
1600 } | 1600 } |
1601 | 1601 |
1602 | 1602 |
1603 #undef __ | 1603 #undef __ |
1604 | 1604 |
1605 } // namespace dart | 1605 } // namespace dart |
1606 | 1606 |
1607 #endif // defined TARGET_ARCH_X64 | 1607 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |