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

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

Issue 22825023: Uses an object pool on x64 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 __ movq(RDI, Address(RSP, kArrayLengthOffset)); // Array Length. 110 __ movq(RDI, Address(RSP, kArrayLengthOffset)); // Array Length.
111 __ StoreIntoObjectNoBarrier(RAX, 111 __ StoreIntoObjectNoBarrier(RAX,
112 FieldAddress(RAX, Array::length_offset()), 112 FieldAddress(RAX, Array::length_offset()),
113 RDI); 113 RDI);
114 114
115 // Initialize all array elements to raw_null. 115 // Initialize all array elements to raw_null.
116 // RAX: new object start as a tagged pointer. 116 // RAX: new object start as a tagged pointer.
117 // RCX: new object end address. 117 // RCX: new object end address.
118 // RDI: iterator which initially points to the start of the variable 118 // RDI: iterator which initially points to the start of the variable
119 // data area to be initialized. 119 // data area to be initialized.
120 const Immediate& raw_null = 120 __ LoadObject(R12, Object::Handle(Object::null()), Assembler::kNotPatchable);
121 Immediate(reinterpret_cast<intptr_t>(Object::null()));
122 __ leaq(RDI, FieldAddress(RAX, sizeof(RawArray))); 121 __ leaq(RDI, FieldAddress(RAX, sizeof(RawArray)));
123 Label done; 122 Label done;
124 Label init_loop; 123 Label init_loop;
125 __ Bind(&init_loop); 124 __ Bind(&init_loop);
126 __ cmpq(RDI, RCX); 125 __ cmpq(RDI, RCX);
127 __ j(ABOVE_EQUAL, &done, Assembler::kNearJump); 126 __ j(ABOVE_EQUAL, &done, Assembler::kNearJump);
128 __ movq(Address(RDI, 0), raw_null); 127 __ movq(Address(RDI, 0), R12);
129 __ addq(RDI, Immediate(kWordSize)); 128 __ addq(RDI, Immediate(kWordSize));
130 __ jmp(&init_loop, Assembler::kNearJump); 129 __ jmp(&init_loop, Assembler::kNearJump);
131 __ Bind(&done); 130 __ Bind(&done);
132 __ ret(); // returns the newly allocated object in RAX. 131 __ ret(); // returns the newly allocated object in RAX.
133 132
134 __ Bind(&fall_through); 133 __ Bind(&fall_through);
135 } 134 }
136 135
137 136
138 void Intrinsifier::Array_getLength(Assembler* assembler) { 137 void Intrinsifier::Array_getLength(Assembler* assembler) {
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 __ j(EQUAL, &fall_through); // Must grow data. 384 __ j(EQUAL, &fall_through); // Must grow data.
386 const Immediate& value_one = 385 const Immediate& value_one =
387 Immediate(reinterpret_cast<int64_t>(Smi::New(1))); 386 Immediate(reinterpret_cast<int64_t>(Smi::New(1)));
388 // len = len + 1; 387 // len = len + 1;
389 __ addq(FieldAddress(RAX, GrowableObjectArray::length_offset()), value_one); 388 __ addq(FieldAddress(RAX, GrowableObjectArray::length_offset()), value_one);
390 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Value 389 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Value
391 ASSERT(kSmiTagShift == 1); 390 ASSERT(kSmiTagShift == 1);
392 __ StoreIntoObject(RDX, 391 __ StoreIntoObject(RDX,
393 FieldAddress(RDX, RCX, TIMES_4, Array::data_offset()), 392 FieldAddress(RDX, RCX, TIMES_4, Array::data_offset()),
394 RAX); 393 RAX);
395 const Immediate& raw_null = 394 __ LoadObject(RAX, Object::Handle(Object::null()), Assembler::kNotPatchable);
396 Immediate(reinterpret_cast<int64_t>(Object::null()));
397 __ movq(RAX, raw_null);
398 __ ret(); 395 __ ret();
399 __ Bind(&fall_through); 396 __ Bind(&fall_through);
400 } 397 }
401 398
402 399
403 #define TYPED_ARRAY_ALLOCATION(type_name, cid, max_len, scale_factor) \ 400 #define TYPED_ARRAY_ALLOCATION(type_name, cid, max_len, scale_factor) \
404 Label fall_through; \ 401 Label fall_through; \
405 const intptr_t kArrayLengthStackOffset = 1 * kWordSize; \ 402 const intptr_t kArrayLengthStackOffset = 1 * kWordSize; \
406 __ movq(RDI, Address(RSP, kArrayLengthStackOffset)); /* Array length. */ \ 403 __ movq(RDI, Address(RSP, kArrayLengthStackOffset)); /* Array length. */ \
407 /* Check that length is a positive Smi. */ \ 404 /* Check that length is a positive Smi. */ \
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 __ Bind(&fall_through); 869 __ Bind(&fall_through);
873 } 870 }
874 871
875 872
876 static void CompareIntegers(Assembler* assembler, Condition true_condition) { 873 static void CompareIntegers(Assembler* assembler, Condition true_condition) {
877 Label fall_through, true_label; 874 Label fall_through, true_label;
878 TestBothArgumentsSmis(assembler, &fall_through); 875 TestBothArgumentsSmis(assembler, &fall_through);
879 // RAX contains the right argument. 876 // RAX contains the right argument.
880 __ cmpq(Address(RSP, + 2 * kWordSize), RAX); 877 __ cmpq(Address(RSP, + 2 * kWordSize), RAX);
881 __ j(true_condition, &true_label, Assembler::kNearJump); 878 __ j(true_condition, &true_label, Assembler::kNearJump);
882 __ LoadObject(RAX, Bool::False()); 879 __ LoadObject(RAX, Bool::False(), Assembler::kNotPatchable);
883 __ ret(); 880 __ ret();
884 __ Bind(&true_label); 881 __ Bind(&true_label);
885 __ LoadObject(RAX, Bool::True()); 882 __ LoadObject(RAX, Bool::True(), Assembler::kNotPatchable);
886 __ ret(); 883 __ ret();
887 __ Bind(&fall_through); 884 __ Bind(&fall_through);
888 } 885 }
889 886
890 887
891 888
892 void Intrinsifier::Integer_lessThan(Assembler* assembler) { 889 void Intrinsifier::Integer_lessThan(Assembler* assembler) {
893 return CompareIntegers(assembler, LESS); 890 return CompareIntegers(assembler, LESS);
894 } 891 }
895 892
(...skipping 16 matching lines...) Expand all
912 void Intrinsifier::Integer_greaterEqualThan(Assembler* assembler) { 909 void Intrinsifier::Integer_greaterEqualThan(Assembler* assembler) {
913 return CompareIntegers(assembler, GREATER_EQUAL); 910 return CompareIntegers(assembler, GREATER_EQUAL);
914 } 911 }
915 912
916 913
917 // This is called for Smi, Mint and Bigint receivers. The right argument 914 // This is called for Smi, Mint and Bigint receivers. The right argument
918 // can be Smi, Mint, Bigint or double. 915 // can be Smi, Mint, Bigint or double.
919 void Intrinsifier::Integer_equalToInteger(Assembler* assembler) { 916 void Intrinsifier::Integer_equalToInteger(Assembler* assembler) {
920 Label fall_through, true_label, check_for_mint; 917 Label fall_through, true_label, check_for_mint;
921 // For integer receiver '===' check first. 918 // For integer receiver '===' check first.
922 __ movq(RAX, Address(RSP, + 1 * kWordSize)); 919 // Entering a dart frame so we can use the PP for loading True and False.
923 __ movq(RCX, Address(RSP, + 2 * kWordSize)); 920 __ EnterDartFrame(0);
921 __ movq(RAX, Address(RSP, + 4 * kWordSize));
922 __ movq(RCX, Address(RSP, + 5 * kWordSize));
924 __ cmpq(RAX, RCX); 923 __ cmpq(RAX, RCX);
925 __ j(EQUAL, &true_label, Assembler::kNearJump); 924 __ j(EQUAL, &true_label, Assembler::kNearJump);
926 __ orq(RAX, RCX); 925 __ orq(RAX, RCX);
927 __ testq(RAX, Immediate(kSmiTagMask)); 926 __ testq(RAX, Immediate(kSmiTagMask));
928 __ j(NOT_ZERO, &check_for_mint, Assembler::kNearJump); 927 __ j(NOT_ZERO, &check_for_mint, Assembler::kNearJump);
929 // Both arguments are smi, '===' is good enough. 928 // Both arguments are smi, '===' is good enough.
930 __ LoadObject(RAX, Bool::False()); 929 __ LoadObject(RAX, Bool::False(), Assembler::kNotPatchable);
930 __ LeaveFrame(true);
931 __ ret(); 931 __ ret();
932 __ Bind(&true_label); 932 __ Bind(&true_label);
933 __ LoadObject(RAX, Bool::True()); 933 __ LoadObject(RAX, Bool::True(), Assembler::kNotPatchable);
934 __ LeaveFrame(true);
934 __ ret(); 935 __ ret();
935 936
936 // At least one of the arguments was not Smi. 937 // At least one of the arguments was not Smi.
937 Label receiver_not_smi; 938 Label receiver_not_smi;
938 __ Bind(&check_for_mint); 939 __ Bind(&check_for_mint);
939 __ movq(RAX, Address(RSP, + 2 * kWordSize)); // Receiver. 940 __ movq(RAX, Address(RSP, + 5 * kWordSize)); // Receiver.
940 __ testq(RAX, Immediate(kSmiTagMask)); 941 __ testq(RAX, Immediate(kSmiTagMask));
941 __ j(NOT_ZERO, &receiver_not_smi); 942 __ j(NOT_ZERO, &receiver_not_smi);
942 943
943 // Left (receiver) is Smi, return false if right is not Double. 944 // Left (receiver) is Smi, return false if right is not Double.
944 // Note that an instance of Mint or Bigint never contains a value that can be 945 // Note that an instance of Mint or Bigint never contains a value that can be
945 // represented by Smi. 946 // represented by Smi.
946 __ movq(RAX, Address(RSP, + 1 * kWordSize)); 947 __ movq(RAX, Address(RSP, + 4 * kWordSize));
947 __ CompareClassId(RAX, kDoubleCid); 948 __ CompareClassId(RAX, kDoubleCid);
948 __ j(EQUAL, &fall_through); 949 __ j(EQUAL, &fall_through);
949 __ LoadObject(RAX, Bool::False()); 950 __ LoadObject(RAX, Bool::False(), Assembler::kNotPatchable);
951 __ LeaveFrame(true);
950 __ ret(); 952 __ ret();
951 953
952 __ Bind(&receiver_not_smi); 954 __ Bind(&receiver_not_smi);
953 // RAX:: receiver. 955 // RAX:: receiver.
954 __ CompareClassId(RAX, kMintCid); 956 __ CompareClassId(RAX, kMintCid);
955 __ j(NOT_EQUAL, &fall_through); 957 __ j(NOT_EQUAL, &fall_through);
956 // Receiver is Mint, return false if right is Smi. 958 // Receiver is Mint, return false if right is Smi.
957 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Right argument. 959 __ movq(RAX, Address(RSP, + 4 * kWordSize)); // Right argument.
958 __ testq(RAX, Immediate(kSmiTagMask)); 960 __ testq(RAX, Immediate(kSmiTagMask));
959 __ j(NOT_ZERO, &fall_through); 961 __ j(NOT_ZERO, &fall_through);
960 __ LoadObject(RAX, Bool::False()); // Smi == Mint -> false. 962 // Smi == Mint -> false.
963 __ LoadObject(RAX, Bool::False(), Assembler::kNotPatchable);
964 __ LeaveFrame(true);
961 __ ret(); 965 __ ret();
962 // TODO(srdjan): Implement Mint == Mint comparison. 966 // TODO(srdjan): Implement Mint == Mint comparison.
963 967
964 __ Bind(&fall_through); 968 __ Bind(&fall_through);
969 __ LeaveFrame(true);
965 } 970 }
966 971
967 972
968 void Intrinsifier::Integer_equal(Assembler* assembler) { 973 void Intrinsifier::Integer_equal(Assembler* assembler) {
969 return Integer_equalToInteger(assembler); 974 return Integer_equalToInteger(assembler);
970 } 975 }
971 976
972 977
973 void Intrinsifier::Integer_sar(Assembler* assembler) { 978 void Intrinsifier::Integer_sar(Assembler* assembler) {
974 Label fall_through, shift_count_ok; 979 Label fall_through, shift_count_ok;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 // Both arguments are double, right operand is in RAX. 1034 // Both arguments are double, right operand is in RAX.
1030 __ movsd(XMM1, FieldAddress(RAX, Double::value_offset())); 1035 __ movsd(XMM1, FieldAddress(RAX, Double::value_offset()));
1031 __ Bind(&double_op); 1036 __ Bind(&double_op);
1032 __ movq(RAX, Address(RSP, + 2 * kWordSize)); // Left argument. 1037 __ movq(RAX, Address(RSP, + 2 * kWordSize)); // Left argument.
1033 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset())); 1038 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset()));
1034 __ comisd(XMM0, XMM1); 1039 __ comisd(XMM0, XMM1);
1035 __ j(PARITY_EVEN, &is_false, Assembler::kNearJump); // NaN -> false; 1040 __ j(PARITY_EVEN, &is_false, Assembler::kNearJump); // NaN -> false;
1036 __ j(true_condition, &is_true, Assembler::kNearJump); 1041 __ j(true_condition, &is_true, Assembler::kNearJump);
1037 // Fall through false. 1042 // Fall through false.
1038 __ Bind(&is_false); 1043 __ Bind(&is_false);
1039 __ LoadObject(RAX, Bool::False()); 1044 __ LoadObject(RAX, Bool::False(), Assembler::kNotPatchable);
1040 __ ret(); 1045 __ ret();
1041 __ Bind(&is_true); 1046 __ Bind(&is_true);
1042 __ LoadObject(RAX, Bool::True()); 1047 __ LoadObject(RAX, Bool::True(), Assembler::kNotPatchable);
1043 __ ret(); 1048 __ ret();
1044 __ Bind(&is_smi); 1049 __ Bind(&is_smi);
1045 __ SmiUntag(RAX); 1050 __ SmiUntag(RAX);
1046 __ cvtsi2sd(XMM1, RAX); 1051 __ cvtsi2sd(XMM1, RAX);
1047 __ jmp(&double_op); 1052 __ jmp(&double_op);
1048 __ Bind(&fall_through); 1053 __ Bind(&fall_through);
1049 } 1054 }
1050 1055
1051 1056
1052 void Intrinsifier::Double_greaterThan(Assembler* assembler) { 1057 void Intrinsifier::Double_greaterThan(Assembler* assembler) {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 __ Bind(&fall_through); 1171 __ Bind(&fall_through);
1167 } 1172 }
1168 1173
1169 1174
1170 void Intrinsifier::Double_getIsNaN(Assembler* assembler) { 1175 void Intrinsifier::Double_getIsNaN(Assembler* assembler) {
1171 Label is_true; 1176 Label is_true;
1172 __ movq(RAX, Address(RSP, +1 * kWordSize)); 1177 __ movq(RAX, Address(RSP, +1 * kWordSize));
1173 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset())); 1178 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset()));
1174 __ comisd(XMM0, XMM0); 1179 __ comisd(XMM0, XMM0);
1175 __ j(PARITY_EVEN, &is_true, Assembler::kNearJump); // NaN -> true; 1180 __ j(PARITY_EVEN, &is_true, Assembler::kNearJump); // NaN -> true;
1176 __ LoadObject(RAX, Bool::False()); 1181 __ LoadObject(RAX, Bool::False(), Assembler::kNotPatchable);
1177 __ ret(); 1182 __ ret();
1178 __ Bind(&is_true); 1183 __ Bind(&is_true);
1179 __ LoadObject(RAX, Bool::True()); 1184 __ LoadObject(RAX, Bool::True(), Assembler::kNotPatchable);
1180 __ ret(); 1185 __ ret();
1181 } 1186 }
1182 1187
1183 1188
1184 void Intrinsifier::Double_getIsNegative(Assembler* assembler) { 1189 void Intrinsifier::Double_getIsNegative(Assembler* assembler) {
1185 Label is_false, is_true, is_zero; 1190 Label is_false, is_true, is_zero;
1186 __ movq(RAX, Address(RSP, +1 * kWordSize)); 1191 __ movq(RAX, Address(RSP, +1 * kWordSize));
1187 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset())); 1192 __ movsd(XMM0, FieldAddress(RAX, Double::value_offset()));
1188 __ xorpd(XMM1, XMM1); // 0.0 -> XMM1. 1193 __ xorpd(XMM1, XMM1); // 0.0 -> XMM1.
1189 __ comisd(XMM0, XMM1); 1194 __ comisd(XMM0, XMM1);
1190 __ j(PARITY_EVEN, &is_false, Assembler::kNearJump); // NaN -> false. 1195 __ j(PARITY_EVEN, &is_false, Assembler::kNearJump); // NaN -> false.
1191 __ j(EQUAL, &is_zero, Assembler::kNearJump); // Check for negative zero. 1196 __ j(EQUAL, &is_zero, Assembler::kNearJump); // Check for negative zero.
1192 __ j(ABOVE_EQUAL, &is_false, Assembler::kNearJump); // >= 0 -> false. 1197 __ j(ABOVE_EQUAL, &is_false, Assembler::kNearJump); // >= 0 -> false.
1193 __ Bind(&is_true); 1198 __ Bind(&is_true);
1194 __ LoadObject(RAX, Bool::True()); 1199 __ LoadObject(RAX, Bool::True(), Assembler::kNotPatchable);
1195 __ ret(); 1200 __ ret();
1196 __ Bind(&is_false); 1201 __ Bind(&is_false);
1197 __ LoadObject(RAX, Bool::False()); 1202 __ LoadObject(RAX, Bool::False(), Assembler::kNotPatchable);
1198 __ ret(); 1203 __ ret();
1199 __ Bind(&is_zero); 1204 __ Bind(&is_zero);
1200 // Check for negative zero (get the sign bit). 1205 // Check for negative zero (get the sign bit).
1201 __ movmskpd(RAX, XMM0); 1206 __ movmskpd(RAX, XMM0);
1202 __ testq(RAX, Immediate(1)); 1207 __ testq(RAX, Immediate(1));
1203 __ j(NOT_ZERO, &is_true, Assembler::kNearJump); 1208 __ j(NOT_ZERO, &is_true, Assembler::kNearJump);
1204 __ jmp(&is_false, Assembler::kNearJump); 1209 __ jmp(&is_false, Assembler::kNearJump);
1205 } 1210 }
1206 1211
1207 1212
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 __ imulq(RCX, RAX); 1340 __ imulq(RCX, RAX);
1336 __ movl(RDX, addr_1); 1341 __ movl(RDX, addr_1);
1337 __ addq(RDX, RCX); 1342 __ addq(RDX, RCX);
1338 __ movl(addr_0, RDX); 1343 __ movl(addr_0, RDX);
1339 __ shrq(RDX, Immediate(32)); 1344 __ shrq(RDX, Immediate(32));
1340 __ movl(addr_1, RDX); 1345 __ movl(addr_1, RDX);
1341 __ ret(); 1346 __ ret();
1342 } 1347 }
1343 1348
1344 1349
1345
1346 // Identity comparison. 1350 // Identity comparison.
1347 void Intrinsifier::Object_equal(Assembler* assembler) { 1351 void Intrinsifier::Object_equal(Assembler* assembler) {
1348 Label is_true; 1352 Label is_true;
1349 __ movq(RAX, Address(RSP, + 1 * kWordSize)); 1353 // This intrinsic is used from the API even when we have not entered any
1350 __ cmpq(RAX, Address(RSP, + 2 * kWordSize)); 1354 // Dart frame, yet, so the PP would otherwise be null in this case unless
1355 // we enter a Dart frame here.
1356 __ EnterDartFrame(0);
1357 __ movq(RAX, Address(RSP, + 4 * kWordSize));
1358 __ cmpq(RAX, Address(RSP, + 5 * kWordSize));
1351 __ j(EQUAL, &is_true, Assembler::kNearJump); 1359 __ j(EQUAL, &is_true, Assembler::kNearJump);
1352 __ LoadObject(RAX, Bool::False()); 1360 __ movq(RAX, Immediate(reinterpret_cast<int64_t>(Bool::False().raw())));
1361 __ LoadObject(RAX, Bool::False(), Assembler::kNotPatchable);
1362 __ LeaveFrame(true);
1353 __ ret(); 1363 __ ret();
1354 __ Bind(&is_true); 1364 __ Bind(&is_true);
1355 __ LoadObject(RAX, Bool::True()); 1365 __ LoadObject(RAX, Bool::True(), Assembler::kNotPatchable);
1366 __ LeaveFrame(true);
1356 __ ret(); 1367 __ ret();
1357 } 1368 }
1358 1369
1359 1370
1360 void Intrinsifier::String_getHashCode(Assembler* assembler) { 1371 void Intrinsifier::String_getHashCode(Assembler* assembler) {
1361 Label fall_through; 1372 Label fall_through;
1362 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // String object. 1373 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // String object.
1363 __ movq(RAX, FieldAddress(RAX, String::hash_offset())); 1374 __ movq(RAX, FieldAddress(RAX, String::hash_offset()));
1364 __ cmpq(RAX, Immediate(0)); 1375 __ cmpq(RAX, Immediate(0));
1365 __ j(EQUAL, &fall_through, Assembler::kNearJump); 1376 __ j(EQUAL, &fall_through, Assembler::kNearJump);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 } 1416 }
1406 1417
1407 1418
1408 void Intrinsifier::String_getIsEmpty(Assembler* assembler) { 1419 void Intrinsifier::String_getIsEmpty(Assembler* assembler) {
1409 Label is_true; 1420 Label is_true;
1410 // Get length. 1421 // Get length.
1411 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // String object. 1422 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // String object.
1412 __ movq(RAX, FieldAddress(RAX, String::length_offset())); 1423 __ movq(RAX, FieldAddress(RAX, String::length_offset()));
1413 __ cmpq(RAX, Immediate(Smi::RawValue(0))); 1424 __ cmpq(RAX, Immediate(Smi::RawValue(0)));
1414 __ j(EQUAL, &is_true, Assembler::kNearJump); 1425 __ j(EQUAL, &is_true, Assembler::kNearJump);
1415 __ LoadObject(RAX, Bool::False()); 1426 __ LoadObject(RAX, Bool::False(), Assembler::kNotPatchable);
1416 __ ret(); 1427 __ ret();
1417 __ Bind(&is_true); 1428 __ Bind(&is_true);
1418 __ LoadObject(RAX, Bool::True()); 1429 __ LoadObject(RAX, Bool::True(), Assembler::kNotPatchable);
1419 __ ret(); 1430 __ ret();
1420 } 1431 }
1421 1432
1422 1433
1423 void Intrinsifier::OneByteString_getHashCode(Assembler* assembler) { 1434 void Intrinsifier::OneByteString_getHashCode(Assembler* assembler) {
1424 Label compute_hash; 1435 Label compute_hash;
1425 __ movq(RBX, Address(RSP, + 1 * kWordSize)); // OneByteString object. 1436 __ movq(RBX, Address(RSP, + 1 * kWordSize)); // OneByteString object.
1426 __ movq(RAX, FieldAddress(RBX, String::hash_offset())); 1437 __ movq(RAX, FieldAddress(RBX, String::hash_offset()));
1427 __ cmpq(RAX, Immediate(0)); 1438 __ cmpq(RAX, Immediate(0));
1428 __ j(EQUAL, &compute_hash, Assembler::kNearJump); 1439 __ j(EQUAL, &compute_hash, Assembler::kNearJump);
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1633 1644
1634 __ Bind(&fall_through); 1645 __ Bind(&fall_through);
1635 } 1646 }
1636 1647
1637 1648
1638 #undef __ 1649 #undef __
1639 1650
1640 } // namespace dart 1651 } // namespace dart
1641 1652
1642 #endif // defined TARGET_ARCH_X64 1653 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698