diff options
author | Andreas Gampe <agampe@google.com> | 2014-09-29 20:07:43 -0700 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-09-29 20:13:48 -0700 |
commit | c8ccf68b805c92674545f63e0341ba47e8d9701c (patch) | |
tree | fb360323538cb242ebf7c5c0aca27d3a0bce0abb | |
parent | fcabfbe577c0fd40910b565beb681bd4b66f6c5d (diff) | |
download | art-c8ccf68b805c92674545f63e0341ba47e8d9701c.zip art-c8ccf68b805c92674545f63e0341ba47e8d9701c.tar.gz art-c8ccf68b805c92674545f63e0341ba47e8d9701c.tar.bz2 |
ART: Fix some -Wpedantic errors
Remove extra semicolons.
Dollar signs in C++ identifiers are an extension.
Named variadic macros are an extension.
Binary literals are a C++14 feature.
Enum re-declarations are not allowed.
Overflow.
Change-Id: I7d16b2217b2ef2959ca69de84eaecc754517714a
29 files changed, 228 insertions, 230 deletions
diff --git a/compiler/dex/global_value_numbering.h b/compiler/dex/global_value_numbering.h index 1a38692..27183bf 100644 --- a/compiler/dex/global_value_numbering.h +++ b/compiler/dex/global_value_numbering.h @@ -79,7 +79,7 @@ class GlobalValueNumbering { static uint64_t BuildKey(uint16_t op, uint16_t operand1, uint16_t operand2, uint16_t modifier) { return (static_cast<uint64_t>(op) << 48 | static_cast<uint64_t>(operand1) << 32 | static_cast<uint64_t>(operand2) << 16 | static_cast<uint64_t>(modifier)); - }; + } // Look up a value in the global value map, adding a new entry if there was none before. uint16_t LookupValue(uint16_t op, uint16_t operand1, uint16_t operand2, uint16_t modifier) { @@ -93,7 +93,7 @@ class GlobalValueNumbering { global_value_map_.PutBefore(lb, key, res); } return res; - }; + } // Check if the exact value is stored in the global value map. bool HasValue(uint16_t op, uint16_t operand1, uint16_t operand2, uint16_t modifier, @@ -105,7 +105,7 @@ class GlobalValueNumbering { uint64_t key = BuildKey(op, operand1, operand2, modifier); ValueMap::const_iterator it = global_value_map_.find(key); return (it != global_value_map_.end() && it->second == value); - }; + } // FieldReference represents a unique resolved field. struct FieldReference { diff --git a/compiler/dex/local_value_numbering.h b/compiler/dex/local_value_numbering.h index f6a454b..e11c6e5 100644 --- a/compiler/dex/local_value_numbering.h +++ b/compiler/dex/local_value_numbering.h @@ -122,19 +122,19 @@ class LocalValueNumbering { void SetOperandValue(uint16_t s_reg, uint16_t value) { SetOperandValueImpl(s_reg, value, &sreg_value_map_); - }; + } uint16_t GetOperandValue(int s_reg) const { return GetOperandValueImpl(s_reg, &sreg_value_map_); - }; + } void SetOperandValueWide(uint16_t s_reg, uint16_t value) { SetOperandValueImpl(s_reg, value, &sreg_wide_value_map_); - }; + } uint16_t GetOperandValueWide(int s_reg) const { return GetOperandValueImpl(s_reg, &sreg_wide_value_map_); - }; + } struct RangeCheckKey { uint16_t array; diff --git a/compiler/dex/quick/quick_compiler.cc b/compiler/dex/quick/quick_compiler.cc index 2c5f79c..6f2a647 100644 --- a/compiler/dex/quick/quick_compiler.cc +++ b/compiler/dex/quick/quick_compiler.cc @@ -489,7 +489,7 @@ static bool CanCompileShorty(const char* shorty, InstructionSet instruction_set) } } return true; -}; +} // Skip the method that we do not support currently. bool QuickCompiler::CanCompileMethod(uint32_t method_idx, const DexFile& dex_file, diff --git a/compiler/utils/arm/assembler_arm.cc b/compiler/utils/arm/assembler_arm.cc index 671ccb6..637a1ff 100644 --- a/compiler/utils/arm/assembler_arm.cc +++ b/compiler/utils/arm/assembler_arm.cc @@ -130,7 +130,7 @@ uint32_t ShifterOperand::encodingThumb() const { return ROR << 4 | static_cast<uint32_t>(rm_); } else { uint32_t imm3 = immed_ >> 2; - uint32_t imm2 = immed_ & 0b11; + uint32_t imm2 = immed_ & 3U /* 0b11 */; return imm3 << 12 | imm2 << 6 | shift_ << 4 | static_cast<uint32_t>(rm_); @@ -229,8 +229,8 @@ uint32_t Address::encodingThumb(bool is_32bit) const { uint32_t PUW = am >> 21; // Move down to bottom of word. PUW = (PUW >> 1) | (PUW & 1); // Bits 3, 2 and 0. // If P is 0 then W must be 1 (Different from ARM). - if ((PUW & 0b100) == 0) { - PUW |= 0b1; + if ((PUW & 4U /* 0b100 */) == 0) { + PUW |= 1U /* 0b1 */; } encoding |= B11 | PUW << 8 | offset; } else { @@ -267,17 +267,17 @@ uint32_t Address::encodingThumbLdrdStrd() const { uint32_t am = am_; // If P is 0 then W must be 1 (Different from ARM). uint32_t PU1W = am_ >> 21; // Move down to bottom of word. - if ((PU1W & 0b1000) == 0) { + if ((PU1W & 8U /* 0b1000 */) == 0) { am |= 1 << 21; // Set W bit. } if (offset_ < 0) { int32_t off = -offset_; CHECK_LT(off, 1024); - CHECK_EQ((off & 0b11), 0); // Must be multiple of 4. + CHECK_EQ((off & 3 /* 0b11 */), 0); // Must be multiple of 4. encoding = (am ^ (1 << kUShift)) | off >> 2; // Flip U to adjust sign. } else { CHECK_LT(offset_, 1024); - CHECK_EQ((offset_ & 0b11), 0); // Must be multiple of 4. + CHECK_EQ((offset_ & 3 /* 0b11 */), 0); // Must be multiple of 4. encoding = am | offset_ >> 2; } encoding |= static_cast<uint32_t>(rn_) << 16; @@ -886,8 +886,8 @@ uint32_t ArmAssembler::ModifiedImmediate(uint32_t value) { /* Put it all together */ uint32_t v = 8 + z_leading; - uint32_t i = (v & 0b10000) >> 4; - uint32_t imm3 = (v >> 1) & 0b111; + uint32_t i = (v & 16U /* 0b10000 */) >> 4; + uint32_t imm3 = (v >> 1) & 7U /* 0b111 */; uint32_t a = v & 1; return value | i << 26 | imm3 << 12 | a << 7; } diff --git a/compiler/utils/arm/assembler_arm32.cc b/compiler/utils/arm/assembler_arm32.cc index 267bba8..6af69c8 100644 --- a/compiler/utils/arm/assembler_arm32.cc +++ b/compiler/utils/arm/assembler_arm32.cc @@ -955,11 +955,11 @@ void Arm32Assembler::EmitVPushPop(uint32_t reg, int nregs, bool push, bool dbl, if (dbl) { // Encoded as D:Vd. D = (reg >> 4) & 1; - Vd = reg & 0b1111; + Vd = reg & 15U /* 0b1111 */; } else { // Encoded as Vd:D. D = reg & 1; - Vd = (reg >> 1) & 0b1111; + Vd = (reg >> 1) & 15U /* 0b1111 */; } int32_t encoding = B27 | B26 | B21 | B19 | B18 | B16 | B11 | B9 | diff --git a/compiler/utils/arm/assembler_thumb2.cc b/compiler/utils/arm/assembler_thumb2.cc index 4904428..7427721 100644 --- a/compiler/utils/arm/assembler_thumb2.cc +++ b/compiler/utils/arm/assembler_thumb2.cc @@ -159,8 +159,8 @@ void Thumb2Assembler::mul(Register rd, Register rn, Register rm, Condition cond) Emit16(encoding); } else { // 32 bit. - uint32_t op1 = 0b000; - uint32_t op2 = 0b00; + uint32_t op1 = 0U /* 0b000 */; + uint32_t op2 = 0U /* 0b00 */; int32_t encoding = B31 | B30 | B29 | B28 | B27 | B25 | B24 | op1 << 20 | B15 | B14 | B13 | B12 | @@ -176,8 +176,8 @@ void Thumb2Assembler::mul(Register rd, Register rn, Register rm, Condition cond) void Thumb2Assembler::mla(Register rd, Register rn, Register rm, Register ra, Condition cond) { - uint32_t op1 = 0b000; - uint32_t op2 = 0b00; + uint32_t op1 = 0U /* 0b000 */; + uint32_t op2 = 0U /* 0b00 */; int32_t encoding = B31 | B30 | B29 | B28 | B27 | B25 | B24 | op1 << 20 | op2 << 4 | @@ -192,8 +192,8 @@ void Thumb2Assembler::mla(Register rd, Register rn, Register rm, Register ra, void Thumb2Assembler::mls(Register rd, Register rn, Register rm, Register ra, Condition cond) { - uint32_t op1 = 0b000; - uint32_t op2 = 0b01; + uint32_t op1 = 0U /* 0b000 */; + uint32_t op2 = 01 /* 0b01 */; int32_t encoding = B31 | B30 | B29 | B28 | B27 | B25 | B24 | op1 << 20 | op2 << 4 | @@ -208,8 +208,8 @@ void Thumb2Assembler::mls(Register rd, Register rn, Register rm, Register ra, void Thumb2Assembler::umull(Register rd_lo, Register rd_hi, Register rn, Register rm, Condition cond) { - uint32_t op1 = 0b010; - uint32_t op2 = 0b0000; + uint32_t op1 = 2U /* 0b010; */; + uint32_t op2 = 0U /* 0b0000 */; int32_t encoding = B31 | B30 | B29 | B28 | B27 | B25 | B24 | B23 | op1 << 20 | op2 << 4 | @@ -223,8 +223,8 @@ void Thumb2Assembler::umull(Register rd_lo, Register rd_hi, Register rn, void Thumb2Assembler::sdiv(Register rd, Register rn, Register rm, Condition cond) { - uint32_t op1 = 0b001; - uint32_t op2 = 0b1111; + uint32_t op1 = 1U /* 0b001 */; + uint32_t op2 = 15U /* 0b1111 */; int32_t encoding = B31 | B30 | B29 | B28 | B27 | B25 | B24 | B23 | B20 | op1 << 20 | op2 << 4 | @@ -238,8 +238,8 @@ void Thumb2Assembler::sdiv(Register rd, Register rn, Register rm, Condition cond void Thumb2Assembler::udiv(Register rd, Register rn, Register rm, Condition cond) { - uint32_t op1 = 0b001; - uint32_t op2 = 0b1111; + uint32_t op1 = 1U /* 0b001 */; + uint32_t op2 = 15U /* 0b1111 */; int32_t encoding = B31 | B30 | B29 | B28 | B27 | B25 | B24 | B23 | B21 | B20 | op1 << 20 | op2 << 4 | @@ -733,29 +733,29 @@ void Thumb2Assembler::Emit32BitDataProcessing(Condition cond, Register rn, Register rd, const ShifterOperand& so) { - uint8_t thumb_opcode = 0b11111111; + uint8_t thumb_opcode = 255U /* 0b11111111 */; switch (opcode) { - case AND: thumb_opcode = 0b0000; break; - case EOR: thumb_opcode = 0b0100; break; - case SUB: thumb_opcode = 0b1101; break; - case RSB: thumb_opcode = 0b1110; break; - case ADD: thumb_opcode = 0b1000; break; - case ADC: thumb_opcode = 0b1010; break; - case SBC: thumb_opcode = 0b1011; break; + case AND: thumb_opcode = 0U /* 0b0000 */; break; + case EOR: thumb_opcode = 4U /* 0b0100 */; break; + case SUB: thumb_opcode = 13U /* 0b1101 */; break; + case RSB: thumb_opcode = 14U /* 0b1110 */; break; + case ADD: thumb_opcode = 8U /* 0b1000 */; break; + case ADC: thumb_opcode = 12U /* 0b1010 */; break; + case SBC: thumb_opcode = 11U /* 0b1011 */; break; case RSC: break; - case TST: thumb_opcode = 0b0000; set_cc = true; rd = PC; break; - case TEQ: thumb_opcode = 0b0100; set_cc = true; rd = PC; break; - case CMP: thumb_opcode = 0b1101; set_cc = true; rd = PC; break; - case CMN: thumb_opcode = 0b1000; set_cc = true; rd = PC; break; - case ORR: thumb_opcode = 0b0010; break; - case MOV: thumb_opcode = 0b0010; rn = PC; break; - case BIC: thumb_opcode = 0b0001; break; - case MVN: thumb_opcode = 0b0011; rn = PC; break; + case TST: thumb_opcode = 0U /* 0b0000 */; set_cc = true; rd = PC; break; + case TEQ: thumb_opcode = 4U /* 0b0100 */; set_cc = true; rd = PC; break; + case CMP: thumb_opcode = 13U /* 0b1101 */; set_cc = true; rd = PC; break; + case CMN: thumb_opcode = 8U /* 0b1000 */; set_cc = true; rd = PC; break; + case ORR: thumb_opcode = 2U /* 0b0010 */; break; + case MOV: thumb_opcode = 2U /* 0b0010 */; rn = PC; break; + case BIC: thumb_opcode = 1U /* 0b0001 */; break; + case MVN: thumb_opcode = 3U /* 0b0011 */; rn = PC; break; default: break; } - if (thumb_opcode == 0b11111111) { + if (thumb_opcode == 255U /* 0b11111111 */) { LOG(FATAL) << "Invalid thumb2 opcode " << opcode; } @@ -764,14 +764,14 @@ void Thumb2Assembler::Emit32BitDataProcessing(Condition cond, // Check special cases. if ((opcode == SUB || opcode == ADD) && (so.GetImmediate() < (1u << 12))) { if (opcode == SUB) { - thumb_opcode = 0b0101; + thumb_opcode = 5U /* 0b0101 */; } else { thumb_opcode = 0; } uint32_t imm = so.GetImmediate(); uint32_t i = (imm >> 11) & 1; - uint32_t imm3 = (imm >> 8) & 0b111; + uint32_t imm3 = (imm >> 8) & 7U /* 0b111 */; uint32_t imm8 = imm & 0xff; encoding = B31 | B30 | B29 | B28 | B25 | @@ -817,9 +817,9 @@ void Thumb2Assembler::Emit16BitDataProcessing(Condition cond, Emit16BitAddSub(cond, opcode, set_cc, rn, rd, so); return; } - uint8_t thumb_opcode = 0b11111111; + uint8_t thumb_opcode = 255U /* 0b11111111 */; // Thumb1. - uint8_t dp_opcode = 0b01; + uint8_t dp_opcode = 1U /* 0b01 */; uint8_t opcode_shift = 6; uint8_t rd_shift = 0; uint8_t rn_shift = 3; @@ -839,13 +839,13 @@ void Thumb2Assembler::Emit16BitDataProcessing(Condition cond, rn = so.GetRegister(); switch (so.GetShift()) { - case LSL: thumb_opcode = 0b00; break; - case LSR: thumb_opcode = 0b01; break; - case ASR: thumb_opcode = 0b10; break; + case LSL: thumb_opcode = 0U /* 0b00 */; break; + case LSR: thumb_opcode = 1U /* 0b01 */; break; + case ASR: thumb_opcode = 2U /* 0b10 */; break; case ROR: // ROR doesn't allow immediates. - thumb_opcode = 0b111; - dp_opcode = 0b01; + thumb_opcode = 7U /* 0b111 */; + dp_opcode = 1U /* 0b01 */; opcode_shift = 6; use_immediate = false; break; @@ -860,68 +860,68 @@ void Thumb2Assembler::Emit16BitDataProcessing(Condition cond, } switch (opcode) { - case AND: thumb_opcode = 0b0000; break; - case EOR: thumb_opcode = 0b0001; break; + case AND: thumb_opcode = 0U /* 0b0000 */; break; + case EOR: thumb_opcode = 1U /* 0b0001 */; break; case SUB: break; - case RSB: thumb_opcode = 0b1001; break; + case RSB: thumb_opcode = 9U /* 0b1001 */; break; case ADD: break; - case ADC: thumb_opcode = 0b0101; break; - case SBC: thumb_opcode = 0b0110; break; + case ADC: thumb_opcode = 5U /* 0b0101 */; break; + case SBC: thumb_opcode = 6U /* 0b0110 */; break; case RSC: break; - case TST: thumb_opcode = 0b1000; rn = so.GetRegister(); break; + case TST: thumb_opcode = 8U /* 0b1000 */; rn = so.GetRegister(); break; case TEQ: break; case CMP: if (use_immediate) { // T2 encoding. dp_opcode = 0; opcode_shift = 11; - thumb_opcode = 0b101; + thumb_opcode = 5U /* 0b101 */; rd_shift = 8; rn_shift = 8; } else { - thumb_opcode = 0b1010; + thumb_opcode = 10U /* 0b1010 */; rd = rn; rn = so.GetRegister(); } break; case CMN: { - thumb_opcode = 0b1011; + thumb_opcode = 11U /* 0b1011 */; rd = rn; rn = so.GetRegister(); break; } - case ORR: thumb_opcode = 0b1100; break; + case ORR: thumb_opcode = 12U /* 0b1100 */; break; case MOV: dp_opcode = 0; if (use_immediate) { // T2 encoding. opcode_shift = 11; - thumb_opcode = 0b100; + thumb_opcode = 4U /* 0b100 */; rd_shift = 8; rn_shift = 8; } else { rn = so.GetRegister(); if (IsHighRegister(rn) || IsHighRegister(rd)) { // Special mov for high registers. - dp_opcode = 0b01; + dp_opcode = 1U /* 0b01 */; opcode_shift = 7; // Put the top bit of rd into the bottom bit of the opcode. - thumb_opcode = 0b0001100 | static_cast<uint32_t>(rd) >> 3; - rd = static_cast<Register>(static_cast<uint32_t>(rd) & 0b111); + thumb_opcode = 12U /* 0b0001100 */ | static_cast<uint32_t>(rd) >> 3; + rd = static_cast<Register>(static_cast<uint32_t>(rd) & 7U /* 0b111 */); } else { thumb_opcode = 0; } } break; - case BIC: thumb_opcode = 0b1110; break; - case MVN: thumb_opcode = 0b1111; rn = so.GetRegister(); break; + case BIC: thumb_opcode = 14U /* 0b1110 */; break; + case MVN: thumb_opcode = 15U /* 0b1111 */; rn = so.GetRegister(); break; default: break; } } - if (thumb_opcode == 0b11111111) { + if (thumb_opcode == 255U /* 0b11111111 */) { LOG(FATAL) << "Invalid thumb1 opcode " << opcode; } @@ -962,17 +962,17 @@ void Thumb2Assembler::Emit16BitAddSub(Condition cond, Register rm = so.GetRegister(); if (rn == rd) { // Can use T2 encoding (allows 4 bit registers) - dp_opcode = 0b01; + dp_opcode = 1U /* 0b01 */; opcode_shift = 10; - thumb_opcode = 0b0001; + thumb_opcode = 1U /* 0b0001 */; // Make Rn also contain the top bit of rd. rn = static_cast<Register>(static_cast<uint32_t>(rm) | - (static_cast<uint32_t>(rd) & 0b1000) << 1); - rd = static_cast<Register>(static_cast<uint32_t>(rd) & 0b111); + (static_cast<uint32_t>(rd) & 8U /* 0b1000 */) << 1); + rd = static_cast<Register>(static_cast<uint32_t>(rd) & 7U /* 0b111 */); } else { // T1. opcode_shift = 9; - thumb_opcode = 0b01100; + thumb_opcode = 12U /* 0b01100 */; immediate = static_cast<uint32_t>(so.GetRegister()); use_immediate = true; immediate_shift = 6; @@ -981,11 +981,11 @@ void Thumb2Assembler::Emit16BitAddSub(Condition cond, // Immediate. if (rd == SP && rn == SP) { // ADD sp, sp, #imm - dp_opcode = 0b10; - thumb_opcode = 0b11; + dp_opcode = 2U /* 0b10 */; + thumb_opcode = 3U /* 0b11 */; opcode_shift = 12; CHECK_LT(immediate, (1 << 9)); - CHECK_EQ((immediate & 0b11), 0); + CHECK_EQ((immediate & 3 /* 0b11 */), 0); // Remove rd and rn from instruction by orring it with immed and clearing bits. rn = R0; @@ -995,11 +995,11 @@ void Thumb2Assembler::Emit16BitAddSub(Condition cond, immediate >>= 2; } else if (rd != SP && rn == SP) { // ADD rd, SP, #imm - dp_opcode = 0b10; - thumb_opcode = 0b101; + dp_opcode = 2U /* 0b10 */; + thumb_opcode = 5U /* 0b101 */; opcode_shift = 11; CHECK_LT(immediate, (1 << 10)); - CHECK_EQ((immediate & 0b11), 0); + CHECK_EQ((immediate & 3 /* 0b11 */), 0); // Remove rn from instruction. rn = R0; @@ -1009,12 +1009,12 @@ void Thumb2Assembler::Emit16BitAddSub(Condition cond, } else if (rn != rd) { // Must use T1. opcode_shift = 9; - thumb_opcode = 0b01110; + thumb_opcode = 14U /* 0b01110 */; immediate_shift = 6; } else { // T2 encoding. opcode_shift = 11; - thumb_opcode = 0b110; + thumb_opcode = 6U /* 0b110 */; rd_shift = 8; rn_shift = 8; } @@ -1025,18 +1025,18 @@ void Thumb2Assembler::Emit16BitAddSub(Condition cond, if (so.IsRegister()) { // T1. opcode_shift = 9; - thumb_opcode = 0b01101; + thumb_opcode = 13U /* 0b01101 */; immediate = static_cast<uint32_t>(so.GetRegister()); use_immediate = true; immediate_shift = 6; } else { if (rd == SP && rn == SP) { // SUB sp, sp, #imm - dp_opcode = 0b10; - thumb_opcode = 0b1100001; + dp_opcode = 2U /* 0b10 */; + thumb_opcode = 0x61 /* 0b1100001 */; opcode_shift = 7; CHECK_LT(immediate, (1 << 9)); - CHECK_EQ((immediate & 0b11), 0); + CHECK_EQ((immediate & 3 /* 0b11 */), 0); // Remove rd and rn from instruction by orring it with immed and clearing bits. rn = R0; @@ -1047,12 +1047,12 @@ void Thumb2Assembler::Emit16BitAddSub(Condition cond, } else if (rn != rd) { // Must use T1. opcode_shift = 9; - thumb_opcode = 0b01111; + thumb_opcode = 15U /* 0b01111 */; immediate_shift = 6; } else { // T2 encoding. opcode_shift = 11; - thumb_opcode = 0b111; + thumb_opcode = 7U /* 0b111 */; rd_shift = 8; rn_shift = 8; } @@ -1094,11 +1094,11 @@ void Thumb2Assembler::EmitShift(Register rd, Register rm, Shift shift, uint8_t a if (IsHighRegister(rd) || IsHighRegister(rm) || shift == ROR || shift == RRX) { uint16_t opcode = 0; switch (shift) { - case LSL: opcode = 0b00; break; - case LSR: opcode = 0b01; break; - case ASR: opcode = 0b10; break; - case ROR: opcode = 0b11; break; - case RRX: opcode = 0b11; amount = 0; break; + case LSL: opcode = 0U /* 0b00 */; break; + case LSR: opcode = 1U /* 0b01 */; break; + case ASR: opcode = 2U /* 0b10 */; break; + case ROR: opcode = 3U /* 0b11 */; break; + case RRX: opcode = 3U /* 0b11 */; amount = 0; break; default: LOG(FATAL) << "Unsupported thumb2 shift opcode"; } @@ -1106,7 +1106,7 @@ void Thumb2Assembler::EmitShift(Register rd, Register rm, Shift shift, uint8_t a int32_t encoding = B31 | B30 | B29 | B27 | B25 | B22 | 0xf << 16 | (setcc ? B20 : 0); uint32_t imm3 = amount >> 2; - uint32_t imm2 = amount & 0b11; + uint32_t imm2 = amount & 3U /* 0b11 */; encoding |= imm3 << 12 | imm2 << 6 | static_cast<int16_t>(rm) | static_cast<int16_t>(rd) << 8 | opcode << 4; Emit32(encoding); @@ -1114,9 +1114,9 @@ void Thumb2Assembler::EmitShift(Register rd, Register rm, Shift shift, uint8_t a // 16 bit shift uint16_t opcode = 0; switch (shift) { - case LSL: opcode = 0b00; break; - case LSR: opcode = 0b01; break; - case ASR: opcode = 0b10; break; + case LSL: opcode = 0U /* 0b00 */; break; + case LSR: opcode = 1U /* 0b01 */; break; + case ASR: opcode = 2U /* 0b10 */; break; default: LOG(FATAL) << "Unsupported thumb2 shift opcode"; } @@ -1136,10 +1136,10 @@ void Thumb2Assembler::EmitShift(Register rd, Register rn, Shift shift, Register if (must_be_32bit) { uint16_t opcode = 0; switch (shift) { - case LSL: opcode = 0b00; break; - case LSR: opcode = 0b01; break; - case ASR: opcode = 0b10; break; - case ROR: opcode = 0b11; break; + case LSL: opcode = 0U /* 0b00 */; break; + case LSR: opcode = 1U /* 0b01 */; break; + case ASR: opcode = 2U /* 0b10 */; break; + case ROR: opcode = 3U /* 0b11 */; break; default: LOG(FATAL) << "Unsupported thumb2 shift opcode"; } @@ -1152,9 +1152,9 @@ void Thumb2Assembler::EmitShift(Register rd, Register rn, Shift shift, Register } else { uint16_t opcode = 0; switch (shift) { - case LSL: opcode = 0b0010; break; - case LSR: opcode = 0b0011; break; - case ASR: opcode = 0b0100; break; + case LSL: opcode = 2U /* 0b0010 */; break; + case LSR: opcode = 3U /* 0b0011 */; break; + case ASR: opcode = 4U /* 0b0100 */; break; default: LOG(FATAL) << "Unsupported thumb2 shift opcode"; } @@ -1204,7 +1204,7 @@ void Thumb2Assembler::Branch::Emit(AssemblerBuffer* buffer) const { if (IsCompareAndBranch()) { offset -= 4; uint16_t i = (offset >> 6) & 1; - uint16_t imm5 = (offset >> 1) & 0b11111; + uint16_t imm5 = (offset >> 1) & 31U /* 0b11111 */; int16_t encoding = B15 | B13 | B12 | (type_ == kCompareAndBranchNonZero ? B11 : 0) | static_cast<uint32_t>(rn_) | @@ -1304,15 +1304,15 @@ void Thumb2Assembler::EmitLoadStore(Condition cond, bool sp_relative = false; if (byte) { - opA = 0b0111; + opA = 7U /* 0b0111 */; } else if (half) { - opA = 0b1000; + opA = 8U /* 0b1000 */; } else { if (rn == SP) { - opA = 0b1001; + opA = 9U /* 0b1001 */; sp_relative = true; } else { - opA = 0b0110; + opA = 6U /* 0b0110 */; } } int16_t encoding = opA << 12 | @@ -1322,7 +1322,7 @@ void Thumb2Assembler::EmitLoadStore(Condition cond, if (sp_relative) { // SP relative, 10 bit offset. CHECK_LT(offset, (1 << 10)); - CHECK_EQ((offset & 0b11), 0); + CHECK_EQ((offset & 3 /* 0b11 */), 0); encoding |= rd << 8 | offset >> 2; } else { // No SP relative. The offset is shifted right depending on @@ -1335,12 +1335,12 @@ void Thumb2Assembler::EmitLoadStore(Condition cond, } else if (half) { // 6 bit offset, shifted by 1. CHECK_LT(offset, (1 << 6)); - CHECK_EQ((offset & 0b1), 0); + CHECK_EQ((offset & 1 /* 0b1 */), 0); offset >>= 1; } else { // 7 bit offset, shifted by 2. CHECK_LT(offset, (1 << 7)); - CHECK_EQ((offset & 0b11), 0); + CHECK_EQ((offset & 3 /* 0b11 */), 0); offset >>= 2; } encoding |= rn << 3 | offset << 6; @@ -1428,11 +1428,11 @@ void Thumb2Assembler::EmitMultiMemOp(Condition cond, switch (am) { case IA: case IA_W: - op = 0b01; + op = 1U /* 0b01 */; break; case DB: case DB_W: - op = 0b10; + op = 2U /* 0b10 */; break; case DA: case IB: @@ -1534,9 +1534,9 @@ void Thumb2Assembler::movw(Register rd, uint16_t imm16, Condition cond) { if (must_be_32bit) { // Use encoding T3. - uint32_t imm4 = (imm16 >> 12) & 0b1111; - uint32_t i = (imm16 >> 11) & 0b1; - uint32_t imm3 = (imm16 >> 8) & 0b111; + uint32_t imm4 = (imm16 >> 12) & 15U /* 0b1111 */; + uint32_t i = (imm16 >> 11) & 1U /* 0b1 */; + uint32_t imm3 = (imm16 >> 8) & 7U /* 0b111 */; uint32_t imm8 = imm16 & 0xff; int32_t encoding = B31 | B30 | B29 | B28 | B25 | B22 | @@ -1557,9 +1557,9 @@ void Thumb2Assembler::movw(Register rd, uint16_t imm16, Condition cond) { void Thumb2Assembler::movt(Register rd, uint16_t imm16, Condition cond) { CheckCondition(cond); // Always 32 bits. - uint32_t imm4 = (imm16 >> 12) & 0b1111; - uint32_t i = (imm16 >> 11) & 0b1; - uint32_t imm3 = (imm16 >> 8) & 0b111; + uint32_t imm4 = (imm16 >> 12) & 15U /* 0b1111 */; + uint32_t i = (imm16 >> 11) & 1U /* 0b1 */; + uint32_t imm3 = (imm16 >> 8) & 7U /* 0b111 */; uint32_t imm8 = imm16 & 0xff; int32_t encoding = B31 | B30 | B29 | B28 | B25 | B23 | B22 | @@ -1638,9 +1638,9 @@ void Thumb2Assembler::clrex(Condition cond) { void Thumb2Assembler::nop(Condition cond) { CheckCondition(cond); - int16_t encoding = B15 | B13 | B12 | + uint16_t encoding = B15 | B13 | B12 | B11 | B10 | B9 | B8; - Emit16(encoding); + Emit16(static_cast<int16_t>(encoding)); } @@ -1840,17 +1840,17 @@ void Thumb2Assembler::EmitVPushPop(uint32_t reg, int nregs, bool push, bool dbl, if (dbl) { // Encoded as D:Vd. D = (reg >> 4) & 1; - Vd = reg & 0b1111; + Vd = reg & 15U /* 0b1111 */; } else { // Encoded as Vd:D. D = reg & 1; - Vd = (reg >> 1) & 0b1111; + Vd = (reg >> 1) & 15U /* 0b1111 */; } int32_t encoding = B27 | B26 | B21 | B19 | B18 | B16 | B11 | B9 | (dbl ? B8 : 0) | (push ? B24 : (B23 | B20)) | - 0b1110 << 28 | + 14U /* 0b1110 */ << 28 | nregs << (dbl ? 1 : 0) | D << 22 | Vd << 12; @@ -1992,7 +1992,7 @@ void Thumb2Assembler::it(Condition firstcond, ItState i1, ItState i2, ItState i3 mask |= ToItMask(i3, firstcond0, 1); SetItCondition(i3, firstcond, 3); if (i3 != kItOmitted) { - mask |= 0b0001; + mask |= 1U /* 0b0001 */; } } } diff --git a/compiler/utils/arm64/assembler_arm64.h b/compiler/utils/arm64/assembler_arm64.h index 788950b..bf89d24 100644 --- a/compiler/utils/arm64/assembler_arm64.h +++ b/compiler/utils/arm64/assembler_arm64.h @@ -33,7 +33,7 @@ namespace art { namespace arm64 { -#define MEM_OP(x...) vixl::MemOperand(x) +#define MEM_OP(...) vixl::MemOperand(__VA_ARGS__) enum LoadOperandType { kLoadSignedByte, diff --git a/compiler/utils/growable_array.h b/compiler/utils/growable_array.h index 5b55b80..61e420c 100644 --- a/compiler/utils/growable_array.h +++ b/compiler/utils/growable_array.h @@ -41,7 +41,7 @@ class GrowableArray { kind_(kind) { elem_list_ = static_cast<T*>(arena_->Alloc(sizeof(T) * init_length, kArenaAllocGrowableArray)); - }; + } // Expand the list size to at least new length. @@ -58,7 +58,7 @@ class GrowableArray { memcpy(new_array, elem_list_, sizeof(T) * num_allocated_); num_allocated_ = target_length; elem_list_ = new_array; - }; + } // NOTE: does not return storage, just resets use count. void Reset() { @@ -89,7 +89,7 @@ class GrowableArray { T Get(size_t index) const { DCHECK_LT(index, num_used_); return elem_list_[index]; - }; + } // Overwrite existing element at position index. List must be large enough. void Put(size_t index, T elem) { @@ -120,14 +120,14 @@ class GrowableArray { // We should either have found the element, or it was the last (unscanned) element. DCHECK(found || (element == elem_list_[num_used_ - 1])); num_used_--; - }; + } void DeleteAt(size_t index) { for (size_t i = index; i < num_used_ - 1; i++) { elem_list_[i] = elem_list_[i + 1]; } num_used_--; - }; + } size_t GetNumAllocated() const { return num_allocated_; } @@ -154,7 +154,7 @@ class GrowableArray { static void* operator new(size_t size, ArenaAllocator* arena) { return arena->Alloc(sizeof(GrowableArray<T>), kArenaAllocGrowableArray); - }; + } static void operator delete(void* p) {} // Nop. private: diff --git a/disassembler/disassembler_arm.cc b/disassembler/disassembler_arm.cc index 54e7761..6f8e08b 100644 --- a/disassembler/disassembler_arm.cc +++ b/disassembler/disassembler_arm.cc @@ -82,14 +82,14 @@ void DisassemblerArm::DumpCond(std::ostream& os, uint32_t cond) { void DisassemblerArm::DumpMemoryDomain(std::ostream& os, uint32_t domain) { switch (domain) { - case 0b1111: os << "sy"; break; - case 0b1110: os << "st"; break; - case 0b1011: os << "ish"; break; - case 0b1010: os << "ishst"; break; - case 0b0111: os << "nsh"; break; - case 0b0110: os << "nshst"; break; - case 0b0011: os << "osh"; break; - case 0b0010: os << "oshst"; break; + case 15U /* 0b1111 */: os << "sy"; break; + case 14U /* 0b1110 */: os << "st"; break; + case 11U /* 0b1011 */: os << "ish"; break; + case 10U /* 0b1010 */: os << "ishst"; break; + case 7U /* 0b0111 */: os << "nsh"; break; + case 6U /* 0b0110 */: os << "nshst"; break; + case 3U /* 0b0011 */: os << "osh"; break; + case 2U /* 0b0010 */: os << "oshst"; break; } } @@ -269,7 +269,7 @@ void DisassemblerArm::DumpArm(std::ostream& os, const uint8_t* instr_ptr) { uint32_t op = (instruction >> 21) & 0xf; opcode = kDataProcessingOperations[op]; bool implicit_s = ((op & ~3) == 8); // TST, TEQ, CMP, and CMN. - bool is_mov = op == 0b1101 || op == 0b1111; + bool is_mov = op == 13U /* 0b1101 */ || op == 15U /* 0b1111 */; if (is_mov) { // Show only Rd and Rm. if (s) { diff --git a/disassembler/disassembler_x86.cc b/disassembler/disassembler_x86.cc index 1d29765..195c45f 100644 --- a/disassembler/disassembler_x86.cc +++ b/disassembler/disassembler_x86.cc @@ -58,10 +58,10 @@ static const char* gReg64Names[] = { }; // 64-bit opcode REX modifier. -constexpr uint8_t REX_W = 0b1000; -constexpr uint8_t REX_R = 0b0100; -constexpr uint8_t REX_X = 0b0010; -constexpr uint8_t REX_B = 0b0001; +constexpr uint8_t REX_W = 8U /* 0b1000 */; +constexpr uint8_t REX_R = 4U /* 0b0100 */; +constexpr uint8_t REX_X = 2U /* 0b0010 */; +constexpr uint8_t REX_B = 1U /* 0b0001 */; static void DumpReg0(std::ostream& os, uint8_t rex, size_t reg, bool byte_operand, uint8_t size_override) { @@ -767,7 +767,7 @@ DISASSEMBLER_ENTRY(cmp, case 0xB1: opcode << "cmpxchg"; has_modrm = true; store = true; break; case 0xB6: opcode << "movzxb"; has_modrm = true; load = true; byte_second_operand = true; break; case 0xB7: opcode << "movzxw"; has_modrm = true; load = true; break; - case 0xBE: opcode << "movsxb"; has_modrm = true; load = true; byte_second_operand = true; rex |= (rex == 0 ? 0 : 0b1000); break; + case 0xBE: opcode << "movsxb"; has_modrm = true; load = true; byte_second_operand = true; rex |= (rex == 0 ? 0 : REX_W); break; case 0xBF: opcode << "movsxw"; has_modrm = true; load = true; break; case 0xC3: opcode << "movnti"; store = true; has_modrm = true; break; case 0xC5: diff --git a/patchoat/patchoat.h b/patchoat/patchoat.h index 326333e..9086d58 100644 --- a/patchoat/patchoat.h +++ b/patchoat/patchoat.h @@ -36,7 +36,7 @@ class Object; class Reference; class Class; class ArtMethod; -}; // namespace mirror +} // namespace mirror class PatchOat { public: diff --git a/runtime/arch/arm/entrypoints_init_arm.cc b/runtime/arch/arm/entrypoints_init_arm.cc index 38a88c5..2780d1b 100644 --- a/runtime/arch/arm/entrypoints_init_arm.cc +++ b/runtime/arch/arm/entrypoints_init_arm.cc @@ -256,6 +256,6 @@ void InitEntryPoints(InterpreterEntryPoints* ipoints, JniEntryPoints* jpoints, qpoints->pThrowNoSuchMethod = art_quick_throw_no_such_method; qpoints->pThrowNullPointer = art_quick_throw_null_pointer_exception; qpoints->pThrowStackOverflow = art_quick_throw_stack_overflow; -}; +} } // namespace art diff --git a/runtime/arch/x86/fault_handler_x86.cc b/runtime/arch/x86/fault_handler_x86.cc index 7db84d0..17310b6 100644 --- a/runtime/arch/x86/fault_handler_x86.cc +++ b/runtime/arch/x86/fault_handler_x86.cc @@ -207,18 +207,18 @@ static uint32_t GetInstructionSize(const uint8_t* pc) { } if (has_modrm) { - uint8_t mod = (modrm >> 6) & 0b11; + uint8_t mod = (modrm >> 6) & 3U /* 0b11 */; // Check for SIB. - if (mod != 0b11 && (modrm & 0b111) == 4) { + if (mod != 3U /* 0b11 */ && (modrm & 7U /* 0b111 */) == 4) { ++pc; // SIB } switch (mod) { - case 0b00: break; - case 0b01: displacement_size = 1; break; - case 0b10: displacement_size = 4; break; - case 0b11: + case 0U /* 0b00 */: break; + case 1U /* 0b01 */: displacement_size = 1; break; + case 2U /* 0b10 */: displacement_size = 4; break; + case 3U /* 0b11 */: break; } } diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 9090f29..cc77c50 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -2116,7 +2116,7 @@ mirror::Class* ClassLinker::FindClassInPathClassLoader(ScopedObjectAccessAlready hs.NewHandle(soa.DecodeField(WellKnownClasses::dalvik_system_DexFile_cookie)); Handle<mirror::ArtField> dex_file_field = hs.NewHandle( - soa.DecodeField(WellKnownClasses::dalvik_system_DexPathList$Element_dexFile)); + soa.DecodeField(WellKnownClasses::dalvik_system_DexPathList__Element_dexFile)); mirror::Object* dex_path_list = soa.DecodeField(WellKnownClasses::dalvik_system_PathClassLoader_pathList)-> GetObject(class_loader.Get()); diff --git a/runtime/class_linker.h b/runtime/class_linker.h index 3ea74e0..111dd63 100644 --- a/runtime/class_linker.h +++ b/runtime/class_linker.h @@ -673,7 +673,7 @@ class ClassLinker { std::vector<const DexFile*> boot_class_path_; mutable ReaderWriterMutex dex_lock_ DEFAULT_MUTEX_ACQUIRED_AFTER; - std::vector<size_t> new_dex_cache_roots_ GUARDED_BY(dex_lock_);; + std::vector<size_t> new_dex_cache_roots_ GUARDED_BY(dex_lock_); std::vector<GcRoot<mirror::DexCache>> dex_caches_ GUARDED_BY(dex_lock_); std::vector<const OatFile*> oat_files_ GUARDED_BY(dex_lock_); diff --git a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc index 9d850c5..d8da463 100644 --- a/runtime/entrypoints/quick/quick_alloc_entrypoints.cc +++ b/runtime/entrypoints/quick/quick_alloc_entrypoints.cc @@ -216,10 +216,10 @@ void SetQuickAllocEntryPoints##suffix(QuickEntryPoints* qpoints, bool instrument // Generate the entrypoint functions. #if !defined(__APPLE__) || !defined(__LP64__) -GENERATE_ENTRYPOINTS(_dlmalloc); -GENERATE_ENTRYPOINTS(_rosalloc); -GENERATE_ENTRYPOINTS(_bump_pointer); -GENERATE_ENTRYPOINTS(_tlab); +GENERATE_ENTRYPOINTS(_dlmalloc) +GENERATE_ENTRYPOINTS(_rosalloc) +GENERATE_ENTRYPOINTS(_bump_pointer) +GENERATE_ENTRYPOINTS(_tlab) #endif static bool entry_points_instrumented = false; diff --git a/runtime/entrypoints/quick/quick_alloc_entrypoints.h b/runtime/entrypoints/quick/quick_alloc_entrypoints.h index 7fd3fe9..ec0aef5 100644 --- a/runtime/entrypoints/quick/quick_alloc_entrypoints.h +++ b/runtime/entrypoints/quick/quick_alloc_entrypoints.h @@ -17,15 +17,12 @@ #ifndef ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_ALLOC_ENTRYPOINTS_H_ #define ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_ALLOC_ENTRYPOINTS_H_ -#include "gc/heap.h" +#include "base/mutex.h" +#include "gc/allocator_type.h" #include "quick_entrypoints.h" namespace art { -namespace gc { -enum AllocatorType; -} // namespace gc - void ResetQuickAllocEntryPoints(QuickEntryPoints* qpoints); // Runtime shutdown lock is necessary to prevent races in thread initialization. When the thread is diff --git a/runtime/gc/heap-inl.h b/runtime/gc/heap-inl.h index c971449..3101c68 100644 --- a/runtime/gc/heap-inl.h +++ b/runtime/gc/heap-inl.h @@ -277,7 +277,7 @@ inline Heap::AllocationTimer::~AllocationTimer() { heap_->total_allocation_time_.FetchAndAddSequentiallyConsistent(allocation_end_time - allocation_start_time_); } } -}; +} inline bool Heap::ShouldAllocLargeObject(mirror::Class* c, size_t byte_count) const { // We need to have a zygote space or else our newly allocated large object can end up in the diff --git a/runtime/interpreter/interpreter_common.cc b/runtime/interpreter/interpreter_common.cc index 0e3c2de..733f1d1 100644 --- a/runtime/interpreter/interpreter_common.cc +++ b/runtime/interpreter/interpreter_common.cc @@ -96,22 +96,22 @@ bool DoFieldGet(Thread* self, ShadowFrame& shadow_frame, const Instruction* inst EXPLICIT_DO_FIELD_GET_TEMPLATE_DECL(_find_type, _field_type, true); // iget-XXX -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstancePrimitiveRead, Primitive::kPrimBoolean); -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstancePrimitiveRead, Primitive::kPrimByte); -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstancePrimitiveRead, Primitive::kPrimChar); -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstancePrimitiveRead, Primitive::kPrimShort); -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstancePrimitiveRead, Primitive::kPrimInt); -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstancePrimitiveRead, Primitive::kPrimLong); -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstanceObjectRead, Primitive::kPrimNot); +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstancePrimitiveRead, Primitive::kPrimBoolean) +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstancePrimitiveRead, Primitive::kPrimByte) +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstancePrimitiveRead, Primitive::kPrimChar) +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstancePrimitiveRead, Primitive::kPrimShort) +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstancePrimitiveRead, Primitive::kPrimInt) +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstancePrimitiveRead, Primitive::kPrimLong) +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(InstanceObjectRead, Primitive::kPrimNot) // sget-XXX -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticPrimitiveRead, Primitive::kPrimBoolean); -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticPrimitiveRead, Primitive::kPrimByte); -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticPrimitiveRead, Primitive::kPrimChar); -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticPrimitiveRead, Primitive::kPrimShort); -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticPrimitiveRead, Primitive::kPrimInt); -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticPrimitiveRead, Primitive::kPrimLong); -EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticObjectRead, Primitive::kPrimNot); +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticPrimitiveRead, Primitive::kPrimBoolean) +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticPrimitiveRead, Primitive::kPrimByte) +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticPrimitiveRead, Primitive::kPrimChar) +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticPrimitiveRead, Primitive::kPrimShort) +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticPrimitiveRead, Primitive::kPrimInt) +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticPrimitiveRead, Primitive::kPrimLong) +EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL(StaticObjectRead, Primitive::kPrimNot) #undef EXPLICIT_DO_FIELD_GET_ALL_TEMPLATE_DECL #undef EXPLICIT_DO_FIELD_GET_TEMPLATE_DECL @@ -301,22 +301,22 @@ bool DoFieldPut(Thread* self, const ShadowFrame& shadow_frame, const Instruction EXPLICIT_DO_FIELD_PUT_TEMPLATE_DECL(_find_type, _field_type, true, true); // iput-XXX -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstancePrimitiveWrite, Primitive::kPrimBoolean); -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstancePrimitiveWrite, Primitive::kPrimByte); -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstancePrimitiveWrite, Primitive::kPrimChar); -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstancePrimitiveWrite, Primitive::kPrimShort); -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstancePrimitiveWrite, Primitive::kPrimInt); -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstancePrimitiveWrite, Primitive::kPrimLong); -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstanceObjectWrite, Primitive::kPrimNot); +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstancePrimitiveWrite, Primitive::kPrimBoolean) +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstancePrimitiveWrite, Primitive::kPrimByte) +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstancePrimitiveWrite, Primitive::kPrimChar) +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstancePrimitiveWrite, Primitive::kPrimShort) +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstancePrimitiveWrite, Primitive::kPrimInt) +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstancePrimitiveWrite, Primitive::kPrimLong) +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(InstanceObjectWrite, Primitive::kPrimNot) // sput-XXX -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticPrimitiveWrite, Primitive::kPrimBoolean); -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticPrimitiveWrite, Primitive::kPrimByte); -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticPrimitiveWrite, Primitive::kPrimChar); -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticPrimitiveWrite, Primitive::kPrimShort); -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticPrimitiveWrite, Primitive::kPrimInt); -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticPrimitiveWrite, Primitive::kPrimLong); -EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticObjectWrite, Primitive::kPrimNot); +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticPrimitiveWrite, Primitive::kPrimBoolean) +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticPrimitiveWrite, Primitive::kPrimByte) +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticPrimitiveWrite, Primitive::kPrimChar) +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticPrimitiveWrite, Primitive::kPrimShort) +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticPrimitiveWrite, Primitive::kPrimInt) +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticPrimitiveWrite, Primitive::kPrimLong) +EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL(StaticObjectWrite, Primitive::kPrimNot) #undef EXPLICIT_DO_FIELD_PUT_ALL_TEMPLATE_DECL #undef EXPLICIT_DO_FIELD_PUT_TEMPLATE_DECL @@ -383,13 +383,13 @@ bool DoIPutQuick(const ShadowFrame& shadow_frame, const Instruction* inst, uint1 EXPLICIT_DO_IPUT_QUICK_TEMPLATE_DECL(_field_type, false); \ EXPLICIT_DO_IPUT_QUICK_TEMPLATE_DECL(_field_type, true); -EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimInt); // iput-quick. -EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimBoolean); // iput-boolean-quick. -EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimByte); // iput-byte-quick. -EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimChar); // iput-char-quick. -EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimShort); // iput-short-quick. -EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimLong); // iput-wide-quick. -EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimNot); // iput-object-quick. +EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimInt) // iput-quick. +EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimBoolean) // iput-boolean-quick. +EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimByte) // iput-byte-quick. +EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimChar) // iput-char-quick. +EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimShort) // iput-short-quick. +EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimLong) // iput-wide-quick. +EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL(Primitive::kPrimNot) // iput-object-quick. #undef EXPLICIT_DO_IPUT_QUICK_ALL_TEMPLATE_DECL #undef EXPLICIT_DO_IPUT_QUICK_TEMPLATE_DECL diff --git a/runtime/interpreter/interpreter_common.h b/runtime/interpreter/interpreter_common.h index 9358632..a8345ad 100644 --- a/runtime/interpreter/interpreter_common.h +++ b/runtime/interpreter/interpreter_common.h @@ -388,11 +388,11 @@ static inline bool IsBackwardBranch(int32_t branch_offset) { EXPLICIT_DO_INVOKE_TEMPLATE_DECL(_type, true, false); \ EXPLICIT_DO_INVOKE_TEMPLATE_DECL(_type, true, true); -EXPLICIT_DO_INVOKE_ALL_TEMPLATE_DECL(kStatic); // invoke-static/range. -EXPLICIT_DO_INVOKE_ALL_TEMPLATE_DECL(kDirect); // invoke-direct/range. -EXPLICIT_DO_INVOKE_ALL_TEMPLATE_DECL(kVirtual); // invoke-virtual/range. -EXPLICIT_DO_INVOKE_ALL_TEMPLATE_DECL(kSuper); // invoke-super/range. -EXPLICIT_DO_INVOKE_ALL_TEMPLATE_DECL(kInterface); // invoke-interface/range. +EXPLICIT_DO_INVOKE_ALL_TEMPLATE_DECL(kStatic) // invoke-static/range. +EXPLICIT_DO_INVOKE_ALL_TEMPLATE_DECL(kDirect) // invoke-direct/range. +EXPLICIT_DO_INVOKE_ALL_TEMPLATE_DECL(kVirtual) // invoke-virtual/range. +EXPLICIT_DO_INVOKE_ALL_TEMPLATE_DECL(kSuper) // invoke-super/range. +EXPLICIT_DO_INVOKE_ALL_TEMPLATE_DECL(kInterface) // invoke-interface/range. #undef EXPLICIT_DO_INVOKE_ALL_TEMPLATE_DECL #undef EXPLICIT_DO_INVOKE_TEMPLATE_DECL diff --git a/runtime/mem_map.cc b/runtime/mem_map.cc index 4d3f8c9..d755cb9 100644 --- a/runtime/mem_map.cc +++ b/runtime/mem_map.cc @@ -485,7 +485,7 @@ MemMap::MemMap(const std::string& name, byte* begin, size_t size, void* base_beg MutexLock mu(Thread::Current(), *Locks::mem_maps_lock_); maps_.insert(std::pair<void*, MemMap*>(base_begin_, this)); } -}; +} MemMap* MemMap::RemapAtEnd(byte* new_end, const char* tail_name, int tail_prot, std::string* error_msg) { diff --git a/runtime/native_bridge_art_interface.cc b/runtime/native_bridge_art_interface.cc index cc44615..bc191b4 100644 --- a/runtime/native_bridge_art_interface.cc +++ b/runtime/native_bridge_art_interface.cc @@ -132,4 +132,4 @@ void UnloadNativeBridge() { android::UnloadNativeBridge(); } -}; // namespace art +} // namespace art diff --git a/runtime/native_bridge_art_interface.h b/runtime/native_bridge_art_interface.h index 42f0ed2..026cd82 100644 --- a/runtime/native_bridge_art_interface.h +++ b/runtime/native_bridge_art_interface.h @@ -35,6 +35,6 @@ void InitializeNativeBridge(JNIEnv* env, const char* instruction_set); void UnloadNativeBridge(); -}; // namespace art +} // namespace art #endif // ART_RUNTIME_NATIVE_BRIDGE_ART_INTERFACE_H_ diff --git a/runtime/thread.cc b/runtime/thread.cc index ae89c90..07657d1 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -1220,7 +1220,7 @@ void Thread::HandleUncaughtExceptions(ScopedObjectAccess& soa) { // Call the handler. tlsPtr_.jni_env->CallVoidMethod(handler.get(), - WellKnownClasses::java_lang_Thread$UncaughtExceptionHandler_uncaughtException, + WellKnownClasses::java_lang_Thread__UncaughtExceptionHandler_uncaughtException, peer.get(), exception.get()); // If the handler threw, clear that exception too. diff --git a/runtime/thread.h b/runtime/thread.h index 164eb86..6c427b8 100644 --- a/runtime/thread.h +++ b/runtime/thread.h @@ -679,7 +679,7 @@ class Thread { // Number of references allocated in handle scopes & JNI shadow frames on this thread. size_t NumStackReferences() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { return NumHandleReferences() + NumJniShadowFrameReferences(); - }; + } // Is the given obj in this thread's stack indirect reference table? bool HandleScopeContains(jobject obj) const; diff --git a/runtime/trace.cc b/runtime/trace.cc index 4bb388f..027f62d 100644 --- a/runtime/trace.cc +++ b/runtime/trace.cc @@ -560,7 +560,7 @@ void Trace::DexPcMoved(Thread* thread, mirror::Object* this_object, mirror::ArtMethod* method, uint32_t new_dex_pc) { // We're not recorded to listen to this kind of event, so complain. LOG(ERROR) << "Unexpected dex PC event in tracing " << PrettyMethod(method) << " " << new_dex_pc; -}; +} void Trace::FieldRead(Thread* /*thread*/, mirror::Object* this_object, mirror::ArtMethod* method, uint32_t dex_pc, mirror::ArtField* field) diff --git a/runtime/verifier/reg_type_cache.cc b/runtime/verifier/reg_type_cache.cc index fb0616d..7c40945 100644 --- a/runtime/verifier/reg_type_cache.cc +++ b/runtime/verifier/reg_type_cache.cc @@ -96,7 +96,7 @@ const RegType& RegTypeCache::FromDescriptor(mirror::ClassLoader* loader, const c } else { return Conflict(); } -}; +} const RegType& RegTypeCache::RegTypeFromPrimitiveType(Primitive::Type prim_type) const { DCHECK(RegTypeCache::primitive_initialized_); diff --git a/runtime/well_known_classes.cc b/runtime/well_known_classes.cc index cef604b..4a3c3ec 100644 --- a/runtime/well_known_classes.cc +++ b/runtime/well_known_classes.cc @@ -29,7 +29,7 @@ namespace art { jclass WellKnownClasses::com_android_dex_Dex; jclass WellKnownClasses::dalvik_system_DexFile; jclass WellKnownClasses::dalvik_system_DexPathList; -jclass WellKnownClasses::dalvik_system_DexPathList$Element; +jclass WellKnownClasses::dalvik_system_DexPathList__Element; jclass WellKnownClasses::dalvik_system_PathClassLoader; jclass WellKnownClasses::java_lang_BootClassLoader; jclass WellKnownClasses::java_lang_ClassLoader; @@ -48,7 +48,7 @@ jclass WellKnownClasses::java_lang_StackOverflowError; jclass WellKnownClasses::java_lang_String; jclass WellKnownClasses::java_lang_System; jclass WellKnownClasses::java_lang_Thread; -jclass WellKnownClasses::java_lang_Thread$UncaughtExceptionHandler; +jclass WellKnownClasses::java_lang_Thread__UncaughtExceptionHandler; jclass WellKnownClasses::java_lang_ThreadGroup; jclass WellKnownClasses::java_lang_Throwable; jclass WellKnownClasses::java_nio_DirectByteBuffer; @@ -78,7 +78,7 @@ jmethodID WellKnownClasses::java_lang_Short_valueOf; jmethodID WellKnownClasses::java_lang_System_runFinalization = NULL; jmethodID WellKnownClasses::java_lang_Thread_init; jmethodID WellKnownClasses::java_lang_Thread_run; -jmethodID WellKnownClasses::java_lang_Thread$UncaughtExceptionHandler_uncaughtException; +jmethodID WellKnownClasses::java_lang_Thread__UncaughtExceptionHandler_uncaughtException; jmethodID WellKnownClasses::java_lang_ThreadGroup_removeThread; jmethodID WellKnownClasses::java_nio_DirectByteBuffer_init; jmethodID WellKnownClasses::org_apache_harmony_dalvik_ddmc_DdmServer_broadcast; @@ -87,7 +87,7 @@ jmethodID WellKnownClasses::org_apache_harmony_dalvik_ddmc_DdmServer_dispatch; jfieldID WellKnownClasses::dalvik_system_DexFile_cookie; jfieldID WellKnownClasses::dalvik_system_PathClassLoader_pathList; jfieldID WellKnownClasses::dalvik_system_DexPathList_dexElements; -jfieldID WellKnownClasses::dalvik_system_DexPathList$Element_dexFile; +jfieldID WellKnownClasses::dalvik_system_DexPathList__Element_dexFile; jfieldID WellKnownClasses::java_lang_Thread_daemon; jfieldID WellKnownClasses::java_lang_Thread_group; jfieldID WellKnownClasses::java_lang_Thread_lock; @@ -163,7 +163,7 @@ void WellKnownClasses::Init(JNIEnv* env) { com_android_dex_Dex = CacheClass(env, "com/android/dex/Dex"); dalvik_system_DexFile = CacheClass(env, "dalvik/system/DexFile"); dalvik_system_DexPathList = CacheClass(env, "dalvik/system/DexPathList"); - dalvik_system_DexPathList$Element = CacheClass(env, "dalvik/system/DexPathList$Element"); + dalvik_system_DexPathList__Element = CacheClass(env, "dalvik/system/DexPathList$Element"); dalvik_system_PathClassLoader = CacheClass(env, "dalvik/system/PathClassLoader"); java_lang_BootClassLoader = CacheClass(env, "java/lang/BootClassLoader"); java_lang_ClassLoader = CacheClass(env, "java/lang/ClassLoader"); @@ -182,7 +182,8 @@ void WellKnownClasses::Init(JNIEnv* env) { java_lang_String = CacheClass(env, "java/lang/String"); java_lang_System = CacheClass(env, "java/lang/System"); java_lang_Thread = CacheClass(env, "java/lang/Thread"); - java_lang_Thread$UncaughtExceptionHandler = CacheClass(env, "java/lang/Thread$UncaughtExceptionHandler"); + java_lang_Thread__UncaughtExceptionHandler = CacheClass(env, + "java/lang/Thread$UncaughtExceptionHandler"); java_lang_ThreadGroup = CacheClass(env, "java/lang/ThreadGroup"); java_lang_Throwable = CacheClass(env, "java/lang/Throwable"); java_nio_DirectByteBuffer = CacheClass(env, "java/nio/DirectByteBuffer"); @@ -207,7 +208,7 @@ void WellKnownClasses::Init(JNIEnv* env) { java_lang_reflect_Proxy_invoke = CacheMethod(env, java_lang_reflect_Proxy, true, "invoke", "(Ljava/lang/reflect/Proxy;Ljava/lang/reflect/ArtMethod;[Ljava/lang/Object;)Ljava/lang/Object;"); java_lang_Thread_init = CacheMethod(env, java_lang_Thread, false, "<init>", "(Ljava/lang/ThreadGroup;Ljava/lang/String;IZ)V"); java_lang_Thread_run = CacheMethod(env, java_lang_Thread, false, "run", "()V"); - java_lang_Thread$UncaughtExceptionHandler_uncaughtException = CacheMethod(env, java_lang_Thread$UncaughtExceptionHandler, false, "uncaughtException", "(Ljava/lang/Thread;Ljava/lang/Throwable;)V"); + java_lang_Thread__UncaughtExceptionHandler_uncaughtException = CacheMethod(env, java_lang_Thread__UncaughtExceptionHandler, false, "uncaughtException", "(Ljava/lang/Thread;Ljava/lang/Throwable;)V"); java_lang_ThreadGroup_removeThread = CacheMethod(env, java_lang_ThreadGroup, false, "removeThread", "(Ljava/lang/Thread;)V"); java_nio_DirectByteBuffer_init = CacheMethod(env, java_nio_DirectByteBuffer, false, "<init>", "(JI)V"); org_apache_harmony_dalvik_ddmc_DdmServer_broadcast = CacheMethod(env, org_apache_harmony_dalvik_ddmc_DdmServer, true, "broadcast", "(I)V"); @@ -216,7 +217,7 @@ void WellKnownClasses::Init(JNIEnv* env) { dalvik_system_DexFile_cookie = CacheField(env, dalvik_system_DexFile, false, "mCookie", "J"); dalvik_system_PathClassLoader_pathList = CacheField(env, dalvik_system_PathClassLoader, false, "pathList", "Ldalvik/system/DexPathList;"); dalvik_system_DexPathList_dexElements = CacheField(env, dalvik_system_DexPathList, false, "dexElements", "[Ldalvik/system/DexPathList$Element;"); - dalvik_system_DexPathList$Element_dexFile = CacheField(env, dalvik_system_DexPathList$Element, false, "dexFile", "Ldalvik/system/DexFile;"); + dalvik_system_DexPathList__Element_dexFile = CacheField(env, dalvik_system_DexPathList__Element, false, "dexFile", "Ldalvik/system/DexFile;"); java_lang_Thread_daemon = CacheField(env, java_lang_Thread, false, "daemon", "Z"); java_lang_Thread_group = CacheField(env, java_lang_Thread, false, "group", "Ljava/lang/ThreadGroup;"); java_lang_Thread_lock = CacheField(env, java_lang_Thread, false, "lock", "Ljava/lang/Object;"); diff --git a/runtime/well_known_classes.h b/runtime/well_known_classes.h index 3780733..790d7f7 100644 --- a/runtime/well_known_classes.h +++ b/runtime/well_known_classes.h @@ -42,7 +42,7 @@ struct WellKnownClasses { static jclass com_android_dex_Dex; static jclass dalvik_system_DexFile; static jclass dalvik_system_DexPathList; - static jclass dalvik_system_DexPathList$Element; + static jclass dalvik_system_DexPathList__Element; static jclass dalvik_system_PathClassLoader; static jclass java_lang_BootClassLoader; static jclass java_lang_ClassLoader; @@ -62,7 +62,7 @@ struct WellKnownClasses { static jclass java_lang_System; static jclass java_lang_Thread; static jclass java_lang_ThreadGroup; - static jclass java_lang_Thread$UncaughtExceptionHandler; + static jclass java_lang_Thread__UncaughtExceptionHandler; static jclass java_lang_Throwable; static jclass java_util_Collections; static jclass java_nio_DirectByteBuffer; @@ -91,7 +91,7 @@ struct WellKnownClasses { static jmethodID java_lang_System_runFinalization; static jmethodID java_lang_Thread_init; static jmethodID java_lang_Thread_run; - static jmethodID java_lang_Thread$UncaughtExceptionHandler_uncaughtException; + static jmethodID java_lang_Thread__UncaughtExceptionHandler_uncaughtException; static jmethodID java_lang_ThreadGroup_removeThread; static jmethodID java_nio_DirectByteBuffer_init; static jmethodID org_apache_harmony_dalvik_ddmc_DdmServer_broadcast; @@ -99,7 +99,7 @@ struct WellKnownClasses { static jfieldID dalvik_system_DexFile_cookie; static jfieldID dalvik_system_DexPathList_dexElements; - static jfieldID dalvik_system_DexPathList$Element_dexFile; + static jfieldID dalvik_system_DexPathList__Element_dexFile; static jfieldID dalvik_system_PathClassLoader_pathList; static jfieldID java_lang_reflect_AbstractMethod_artMethod; static jfieldID java_lang_reflect_Field_artField; |