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

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

Issue 735543003: Range feedback for binary integer operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 6 years 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
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/assembler_arm64_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/longjump.h" 10 #include "vm/longjump.h"
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1126 LoadClassId(result, TMP, PP); 1126 LoadClassId(result, TMP, PP);
1127 1127
1128 LoadImmediate(TMP, kSmiCid, PP); 1128 LoadImmediate(TMP, kSmiCid, PP);
1129 // If object is a Smi, move the Smi cid into result. o/w leave alone. 1129 // If object is a Smi, move the Smi cid into result. o/w leave alone.
1130 csel(result, TMP, result, EQ); 1130 csel(result, TMP, result, EQ);
1131 // Finally, tag the result. 1131 // Finally, tag the result.
1132 SmiTag(result); 1132 SmiTag(result);
1133 } 1133 }
1134 1134
1135 1135
1136 void Assembler::ComputeRange(Register result,
1137 Register value,
1138 Register scratch,
1139 Label* not_mint) {
1140 Label done, not_smi;
1141 tsti(value, Immediate(kSmiTagMask));
1142 b(&not_smi, NE);
1143
1144 AsrImmediate(scratch, value, 32);
1145 LoadImmediate(result, ICData::kUint32RangeBit, PP);
1146 cmp(scratch, Operand(1));
1147 b(&done, EQ);
1148
1149 neg(scratch, scratch);
1150 add(result, scratch, Operand(ICData::kInt32RangeBit));
1151 cmp(scratch, Operand(1));
1152 LoadImmediate(TMP, ICData::kSignedRangeBit, PP);
1153 csel(result, result, TMP, LS);
1154 b(&done);
1155
1156 Bind(&not_smi);
1157 CompareClassId(value, kMintCid, PP);
1158 b(not_mint, NE);
1159
1160 LoadImmediate(result, ICData::kInt64RangeBit, PP);
1161 Bind(&done);
1162 }
1163
1164
1165 void Assembler::UpdateRangeFeedback(Register value,
1166 intptr_t index,
1167 Register ic_data,
1168 Register scratch1,
1169 Register scratch2,
1170 Label* miss) {
1171 ASSERT(ICData::IsValidRangeFeedbackIndex(index));
1172 ComputeRange(scratch1, value, scratch2, miss);
1173 ldr(scratch2, FieldAddress(ic_data, ICData::range_feedback_offset()), kWord);
1174 orrw(scratch2,
1175 scratch2,
1176 Operand(scratch1, LSL, ICData::kBitsPerRangeFeedback * index));
1177 str(scratch2, FieldAddress(ic_data, ICData::range_feedback_offset()), kWord);
1178 }
1179
1180
1136 // Frame entry and exit. 1181 // Frame entry and exit.
1137 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { 1182 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) {
1138 // Reserve space for arguments and align frame before entering 1183 // Reserve space for arguments and align frame before entering
1139 // the C++ world. 1184 // the C++ world.
1140 if (frame_space != 0) { 1185 if (frame_space != 0) {
1141 AddImmediate(SP, SP, -frame_space, kNoPP); 1186 AddImmediate(SP, SP, -frame_space, kNoPP);
1142 } 1187 }
1143 if (OS::ActivationFrameAlignment() > 1) { 1188 if (OS::ActivationFrameAlignment() > 1) {
1144 andi(SP, SP, Immediate(~(OS::ActivationFrameAlignment() - 1))); 1189 andi(SP, SP, Immediate(~(OS::ActivationFrameAlignment() - 1)));
1145 } 1190 }
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1512 add(base, array, Operand(index, LSL, shift)); 1557 add(base, array, Operand(index, LSL, shift));
1513 } 1558 }
1514 const OperandSize size = Address::OperandSizeFor(cid); 1559 const OperandSize size = Address::OperandSizeFor(cid);
1515 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); 1560 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size));
1516 return Address(base, offset, Address::Offset, size); 1561 return Address(base, offset, Address::Offset, size);
1517 } 1562 }
1518 1563
1519 } // namespace dart 1564 } // namespace dart
1520 1565
1521 #endif // defined TARGET_ARCH_ARM64 1566 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/assembler_arm64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698