Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: runtime/vm/intrinsifier_arm64.cc

Issue 562333004: Recognize Bigint setters and getters. This code will be removed when/if we change the fields to be … (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 __ andi(R0, R0, ~kSmiTagMask); // Remove inverted smi-tag. 770 __ andi(R0, R0, ~kSmiTagMask); // Remove inverted smi-tag.
771 __ ret(); 771 __ ret();
772 } 772 }
773 773
774 774
775 void Intrinsifier::Smi_bitLength(Assembler* assembler) { 775 void Intrinsifier::Smi_bitLength(Assembler* assembler) {
776 // TODO(sra): Implement as word-length - CLZ. 776 // TODO(sra): Implement as word-length - CLZ.
777 } 777 }
778 778
779 779
780 void Intrinsifier::Bigint_getNeg(Assembler* assembler) {
781 __ ldr(R0, Address(SP, 0 * kWordSize));
782 __ ldr(R0, FieldAddress(R0, Bigint::neg_offset()));
783 __ ret();
784 }
785
786
787 void Intrinsifier::Bigint_setNeg(Assembler* assembler) { 780 void Intrinsifier::Bigint_setNeg(Assembler* assembler) {
788 __ ldr(R0, Address(SP, 0 * kWordSize)); 781 __ ldr(R0, Address(SP, 0 * kWordSize));
789 __ ldr(R1, Address(SP, 1 * kWordSize)); 782 __ ldr(R1, Address(SP, 1 * kWordSize));
790 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::neg_offset()), R0, false); 783 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::neg_offset()), R0, false);
791 __ ret(); 784 __ ret();
792 } 785 }
793 786
794 787
795 void Intrinsifier::Bigint_getUsed(Assembler* assembler) {
796 __ ldr(R0, Address(SP, 0 * kWordSize));
797 __ ldr(R0, FieldAddress(R0, Bigint::used_offset()));
798 __ ret();
799 }
800
801
802 void Intrinsifier::Bigint_setUsed(Assembler* assembler) { 788 void Intrinsifier::Bigint_setUsed(Assembler* assembler) {
803 __ ldr(R0, Address(SP, 0 * kWordSize)); 789 __ ldr(R0, Address(SP, 0 * kWordSize));
804 __ ldr(R1, Address(SP, 1 * kWordSize)); 790 __ ldr(R1, Address(SP, 1 * kWordSize));
805 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::used_offset()), R0); 791 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::used_offset()), R0);
806 __ ret(); 792 __ ret();
807 } 793 }
808 794
809 795
810 void Intrinsifier::Bigint_getDigits(Assembler* assembler) {
811 __ ldr(R0, Address(SP, 0 * kWordSize));
812 __ ldr(R0, FieldAddress(R0, Bigint::digits_offset()));
813 __ ret();
814 }
815
816
817 void Intrinsifier::Bigint_setDigits(Assembler* assembler) { 796 void Intrinsifier::Bigint_setDigits(Assembler* assembler) {
818 __ ldr(R0, Address(SP, 0 * kWordSize)); 797 __ ldr(R0, Address(SP, 0 * kWordSize));
819 __ ldr(R1, Address(SP, 1 * kWordSize)); 798 __ ldr(R1, Address(SP, 1 * kWordSize));
820 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::digits_offset()), R0, false); 799 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::digits_offset()), R0, false);
821 __ ret(); 800 __ ret();
822 } 801 }
823 802
824 803
825 // Check if the last argument is a double, jump to label 'is_smi' if smi 804 // Check if the last argument is a double, jump to label 'is_smi' if smi
826 // (easy to convert to double), otherwise jump to label 'not_double_smi', 805 // (easy to convert to double), otherwise jump to label 'not_double_smi',
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 Isolate* isolate = Isolate::Current(); 1523 Isolate* isolate = Isolate::Current();
1545 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP); 1524 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP);
1546 // Set return value to Isolate::current_tag_. 1525 // Set return value to Isolate::current_tag_.
1547 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 1526 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
1548 __ ret(); 1527 __ ret();
1549 } 1528 }
1550 1529
1551 } // namespace dart 1530 } // namespace dart
1552 1531
1553 #endif // defined TARGET_ARCH_ARM64 1532 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698