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

Side by Side Diff: runtime/vm/intrinsifier_arm64.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) 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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 __ andi(R0, R0, Immediate(~kSmiTagMask)); // Remove inverted smi-tag. 681 __ andi(R0, R0, Immediate(~kSmiTagMask)); // Remove inverted smi-tag.
682 __ ret(); 682 __ ret();
683 } 683 }
684 684
685 685
686 void Intrinsifier::Smi_bitLength(Assembler* assembler) { 686 void Intrinsifier::Smi_bitLength(Assembler* assembler) {
687 // TODO(sra): Implement as word-length - CLZ. 687 // TODO(sra): Implement as word-length - CLZ.
688 } 688 }
689 689
690 690
691 void Intrinsifier::Bigint_setNeg(Assembler* assembler) {
692 __ ldr(R0, Address(SP, 0 * kWordSize));
693 __ ldr(R1, Address(SP, 1 * kWordSize));
694 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::neg_offset()), R0, false);
695 __ ret();
696 }
697
698
699 void Intrinsifier::Bigint_setUsed(Assembler* assembler) {
700 __ ldr(R0, Address(SP, 0 * kWordSize));
701 __ ldr(R1, Address(SP, 1 * kWordSize));
702 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::used_offset()), R0);
703 __ ret();
704 }
705
706
707 void Intrinsifier::Bigint_setDigits(Assembler* assembler) {
708 __ ldr(R0, Address(SP, 0 * kWordSize));
709 __ ldr(R1, Address(SP, 1 * kWordSize));
710 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::digits_offset()), R0, false);
711 __ ret();
712 }
713
714
715 void Intrinsifier::Bigint_absAdd(Assembler* assembler) { 691 void Intrinsifier::Bigint_absAdd(Assembler* assembler) {
716 // static void _absAdd(Uint32List digits, int used, 692 // static void _absAdd(Uint32List digits, int used,
717 // Uint32List a_digits, int a_used, 693 // Uint32List a_digits, int a_used,
718 // Uint32List r_digits) 694 // Uint32List r_digits)
719 695
720 // R2 = used, R3 = digits 696 // R2 = used, R3 = digits
721 __ ldp(R2, R3, Address(SP, 3 * kWordSize, Address::PairOffset)); 697 __ ldp(R2, R3, Address(SP, 3 * kWordSize, Address::PairOffset));
722 __ add(R2, R2, Operand(2)); // used > 0, Smi. R2 = used + 1, round up. 698 __ add(R2, R2, Operand(2)); // used > 0, Smi. R2 = used + 1, round up.
723 __ add(R2, ZR, Operand(R2, ASR, 2)); // R2 = num of digit pairs to process. 699 __ add(R2, ZR, Operand(R2, ASR, 2)); // R2 = num of digit pairs to process.
724 // R3 = &digits[0] 700 // R3 = &digits[0]
(...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after
2026 Isolate* isolate = Isolate::Current(); 2002 Isolate* isolate = Isolate::Current();
2027 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP); 2003 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP);
2028 // Set return value to Isolate::current_tag_. 2004 // Set return value to Isolate::current_tag_.
2029 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 2005 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
2030 __ ret(); 2006 __ ret();
2031 } 2007 }
2032 2008
2033 } // namespace dart 2009 } // namespace dart
2034 2010
2035 #endif // defined TARGET_ARCH_ARM64 2011 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698