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

Side by Side Diff: runtime/vm/stub_code_arm.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/intermediate_language_arm64.cc ('k') | runtime/vm/stub_code_ia32.cc » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after
1256 // Check single stepping. 1256 // Check single stepping.
1257 __ ldr(R6, FieldAddress(CTX, Context::isolate_offset())); 1257 __ ldr(R6, FieldAddress(CTX, Context::isolate_offset()));
1258 __ ldrb(R6, Address(R6, Isolate::single_step_offset())); 1258 __ ldrb(R6, Address(R6, Isolate::single_step_offset()));
1259 __ CompareImmediate(R6, 0); 1259 __ CompareImmediate(R6, 0);
1260 __ b(&stepping, NE); 1260 __ b(&stepping, NE);
1261 __ Bind(&done_stepping); 1261 __ Bind(&done_stepping);
1262 } 1262 }
1263 1263
1264 // Load arguments descriptor into R4. 1264 // Load arguments descriptor into R4.
1265 __ ldr(R4, FieldAddress(R5, ICData::arguments_descriptor_offset())); 1265 __ ldr(R4, FieldAddress(R5, ICData::arguments_descriptor_offset()));
1266 // Preserve return address, since LR is needed for subroutine call.
1267 __ mov(R8, Operand(LR));
1268 // Loop that checks if there is an IC data match. 1266 // Loop that checks if there is an IC data match.
1269 Label loop, update, test, found; 1267 Label loop, update, test, found;
1270 // R5: IC data object (preserved). 1268 // R5: IC data object (preserved).
1271 __ ldr(R6, FieldAddress(R5, ICData::ic_data_offset())); 1269 __ ldr(R6, FieldAddress(R5, ICData::ic_data_offset()));
1272 // R6: ic_data_array with check entries: classes and target functions. 1270 // R6: ic_data_array with check entries: classes and target functions.
1273 __ AddImmediate(R6, R6, Array::data_offset() - kHeapObjectTag); 1271 __ AddImmediate(R6, R6, Array::data_offset() - kHeapObjectTag);
1274 // R6: points directly to the first ic data array element. 1272 // R6: points directly to the first ic data array element.
1275 1273
1276 // Get the receiver's class ID (first read number of arguments from 1274 // Get the receiver's class ID (first read number of arguments from
1277 // arguments descriptor array and then access the receiver from the stack). 1275 // arguments descriptor array and then access the receiver from the stack).
(...skipping 15 matching lines...) Expand all
1293 __ LoadTaggedClassIdMayBeSmi(R0, R0); 1291 __ LoadTaggedClassIdMayBeSmi(R0, R0);
1294 // R0: next argument class ID (smi). 1292 // R0: next argument class ID (smi).
1295 __ LoadFromOffset(kWord, R1, R6, i * kWordSize); 1293 __ LoadFromOffset(kWord, R1, R6, i * kWordSize);
1296 // R1: next class ID to check (smi). 1294 // R1: next class ID to check (smi).
1297 } 1295 }
1298 __ cmp(R0, Operand(R1)); // Class id match? 1296 __ cmp(R0, Operand(R1)); // Class id match?
1299 if (i < (num_args - 1)) { 1297 if (i < (num_args - 1)) {
1300 __ b(&update, NE); // Continue. 1298 __ b(&update, NE); // Continue.
1301 } else { 1299 } else {
1302 // Last check, all checks before matched. 1300 // Last check, all checks before matched.
1303 __ mov(LR, Operand(R8), EQ); // Restore return address if found.
1304 __ b(&found, EQ); // Break. 1301 __ b(&found, EQ); // Break.
1305 } 1302 }
1306 } 1303 }
1307 __ Bind(&update); 1304 __ Bind(&update);
1308 // Reload receiver class ID. It has not been destroyed when num_args == 1. 1305 // Reload receiver class ID. It has not been destroyed when num_args == 1.
1309 if (num_args > 1) { 1306 if (num_args > 1) {
1310 __ ldr(R0, Address(SP, R7, LSL, 1)); 1307 __ ldr(R0, Address(SP, R7, LSL, 1));
1311 __ LoadTaggedClassIdMayBeSmi(R0, R0); 1308 __ LoadTaggedClassIdMayBeSmi(R0, R0);
1312 } 1309 }
1313 1310
1314 const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize; 1311 const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize;
1315 __ AddImmediate(R6, entry_size); // Next entry. 1312 __ AddImmediate(R6, entry_size); // Next entry.
1316 __ ldr(R1, Address(R6, 0)); // Next class ID. 1313 __ ldr(R1, Address(R6, 0)); // Next class ID.
1317 1314
1318 __ Bind(&test); 1315 __ Bind(&test);
1319 __ CompareImmediate(R1, Smi::RawValue(kIllegalCid)); // Done? 1316 __ CompareImmediate(R1, Smi::RawValue(kIllegalCid)); // Done?
1320 __ b(&loop, NE); 1317 __ b(&loop, NE);
1321 1318
1322 // IC miss. 1319 // IC miss.
1323 // Restore return address.
1324 __ mov(LR, Operand(R8));
1325
1326 // Compute address of arguments. 1320 // Compute address of arguments.
1327 // R7: argument_count - 1 (smi). 1321 // R7: argument_count - 1 (smi).
1328 __ add(R7, SP, Operand(R7, LSL, 1)); // R7 is Smi. 1322 __ add(R7, SP, Operand(R7, LSL, 1)); // R7 is Smi.
1329 // R7: address of receiver. 1323 // R7: address of receiver.
1330 // Create a stub frame as we are pushing some objects on the stack before 1324 // Create a stub frame as we are pushing some objects on the stack before
1331 // calling into the runtime. 1325 // calling into the runtime.
1332 __ EnterStubFrame(); 1326 __ EnterStubFrame();
1333 __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null())); 1327 __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
1334 // Preserve IC data object and arguments descriptor array and 1328 // Preserve IC data object and arguments descriptor array and
1335 // setup space on stack for result (target code object). 1329 // setup space on stack for result (target code object).
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
1872 const Register right = R0; 1866 const Register right = R0;
1873 __ ldr(left, Address(SP, 1 * kWordSize)); 1867 __ ldr(left, Address(SP, 1 * kWordSize));
1874 __ ldr(right, Address(SP, 0 * kWordSize)); 1868 __ ldr(right, Address(SP, 0 * kWordSize));
1875 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 1869 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
1876 __ Ret(); 1870 __ Ret();
1877 } 1871 }
1878 1872
1879 } // namespace dart 1873 } // namespace dart
1880 1874
1881 #endif // defined TARGET_ARCH_ARM 1875 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm64.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698