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

Unified Diff: src/arm64/assembler-arm64.cc

Issue 437813004: ARM64: Use ARRAY_SIZE where possible. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/arm64/instrument-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm64/assembler-arm64.cc
diff --git a/src/arm64/assembler-arm64.cc b/src/arm64/assembler-arm64.cc
index 240dc9c3572a2dfd4d84cdc6dd6ecb9b8f79bcfc..68bc67934e42bcd8c8e0b6f51331e4412a2d7737 100644
--- a/src/arm64/assembler-arm64.cc
+++ b/src/arm64/assembler-arm64.cc
@@ -227,7 +227,7 @@ bool AreAliased(const CPURegister& reg1, const CPURegister& reg2,
const CPURegister regs[] = {reg1, reg2, reg3, reg4, reg5, reg6, reg7, reg8};
- for (unsigned i = 0; i < sizeof(regs) / sizeof(regs[0]); i++) {
+ for (unsigned i = 0; i < ARRAY_SIZE(regs); i++) {
if (regs[i].IsRegister()) {
number_of_valid_regs++;
unique_regs |= regs[i].Bit();
@@ -2658,8 +2658,7 @@ bool Assembler::IsImmLogical(uint64_t value,
int multiplier_idx = CountLeadingZeros(d, kXRegSizeInBits) - 57;
// Ensure that the index to the multipliers array is within bounds.
ASSERT((multiplier_idx >= 0) &&
- (static_cast<size_t>(multiplier_idx) <
- (sizeof(multipliers) / sizeof(multipliers[0]))));
+ (static_cast<size_t>(multiplier_idx) < ARRAY_SIZE(multipliers)));
uint64_t multiplier = multipliers[multiplier_idx];
uint64_t candidate = (b - a) * multiplier;
« no previous file with comments | « no previous file | src/arm64/instrument-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698