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

Side by Side Diff: runtime/vm/intrinsifier_arm.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) 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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 __ bic(R0, R0, Operand(kSmiTagMask)); // Remove inverted smi-tag. 863 __ bic(R0, R0, Operand(kSmiTagMask)); // Remove inverted smi-tag.
864 __ Ret(); 864 __ Ret();
865 } 865 }
866 866
867 867
868 void Intrinsifier::Smi_bitLength(Assembler* assembler) { 868 void Intrinsifier::Smi_bitLength(Assembler* assembler) {
869 // TODO(sra): Implement as word-length - CLZ. 869 // TODO(sra): Implement as word-length - CLZ.
870 } 870 }
871 871
872 872
873 void Intrinsifier::Bigint_getNeg(Assembler* assembler) {
874 __ ldr(R0, Address(SP, 0 * kWordSize));
875 __ ldr(R0, FieldAddress(R0, Bigint::neg_offset()));
876 __ Ret();
877 }
878
879
880 void Intrinsifier::Bigint_setNeg(Assembler* assembler) { 873 void Intrinsifier::Bigint_setNeg(Assembler* assembler) {
881 __ ldr(R0, Address(SP, 0 * kWordSize)); 874 __ ldr(R0, Address(SP, 0 * kWordSize));
882 __ ldr(R1, Address(SP, 1 * kWordSize)); 875 __ ldr(R1, Address(SP, 1 * kWordSize));
883 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::neg_offset()), R0, false); 876 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::neg_offset()), R0, false);
884 __ Ret(); 877 __ Ret();
885 } 878 }
886 879
887 880
888 void Intrinsifier::Bigint_getUsed(Assembler* assembler) {
889 __ ldr(R0, Address(SP, 0 * kWordSize));
890 __ ldr(R0, FieldAddress(R0, Bigint::used_offset()));
891 __ Ret();
892 }
893
894
895 void Intrinsifier::Bigint_setUsed(Assembler* assembler) { 881 void Intrinsifier::Bigint_setUsed(Assembler* assembler) {
896 __ ldr(R0, Address(SP, 0 * kWordSize)); 882 __ ldr(R0, Address(SP, 0 * kWordSize));
897 __ ldr(R1, Address(SP, 1 * kWordSize)); 883 __ ldr(R1, Address(SP, 1 * kWordSize));
898 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::used_offset()), R0); 884 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::used_offset()), R0);
899 __ Ret(); 885 __ Ret();
900 } 886 }
901 887
902 888
903 void Intrinsifier::Bigint_getDigits(Assembler* assembler) {
904 __ ldr(R0, Address(SP, 0 * kWordSize));
905 __ ldr(R0, FieldAddress(R0, Bigint::digits_offset()));
906 __ Ret();
907 }
908
909
910 void Intrinsifier::Bigint_setDigits(Assembler* assembler) { 889 void Intrinsifier::Bigint_setDigits(Assembler* assembler) {
911 __ ldr(R0, Address(SP, 0 * kWordSize)); 890 __ ldr(R0, Address(SP, 0 * kWordSize));
912 __ ldr(R1, Address(SP, 1 * kWordSize)); 891 __ ldr(R1, Address(SP, 1 * kWordSize));
913 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::digits_offset()), R0, false); 892 __ StoreIntoObject(R1, FieldAddress(R1, Bigint::digits_offset()), R0, false);
914 __ Ret(); 893 __ Ret();
915 } 894 }
916 895
917 896
918 // Check if the last argument is a double, jump to label 'is_smi' if smi 897 // Check if the last argument is a double, jump to label 'is_smi' if smi
919 // (easy to convert to double), otherwise jump to label 'not_double_smi', 898 // (easy to convert to double), otherwise jump to label 'not_double_smi',
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 Isolate* isolate = Isolate::Current(); 1630 Isolate* isolate = Isolate::Current();
1652 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); 1631 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate));
1653 // Set return value to Isolate::current_tag_. 1632 // Set return value to Isolate::current_tag_.
1654 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 1633 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
1655 __ Ret(); 1634 __ Ret();
1656 } 1635 }
1657 1636
1658 } // namespace dart 1637 } // namespace dart
1659 1638
1660 #endif // defined TARGET_ARCH_ARM 1639 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698