summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2012-03-26 16:35:06 -0700
committerElliott Hughes <enh@google.com>2012-03-26 17:11:59 -0700
commitb25c3f6a86dc634ce44fb2849385b49465caa84d (patch)
treef359c72d821d913f78b977d8dde0fc7023afb511
parentfc9e6fabed89d948fa8c0e9d673e430076712c60 (diff)
downloadart-b25c3f6a86dc634ce44fb2849385b49465caa84d.zip
art-b25c3f6a86dc634ce44fb2849385b49465caa84d.tar.gz
art-b25c3f6a86dc634ce44fb2849385b49465caa84d.tar.bz2
Fix cpplint's whitespace complaints.
Change-Id: I11fd2db2badf7bd98e7866ca2155d8ef1e112408
-rw-r--r--Android.mk2
-rw-r--r--src/compiler.cc12
-rw-r--r--src/compiler.h2
-rw-r--r--src/compiler/Dataflow.cc8
-rw-r--r--src/compiler/Ralloc.cc4
-rw-r--r--src/compiler/codegen/CodegenUtil.cc4
-rw-r--r--src/compiler/codegen/GenCommon.cc10
-rw-r--r--src/compiler/codegen/GenInvoke.cc6
-rw-r--r--src/compiler/codegen/LocalOptimizations.cc2
-rw-r--r--src/compiler/codegen/MethodCodegenDriver.cc2
-rw-r--r--src/compiler/codegen/RallocUtil.cc4
-rw-r--r--src/compiler/codegen/arm/ArchUtility.cc6
-rw-r--r--src/compiler/codegen/arm/Assemble.cc2
-rw-r--r--src/compiler/codegen/arm/FP/Thumb2VFP.cc2
-rw-r--r--src/compiler/codegen/arm/Thumb2/Factory.cc2
-rw-r--r--src/compiler/codegen/arm/Thumb2/Gen.cc4
-rw-r--r--src/compiler/codegen/mips/ArchUtility.cc2
-rw-r--r--src/compiler/codegen/mips/Assemble.cc4
-rw-r--r--src/compiler/codegen/mips/FP/MipsFP.cc2
-rw-r--r--src/compiler/codegen/mips/Mips32/Factory.cc2
-rw-r--r--src/compiler/codegen/mips/Mips32/Gen.cc4
-rw-r--r--src/compiler/codegen/x86/ArchUtility.cc4
-rw-r--r--src/compiler/codegen/x86/Assemble.cc6
-rw-r--r--src/compiler/codegen/x86/X86/Gen.cc2
-rw-r--r--src/compiler_llvm/ir_builder.cc2
-rw-r--r--src/compiler_llvm/method_compiler.cc2
-rw-r--r--src/compiler_llvm/runtime_support_llvm.cc2
-rw-r--r--src/dex_verifier.cc36
-rw-r--r--src/disassembler_x86.cc4
-rw-r--r--src/heap.cc3
-rw-r--r--src/heap_bitmap.cc6
-rw-r--r--src/image_writer.cc5
-rw-r--r--src/jni_compiler_test.cc4
-rw-r--r--src/jni_internal_test.cc6
-rw-r--r--src/mark_sweep.cc4
-rw-r--r--src/oat_file.cc1
-rw-r--r--src/oat_file.h4
-rw-r--r--src/oatdump.cc2
-rw-r--r--src/object.h2
-rw-r--r--src/org_apache_harmony_dalvik_ddmc_DdmServer.cc3
-rw-r--r--src/os.h2
-rw-r--r--src/runtime_support.cc2
-rw-r--r--src/space.cc2
-rw-r--r--src/space_test.cc16
-rw-r--r--src/stack.cc5
-rw-r--r--src/utils.cc6
-rw-r--r--test/003-omnibus-opcodes/src/Array.java2
-rw-r--r--test/021-string2/src/junit/framework/ComparisonFailure.java2
-rw-r--r--test/053-wait-some/src/Main.java2
-rw-r--r--test/082-inline-execute/src/junit/framework/ComparisonFailure.java2
-rw-r--r--test/083-compiler-regressions/src/Main.java4
-rw-r--r--test/ReferenceMap/stack_walk_refmap_jni.cc2
-rw-r--r--test/StackWalk/stack_walk_jni.cc2
53 files changed, 113 insertions, 120 deletions
diff --git a/Android.mk b/Android.mk
index ec3e4b2..a7826e0 100644
--- a/Android.mk
+++ b/Android.mk
@@ -242,7 +242,7 @@ clean-oat:
.PHONY: cpplint-art
cpplint-art:
./art/tools/cpplint.py \
- --filter=-whitespace/comments,-whitespace/line_length,-build/include,-build/header_guard,-readability/streams,-readability/todo,-runtime/references \
+ --filter=-whitespace/comments,-whitespace/line_length,-build/include,-build/header_guard,-readability/function,-readability/streams,-readability/todo,-runtime/references \
$(ANDROID_BUILD_TOP)/art/src/*.h $(ANDROID_BUILD_TOP)/art/src/*.cc
########################################################################
diff --git a/src/compiler.cc b/src/compiler.cc
index 6618dea..6cdb6ee 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -78,7 +78,7 @@ class AOTCompilationStats {
virtual_made_direct_[i] = 0;
direct_calls_to_boot_[i] = 0;
direct_methods_to_boot_[i] = 0;
- }
+ }
}
void Dump() {
@@ -161,7 +161,7 @@ class AOTCompilationStats {
resolved_instance_fields_++;
}
- void UnresolvedInstanceField(){
+ void UnresolvedInstanceField() {
STATS_LOCK();
unresolved_instance_fields_++;
}
@@ -236,7 +236,7 @@ class AOTCompilationStats {
size_t direct_calls_to_boot_[kMaxInvokeType + 1];
size_t direct_methods_to_boot_[kMaxInvokeType + 1];
- DISALLOW_COPY_AND_ASSIGN(AOTCompilationStats);;
+ DISALLOW_COPY_AND_ASSIGN(AOTCompilationStats);
};
static std::string MakeCompilerSoName(InstructionSet instruction_set) {
@@ -322,8 +322,7 @@ Compiler::Compiler(InstructionSet instruction_set, bool image, size_t thread_cou
compiler_(NULL),
compiler_context_(NULL),
jni_compiler_(NULL),
- create_invoke_stub_(NULL)
-{
+ create_invoke_stub_(NULL) {
std::string compiler_so_name(MakeCompilerSoName(instruction_set_));
compiler_library_ = dlopen(compiler_so_name.c_str(), RTLD_LAZY);
if (compiler_library_ == NULL) {
@@ -676,7 +675,7 @@ bool Compiler::ComputeStaticFieldInfo(uint32_t field_idx, OatCompilationUnit* mU
if (string_id != NULL) {
const DexFile::TypeId* type_id =
mUnit->dex_file_->FindTypeId(mUnit->dex_file_->GetIndexForStringId(*string_id));
- if(type_id != NULL) {
+ if (type_id != NULL) {
// medium path, needs check of static storage base being initialized
ssb_index = mUnit->dex_file_->GetIndexForTypeId(*type_id);
field_offset = resolved_field->GetOffset().Int32Value();
@@ -757,7 +756,6 @@ bool Compiler::ComputeInvokeInfo(uint32_t method_idx, OatCompilationUnit* mUnit,
mUnit->class_linker_->ResolveType(dex_file,
dex_file.GetMethodId(method_idx).class_idx_,
referrer_class);
-
}
if (referrer_class->CanAccess(methods_class) &&
referrer_class->CanAccessMember(methods_class,
diff --git a/src/compiler.h b/src/compiler.h
index 2085f43..dee498b 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -213,7 +213,7 @@ class Compiler {
private:
// Compute constant code and method pointers when possible
- void GetCodeAndMethodForDirectCall(InvokeType type, InvokeType sharp_type,Method* method,
+ void GetCodeAndMethodForDirectCall(InvokeType type, InvokeType sharp_type, Method* method,
uintptr_t& direct_code, uintptr_t& direct_method);
// Checks if class specified by type_idx is one of the image_classes_
diff --git a/src/compiler/Dataflow.cc b/src/compiler/Dataflow.cc
index 19282d1..72e3dc4 100644
--- a/src/compiler/Dataflow.cc
+++ b/src/compiler/Dataflow.cc
@@ -1698,7 +1698,7 @@ void squashDupRangeChecks(CompilationUnit* cUnit, BasicBlock** pBp, MIR* mir,
}
int checkArray = INVALID_SREG;
int checkIndex = INVALID_SREG;
- switch(mir->dalvikInsn.opcode) {
+ switch (mir->dalvikInsn.opcode) {
case Instruction::AGET:
case Instruction::AGET_OBJECT:
case Instruction::AGET_BOOLEAN:
@@ -1792,7 +1792,7 @@ bool basicBlockOpt(CompilationUnit* cUnit, BasicBlock* bb)
for (MIR* mir = bb->firstMIRInsn; mir; mir = mir->next) {
// Look for interesting opcodes, skip otherwise
Instruction::Code opcode = mir->dalvikInsn.opcode;
- switch(opcode) {
+ switch (opcode) {
case Instruction::AGET:
case Instruction::AGET_OBJECT:
case Instruction::AGET_BOOLEAN:
@@ -1917,7 +1917,7 @@ bool eliminateNullChecks( struct CompilationUnit* cUnit, struct BasicBlock* bb)
// Look in next basic block
struct BasicBlock* nextBB = bb->fallThrough;
for (MIR* tmir = nextBB->firstMIRInsn; tmir;
- tmir =tmir->next){
+ tmir =tmir->next) {
if ((int)tmir->dalvikInsn.opcode >= (int)kMirOpFirst) {
continue;
}
@@ -2170,7 +2170,7 @@ bool invokeUsesMethodStar(CompilationUnit* cUnit, MIR* mir)
{
InvokeType type;
Instruction::Code opcode = mir->dalvikInsn.opcode;
- switch(opcode) {
+ switch (opcode) {
case Instruction::INVOKE_STATIC:
case Instruction::INVOKE_STATIC_RANGE:
type = kStatic;
diff --git a/src/compiler/Ralloc.cc b/src/compiler/Ralloc.cc
index 91dc936..25acdd5 100644
--- a/src/compiler/Ralloc.cc
+++ b/src/compiler/Ralloc.cc
@@ -193,7 +193,7 @@ bool inferTypeAndSize(CompilationUnit* cUnit, BasicBlock* bb)
if (strlen(shorty) > 1) {
for (int i = next; i < numUses;) {
DCHECK_LT(cpos, strlen(shorty));
- switch(shorty[cpos++]) {
+ switch (shorty[cpos++]) {
case 'D':
ssaRep->fpUse[i] = true;
ssaRep->fpUse[i+1] = true;
@@ -350,7 +350,7 @@ void oatSimpleRegAlloc(CompilationUnit* cUnit)
const char* shorty = cUnit->shorty;
int shorty_len = strlen(shorty);
for (int i = 1; i < shorty_len; i++) {
- switch(shorty[i]) {
+ switch (shorty[i]) {
case 'D':
cUnit->regLocation[sReg].wide = true;
cUnit->regLocation[sReg+1].highWord = true;
diff --git a/src/compiler/codegen/CodegenUtil.cc b/src/compiler/codegen/CodegenUtil.cc
index 2318a04..20eb47f 100644
--- a/src/compiler/codegen/CodegenUtil.cc
+++ b/src/compiler/codegen/CodegenUtil.cc
@@ -29,7 +29,7 @@ void setMemRefType(LIR* lir, bool isLoad, int memType)
/* Clear out the memref flags */
*maskPtr &= ~mask;
/* ..and then add back the one we need */
- switch(memType) {
+ switch (memType) {
case kLiteral:
DCHECK(isLoad);
*maskPtr |= ENCODE_LITERAL;
@@ -255,7 +255,7 @@ void oatDumpLIRInsn(CompilationUnit* cUnit, LIR* arg, unsigned char* baseAddr)
const bool dumpNop = (cUnit->enableDebug & (1 << kDebugShowNops));
/* Handle pseudo-ops individually, and all regular insns as a group */
- switch(lir->opcode) {
+ switch (lir->opcode) {
case kPseudoMethodEntry:
LOG(INFO) << "-------- method entry " <<
PrettyMethod(cUnit->method_idx, *cUnit->dex_file);
diff --git a/src/compiler/codegen/GenCommon.cc b/src/compiler/codegen/GenCommon.cc
index 0ef1641..0b0d100 100644
--- a/src/compiler/codegen/GenCommon.cc
+++ b/src/compiler/codegen/GenCommon.cc
@@ -367,7 +367,7 @@ void genCompareAndBranch(CompilationUnit* cUnit, BasicBlock* bb, MIR* mir,
rlSrc1 = loadValue(cUnit, rlSrc1, kCoreReg);
rlSrc2 = loadValue(cUnit, rlSrc2, kCoreReg);
Instruction::Code opcode = mir->dalvikInsn.opcode;
- switch(opcode) {
+ switch (opcode) {
case Instruction::IF_EQ:
cond = kCondEq;
break;
@@ -406,7 +406,7 @@ void genCompareZeroAndBranch(CompilationUnit* cUnit, BasicBlock* bb, MIR* mir,
ConditionCode cond;
rlSrc = loadValue(cUnit, rlSrc, kCoreReg);
Instruction::Code opcode = mir->dalvikInsn.opcode;
- switch(opcode) {
+ switch (opcode) {
case Instruction::IF_EQZ:
cond = kCondEq;
break;
@@ -458,7 +458,7 @@ void genIntNarrowing(CompilationUnit* cUnit, MIR* mir, RegLocation rlDest,
rlSrc = loadValue(cUnit, rlSrc, kCoreReg);
RegLocation rlResult = oatEvalLoc(cUnit, rlDest, kCoreReg, true);
OpKind op = kOpInvalid;
- switch(mir->dalvikInsn.opcode) {
+ switch (mir->dalvikInsn.opcode) {
case Instruction::INT_TO_BYTE:
op = kOp2Byte;
break;
@@ -887,7 +887,7 @@ void handleThrowLaunchpads(CompilationUnit *cUnit)
int funcOffset = 0;
int v1 = lab->operands[2];
int v2 = lab->operands[3];
- switch(lab->operands[0]) {
+ switch (lab->operands[0]) {
case kThrowNullPointer:
funcOffset = OFFSETOF_MEMBER(Thread, pThrowNullPointerFromCode);
break;
@@ -1722,7 +1722,7 @@ bool genShiftOpLong(CompilationUnit* cUnit, MIR* mir, RegLocation rlDest,
{
int funcOffset;
- switch( mir->dalvikInsn.opcode) {
+ switch (mir->dalvikInsn.opcode) {
case Instruction::SHL_LONG:
case Instruction::SHL_LONG_2ADDR:
funcOffset = OFFSETOF_MEMBER(Thread, pShlLong);
diff --git a/src/compiler/codegen/GenInvoke.cc b/src/compiler/codegen/GenInvoke.cc
index ba027f0..e4feb4d 100644
--- a/src/compiler/codegen/GenInvoke.cc
+++ b/src/compiler/codegen/GenInvoke.cc
@@ -141,7 +141,7 @@ int nextSDCallInsn(CompilationUnit* cUnit, MIR* mir,
directMethod = 0;
#endif
if (directCode != 0 && directMethod != 0) {
- switch(state) {
+ switch (state) {
case 0: // Get the current Method* [sets rARG0]
if (directCode != (uintptr_t)-1) {
loadConstant(cUnit, rINVOKE_TGT, directCode);
@@ -180,7 +180,7 @@ int nextSDCallInsn(CompilationUnit* cUnit, MIR* mir,
return -1;
}
} else {
- switch(state) {
+ switch (state) {
case 0: // Get the current Method* [sets rARG0]
// TUNING: we can save a reg copy if Method* has been promoted
loadCurrMethodDirect(cUnit, rARG0);
@@ -245,7 +245,7 @@ int nextVCallInsn(CompilationUnit* cUnit, MIR* mir,
* This is the fast path in which the target virtual method is
* fully resolved at compile time.
*/
- switch(state) {
+ switch (state) {
case 0: // Get "this" [set rARG1]
rlArg = oatGetSrc(cUnit, mir, 0);
loadValueDirectFixed(cUnit, rlArg, rARG1);
diff --git a/src/compiler/codegen/LocalOptimizations.cc b/src/compiler/codegen/LocalOptimizations.cc
index 3bed72f..b7a7e57 100644
--- a/src/compiler/codegen/LocalOptimizations.cc
+++ b/src/compiler/codegen/LocalOptimizations.cc
@@ -147,7 +147,7 @@ void applyLoadStoreElimination(CompilationUnit* cUnit, LIR* headLIR,
IS_STORE));
/* Same value && same register type */
if (checkLIR->aliasInfo == thisLIR->aliasInfo &&
- REGTYPE(checkLIR->operands[0]) == REGTYPE(nativeRegId)){
+ REGTYPE(checkLIR->operands[0]) == REGTYPE(nativeRegId)) {
/*
* Different destination register - insert
* a move
diff --git a/src/compiler/codegen/MethodCodegenDriver.cc b/src/compiler/codegen/MethodCodegenDriver.cc
index 87a86eb..d753fcc 100644
--- a/src/compiler/codegen/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/MethodCodegenDriver.cc
@@ -186,7 +186,7 @@ bool compileDalvikInstruction(CompilationUnit* cUnit, MIR* mir,
rlDest = oatGetDestWide(cUnit, mir, 0, 1);
}
- switch(opcode) {
+ switch (opcode) {
case Instruction::NOP:
break;
diff --git a/src/compiler/codegen/RallocUtil.cc b/src/compiler/codegen/RallocUtil.cc
index 5f1f62d..6a98d60 100644
--- a/src/compiler/codegen/RallocUtil.cc
+++ b/src/compiler/codegen/RallocUtil.cc
@@ -79,7 +79,7 @@ extern void oatInitPool(RegisterInfo* regs, int* regNums, int num)
void dumpRegPool(RegisterInfo* p, int numRegs)
{
LOG(INFO) << "================================================";
- for (int i = 0; i < numRegs; i++){
+ for (int i = 0; i < numRegs; i++) {
LOG(INFO) << StringPrintf(
"R[%d]: T:%d, U:%d, P:%d, p:%d, LV:%d, D:%d, SR:%d, ST:%x, EN:%x",
p[i].reg, p[i].isTemp, p[i].inUse, p[i].pair, p[i].partner,
@@ -434,7 +434,7 @@ RegisterInfo* allocLiveBody(RegisterInfo* p, int numRegs, int sReg)
RegisterInfo* allocLive(CompilationUnit* cUnit, int sReg, int regClass)
{
RegisterInfo* res = NULL;
- switch(regClass) {
+ switch (regClass) {
case kAnyReg:
res = allocLiveBody(cUnit->regPool->FPRegs,
cUnit->regPool->numFPRegs, sReg);
diff --git a/src/compiler/codegen/arm/ArchUtility.cc b/src/compiler/codegen/arm/ArchUtility.cc
index be6b44d..4346bda 100644
--- a/src/compiler/codegen/arm/ArchUtility.cc
+++ b/src/compiler/codegen/arm/ArchUtility.cc
@@ -25,7 +25,7 @@ namespace art {
ArmConditionCode oatArmConditionEncoding(ConditionCode code)
{
ArmConditionCode res;
- switch(code) {
+ switch (code) {
case kCondEq: res = kArmCondEq; break;
case kCondNe: res = kArmCondNe; break;
case kCondCs: res = kArmCondCs; break;
@@ -113,7 +113,7 @@ int expandImmediate(int value)
{
int mode = (value & 0xf00) >> 8;
u4 bits = value & 0xff;
- switch(mode) {
+ switch (mode) {
case 0:
return bits;
case 1:
@@ -156,7 +156,7 @@ std::string buildInsnString(const char* fmt, LIR* lir,
DCHECK_LT(fmt, fmtEnd);
DCHECK_LT((unsigned)(nc-'0'), 4U);
operand = lir->operands[nc-'0'];
- switch(*fmt++) {
+ switch (*fmt++) {
case 'H':
if (operand != 0) {
sprintf(tbuf, ", %s %d",shiftNames[operand & 0x3],
diff --git a/src/compiler/codegen/arm/Assemble.cc b/src/compiler/codegen/arm/Assemble.cc
index 8901bf3..1b7dc29 100644
--- a/src/compiler/codegen/arm/Assemble.cc
+++ b/src/compiler/codegen/arm/Assemble.cc
@@ -1256,7 +1256,7 @@ AssemblerStatus oatAssembleInstructions(CompilationUnit* cUnit,
u4 operand;
u4 value;
operand = lir->operands[i];
- switch(encoder->fieldLoc[i].kind) {
+ switch (encoder->fieldLoc[i].kind) {
case kFmtUnused:
break;
case kFmtFPImm:
diff --git a/src/compiler/codegen/arm/FP/Thumb2VFP.cc b/src/compiler/codegen/arm/FP/Thumb2VFP.cc
index 7f372aa..72b4fec 100644
--- a/src/compiler/codegen/arm/FP/Thumb2VFP.cc
+++ b/src/compiler/codegen/arm/FP/Thumb2VFP.cc
@@ -189,7 +189,7 @@ bool genCmpFP(CompilationUnit* cUnit, MIR* mir, RegLocation rlDest,
int defaultResult;
RegLocation rlResult;
- switch(mir->dalvikInsn.opcode) {
+ switch (mir->dalvikInsn.opcode) {
case Instruction::CMPL_FLOAT:
isDouble = false;
defaultResult = -1;
diff --git a/src/compiler/codegen/arm/Thumb2/Factory.cc b/src/compiler/codegen/arm/Thumb2/Factory.cc
index 11d5bf4..e065a2f 100644
--- a/src/compiler/codegen/arm/Thumb2/Factory.cc
+++ b/src/compiler/codegen/arm/Thumb2/Factory.cc
@@ -418,7 +418,7 @@ LIR* opRegRegImm(CompilationUnit* cUnit, OpKind op, int rDest, int rSrc1,
int modImm = modifiedImmediate(value);
int modImmNeg = modifiedImmediate(-value);
- switch(op) {
+ switch (op) {
case kOpLsl:
if (allLowRegs)
return newLIR3(cUnit, kThumbLslRRI5, rDest, rSrc1, value);
diff --git a/src/compiler/codegen/arm/Thumb2/Gen.cc b/src/compiler/codegen/arm/Thumb2/Gen.cc
index 1938960..d5a4efc 100644
--- a/src/compiler/codegen/arm/Thumb2/Gen.cc
+++ b/src/compiler/codegen/arm/Thumb2/Gen.cc
@@ -251,7 +251,7 @@ void genSpecialCase(CompilationUnit* cUnit, BasicBlock* bb, MIR* mir,
{
cUnit->currentDalvikOffset = mir->offset;
MIR* nextMir = NULL;
- switch(specialCase) {
+ switch (specialCase) {
case kNullMethod:
DCHECK(mir->dalvikInsn.opcode == Instruction::RETURN_VOID);
nextMir = mir;
@@ -341,7 +341,7 @@ LIR* opIT(CompilationUnit* cUnit, ArmConditionCode code, const char* guide)
int mask1 = 0;
//Note: case fallthroughs intentional
- switch(strlen(guide)) {
+ switch (strlen(guide)) {
case 3:
mask1 = (guide[2] == 'T') ? condBit : altBit;
case 2:
diff --git a/src/compiler/codegen/mips/ArchUtility.cc b/src/compiler/codegen/mips/ArchUtility.cc
index 40188ce..4252d50 100644
--- a/src/compiler/codegen/mips/ArchUtility.cc
+++ b/src/compiler/codegen/mips/ArchUtility.cc
@@ -54,7 +54,7 @@ std::string buildInsnString(const char *fmt, LIR *lir, unsigned char* baseAddr)
DCHECK_LT(fmt, fmtEnd);
DCHECK_LT((unsigned)(nc-'0'), 4u);
operand = lir->operands[nc-'0'];
- switch(*fmt++) {
+ switch (*fmt++) {
case 'b':
strcpy(tbuf,"0000");
for (i=3; i>= 0; i--) {
diff --git a/src/compiler/codegen/mips/Assemble.cc b/src/compiler/codegen/mips/Assemble.cc
index 07a9975..1d629be 100644
--- a/src/compiler/codegen/mips/Assemble.cc
+++ b/src/compiler/codegen/mips/Assemble.cc
@@ -467,7 +467,7 @@ void convertShortToLongBranch(CompilationUnit* cUnit, LIR* lir)
bool unconditional = false;
int opcode = lir->opcode;
int dalvikOffset = lir->dalvikOffset;
- switch(opcode) {
+ switch (opcode) {
case kMipsBal:
LOG(FATAL) << "long branch and link unsupported";
case kMipsB:
@@ -656,7 +656,7 @@ AssemblerStatus oatAssembleInstructions(CompilationUnit *cUnit,
u4 operand;
u4 value;
operand = lir->operands[i];
- switch(encoder->fieldLoc[i].kind) {
+ switch (encoder->fieldLoc[i].kind) {
case kFmtUnused:
break;
case kFmtBitBlt:
diff --git a/src/compiler/codegen/mips/FP/MipsFP.cc b/src/compiler/codegen/mips/FP/MipsFP.cc
index d8ca0a1..6524641 100644
--- a/src/compiler/codegen/mips/FP/MipsFP.cc
+++ b/src/compiler/codegen/mips/FP/MipsFP.cc
@@ -189,7 +189,7 @@ static bool genCmpFP(CompilationUnit *cUnit, MIR *mir, RegLocation rlDest,
bool wide = true;
int offset;
- switch(mir->dalvikInsn.opcode) {
+ switch (mir->dalvikInsn.opcode) {
case Instruction::CMPL_FLOAT:
offset = OFFSETOF_MEMBER(Thread, pCmplFloat);
wide = false;
diff --git a/src/compiler/codegen/mips/Mips32/Factory.cc b/src/compiler/codegen/mips/Mips32/Factory.cc
index 0ee936e..1162702 100644
--- a/src/compiler/codegen/mips/Mips32/Factory.cc
+++ b/src/compiler/codegen/mips/Mips32/Factory.cc
@@ -235,7 +235,7 @@ LIR *opRegRegImm(CompilationUnit *cUnit, OpKind op, int rDest,
MipsOpCode opcode = kMipsNop;
bool shortForm = true;
- switch(op) {
+ switch (op) {
case kOpAdd:
if (IS_SIMM16(value)) {
opcode = kMipsAddiu;
diff --git a/src/compiler/codegen/mips/Mips32/Gen.cc b/src/compiler/codegen/mips/Mips32/Gen.cc
index 4530517..bf65ba6 100644
--- a/src/compiler/codegen/mips/Mips32/Gen.cc
+++ b/src/compiler/codegen/mips/Mips32/Gen.cc
@@ -357,7 +357,7 @@ LIR* opCmpBranch(CompilationUnit* cUnit, ConditionCode cond, int src1,
MipsOpCode brOp;
bool cmpZero = false;
bool swapped = false;
- switch(cond) {
+ switch (cond) {
case kCondEq:
brOp = kMipsBeq;
cmpZero = true;
@@ -430,7 +430,7 @@ LIR* opCmpImmBranch(CompilationUnit* cUnit, ConditionCode cond, int reg,
return branch;
}
MipsOpCode opc;
- switch(cond) {
+ switch (cond) {
case kCondEq: opc = kMipsBeqz; break;
case kCondGe: opc = kMipsBgez; break;
case kCondGt: opc = kMipsBgtz; break;
diff --git a/src/compiler/codegen/x86/ArchUtility.cc b/src/compiler/codegen/x86/ArchUtility.cc
index a5987f2..fa94db3 100644
--- a/src/compiler/codegen/x86/ArchUtility.cc
+++ b/src/compiler/codegen/x86/ArchUtility.cc
@@ -55,7 +55,7 @@ std::string buildInsnString(const char *fmt, LIR *lir, unsigned char* baseAddr)
std::string buf;
size_t i = 0;
size_t fmt_len = strlen(fmt);
- while(i < fmt_len) {
+ while (i < fmt_len) {
if (fmt[i] != '!') {
buf += fmt[i];
i++;
@@ -71,7 +71,7 @@ std::string buildInsnString(const char *fmt, LIR *lir, unsigned char* baseAddr)
DCHECK_LT(operand_number, 6); // Expect upto 6 LIR operands.
DCHECK_LT(i, fmt_len);
int operand = lir->operands[operand_number];
- switch(fmt[i]) {
+ switch (fmt[i]) {
case 'c':
DCHECK_LT(static_cast<size_t>(operand), sizeof(x86CondName));
buf += x86CondName[operand];
diff --git a/src/compiler/codegen/x86/Assemble.cc b/src/compiler/codegen/x86/Assemble.cc
index b62b5b4..d1a8d64 100644
--- a/src/compiler/codegen/x86/Assemble.cc
+++ b/src/compiler/codegen/x86/Assemble.cc
@@ -433,7 +433,7 @@ int oatGetInsnSize(LIR* lir) {
return 5; // opcode + rel32
}
case kCall:
- switch(lir->opcode) {
+ switch (lir->opcode) {
case kX86CallR: return 2; // opcode modrm
case kX86CallM: // lir operands - 0: base, 1: disp
return computeSize(entry, lir->operands[1], false);
@@ -1030,7 +1030,7 @@ AssemblerStatus oatAssembleInstructions(CompilationUnit *cUnit, intptr_t startAd
}
const X86EncodingMap *entry = &EncodingMap[lir->opcode];
size_t starting_cbuf_size = cUnit->codeBuffer.size();
- switch(entry->kind) {
+ switch (entry->kind) {
case kData: // 4 bytes of data
cUnit->codeBuffer.push_back(lir->operands[0]);
break;
@@ -1095,7 +1095,7 @@ AssemblerStatus oatAssembleInstructions(CompilationUnit *cUnit, intptr_t startAd
emitJcc(cUnit, entry, lir->operands[0], lir->operands[1]);
break;
case kCall:
- switch(entry->opcode) {
+ switch (entry->opcode) {
case kX86CallM: // lir operands - 0: base, 1: disp
emitCallMem(cUnit, entry, lir->operands[0], lir->operands[1]);
break;
diff --git a/src/compiler/codegen/x86/X86/Gen.cc b/src/compiler/codegen/x86/X86/Gen.cc
index c6cd55c..f957cbc 100644
--- a/src/compiler/codegen/x86/X86/Gen.cc
+++ b/src/compiler/codegen/x86/X86/Gen.cc
@@ -387,7 +387,7 @@ void genCmpLong(CompilationUnit* cUnit, MIR* mir, RegLocation rlDest,
}
X86ConditionCode oatX86ConditionEncoding(ConditionCode cond) {
- switch(cond) {
+ switch (cond) {
case kCondEq: return kX86CondEq;
case kCondNe: return kX86CondNe;
case kCondCs: return kX86CondC;
diff --git a/src/compiler_llvm/ir_builder.cc b/src/compiler_llvm/ir_builder.cc
index 60f31f2..6612911 100644
--- a/src/compiler_llvm/ir_builder.cc
+++ b/src/compiler_llvm/ir_builder.cc
@@ -73,7 +73,7 @@ void IRBuilder::InitRuntimeSupportFuncDecl() {
llvm::Function* IRBuilder::GetRuntime(runtime_support::RuntimeId rt) const {
using namespace runtime_support;
- if (rt >= 0 && rt < MAX_ID){
+ if (rt >= 0 && rt < MAX_ID) {
return runtime_support_func_decls_[rt];
} else {
LOG(ERROR) << "Unknown runtime function id: " << rt;
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index 18e157e..6e26b78 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -1134,7 +1134,7 @@ void MethodCompiler::EmitInsn_Nop(uint32_t dex_pc,
insn_signature == Instruction::kSparseSwitchSignature ||
insn_signature == Instruction::kArrayDataSignature) {
irb_.CreateUnreachable();
- } else{
+ } else {
irb_.CreateBr(GetNextBasicBlock(dex_pc));
}
}
diff --git a/src/compiler_llvm/runtime_support_llvm.cc b/src/compiler_llvm/runtime_support_llvm.cc
index 013a530..54c6cbe 100644
--- a/src/compiler_llvm/runtime_support_llvm.cc
+++ b/src/compiler_llvm/runtime_support_llvm.cc
@@ -205,7 +205,7 @@ Object* art_check_and_alloc_array_from_code_with_access_check(uint32_t type_idx,
}
static Method* FindMethodHelper(uint32_t method_idx, Object* this_object, Method* caller_method,
- bool access_check, InvokeType type){
+ bool access_check, InvokeType type) {
Method* method = FindMethodFast(method_idx, this_object, caller_method, access_check, type);
if (UNLIKELY(method == NULL)) {
method = FindMethodFromCode(method_idx, this_object, caller_method,
diff --git a/src/dex_verifier.cc b/src/dex_verifier.cc
index a5ab8cd..448f3b7 100644
--- a/src/dex_verifier.cc
+++ b/src/dex_verifier.cc
@@ -94,7 +94,7 @@ std::string RegType::Dump() const {
if (val == 0) {
result = "Zero";
} else {
- if(IsConstantShort()) {
+ if (IsConstantShort()) {
result = StringPrintf("32-bit Constant: %d", val);
} else {
result = StringPrintf("32-bit Constant: 0x%x", val);
@@ -243,7 +243,7 @@ const RegType& RegType::Merge(const RegType& incoming_type, RegTypeCache* reg_ty
return incoming_type; // * MERGE Conflict => Conflict
} else if (IsUnknown() || incoming_type.IsUnknown()) {
return reg_types->Conflict(); // Unknown MERGE * => Conflict
- } else if(IsConstant() && incoming_type.IsConstant()) {
+ } else if (IsConstant() && incoming_type.IsConstant()) {
int32_t val1 = ConstantValue();
int32_t val2 = incoming_type.ConstantValue();
if (val1 >= 0 && val2 >= 0) {
@@ -361,7 +361,7 @@ static RegType::Type RegTypeFromDescriptor(const std::string& descriptor) {
case 'V':
default: return RegType::kRegTypeUnknown;
}
- } else if(descriptor[0] == 'L' || descriptor[0] == '[') {
+ } else if (descriptor[0] == 'L' || descriptor[0] == '[') {
return RegType::kRegTypeReference;
} else {
return RegType::kRegTypeUnknown;
@@ -394,7 +394,7 @@ const RegType& RegTypeCache::From(RegType::Type type, const ClassLoader* loader,
}
return *entry;
} else {
- DCHECK (type == RegType::kRegTypeReference);
+ DCHECK(type == RegType::kRegTypeReference);
ClassHelper kh;
for (size_t i = RegType::kRegTypeLastFixedLocation + 1; i < entries_.size(); i++) {
RegType* cur_entry = entries_[i];
@@ -610,7 +610,7 @@ void RegisterLine::SetResultTypeToUnknown() {
void RegisterLine::SetResultRegisterType(const RegType& new_type) {
result_[0] = new_type.GetId();
- if(new_type.IsLowHalf()) {
+ if (new_type.IsLowHalf()) {
DCHECK_EQ(new_type.HighHalf(verifier_->GetRegTypeCache()).GetId(), new_type.GetId() + 1);
result_[1] = new_type.GetId() + 1;
} else {
@@ -821,7 +821,7 @@ void RegisterLine::PopMonitor(uint32_t reg_idx) {
verifier_->Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "monitor-exit stack underflow";
} else {
monitors_.pop_back();
- if(!IsSetLockDepth(reg_idx, monitors_.size())) {
+ if (!IsSetLockDepth(reg_idx, monitors_.size())) {
// Bug 3215458: Locks and unlocks are on objects, if that object is a literal then before
// format "036" the constant collector may create unlocks on the same object but referenced
// via different registers.
@@ -855,7 +855,7 @@ bool RegisterLine::MergeRegisters(const RegisterLine* incoming_line) {
line_[idx] = new_type.GetId();
}
}
- if(monitors_.size() != incoming_line->monitors_.size()) {
+ if (monitors_.size() != incoming_line->monitors_.size()) {
verifier_->Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "mismatched stack depths (depth="
<< MonitorStackDepth() << ", incoming depth=" << incoming_line->MonitorStackDepth() << ")";
} else if (reg_to_lock_depths_ != incoming_line->reg_to_lock_depths_) {
@@ -1261,7 +1261,7 @@ bool DexVerifier::VerifyInstructions() {
insn_flags_[0].SetBranchTarget();
uint32_t insns_size = code_item_->insns_size_in_code_units_;
- for(uint32_t dex_pc = 0; dex_pc < insns_size;) {
+ for (uint32_t dex_pc = 0; dex_pc < insns_size;) {
if (!VerifyInstruction(inst, dex_pc)) {
DCHECK_NE(failure_, VERIFY_ERROR_NONE);
fail_messages_ << "Rejecting opcode " << inst->Name() << " at " << dex_pc;
@@ -3135,7 +3135,7 @@ bool DexVerifier::CodeFlowVerifyInstruction(uint32_t* start_guess) {
/* If we're returning from the method, make sure monitor stack is empty. */
if ((opcode_flags & Instruction::kReturn) != 0) {
- if(!work_line_->VerifyMonitorStackEmpty()) {
+ if (!work_line_->VerifyMonitorStackEmpty()) {
return false;
}
}
@@ -3202,7 +3202,7 @@ const RegType& DexVerifier::GetCaughtExceptionType() {
// Unconditionally assign for the first handler. We don't assert this is a Throwable
// as that is caught at runtime
common_super = &exception;
- } else if(!reg_types_.JavaLangThrowable().IsAssignableFrom(exception)) {
+ } else if (!reg_types_.JavaLangThrowable().IsAssignableFrom(exception)) {
// We don't know enough about the type and the common path merge will result in
// Conflict. Fail here knowing the correct thing can be done at runtime.
Fail(VERIFY_ERROR_BAD_CLASS_SOFT) << "unexpected non-exception class " << exception;
@@ -3550,7 +3550,7 @@ Field* DexVerifier::GetStaticField(int field_idx) {
<< dex_file_->GetFieldDeclaringClassDescriptor(field_id);
return NULL;
}
- if(klass_type.IsUnresolvedTypes()) {
+ if (klass_type.IsUnresolvedTypes()) {
return NULL; // Can't resolve Class so no more to do here
}
Field* field = Runtime::Current()->GetClassLinker()->ResolveFieldJLS(field_idx, method_);
@@ -3607,16 +3607,16 @@ Field* DexVerifier::GetInstanceField(const RegType& obj_type, int field_idx) {
} else if (obj_type.IsZero()) {
// Cannot infer and check type, however, access will cause null pointer exception
return field;
- } else if(obj_type.IsUninitializedTypes() &&
- (!method_->IsConstructor() || method_->GetDeclaringClass() != obj_type.GetClass() ||
- field->GetDeclaringClass() != method_->GetDeclaringClass())) {
+ } else if (obj_type.IsUninitializedTypes() &&
+ (!method_->IsConstructor() || method_->GetDeclaringClass() != obj_type.GetClass() ||
+ field->GetDeclaringClass() != method_->GetDeclaringClass())) {
// Field accesses through uninitialized references are only allowable for constructors where
// the field is declared in this class
Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "cannot access instance field " << PrettyField(field)
<< " of a not fully initialized object within the context of "
<< PrettyMethod(method_);
return NULL;
- } else if(!field->GetDeclaringClass()->IsAssignableFrom(obj_type.GetClass())) {
+ } else if (!field->GetDeclaringClass()->IsAssignableFrom(obj_type.GetClass())) {
// Trying to access C1.field1 using reference of type C2, which is neither C1 or a sub-class
// of C1. For resolution to occur the declared class of the field must be compatible with
// obj_type, we've discovered this wasn't so, so report the field didn't exist.
@@ -3947,7 +3947,7 @@ const std::vector<uint8_t>* DexVerifier::GenerateGcMap() {
<< (1 << pc_bits) << " instructions (number is rounded up to nearest power of 2)";
return NULL;
}
- size_t table_size = ((pc_bytes + ref_bitmap_bytes) * num_entries ) + 4;
+ size_t table_size = ((pc_bytes + ref_bitmap_bytes) * num_entries) + 4;
std::vector<uint8_t>* table = new std::vector<uint8_t>;
if (table == NULL) {
Fail(VERIFY_ERROR_BAD_CLASS_HARD) << "Failed to encode GC map (size=" << table_size << ")";
@@ -3978,7 +3978,7 @@ void DexVerifier::VerifyGcMap(const std::vector<uint8_t>& data) {
// that the table data is well formed and all references are marked (or not) in the bitmap
PcToReferenceMap map(&data[0], data.size());
size_t map_index = 0;
- for(size_t i = 0; i < code_item_->insns_size_in_code_units_; i++) {
+ for (size_t i = 0; i < code_item_->insns_size_in_code_units_; i++) {
const uint8_t* reg_bitmap = map.FindBitMap(i, false);
if (insn_flags_[i].IsGcPoint()) {
CHECK_LT(map_index, map.NumEntries());
@@ -3986,7 +3986,7 @@ void DexVerifier::VerifyGcMap(const std::vector<uint8_t>& data) {
CHECK_EQ(map.GetBitMap(map_index), reg_bitmap);
map_index++;
RegisterLine* line = reg_table_.GetLine(i);
- for(size_t j = 0; j < code_item_->registers_size_; j++) {
+ for (size_t j = 0; j < code_item_->registers_size_; j++) {
if (line->GetRegisterType(j).IsNonZeroReferenceTypes()) {
CHECK_LT(j / 8, map.RegWidth());
CHECK_EQ((reg_bitmap[j / 8] >> (j % 8)) & 1, 1);
diff --git a/src/disassembler_x86.cc b/src/disassembler_x86.cc
index c40e30c..08025ea 100644
--- a/src/disassembler_x86.cc
+++ b/src/disassembler_x86.cc
@@ -189,8 +189,8 @@ DISASSEMBLER_ENTRY(cmp,
case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77:
case 0x78: case 0x79: case 0x7A: case 0x7B: case 0x7C: case 0x7D: case 0x7E: case 0x7F:
static const char* condition_codes[] =
- {"o", "no", "b/nae/c", "nb/ae/nc", "z/eq", "nz/ne", "be/na", "nbe/a",
- "s", "ns", "p/pe", "np/po", "l/nge","nl/ge", "le/ng", "nle/g"
+ {"o", "no", "b/nae/c", "nb/ae/nc", "z/eq", "nz/ne", "be/na", "nbe/a",
+ "s", "ns", "p/pe", "np/po", "l/nge", "nl/ge", "le/ng", "nle/g"
};
opcode << "j" << condition_codes[*instr & 0xF];
branch_bytes = 1;
diff --git a/src/heap.cc b/src/heap.cc
index f351b72..d2aada4 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -149,8 +149,7 @@ Heap::Heap(size_t initial_size, size_t growth_limit, size_t capacity,
reference_pendingNext_offset_(0),
finalizer_reference_zombie_offset_(0),
target_utilization_(0.5),
- verify_objects_(false)
-{
+ verify_objects_(false) {
if (VLOG_IS_ON(heap) || VLOG_IS_ON(startup)) {
LOG(INFO) << "Heap() entering";
}
diff --git a/src/heap_bitmap.cc b/src/heap_bitmap.cc
index d432fa9..5223178 100644
--- a/src/heap_bitmap.cc
+++ b/src/heap_bitmap.cc
@@ -290,9 +290,9 @@ static void WalkFieldsInOrder(HeapBitmap* visited, HeapBitmap::Callback* callbac
// Visits set bits with an in order traversal. The callback is not permitted to change the bitmap
// bits or max during the traversal.
void HeapBitmap::InOrderWalk(HeapBitmap::Callback* callback, void* arg) {
- UniquePtr<HeapBitmap> visited (Create("bitmap for in-order walk",
- reinterpret_cast<byte*>(heap_begin_),
- HB_INDEX_TO_OFFSET(bitmap_size_ / kWordSize)));
+ UniquePtr<HeapBitmap> visited(Create("bitmap for in-order walk",
+ reinterpret_cast<byte*>(heap_begin_),
+ HB_INDEX_TO_OFFSET(bitmap_size_ / kWordSize)));
CHECK(bitmap_begin_ != NULL);
CHECK(callback != NULL);
uintptr_t end = HB_OFFSET_TO_INDEX(heap_end_ - heap_begin_);
diff --git a/src/image_writer.cc b/src/image_writer.cc
index 2d3ae44..adaeebc 100644
--- a/src/image_writer.cc
+++ b/src/image_writer.cc
@@ -67,7 +67,7 @@ bool ImageWriter::Write(const std::string& image_filename,
LOG(ERROR) << "Failed to open oat file " << oat_filename;
return false;
}
- class_linker->RegisterOatFile(*oat_file_);
+ class_linker->RegisterOatFile(*oat_file_);
PruneNonImageClasses(); // Remove junk
ComputeLazyFieldsForImageClasses(); // Add useful information
@@ -114,7 +114,6 @@ void ImageWriter::ComputeLazyFieldsForImageClasses() {
Runtime* runtime = Runtime::Current();
ClassLinker* class_linker = runtime->GetClassLinker();
class_linker->VisitClasses(ComputeLazyFieldsForClassesVisitor, NULL);
-
}
bool ImageWriter::ComputeLazyFieldsForClassesVisitor(Class* c, void* /*arg*/) {
@@ -608,7 +607,7 @@ void ImageWriter::SetPatchLocation(const Compiler::PatchInformation* patch, uint
<< "expected=" << expected
<< "value=" << value;
#endif
- *patch_location = value;
+ *patch_location = value;
}
} // namespace art
diff --git a/src/jni_compiler_test.cc b/src/jni_compiler_test.cc
index fd81457..38266c9 100644
--- a/src/jni_compiler_test.cc
+++ b/src/jni_compiler_test.cc
@@ -81,7 +81,7 @@ class JniCompilerTest : public CommonTest {
ASSERT_TRUE(jmethod_ != NULL);
if (native_fnptr != NULL) {
- JNINativeMethod methods[] = {{method_name, method_sig, native_fnptr}};
+ JNINativeMethod methods[] = { { method_name, method_sig, native_fnptr } };
ASSERT_EQ(JNI_OK, env_->RegisterNatives(jklass_, methods, 1));
} else {
env_->UnregisterNatives(jklass_);
@@ -579,7 +579,7 @@ TEST_F(JniCompilerTest, LocalReferenceTableClearingTest) {
SirtRef<ClassLoader> class_loader(LoadDex("MyClassNatives"));
SetupForTest(class_loader.get(), false, "fooI", "(I)I", reinterpret_cast<void*>(&local_ref_test));
// 1000 invocations of a method that adds 10 local references
- for (int i=0; i < 1000; i++) {
+ for (int i = 0; i < 1000; i++) {
jint result = env_->CallIntMethod(jobj_, jmethod_, i);
EXPECT_TRUE(result == i + 1);
}
diff --git a/src/jni_internal_test.cc b/src/jni_internal_test.cc
index c86d551..414f003 100644
--- a/src/jni_internal_test.cc
+++ b/src/jni_internal_test.cc
@@ -738,21 +738,21 @@ TEST_F(JniInternalTest, RegisterNatives) {
// Check that registering to a non-existent java.lang.Object.foo() causes a
// NoSuchMethodError
{
- JNINativeMethod methods[] = {{"foo", "()V", NULL}};
+ JNINativeMethod methods[] = { { "foo", "()V", NULL } };
env_->RegisterNatives(jlobject, methods, 1);
}
EXPECT_EXCEPTION(jlnsme);
// Check that registering non-native methods causes a NoSuchMethodError
{
- JNINativeMethod methods[] = {{"equals", "(Ljava/lang/Object;)Z", NULL}};
+ JNINativeMethod methods[] = { { "equals", "(Ljava/lang/Object;)Z", NULL } };
env_->RegisterNatives(jlobject, methods, 1);
}
EXPECT_EXCEPTION(jlnsme);
// Check that registering native methods is successful
{
- JNINativeMethod methods[] = {{"notify", "()V", reinterpret_cast<void*>(BogusMethod)}};
+ JNINativeMethod methods[] = { { "notify", "()V", reinterpret_cast<void*>(BogusMethod) } };
env_->RegisterNatives(jlobject, methods, 1);
}
EXPECT_FALSE(env_->ExceptionCheck());
diff --git a/src/mark_sweep.cc b/src/mark_sweep.cc
index e5e0835..3740d91 100644
--- a/src/mark_sweep.cc
+++ b/src/mark_sweep.cc
@@ -144,7 +144,7 @@ void MarkSweep::RecursiveMark() {
uintptr_t end = reinterpret_cast<uintptr_t>(spaces[i]->End());
if (!spaces[i]->IsImageSpace()) {
mark_bitmap_->ScanWalk(begin, end, &MarkSweep::ScanBitmapCallback, arg);
- } else{
+ } else {
mark_bitmap_->ScanWalk(begin, end, &MarkSweep::CheckBitmapCallback, arg);
}
#else
@@ -297,7 +297,7 @@ inline void MarkSweep::CheckReference(const Object* obj, const Object* ref, Memb
AllocSpace* alloc_space = heap_->GetAllocSpace();
if (alloc_space->Contains(ref)) {
bool is_marked = mark_bitmap_->Test(ref);
- if(!is_marked) {
+ if (!is_marked) {
LOG(INFO) << *alloc_space;
LOG(WARNING) << (is_static ? "Static ref'" : "Instance ref'") << PrettyTypeOf(ref)
<< "' (" << (void*)ref << ") in '" << PrettyTypeOf(obj)
diff --git a/src/oat_file.cc b/src/oat_file.cc
index 6ae502c..fcf07b0 100644
--- a/src/oat_file.cc
+++ b/src/oat_file.cc
@@ -64,7 +64,6 @@ OatFile::~OatFile() {
}
bool OatFile::Map(File& file, byte* requested_base, bool writable) {
-
OatHeader oat_header;
bool success = file.ReadFully(&oat_header, sizeof(oat_header));
if (!success || !oat_header.IsValid()) {
diff --git a/src/oat_file.h b/src/oat_file.h
index d75c7c7..3243fe2 100644
--- a/src/oat_file.h
+++ b/src/oat_file.h
@@ -38,13 +38,13 @@ class OatFile {
static OatFile* Open(const std::string& filename,
const std::string& location,
byte* requested_base,
- bool writable=false);
+ bool writable = false);
// Open an oat file from an already opened File with the given location.
static OatFile* Open(File& file,
const std::string& location,
byte* requested_base,
- bool writable=false);
+ bool writable = false);
~OatFile();
diff --git a/src/oatdump.cc b/src/oatdump.cc
index f38f878..a795845 100644
--- a/src/oatdump.cc
+++ b/src/oatdump.cc
@@ -618,7 +618,7 @@ class ImageDumper {
StringAppendF(&summary, "%f (%a)\n", field->GetDouble(obj), field->GetDouble(obj));
} else if (type->IsPrimitiveFloat()) {
StringAppendF(&summary, "%f (%a)\n", field->GetFloat(obj), field->GetFloat(obj));
- } else if (type->IsPrimitive()){
+ } else if (type->IsPrimitive()) {
StringAppendF(&summary, "%d (0x%x)\n", field->Get32(obj), field->Get32(obj));
} else {
Object* value = field->GetObj(obj);
diff --git a/src/object.h b/src/object.h
index 61d0965..c58eb29 100644
--- a/src/object.h
+++ b/src/object.h
@@ -1245,7 +1245,7 @@ class MANAGED Class : public StaticStorageBase {
}
- String* GetName() const ; // Returns the cached name
+ String* GetName() const; // Returns the cached name
void SetName(String* name); // Sets the cached name
String* ComputeName(); // Computes the name, then sets the cached value
diff --git a/src/org_apache_harmony_dalvik_ddmc_DdmServer.cc b/src/org_apache_harmony_dalvik_ddmc_DdmServer.cc
index 42568d0..ed36590 100644
--- a/src/org_apache_harmony_dalvik_ddmc_DdmServer.cc
+++ b/src/org_apache_harmony_dalvik_ddmc_DdmServer.cc
@@ -23,8 +23,7 @@
namespace art {
static void DdmServer_nativeSendChunk(JNIEnv* env, jclass, jint type,
- jbyteArray javaData, jint offset, jint length)
-{
+ jbyteArray javaData, jint offset, jint length) {
ScopedByteArrayRO data(env, javaData);
DCHECK_LE(offset + length, static_cast<int32_t>(data.size()));
Dbg::DdmSendChunk(type, length, reinterpret_cast<const uint8_t*>(&data[offset]));
diff --git a/src/os.h b/src/os.h
index 3d7c0fa..653f14d 100644
--- a/src/os.h
+++ b/src/os.h
@@ -27,7 +27,7 @@ class OS {
public:
// Open a file. The returned file must be deleted by the caller.
- static File* OpenFile(const char* name, bool writable, bool create=true);
+ static File* OpenFile(const char* name, bool writable, bool create = true);
// Create a file from an already open file descriptor
static File* FileFromFd(const char* name, int fd);
diff --git a/src/runtime_support.cc b/src/runtime_support.cc
index 5ed856a..a1c1be4 100644
--- a/src/runtime_support.cc
+++ b/src/runtime_support.cc
@@ -998,7 +998,7 @@ extern "C" int artHandleFillArrayDataFromCode(Array* array, const uint16_t* tabl
}
static uint64_t artInvokeCommon(uint32_t method_idx, Object* this_object, Method* caller_method,
- Thread* self, Method** sp, bool access_check, InvokeType type){
+ Thread* self, Method** sp, bool access_check, InvokeType type) {
Method* method = FindMethodFast(method_idx, this_object, caller_method, access_check, type);
if (UNLIKELY(method == NULL)) {
FinishCalleeSaveFrameSetup(self, sp, Runtime::kRefsAndArgs);
diff --git a/src/space.cc b/src/space.cc
index cb8746f..15b7caf 100644
--- a/src/space.cc
+++ b/src/space.cc
@@ -164,7 +164,7 @@ void AllocSpace::FreeList(size_t num_ptrs, Object** ptrs) {
CHECK(ptrs != NULL);
size_t num_broken_ptrs = 0;
for (size_t i = 0; i < num_ptrs; i++) {
- if(!Contains(ptrs[i])) {
+ if (!Contains(ptrs[i])) {
num_broken_ptrs++;
LOG(ERROR) << "FreeList[" << i << "] (" << ptrs[i] << ") not in bounds of heap " << *this;
}
diff --git a/src/space_test.cc b/src/space_test.cc
index 37e5a8a..7ac0493 100644
--- a/src/space_test.cc
+++ b/src/space_test.cc
@@ -121,26 +121,26 @@ TEST_F(SpaceTest, AllocAndFreeList) {
// Succeeds, fits without adjusting the max allowed footprint.
Object* lots_of_objects[1024];
- for(size_t i = 0; i < arraysize(lots_of_objects); i++) {
+ for (size_t i = 0; i < arraysize(lots_of_objects); i++) {
lots_of_objects[i] = space->AllocWithoutGrowth(16);
EXPECT_TRUE(lots_of_objects[i] != NULL);
}
// Release memory and check pointers are NULL
space->FreeList(arraysize(lots_of_objects), lots_of_objects);
- for(size_t i = 0; i < arraysize(lots_of_objects); i++) {
+ for (size_t i = 0; i < arraysize(lots_of_objects); i++) {
EXPECT_TRUE(lots_of_objects[i] == NULL);
}
// Succeeds, fits by adjusting the max allowed footprint.
- for(size_t i = 0; i < arraysize(lots_of_objects); i++) {
+ for (size_t i = 0; i < arraysize(lots_of_objects); i++) {
lots_of_objects[i] = space->AllocWithGrowth(1024);
EXPECT_TRUE(lots_of_objects[i] != NULL);
}
// Release memory and check pointers are NULL
space->FreeList(arraysize(lots_of_objects), lots_of_objects);
- for(size_t i = 0; i < arraysize(lots_of_objects); i++) {
+ for (size_t i = 0; i < arraysize(lots_of_objects); i++) {
EXPECT_TRUE(lots_of_objects[i] == NULL);
}
}
@@ -181,7 +181,7 @@ void SpaceTest::SizeFootPrintGrowthLimitAndTrimBody(AllocSpace* space, intptr_t
UniquePtr<Object*[]> lots_of_objects(new Object*[max_objects]);
size_t last_object = 0; // last object for which allocation succeeded
size_t amount_allocated = 0; // amount of space allocated
- for(size_t i = 0; i < max_objects; i++) {
+ for (size_t i = 0; i < max_objects; i++) {
size_t alloc_fails = 0; // number of failed allocations
size_t max_fails = 30; // number of times we fail allocation before giving up
for (; alloc_fails < max_fails; alloc_fails++) {
@@ -202,7 +202,7 @@ void SpaceTest::SizeFootPrintGrowthLimitAndTrimBody(AllocSpace* space, intptr_t
}
footprint = mspace_footprint(mspace);
EXPECT_GE(space->Size(), footprint); // invariant
- if(object != NULL) { // allocation succeeded
+ if (object != NULL) { // allocation succeeded
lots_of_objects.get()[i] = object;
size_t allocation_size = space->AllocationSize(object);
if (object_size > 0) {
@@ -233,7 +233,7 @@ void SpaceTest::SizeFootPrintGrowthLimitAndTrimBody(AllocSpace* space, intptr_t
// Release storage in a semi-adhoc manner
size_t free_increment = 96;
- while(true) {
+ while (true) {
// Give the space a haircut
space->Trim();
@@ -250,7 +250,7 @@ void SpaceTest::SizeFootPrintGrowthLimitAndTrimBody(AllocSpace* space, intptr_t
}
// Free some objects
- for(size_t i = 0; i < last_object; i += free_increment) {
+ for (size_t i = 0; i < last_object; i += free_increment) {
Object* object = lots_of_objects.get()[i];
if (object == NULL) {
continue;
diff --git a/src/stack.cc b/src/stack.cc
index 83df5ad..bab36c4 100644
--- a/src/stack.cc
+++ b/src/stack.cc
@@ -89,9 +89,8 @@ void Frame::SetReturnPC(uintptr_t pc) {
*/
int Frame::GetVRegOffset(const DexFile::CodeItem* code_item,
uint32_t core_spills, uint32_t fp_spills,
- size_t frame_size, int reg)
-{
- DCHECK_EQ( frame_size & (kStackAlignment - 1), 0U);
+ size_t frame_size, int reg) {
+ DCHECK_EQ(frame_size & (kStackAlignment - 1), 0U);
int num_spills = __builtin_popcount(core_spills) + __builtin_popcount(fp_spills) + 1 /* filler */;
int num_ins = code_item->ins_size_;
int num_regs = code_item->registers_size_ - num_ins;
diff --git a/src/utils.cc b/src/utils.cc
index a1c4b7a..67c88cf 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -363,11 +363,11 @@ std::string PrettyDuration(uint64_t nano_duration) {
unit = "s";
divisor = one_sec;
zero_fill = 9;
- } else if(nano_duration >= one_ms) {
+ } else if (nano_duration >= one_ms) {
unit = "ms";
divisor = one_ms;
zero_fill = 6;
- } else if(nano_duration >= one_us) {
+ } else if (nano_duration >= one_us) {
unit = "us";
divisor = one_us;
zero_fill = 3;
@@ -563,7 +563,7 @@ bool IsValidPartOfMemberNameUtf8(const char** pUtf8Ptr) {
bool IsValidMemberName(const char* s) {
bool angle_name = false;
- switch(*s) {
+ switch (*s) {
case '\0':
// The empty string is not a valid name.
return false;
diff --git a/test/003-omnibus-opcodes/src/Array.java b/test/003-omnibus-opcodes/src/Array.java
index cb3ecde..a9ed8ec 100644
--- a/test/003-omnibus-opcodes/src/Array.java
+++ b/test/003-omnibus-opcodes/src/Array.java
@@ -82,7 +82,7 @@ public class Array {
/*
* Try bad range values, 32 bit get/put.
*/
- static void checkRange32(int[] ints, int[] empty, int negVal1, int negVal2){
+ static void checkRange32(int[] ints, int[] empty, int negVal1, int negVal2) {
System.out.println("Array.checkRange32");
int i = 0;
diff --git a/test/021-string2/src/junit/framework/ComparisonFailure.java b/test/021-string2/src/junit/framework/ComparisonFailure.java
index 0cb2cee..ccd476b 100644
--- a/test/021-string2/src/junit/framework/ComparisonFailure.java
+++ b/test/021-string2/src/junit/framework/ComparisonFailure.java
@@ -34,7 +34,7 @@ public class ComparisonFailure extends AssertionFailedError {
int end= Math.min(fExpected.length(), fActual.length());
int i= 0;
- for(; i < end; i++) {
+ for (; i < end; i++) {
if (fExpected.charAt(i) != fActual.charAt(i))
break;
}
diff --git a/test/053-wait-some/src/Main.java b/test/053-wait-some/src/Main.java
index 8cd77ff..377a578 100644
--- a/test/053-wait-some/src/Main.java
+++ b/test/053-wait-some/src/Main.java
@@ -42,7 +42,7 @@ public class Main {
ie.printStackTrace();
}
- for(long delay : DELAYS) {
+ for (long delay : DELAYS) {
System.out.println("Waiting for " + delay + "ms...");
start = System.currentTimeMillis();
diff --git a/test/082-inline-execute/src/junit/framework/ComparisonFailure.java b/test/082-inline-execute/src/junit/framework/ComparisonFailure.java
index 0cb2cee..ccd476b 100644
--- a/test/082-inline-execute/src/junit/framework/ComparisonFailure.java
+++ b/test/082-inline-execute/src/junit/framework/ComparisonFailure.java
@@ -34,7 +34,7 @@ public class ComparisonFailure extends AssertionFailedError {
int end= Math.min(fExpected.length(), fActual.length());
int i= 0;
- for(; i < end; i++) {
+ for (; i < end; i++) {
if (fExpected.charAt(i) != fActual.charAt(i))
break;
}
diff --git a/test/083-compiler-regressions/src/Main.java b/test/083-compiler-regressions/src/Main.java
index cf082e1..efd8aa9 100644
--- a/test/083-compiler-regressions/src/Main.java
+++ b/test/083-compiler-regressions/src/Main.java
@@ -226,8 +226,8 @@ public class Main {
int k = 0;
do
vA += 1;
- while(++k < 100);
- } while(++l < 1000);
+ while (++k < 100);
+ } while (++l < 1000);
if (vA == 100001) {
System.out.println("b5884080 passes");
}
diff --git a/test/ReferenceMap/stack_walk_refmap_jni.cc b/test/ReferenceMap/stack_walk_refmap_jni.cc
index 5a80d80..3a16833 100644
--- a/test/ReferenceMap/stack_walk_refmap_jni.cc
+++ b/test/ReferenceMap/stack_walk_refmap_jni.cc
@@ -37,7 +37,7 @@ namespace art {
for (int i = 0; i < t_size; ++i) \
CHECK(IS_IN_REF_BITMAP(mh, ref_bitmap, t[i])) \
<< "Error: Reg @ " << i << "-th argument is not in GC map"; \
- } while(false)
+ } while (false)
struct ReferenceMap2Visitor : public Thread::StackVisitor {
ReferenceMap2Visitor() {
diff --git a/test/StackWalk/stack_walk_jni.cc b/test/StackWalk/stack_walk_jni.cc
index 95f3807..ca0ec00 100644
--- a/test/StackWalk/stack_walk_jni.cc
+++ b/test/StackWalk/stack_walk_jni.cc
@@ -34,7 +34,7 @@ namespace art {
int t_size = sizeof(t) / sizeof(*t); \
for (int i = 0; i < t_size; ++i) \
CHECK(REG(mh, reg_bitmap, t[i])) << "Error: Reg " << i << " is not in RegisterMap"; \
- } while(false)
+ } while (false)
static int gJava_StackWalk_refmap_calls = 0;