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

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

Issue 392343002: Cleanup of class id loading sequences. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 months 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_arm.cc ('k') | runtime/vm/assembler_ia32.h » ('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 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1088 1088
1089 1089
1090 void Assembler::CompareClassId( 1090 void Assembler::CompareClassId(
1091 Register object, intptr_t class_id, Register pp) { 1091 Register object, intptr_t class_id, Register pp) {
1092 LoadClassId(TMP, object, pp); 1092 LoadClassId(TMP, object, pp);
1093 CompareImmediate(TMP, class_id, pp); 1093 CompareImmediate(TMP, class_id, pp);
1094 } 1094 }
1095 1095
1096 1096
1097 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) { 1097 void Assembler::LoadTaggedClassIdMayBeSmi(Register result, Register object) {
1098 ASSERT(result != TMP);
1099 ASSERT(object != TMP);
1100
1101 // Make a copy of object since result and object can be the same register.
1102 mov(TMP, object);
1103 // Load up a null object. We only need it so we can use LoadClassId on it in 1098 // Load up a null object. We only need it so we can use LoadClassId on it in
1104 // the case that object is a Smi.. 1099 // the case that object is a Smi..
1105 LoadObject(result, Object::null_object(), PP); 1100 LoadObject(TMP, Object::null_object(), PP);
1106 // Check if the object is a Smi. 1101 // Check if the object is a Smi.
1107 tsti(TMP, kSmiTagMask); 1102 tsti(object, kSmiTagMask);
1108 // If the object *is* a Smi, load the null object into tmp. o/w leave alone. 1103 // If the object *is* a Smi, use the null object instead. o/w leave alone.
1109 csel(TMP, result, TMP, EQ); 1104 csel(TMP, TMP, object, EQ);
1110 // Loads either the cid of the object if it isn't a Smi, or the cid of null 1105 // Loads either the cid of the object if it isn't a Smi, or the cid of null
1111 // if it is a Smi, which will be ignored. 1106 // if it is a Smi, which will be ignored.
1112 LoadClassId(result, TMP, PP); 1107 LoadClassId(result, TMP, PP);
1113 1108
1114 LoadImmediate(TMP, kSmiCid, PP); 1109 LoadImmediate(TMP, kSmiCid, PP);
1115 // If object is a Smi, move the Smi cid into result. o/w leave alone. 1110 // If object is a Smi, move the Smi cid into result. o/w leave alone.
1116 csel(result, TMP, result, EQ); 1111 csel(result, TMP, result, EQ);
1117 // Finally, tag the result. 1112 // Finally, tag the result.
1118 SmiTag(result); 1113 SmiTag(result);
1119 } 1114 }
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 LoadImmediate(TMP, tags, pp); 1409 LoadImmediate(TMP, tags, pp);
1415 StoreFieldToOffset(TMP, instance_reg, Object::tags_offset(), pp); 1410 StoreFieldToOffset(TMP, instance_reg, Object::tags_offset(), pp);
1416 } else { 1411 } else {
1417 b(failure); 1412 b(failure);
1418 } 1413 }
1419 } 1414 }
1420 1415
1421 } // namespace dart 1416 } // namespace dart
1422 1417
1423 #endif // defined TARGET_ARCH_ARM64 1418 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm.cc ('k') | runtime/vm/assembler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698