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

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 | « no previous file | runtime/vm/assembler_ia32.h » ('j') | runtime/vm/stub_code_x64.cc » ('J')
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); 1098 ASSERT(result != object);
1099 ASSERT(object != TMP);
1100 1099
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 1100 // 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.. 1101 // the case that object is a Smi..
1105 LoadObject(result, Object::null_object(), PP); 1102 LoadObject(result, Object::null_object(), PP);
1106 // Check if the object is a Smi. 1103 // Check if the object is a Smi.
1107 tsti(TMP, kSmiTagMask); 1104 tsti(object, kSmiTagMask);
1108 // If the object *is* a Smi, load the null object into tmp. o/w leave alone. 1105 // If the object *is* a Smi, use the null object instead. o/w leave alone.
1109 csel(TMP, result, TMP, EQ); 1106 csel(object, result, object, EQ);
1110 // Loads either the cid of the object if it isn't a Smi, or the cid of null 1107 // 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. 1108 // if it is a Smi, which will be ignored.
1112 LoadClassId(result, TMP, PP); 1109 LoadClassId(result, object, PP);
1113 1110
1114 LoadImmediate(TMP, kSmiCid, PP); 1111 LoadImmediate(object, kSmiCid, PP);
1115 // If object is a Smi, move the Smi cid into result. o/w leave alone. 1112 // If object is a Smi, move the Smi cid into result. o/w leave alone.
1116 csel(result, TMP, result, EQ); 1113 csel(result, object, result, EQ);
1117 // Finally, tag the result. 1114 // Finally, tag the result.
1118 SmiTag(result); 1115 SmiTag(result);
1119 } 1116 }
1120 1117
1121 1118
1122 // Frame entry and exit. 1119 // Frame entry and exit.
1123 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) { 1120 void Assembler::ReserveAlignedFrameSpace(intptr_t frame_space) {
1124 // Reserve space for arguments and align frame before entering 1121 // Reserve space for arguments and align frame before entering
1125 // the C++ world. 1122 // the C++ world.
1126 if (frame_space != 0) { 1123 if (frame_space != 0) {
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 LoadImmediate(TMP, tags, pp); 1411 LoadImmediate(TMP, tags, pp);
1415 StoreFieldToOffset(TMP, instance_reg, Object::tags_offset(), pp); 1412 StoreFieldToOffset(TMP, instance_reg, Object::tags_offset(), pp);
1416 } else { 1413 } else {
1417 b(failure); 1414 b(failure);
1418 } 1415 }
1419 } 1416 }
1420 1417
1421 } // namespace dart 1418 } // namespace dart
1422 1419
1423 #endif // defined TARGET_ARCH_ARM64 1420 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/assembler_ia32.h » ('j') | runtime/vm/stub_code_x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698