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

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

Powered by Google App Engine
This is Rietveld 408576698