Commit fc57b3c3 authored by Jacob.Bramley@arm.com's avatar Jacob.Bramley@arm.com

ARM64: Use ARRAY_SIZE where possible.

BUG=
R=svenpanne@chromium.org

Review URL: https://codereview.chromium.org/437813004

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22816 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent a638717d
...@@ -227,7 +227,7 @@ bool AreAliased(const CPURegister& reg1, const CPURegister& reg2, ...@@ -227,7 +227,7 @@ bool AreAliased(const CPURegister& reg1, const CPURegister& reg2,
const CPURegister regs[] = {reg1, reg2, reg3, reg4, reg5, reg6, reg7, reg8}; 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()) { if (regs[i].IsRegister()) {
number_of_valid_regs++; number_of_valid_regs++;
unique_regs |= regs[i].Bit(); unique_regs |= regs[i].Bit();
...@@ -2658,8 +2658,7 @@ bool Assembler::IsImmLogical(uint64_t value, ...@@ -2658,8 +2658,7 @@ bool Assembler::IsImmLogical(uint64_t value,
int multiplier_idx = CountLeadingZeros(d, kXRegSizeInBits) - 57; int multiplier_idx = CountLeadingZeros(d, kXRegSizeInBits) - 57;
// Ensure that the index to the multipliers array is within bounds. // Ensure that the index to the multipliers array is within bounds.
DCHECK((multiplier_idx >= 0) && DCHECK((multiplier_idx >= 0) &&
(static_cast<size_t>(multiplier_idx) < (static_cast<size_t>(multiplier_idx) < ARRAY_SIZE(multipliers)));
(sizeof(multipliers) / sizeof(multipliers[0]))));
uint64_t multiplier = multipliers[multiplier_idx]; uint64_t multiplier = multipliers[multiplier_idx];
uint64_t candidate = (b - a) * multiplier; uint64_t candidate = (b - a) * multiplier;
......
...@@ -107,8 +107,7 @@ Instrument::Instrument(const char* datafile, uint64_t sample_period) ...@@ -107,8 +107,7 @@ Instrument::Instrument(const char* datafile, uint64_t sample_period)
} }
} }
static const int num_counters = static const int num_counters = ARRAY_SIZE(kCounterList);
sizeof(kCounterList) / sizeof(CounterDescriptor);
// Dump an instrumentation description comment at the top of the file. // Dump an instrumentation description comment at the top of the file.
fprintf(output_stream_, "# counters=%d\n", num_counters); fprintf(output_stream_, "# counters=%d\n", num_counters);
......
...@@ -1065,7 +1065,7 @@ void Simulator::PrintSystemRegisters(bool print_all) { ...@@ -1065,7 +1065,7 @@ void Simulator::PrintSystemRegisters(bool print_all) {
"0b10 (Round towards Minus Infinity)", "0b10 (Round towards Minus Infinity)",
"0b11 (Round towards Zero)" "0b11 (Round towards Zero)"
}; };
DCHECK(fpcr().RMode() <= (sizeof(rmode) / sizeof(rmode[0]))); DCHECK(fpcr().RMode() < ARRAY_SIZE(rmode));
fprintf(stream_, "# %sFPCR: %sAHP:%d DN:%d FZ:%d RMode:%s%s\n", fprintf(stream_, "# %sFPCR: %sAHP:%d DN:%d FZ:%d RMode:%s%s\n",
clr_flag_name, clr_flag_name,
clr_flag_value, clr_flag_value,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment