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

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

Issue 509153003: New bigint implementation in the vm. (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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 __ Ret(); 1042 __ Ret();
1043 __ delay_slot()->addiu(V0, V0, Immediate(-1)); // Remove inverted smi-tag. 1043 __ delay_slot()->addiu(V0, V0, Immediate(-1)); // Remove inverted smi-tag.
1044 } 1044 }
1045 1045
1046 1046
1047 void Intrinsifier::Smi_bitLength(Assembler* assembler) { 1047 void Intrinsifier::Smi_bitLength(Assembler* assembler) {
1048 // TODO(sra): Implement. 1048 // TODO(sra): Implement.
1049 } 1049 }
1050 1050
1051 1051
1052 void Intrinsifier::Bigint_getNeg(Assembler* assembler) {
1053 __ lw(V0, Address(SP, 0 * kWordSize));
1054 __ Ret();
1055 __ delay_slot()->lw(V0, FieldAddress(V0, Bigint::neg_offset()));
1056 }
1057
1058
1059 void Intrinsifier::Bigint_setNeg(Assembler* assembler) {
1060 __ lw(T0, Address(SP, 0 * kWordSize));
1061 __ lw(T1, Address(SP, 1 * kWordSize));
1062 __ StoreIntoObject(T1, FieldAddress(T1, Bigint::neg_offset()), T0, false);
1063 __ Ret();
1064 }
1065
1066
1067 void Intrinsifier::Bigint_getUsed(Assembler* assembler) {
1068 __ lw(V0, Address(SP, 0 * kWordSize));
1069 __ Ret();
1070 __ delay_slot()->lw(V0, FieldAddress(V0, Bigint::used_offset()));
1071 }
1072
1073
1074 void Intrinsifier::Bigint_setUsed(Assembler* assembler) {
1075 __ lw(T0, Address(SP, 0 * kWordSize));
1076 __ lw(T1, Address(SP, 1 * kWordSize));
1077 __ StoreIntoObject(T1, FieldAddress(T1, Bigint::used_offset()), T0);
1078 __ Ret();
1079 }
1080
1081
1082 void Intrinsifier::Bigint_getDigits(Assembler* assembler) {
1083 __ lw(V0, Address(SP, 0 * kWordSize));
1084 __ Ret();
1085 __ delay_slot()->lw(V0, FieldAddress(V0, Bigint::digits_offset()));
1086 }
1087
1088
1089 void Intrinsifier::Bigint_setDigits(Assembler* assembler) {
1090 __ lw(T0, Address(SP, 0 * kWordSize));
1091 __ lw(T1, Address(SP, 1 * kWordSize));
1092 __ StoreIntoObject(T1, FieldAddress(T1, Bigint::digits_offset()), T0, false);
1093 __ Ret();
1094 }
1095
1096
1052 // Check if the last argument is a double, jump to label 'is_smi' if smi 1097 // Check if the last argument is a double, jump to label 'is_smi' if smi
1053 // (easy to convert to double), otherwise jump to label 'not_double_smi', 1098 // (easy to convert to double), otherwise jump to label 'not_double_smi',
1054 // Returns the last argument in T0. 1099 // Returns the last argument in T0.
1055 static void TestLastArgumentIsDouble(Assembler* assembler, 1100 static void TestLastArgumentIsDouble(Assembler* assembler,
1056 Label* is_smi, 1101 Label* is_smi,
1057 Label* not_double_smi) { 1102 Label* not_double_smi) {
1058 __ lw(T0, Address(SP, 0 * kWordSize)); 1103 __ lw(T0, Address(SP, 0 * kWordSize));
1059 __ andi(CMPRES1, T0, Immediate(kSmiTagMask)); 1104 __ andi(CMPRES1, T0, Immediate(kSmiTagMask));
1060 __ beq(CMPRES1, ZR, is_smi); 1105 __ beq(CMPRES1, ZR, is_smi);
1061 __ LoadClassId(CMPRES1, T0); 1106 __ LoadClassId(CMPRES1, T0);
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
1833 Isolate* isolate = Isolate::Current(); 1878 Isolate* isolate = Isolate::Current();
1834 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate)); 1879 __ LoadImmediate(V0, reinterpret_cast<uword>(isolate));
1835 // Set return value. 1880 // Set return value.
1836 __ Ret(); 1881 __ Ret();
1837 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); 1882 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset()));
1838 } 1883 }
1839 1884
1840 } // namespace dart 1885 } // namespace dart
1841 1886
1842 #endif // defined TARGET_ARCH_MIPS 1887 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698