| 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 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1009 } | 1009 } |
| 1010 | 1010 |
| 1011 | 1011 |
| 1012 void Assembler::CompareClassId( | 1012 void Assembler::CompareClassId( |
| 1013 Register object, intptr_t class_id, Register pp) { | 1013 Register object, intptr_t class_id, Register pp) { |
| 1014 LoadClassId(TMP, object, pp); | 1014 LoadClassId(TMP, object, pp); |
| 1015 CompareImmediate(TMP, class_id, pp); | 1015 CompareImmediate(TMP, class_id, pp); |
| 1016 } | 1016 } |
| 1017 | 1017 |
| 1018 | 1018 |
| 1019 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { | 1019 void Assembler::LoadClassIdMayBeSmi(Register result, Register object) { |
| 1020 // Load up a null object. We only need it so we can use LoadClassId on it in | 1020 // Load up a null object. We only need it so we can use LoadClassId on it in |
| 1021 // the case that object is a Smi.. | 1021 // the case that object is a Smi.. |
| 1022 LoadObject(TMP, Object::null_object(), PP); | 1022 LoadObject(TMP, Object::null_object(), PP); |
| 1023 // Check if the object is a Smi. | 1023 // Check if the object is a Smi. |
| 1024 tsti(object, Immediate(kSmiTagMask)); | 1024 tsti(object, Immediate(kSmiTagMask)); |
| 1025 // If the object *is* a Smi, use the null object instead. o/w leave alone. | 1025 // If the object *is* a Smi, use the null object instead. o/w leave alone. |
| 1026 csel(TMP, TMP, object, EQ); | 1026 csel(TMP, TMP, object, EQ); |
| 1027 // Loads either the cid of the object if it isn't a Smi, or the cid of null | 1027 // Loads either the cid of the object if it isn't a Smi, or the cid of null |
| 1028 // if it is a Smi, which will be ignored. | 1028 // if it is a Smi, which will be ignored. |
| 1029 LoadClassId(result, TMP, PP); | 1029 LoadClassId(result, TMP, PP); |
| 1030 | 1030 |
| 1031 LoadImmediate(TMP, kSmiCid, PP); | 1031 LoadImmediate(TMP, kSmiCid, PP); |
| 1032 // If object is a Smi, move the Smi cid into result. o/w leave alone. | 1032 // If object is a Smi, move the Smi cid into result. o/w leave alone. |
| 1033 csel(result, TMP, result, EQ); | 1033 csel(result, TMP, result, EQ); |
| 1034 } |
| 1035 |
| 1036 |
| 1037 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { |
| 1038 LoadClassIdMayBeSmi(result, object); |
| 1034 // Finally, tag the result. | 1039 // Finally, tag the result. |
| 1035 SmiTag(result); | 1040 SmiTag(result); |
| 1036 } | 1041 } |
| 1037 | 1042 |
| 1038 | 1043 |
| 1039 void Assembler::ComputeRange(Register result, | 1044 void Assembler::ComputeRange(Register result, |
| 1040 Register value, | 1045 Register value, |
| 1041 Register scratch, | 1046 Register scratch, |
| 1042 Label* not_mint) { | 1047 Label* not_mint) { |
| 1043 Label done, not_smi; | 1048 Label done, not_smi; |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 add(base, array, Operand(index, LSL, shift)); | 1464 add(base, array, Operand(index, LSL, shift)); |
| 1460 } | 1465 } |
| 1461 const OperandSize size = Address::OperandSizeFor(cid); | 1466 const OperandSize size = Address::OperandSizeFor(cid); |
| 1462 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); | 1467 ASSERT(Address::CanHoldOffset(offset, Address::Offset, size)); |
| 1463 return Address(base, offset, Address::Offset, size); | 1468 return Address(base, offset, Address::Offset, size); |
| 1464 } | 1469 } |
| 1465 | 1470 |
| 1466 } // namespace dart | 1471 } // namespace dart |
| 1467 | 1472 |
| 1468 #endif // defined TARGET_ARCH_ARM64 | 1473 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |