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

Side by Side Diff: runtime/vm/stub_code_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
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/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 __ AddImmediate(R6, R6, Array::data_offset() - kHeapObjectTag, kNoPP); 1367 __ AddImmediate(R6, R6, Array::data_offset() - kHeapObjectTag, kNoPP);
1368 // R6: points directly to the first ic data array element. 1368 // R6: points directly to the first ic data array element.
1369 1369
1370 // Get the receiver's class ID (first read number of arguments from 1370 // Get the receiver's class ID (first read number of arguments from
1371 // arguments descriptor array and then access the receiver from the stack). 1371 // arguments descriptor array and then access the receiver from the stack).
1372 __ LoadFieldFromOffset(R7, R4, ArgumentsDescriptor::count_offset(), kNoPP); 1372 __ LoadFieldFromOffset(R7, R4, ArgumentsDescriptor::count_offset(), kNoPP);
1373 __ SmiUntag(R7); // Untag so we can use the LSL 3 addressing mode. 1373 __ SmiUntag(R7); // Untag so we can use the LSL 3 addressing mode.
1374 __ sub(R7, R7, Operand(1)); 1374 __ sub(R7, R7, Operand(1));
1375 1375
1376 // R0 <- [SP + (R7 << 3)] 1376 // R0 <- [SP + (R7 << 3)]
1377 __ ldr(R0, Address(SP, R7, UXTX, Address::Scaled)); 1377 __ ldr(R1, Address(SP, R7, UXTX, Address::Scaled));
1378 __ LoadTaggedClassIdMayBeSmi(R0, R0); 1378 __ LoadTaggedClassIdMayBeSmi(R0, R1);
1379 1379
1380 // R7: argument_count - 1 (untagged). 1380 // R7: argument_count - 1 (untagged).
1381 // R0: receiver's class ID (smi). 1381 // R0: receiver's class ID (smi).
1382 __ ldr(R1, Address(R6)); // First class id (smi) to check. 1382 __ ldr(R1, Address(R6)); // First class id (smi) to check.
1383 __ b(&test); 1383 __ b(&test);
1384 1384
1385 __ Bind(&loop); 1385 __ Bind(&loop);
1386 for (int i = 0; i < num_args; i++) { 1386 for (int i = 0; i < num_args; i++) {
1387 if (i > 0) { 1387 if (i > 0) {
1388 // If not the first, load the next argument's class ID. 1388 // If not the first, load the next argument's class ID.
1389 __ AddImmediate(R0, R7, -i, kNoPP); 1389 __ AddImmediate(R0, R7, -i, kNoPP);
1390 // R0 <- [SP + (R0 << 3)] 1390 // R0 <- [SP + (R0 << 3)]
1391 __ ldr(R0, Address(SP, R0, UXTX, Address::Scaled)); 1391 __ ldr(R1, Address(SP, R0, UXTX, Address::Scaled));
1392 __ LoadTaggedClassIdMayBeSmi(R0, R0); 1392 __ LoadTaggedClassIdMayBeSmi(R0, R1);
1393 // R0: next argument class ID (smi). 1393 // R0: next argument class ID (smi).
1394 __ LoadFromOffset(R1, R6, i * kWordSize, kNoPP); 1394 __ LoadFromOffset(R1, R6, i * kWordSize, kNoPP);
1395 // R1: next class ID to check (smi). 1395 // R1: next class ID to check (smi).
1396 } 1396 }
1397 __ CompareRegisters(R0, R1); // Class id match? 1397 __ CompareRegisters(R0, R1); // Class id match?
1398 if (i < (num_args - 1)) { 1398 if (i < (num_args - 1)) {
1399 __ b(&update, NE); // Continue. 1399 __ b(&update, NE); // Continue.
1400 } else { 1400 } else {
1401 // Last check, all checks before matched. 1401 // Last check, all checks before matched.
1402 __ b(&found, EQ); // Break. 1402 __ b(&found, EQ); // Break.
1403 } 1403 }
1404 } 1404 }
1405 __ Bind(&update); 1405 __ Bind(&update);
1406 // Reload receiver class ID. It has not been destroyed when num_args == 1. 1406 // Reload receiver class ID. It has not been destroyed when num_args == 1.
1407 if (num_args > 1) { 1407 if (num_args > 1) {
1408 __ ldr(R0, Address(SP, R7, UXTX, Address::Scaled)); 1408 __ ldr(R1, Address(SP, R7, UXTX, Address::Scaled));
1409 __ LoadTaggedClassIdMayBeSmi(R0, R0); 1409 __ LoadTaggedClassIdMayBeSmi(R0, R1);
1410 } 1410 }
1411 1411
1412 const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize; 1412 const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize;
1413 __ AddImmediate(R6, R6, entry_size, kNoPP); // Next entry. 1413 __ AddImmediate(R6, R6, entry_size, kNoPP); // Next entry.
1414 __ ldr(R1, Address(R6)); // Next class ID. 1414 __ ldr(R1, Address(R6)); // Next class ID.
1415 1415
1416 __ Bind(&test); 1416 __ Bind(&test);
1417 __ CompareImmediate(R1, Smi::RawValue(kIllegalCid), kNoPP); // Done? 1417 __ CompareImmediate(R1, Smi::RawValue(kIllegalCid), kNoPP); // Done?
1418 __ b(&loop, NE); 1418 __ b(&loop, NE);
1419 1419
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
1961 const Register right = R0; 1961 const Register right = R0;
1962 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP); 1962 __ LoadFromOffset(left, SP, 1 * kWordSize, kNoPP);
1963 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP); 1963 __ LoadFromOffset(right, SP, 0 * kWordSize, kNoPP);
1964 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); 1964 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp);
1965 __ ret(); 1965 __ ret();
1966 } 1966 }
1967 1967
1968 } // namespace dart 1968 } // namespace dart
1969 1969
1970 #endif // defined TARGET_ARCH_ARM64 1970 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698