Index: runtime/vm/assembler_arm64.cc |
=================================================================== |
--- runtime/vm/assembler_arm64.cc (revision 38283) |
+++ runtime/vm/assembler_arm64.cc (working copy) |
@@ -1095,25 +1095,22 @@ |
void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { |
- ASSERT(result != TMP); |
- ASSERT(object != TMP); |
+ ASSERT(result != object); |
- // Make a copy of object since result and object can be the same register. |
- mov(TMP, object); |
// Load up a null object. We only need it so we can use LoadClassId on it in |
// the case that object is a Smi.. |
LoadObject(result, Object::null_object(), PP); |
// Check if the object is a Smi. |
- tsti(TMP, kSmiTagMask); |
- // If the object *is* a Smi, load the null object into tmp. o/w leave alone. |
- csel(TMP, result, TMP, EQ); |
+ tsti(object, kSmiTagMask); |
+ // If the object *is* a Smi, use the null object instead. o/w leave alone. |
+ csel(object, result, object, EQ); |
// Loads either the cid of the object if it isn't a Smi, or the cid of null |
// if it is a Smi, which will be ignored. |
- LoadClassId(result, TMP, PP); |
+ LoadClassId(result, object, PP); |
- LoadImmediate(TMP, kSmiCid, PP); |
+ LoadImmediate(object, kSmiCid, PP); |
// If object is a Smi, move the Smi cid into result. o/w leave alone. |
- csel(result, TMP, result, EQ); |
+ csel(result, object, result, EQ); |
// Finally, tag the result. |
SmiTag(result); |
} |