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

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

Issue 842033005: Make Bigint instances immutable by removing all setters. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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) 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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 __ bic(R0, R0, Operand(kSmiTagMask)); // Remove inverted smi-tag. 792 __ bic(R0, R0, Operand(kSmiTagMask)); // Remove inverted smi-tag.
793 __ Ret(); 793 __ Ret();
794 } 794 }
795 795
796 796
797 void Intrinsifier::Smi_bitLength(Assembler* assembler) { 797 void Intrinsifier::Smi_bitLength(Assembler* assembler) {
798 // TODO(sra): Implement as word-length - CLZ. 798 // TODO(sra): Implement as word-length - CLZ.
799 } 799 }
800 800
801 801
802 void Intrinsifier::Bigint_setNeg(Assembler* assembler) {
803 __ ldrd(R0, Address(SP, 0 * kWordSize)); // R0 = this, R1 = neg value.
804 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::neg_offset()), R0, false);
805 __ Ret();
806 }
807
808
809 void Intrinsifier::Bigint_setUsed(Assembler* assembler) {
810 __ ldrd(R0, Address(SP, 0 * kWordSize)); // R0 = this, R1 = used value.
811 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::used_offset()), R0);
812 __ Ret();
813 }
814
815
816 void Intrinsifier::Bigint_setDigits(Assembler* assembler) {
817 __ ldrd(R0, Address(SP, 0 * kWordSize)); // R0 = this, R1 = digits value.
818 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::digits_offset()), R0, false);
819 __ Ret();
820 }
821
822
823 void Intrinsifier::Bigint_absAdd(Assembler* assembler) { 802 void Intrinsifier::Bigint_absAdd(Assembler* assembler) {
824 // static void _absAdd(Uint32List digits, int used, 803 // static void _absAdd(Uint32List digits, int used,
825 // Uint32List a_digits, int a_used, 804 // Uint32List a_digits, int a_used,
826 // Uint32List r_digits) 805 // Uint32List r_digits)
827 806
828 // R2 = used, R3 = digits 807 // R2 = used, R3 = digits
829 __ ldrd(R2, Address(SP, 3 * kWordSize)); 808 __ ldrd(R2, Address(SP, 3 * kWordSize));
830 // R3 = &digits[0] 809 // R3 = &digits[0]
831 __ add(R3, R3, Operand(TypedData::data_offset() - kHeapObjectTag)); 810 __ add(R3, R3, Operand(TypedData::data_offset() - kHeapObjectTag));
832 811
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1974 Isolate* isolate = Isolate::Current(); 1953 Isolate* isolate = Isolate::Current();
1975 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); 1954 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate));
1976 // Set return value to Isolate::current_tag_. 1955 // Set return value to Isolate::current_tag_.
1977 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 1956 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
1978 __ Ret(); 1957 __ Ret();
1979 } 1958 }
1980 1959
1981 } // namespace dart 1960 } // namespace dart
1982 1961
1983 #endif // defined TARGET_ARCH_ARM 1962 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698