| 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" | 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 1058 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 | 1069 |
| 1070 | 1070 |
| 1071 void Assembler::CompareClassId( | 1071 void Assembler::CompareClassId( |
| 1072 Register object, intptr_t class_id, Register pp) { | 1072 Register object, intptr_t class_id, Register pp) { |
| 1073 LoadClassId(TMP, object, pp); | 1073 LoadClassId(TMP, object, pp); |
| 1074 CompareImmediate(TMP, class_id, pp); | 1074 CompareImmediate(TMP, class_id, pp); |
| 1075 } | 1075 } |
| 1076 | 1076 |
| 1077 | 1077 |
| 1078 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { | 1078 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { |
| 1079 Label load, done; | 1079 ASSERT(result != TMP); |
| 1080 tsti(object, kSmiTagMask); | 1080 ASSERT(object != TMP); |
| 1081 b(&load, NE); | 1081 |
| 1082 LoadImmediate(result, Smi::RawValue(kSmiCid), PP); | 1082 // Make a copy of object since result and object can be the same register. |
| 1083 b(&done); | 1083 mov(TMP, object); |
| 1084 Bind(&load); | 1084 // Load up a null object. We only need it so we can use LoadClassId on it in |
| 1085 LoadClassId(result, object, PP); | 1085 // the case that object is a Smi.. |
| 1086 LoadObject(result, Object::null_object(), PP); |
| 1087 // Check if the object is a Smi. |
| 1088 tsti(TMP, kSmiTagMask); |
| 1089 // If the object *is* a Smi, load the null object into tmp. o/w leave alone. |
| 1090 csel(TMP, result, TMP, EQ); |
| 1091 // Loads either the cid of the object if it isn't a Smi, or the cid of null |
| 1092 // if it is a Smi, which will be ignored. |
| 1093 LoadClassId(result, TMP, PP); |
| 1094 |
| 1095 LoadImmediate(TMP, kSmiCid, PP); |
| 1096 // If object is a Smi, move the Smi cid into result. o/w leave alone. |
| 1097 csel(result, TMP, result, EQ); |
| 1098 // Finally, tag the result. |
| 1086 SmiTag(result); | 1099 SmiTag(result); |
| 1087 Bind(&done); | |
| 1088 } | 1100 } |
| 1089 | 1101 |
| 1090 | 1102 |
| 1091 // Frame entry and exit. | 1103 // Frame entry and exit. |
| 1092 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { | 1104 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { |
| 1093 // Reserve space for arguments and align frame before entering | 1105 // Reserve space for arguments and align frame before entering |
| 1094 // the C++ world. | 1106 // the C++ world. |
| 1095 if (frame_space != 0) { | 1107 if (frame_space != 0) { |
| 1096 AddImmediate(SP, SP, -frame_space, kNoPP); | 1108 AddImmediate(SP, SP, -frame_space, kNoPP); |
| 1097 } | 1109 } |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1383 LoadImmediate(TMP, tags, pp); | 1395 LoadImmediate(TMP, tags, pp); |
| 1384 StoreFieldToOffset(TMP, instance_reg, Object::tags_offset(), pp); | 1396 StoreFieldToOffset(TMP, instance_reg, Object::tags_offset(), pp); |
| 1385 } else { | 1397 } else { |
| 1386 b(failure); | 1398 b(failure); |
| 1387 } | 1399 } |
| 1388 } | 1400 } |
| 1389 | 1401 |
| 1390 } // namespace dart | 1402 } // namespace dart |
| 1391 | 1403 |
| 1392 #endif // defined TARGET_ARCH_ARM64 | 1404 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |