| OLD | NEW |
| 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" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
| 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 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 } | 1029 } |
| 1030 | 1030 |
| 1031 | 1031 |
| 1032 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { | 1032 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { |
| 1033 LoadClassIdMayBeSmi(result, object); | 1033 LoadClassIdMayBeSmi(result, object); |
| 1034 // Finally, tag the result. | 1034 // Finally, tag the result. |
| 1035 SmiTag(result); | 1035 SmiTag(result); |
| 1036 } | 1036 } |
| 1037 | 1037 |
| 1038 | 1038 |
| 1039 void Assembler::ComputeRange(Register result, | |
| 1040 Register value, | |
| 1041 Register scratch, | |
| 1042 Label* not_mint) { | |
| 1043 Label done, not_smi; | |
| 1044 tsti(value, Immediate(kSmiTagMask)); | |
| 1045 b(¬_smi, NE); | |
| 1046 | |
| 1047 AsrImmediate(scratch, value, 32); | |
| 1048 LoadImmediate(result, ICData::kUint32RangeBit); | |
| 1049 cmp(scratch, Operand(1)); | |
| 1050 b(&done, EQ); | |
| 1051 | |
| 1052 neg(scratch, scratch); | |
| 1053 add(result, scratch, Operand(ICData::kInt32RangeBit)); | |
| 1054 cmp(scratch, Operand(1)); | |
| 1055 LoadImmediate(TMP, ICData::kSignedRangeBit); | |
| 1056 csel(result, result, TMP, LS); | |
| 1057 b(&done); | |
| 1058 | |
| 1059 Bind(¬_smi); | |
| 1060 CompareClassId(value, kMintCid); | |
| 1061 b(not_mint, NE); | |
| 1062 | |
| 1063 LoadImmediate(result, ICData::kInt64RangeBit); | |
| 1064 Bind(&done); | |
| 1065 } | |
| 1066 | |
| 1067 | |
| 1068 void Assembler::UpdateRangeFeedback(Register value, | |
| 1069 intptr_t index, | |
| 1070 Register ic_data, | |
| 1071 Register scratch1, | |
| 1072 Register scratch2, | |
| 1073 Label* miss) { | |
| 1074 ASSERT(ICData::IsValidRangeFeedbackIndex(index)); | |
| 1075 ComputeRange(scratch1, value, scratch2, miss); | |
| 1076 ldr(scratch2, FieldAddress(ic_data, ICData::state_bits_offset()), kWord); | |
| 1077 orrw(scratch2, | |
| 1078 scratch2, | |
| 1079 Operand(scratch1, LSL, ICData::RangeFeedbackShift(index))); | |
| 1080 str(scratch2, FieldAddress(ic_data, ICData::state_bits_offset()), kWord); | |
| 1081 } | |
| 1082 | |
| 1083 | |
| 1084 // Frame entry and exit. | 1039 // Frame entry and exit. |
| 1085 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { | 1040 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { |
| 1086 // Reserve space for arguments and align frame before entering | 1041 // Reserve space for arguments and align frame before entering |
| 1087 // the C++ world. | 1042 // the C++ world. |
| 1088 if (frame_space != 0) { | 1043 if (frame_space != 0) { |
| 1089 AddImmediate(SP, SP, -frame_space); | 1044 AddImmediate(SP, SP, -frame_space); |
| 1090 } | 1045 } |
| 1091 if (OS::ActivationFrameAlignment() > 1) { | 1046 if (OS::ActivationFrameAlignment() > 1) { |
| 1092 andi(SP, SP, Immediate(~(OS::ActivationFrameAlignment() - 1))); | 1047 andi(SP, SP, Immediate(~(OS::ActivationFrameAlignment() - 1))); |
| 1093 } | 1048 } |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1471 add(base, array, Operand(index, LSL, shift)); | 1426 add(base, array, Operand(index, LSL, shift)); |
| 1472 } | 1427 } |
| 1473 const OperandSize size = Address::OperandSizeFor(cid); | 1428 const OperandSize size = Address::OperandSizeFor(cid); |
| 1474 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); | 1429 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); |
| 1475 return Address(base, offset, Address::Offset, size); | 1430 return Address(base, offset, Address::Offset, size); |
| 1476 } | 1431 } |
| 1477 | 1432 |
| 1478 } // namespace dart | 1433 } // namespace dart |
| 1479 | 1434 |
| 1480 #endif // defined TARGET_ARCH_ARM64 | 1435 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |