From 7940e44f4517de5e2634a7e07d58d0fb26160513 Mon Sep 17 00:00:00 2001 From: Brian Carlstrom Date: Fri, 12 Jul 2013 13:46:57 -0700 Subject: Create separate Android.mk for main build targets The runtime, compiler, dex2oat, and oatdump now are in seperate trees to prevent dependency creep. They can now be individually built without rebuilding the rest of the art projects. dalvikvm and jdwpspy were already this way. Builds in the art directory should behave as before, building everything including tests. Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81 --- compiler/llvm/ir_builder.cc | 130 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 compiler/llvm/ir_builder.cc (limited to 'compiler/llvm/ir_builder.cc') diff --git a/compiler/llvm/ir_builder.cc b/compiler/llvm/ir_builder.cc new file mode 100644 index 0000000000..a65cf2bdae --- /dev/null +++ b/compiler/llvm/ir_builder.cc @@ -0,0 +1,130 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ir_builder.h" + +#include "base/stringprintf.h" + +#include + +namespace art { +namespace llvm { + + +//---------------------------------------------------------------------------- +// General +//---------------------------------------------------------------------------- + +IRBuilder::IRBuilder(::llvm::LLVMContext& context, ::llvm::Module& module, + IntrinsicHelper& intrinsic_helper) + : LLVMIRBuilder(context), module_(&module), mdb_(context), java_object_type_(NULL), + java_method_type_(NULL), java_thread_type_(NULL), intrinsic_helper_(intrinsic_helper) { + // Get java object type from module + ::llvm::Type* jobject_struct_type = module.getTypeByName("JavaObject"); + CHECK(jobject_struct_type != NULL); + java_object_type_ = jobject_struct_type->getPointerTo(); + + // If type of Method is not explicitly defined in the module, use JavaObject* + ::llvm::Type* type = module.getTypeByName("Method"); + if (type != NULL) { + java_method_type_ = type->getPointerTo(); + } else { + java_method_type_ = java_object_type_; + } + + // If type of Thread is not explicitly defined in the module, use JavaObject* + type = module.getTypeByName("Thread"); + if (type != NULL) { + java_thread_type_ = type->getPointerTo(); + } else { + java_thread_type_ = java_object_type_; + } + + // Create JEnv* type + ::llvm::Type* jenv_struct_type = ::llvm::StructType::create(context, "JEnv"); + jenv_type_ = jenv_struct_type->getPointerTo(); + + // Get Art shadow frame struct type from module + art_frame_type_ = module.getTypeByName("ShadowFrame"); + CHECK(art_frame_type_ != NULL); + + runtime_support_ = NULL; +} + + +//---------------------------------------------------------------------------- +// Type Helper Function +//---------------------------------------------------------------------------- + +::llvm::Type* IRBuilder::getJType(JType jty) { + switch (jty) { + case kVoid: + return getJVoidTy(); + + case kBoolean: + return getJBooleanTy(); + + case kByte: + return getJByteTy(); + + case kChar: + return getJCharTy(); + + case kShort: + return getJShortTy(); + + case kInt: + return getJIntTy(); + + case kLong: + return getJLongTy(); + + case kFloat: + return getJFloatTy(); + + case kDouble: + return getJDoubleTy(); + + case kObject: + return getJObjectTy(); + + default: + LOG(FATAL) << "Unknown java type: " << jty; + return NULL; + } +} + +::llvm::StructType* IRBuilder::getShadowFrameTy(uint32_t vreg_size) { + std::string name(StringPrintf("ShadowFrame%u", vreg_size)); + + // Try to find the existing struct type definition + if (::llvm::Type* type = module_->getTypeByName(name)) { + CHECK(::llvm::isa< ::llvm::StructType>(type)); + return static_cast< ::llvm::StructType*>(type); + } + + // Create new struct type definition + ::llvm::Type* elem_types[] = { + art_frame_type_, + ::llvm::ArrayType::get(getInt32Ty(), vreg_size), + }; + + return ::llvm::StructType::create(elem_types, name); +} + + +} // namespace llvm +} // namespace art -- cgit v1.2.3-59-g8ed1b From 7934ac288acfb2552bb0b06ec1f61e5820d924a4 Mon Sep 17 00:00:00 2001 From: Brian Carlstrom Date: Fri, 26 Jul 2013 10:54:15 -0700 Subject: Fix cpplint whitespace/comments issues Change-Id: Iae286862c85fb8fd8901eae1204cd6d271d69496 --- build/Android.cpplint.mk | 2 +- compiler/dex/arena_allocator.h | 2 +- compiler/dex/compiler_enums.h | 20 +- compiler/dex/dataflow_iterator.h | 2 +- compiler/dex/dex_to_dex_compiler.cc | 4 +- compiler/dex/frontend.cc | 56 +- compiler/dex/frontend.h | 2 +- compiler/dex/local_value_numbering.h | 2 +- compiler/dex/mir_graph.cc | 12 +- compiler/dex/mir_graph.h | 6 +- compiler/dex/mir_optimization.cc | 2 +- compiler/dex/portable/mir_to_gbc.cc | 6 +- compiler/dex/quick/arm/arm_lir.h | 28 +- compiler/dex/quick/arm/call_arm.cc | 6 +- compiler/dex/quick/arm/fp_arm.cc | 2 +- compiler/dex/quick/arm/int_arm.cc | 16 +- compiler/dex/quick/arm/target_arm.cc | 2 +- compiler/dex/quick/arm/utility_arm.cc | 6 +- compiler/dex/quick/codegen_util.cc | 2 +- compiler/dex/quick/gen_common.cc | 10 +- compiler/dex/quick/gen_invoke.cc | 14 +- compiler/dex/quick/mips/call_mips.cc | 2 +- compiler/dex/quick/mips/fp_mips.cc | 4 +- compiler/dex/quick/mips/int_mips.cc | 6 +- compiler/dex/quick/mips/mips_lir.h | 58 +- compiler/dex/quick/mips/target_mips.cc | 4 +- compiler/dex/quick/mips/utility_mips.cc | 2 +- compiler/dex/quick/mir_to_lir.h | 4 +- compiler/dex/quick/ralloc_util.cc | 10 +- compiler/dex/quick/x86/assemble_x86.cc | 4 +- compiler/dex/quick/x86/call_x86.cc | 2 +- compiler/dex/quick/x86/fp_x86.cc | 2 +- compiler/dex/quick/x86/target_x86.cc | 4 +- compiler/dex/quick/x86/utility_x86.cc | 10 +- compiler/dex/quick/x86/x86_lir.h | 36 +- compiler/dex/ssa_transformation.cc | 8 +- compiler/dex/vreg_analysis.cc | 2 +- compiler/driver/compiler_driver.cc | 808 ++++++++++----------- compiler/driver/dex_compilation_unit.cc | 2 +- compiler/driver/dex_compilation_unit.h | 2 +- compiler/elf_fixup.cc | 32 +- compiler/elf_writer_mclinker.h | 2 +- compiler/elf_writer_quick.cc | 4 +- compiler/image_writer.cc | 6 +- compiler/jni/portable/jni_compiler.cc | 14 +- compiler/llvm/backend_types.h | 4 +- compiler/llvm/compiler_llvm.cc | 8 +- compiler/llvm/compiler_llvm.h | 4 +- compiler/llvm/gbc_expander.cc | 46 +- compiler/llvm/generated/art_module.cc | 132 ++-- compiler/llvm/intrinsic_helper.cc | 4 +- compiler/llvm/intrinsic_helper.h | 4 +- compiler/llvm/ir_builder.cc | 4 +- compiler/llvm/ir_builder.h | 4 +- compiler/llvm/llvm_compilation_unit.cc | 12 +- compiler/llvm/llvm_compilation_unit.h | 6 +- compiler/llvm/md_builder.cc | 4 +- compiler/llvm/md_builder.h | 4 +- compiler/llvm/runtime_support_builder.cc | 4 +- compiler/llvm/runtime_support_builder.h | 4 +- compiler/llvm/runtime_support_builder_arm.cc | 6 +- compiler/llvm/runtime_support_builder_arm.h | 4 +- compiler/llvm/runtime_support_builder_thumb2.cc | 6 +- compiler/llvm/runtime_support_builder_thumb2.h | 4 +- compiler/llvm/runtime_support_builder_x86.cc | 4 +- compiler/llvm/runtime_support_builder_x86.h | 4 +- compiler/llvm/runtime_support_llvm_func.h | 6 +- compiler/sea_ir/code_gen.cc | 4 +- compiler/sea_ir/code_gen.h | 8 +- compiler/sea_ir/frontend.cc | 4 +- compiler/sea_ir/instruction_nodes.h | 6 +- compiler/sea_ir/instruction_tools.cc | 2 +- compiler/sea_ir/instruction_tools.h | 2 +- compiler/sea_ir/sea.cc | 28 +- compiler/sea_ir/sea.h | 4 +- compiler/sea_ir/sea_node.h | 2 +- compiler/sea_ir/visitor.h | 4 +- compiler/stubs/portable/stubs.cc | 14 +- compiler/stubs/quick/stubs.cc | 12 +- compiler/utils/scoped_hashtable.h | 2 +- compiler/utils/scoped_hashtable_test.cc | 2 +- dalvikvm/dalvikvm.cc | 2 +- dex2oat/dex2oat.cc | 6 +- jdwpspy/Net.cpp | 2 +- oatdump/oatdump.cc | 2 +- runtime/base/histogram_test.cc | 28 +- runtime/base/logging.cc | 2 +- runtime/base/logging.h | 4 +- runtime/base/macros.h | 2 +- runtime/base/mutex-inl.h | 2 +- runtime/base/mutex.cc | 10 +- runtime/base/unix_file/mapped_file_test.cc | 2 +- runtime/check_jni.cc | 56 +- runtime/class_linker.cc | 6 +- runtime/class_linker.h | 4 +- runtime/common_test.h | 8 +- runtime/compiled_method.cc | 2 +- runtime/debugger.cc | 44 +- runtime/debugger.h | 2 +- runtime/dex_file.cc | 2 +- runtime/dex_file.h | 2 +- runtime/dex_file_verifier.cc | 2 +- runtime/dex_instruction-inl.h | 8 +- runtime/dex_instruction.cc | 8 +- runtime/dex_instruction.h | 4 +- runtime/dex_instruction_list.h | 2 +- runtime/disassembler_arm.cc | 52 +- runtime/disassembler_mips.cc | 42 +- runtime/disassembler_x86.cc | 2 +- runtime/exception_test.cc | 2 +- runtime/gc/accounting/card_table.cc | 2 +- runtime/gc/accounting/space_bitmap-inl.h | 2 +- runtime/gc/collector/mark_sweep.cc | 4 +- runtime/gc/collector/mark_sweep.h | 2 +- runtime/gc/heap.cc | 2 +- runtime/gc/space/dlmalloc_space.cc | 4 +- runtime/gc/space/space.h | 2 +- runtime/hprof/hprof.cc | 18 +- runtime/indirect_reference_table.cc | 2 +- runtime/indirect_reference_table.h | 8 +- runtime/instrumentation.cc | 14 +- runtime/intern_table.cc | 8 +- runtime/intern_table_test.cc | 2 +- runtime/interpreter/interpreter.cc | 6 +- runtime/invoke_type.h | 10 +- runtime/jdwp/jdwp.h | 8 +- runtime/jdwp/jdwp_constants.h | 8 +- runtime/jdwp/jdwp_event.cc | 6 +- runtime/jdwp/jdwp_handler.cc | 6 +- runtime/jdwp/jdwp_priv.h | 4 +- runtime/jdwp/jdwp_request.cc | 2 +- runtime/jdwp/object_registry.cc | 6 +- runtime/jni_internal.cc | 26 +- runtime/jvalue.h | 4 +- runtime/locks.h | 2 +- runtime/log_severity.h | 2 +- runtime/mem_map.cc | 6 +- runtime/mirror/dex_cache.h | 2 +- runtime/mirror/field.cc | 2 +- runtime/mirror/throwable.h | 2 +- runtime/monitor.cc | 6 +- runtime/native/dalvik_system_VMDebug.cc | 4 +- runtime/native/dalvik_system_Zygote.cc | 2 +- runtime/native/java_lang_Thread.cc | 2 +- runtime/oat/runtime/arm/context_arm.cc | 2 +- runtime/oat/runtime/mips/context_mips.cc | 2 +- runtime/oat/runtime/support_interpreter.cc | 2 +- runtime/oat/runtime/support_jni.cc | 2 +- runtime/oat/runtime/support_stubs.cc | 4 +- .../oat/runtime/x86/oat_support_entrypoints_x86.cc | 12 +- runtime/oat_test.cc | 2 +- runtime/reference_table.cc | 2 +- runtime/reference_table.h | 2 +- runtime/reflection.cc | 2 +- runtime/runtime.cc | 32 +- runtime/runtime_linux.cc | 2 +- runtime/runtime_support.cc | 8 +- runtime/runtime_support_llvm_func_list.h | 2 +- runtime/safe_map.h | 2 +- runtime/scoped_thread_state_change.h | 2 +- runtime/signal_catcher.cc | 2 +- runtime/stack.cc | 8 +- runtime/stack.h | 6 +- runtime/thread.cc | 20 +- runtime/thread.h | 6 +- runtime/thread_linux.cc | 2 +- runtime/thread_list.cc | 6 +- runtime/thread_list.h | 4 +- runtime/thread_state.h | 40 +- runtime/trace.cc | 14 +- runtime/utils.cc | 34 +- runtime/verifier/dex_gc_map.h | 6 +- runtime/verifier/method_verifier.cc | 16 +- runtime/verifier/method_verifier.h | 22 +- runtime/verifier/reg_type_cache.cc | 2 +- runtime/verifier/reg_type_test.cc | 2 +- runtime/zip_archive.cc | 2 +- test/ReferenceMap/stack_walk_refmap_jni.cc | 44 +- test/StackWalk/stack_walk_jni.cc | 2 +- 179 files changed, 1208 insertions(+), 1208 deletions(-) (limited to 'compiler/llvm/ir_builder.cc') diff --git a/build/Android.cpplint.mk b/build/Android.cpplint.mk index eabaf31cca..adb87cb4e9 100644 --- a/build/Android.cpplint.mk +++ b/build/Android.cpplint.mk @@ -15,7 +15,7 @@ # ART_CPPLINT := art/tools/cpplint.py -ART_CPPLINT_FILTER := --filter=-whitespace/comments,-whitespace/line_length,-build/include,-readability/function,-readability/streams,-readability/todo,-runtime/references,-runtime/sizeof,-runtime/threadsafe_fn,-runtime/printf +ART_CPPLINT_FILTER := --filter=-whitespace/line_length,-build/include,-readability/function,-readability/streams,-readability/todo,-runtime/references,-runtime/sizeof,-runtime/threadsafe_fn,-runtime/printf ART_CPPLINT_SRC := $(shell find art -name *.h -o -name *$(ART_CPP_EXTENSION) | grep -v art/compiler/llvm/generated/) # "mm cpplint-art" to verify we aren't regressing diff --git a/compiler/dex/arena_allocator.h b/compiler/dex/arena_allocator.h index 3bd733e753..e8e2c027d0 100644 --- a/compiler/dex/arena_allocator.h +++ b/compiler/dex/arena_allocator.h @@ -86,7 +86,7 @@ struct MemStats { explicit MemStats(const ArenaAllocator &arena) : arena_(arena) {} private: const ArenaAllocator &arena_; -}; // MemStats +}; // MemStats } // namespace art diff --git a/compiler/dex/compiler_enums.h b/compiler/dex/compiler_enums.h index 88240e8c40..97a682f2aa 100644 --- a/compiler/dex/compiler_enums.h +++ b/compiler/dex/compiler_enums.h @@ -48,7 +48,7 @@ enum SpecialTargetRegister { }; enum RegLocationType { - kLocDalvikFrame = 0, // Normal Dalvik register + kLocDalvikFrame = 0, // Normal Dalvik register kLocPhysReg, kLocCompilerTemp, kLocInvalid @@ -249,20 +249,20 @@ enum X86ConditionCode { kX86CondC = kX86CondB, // carry kX86CondNb = 0x3, // not-below - kX86CondAe = kX86CondNb, // above-equal - kX86CondNc = kX86CondNb, // not-carry + kX86CondAe = kX86CondNb, // above-equal + kX86CondNc = kX86CondNb, // not-carry kX86CondZ = 0x4, // zero kX86CondEq = kX86CondZ, // equal kX86CondNz = 0x5, // not-zero - kX86CondNe = kX86CondNz, // not-equal + kX86CondNe = kX86CondNz, // not-equal kX86CondBe = 0x6, // below-equal - kX86CondNa = kX86CondBe, // not-above + kX86CondNa = kX86CondBe, // not-above kX86CondNbe = 0x7, // not-below-equal - kX86CondA = kX86CondNbe,// above + kX86CondA = kX86CondNbe, // above kX86CondS = 0x8, // sign kX86CondNs = 0x9, // not-sign @@ -277,13 +277,13 @@ enum X86ConditionCode { kX86CondNge = kX86CondL, // not-greater-equal kX86CondNl = 0xd, // not-less-than - kX86CondGe = kX86CondNl, // not-greater-equal + kX86CondGe = kX86CondNl, // not-greater-equal kX86CondLe = 0xe, // less-than-equal - kX86CondNg = kX86CondLe, // not-greater + kX86CondNg = kX86CondLe, // not-greater kX86CondNle = 0xf, // not-less-than - kX86CondG = kX86CondNle,// greater + kX86CondG = kX86CondNle, // greater }; std::ostream& operator<<(std::ostream& os, const X86ConditionCode& kind); @@ -349,7 +349,7 @@ enum OpFeatureFlags { kIsIT, kMemLoad, kMemStore, - kPCRelFixup, // x86 FIXME: add NEEDS_FIXUP to instruction attributes. + kPCRelFixup, // x86 FIXME: add NEEDS_FIXUP to instruction attributes. kRegDef0, kRegDef1, kRegDefA, diff --git a/compiler/dex/dataflow_iterator.h b/compiler/dex/dataflow_iterator.h index 847a614727..da44ffd99c 100644 --- a/compiler/dex/dataflow_iterator.h +++ b/compiler/dex/dataflow_iterator.h @@ -80,7 +80,7 @@ namespace art { GrowableArray* block_id_list_; int idx_; bool changed_; - }; // DataflowIterator + }; // DataflowIterator class ReachableNodesIterator : public DataflowIterator { public: diff --git a/compiler/dex/dex_to_dex_compiler.cc b/compiler/dex/dex_to_dex_compiler.cc index 28c325726e..3c491ce20f 100644 --- a/compiler/dex/dex_to_dex_compiler.cc +++ b/compiler/dex/dex_to_dex_compiler.cc @@ -240,12 +240,12 @@ Instruction* DexCompiler::CompileCheckCast(Instruction* inst, uint32_t dex_pc) { // We are modifying 4 consecutive bytes. ScopedDexWriteAccess sdwa(GetModifiableDexFile(), inst, 4u); inst->SetOpcode(Instruction::NOP); - inst->SetVRegA_10x(0u); // keep compliant with verifier. + inst->SetVRegA_10x(0u); // keep compliant with verifier. // Get to next instruction which is the second half of check-cast and replace // it by a NOP. inst = const_cast(inst->Next()); inst->SetOpcode(Instruction::NOP); - inst->SetVRegA_10x(0u); // keep compliant with verifier. + inst->SetVRegA_10x(0u); // keep compliant with verifier. return inst; } diff --git a/compiler/dex/frontend.cc b/compiler/dex/frontend.cc index 113a80a96c..9cc4d18d37 100644 --- a/compiler/dex/frontend.cc +++ b/compiler/dex/frontend.cc @@ -72,37 +72,37 @@ extern "C" void ArtUnInitQuickCompilerContext(art::CompilerDriver& compiler) { } /* Default optimizer/debug setting for the compiler. */ -static uint32_t kCompilerOptimizerDisableFlags = 0 | // Disable specific optimizations +static uint32_t kCompilerOptimizerDisableFlags = 0 | // Disable specific optimizations (1 << kLoadStoreElimination) | - //(1 << kLoadHoisting) | - //(1 << kSuppressLoads) | - //(1 << kNullCheckElimination) | - //(1 << kPromoteRegs) | - //(1 << kTrackLiveTemps) | - //(1 << kSafeOptimizations) | - //(1 << kBBOpt) | - //(1 << kMatch) | - //(1 << kPromoteCompilerTemps) | + // (1 << kLoadHoisting) | + // (1 << kSuppressLoads) | + // (1 << kNullCheckElimination) | + // (1 << kPromoteRegs) | + // (1 << kTrackLiveTemps) | + // (1 << kSafeOptimizations) | + // (1 << kBBOpt) | + // (1 << kMatch) | + // (1 << kPromoteCompilerTemps) | 0; static uint32_t kCompilerDebugFlags = 0 | // Enable debug/testing modes - //(1 << kDebugDisplayMissingTargets) | - //(1 << kDebugVerbose) | - //(1 << kDebugDumpCFG) | - //(1 << kDebugSlowFieldPath) | - //(1 << kDebugSlowInvokePath) | - //(1 << kDebugSlowStringPath) | - //(1 << kDebugSlowestFieldPath) | - //(1 << kDebugSlowestStringPath) | - //(1 << kDebugExerciseResolveMethod) | - //(1 << kDebugVerifyDataflow) | - //(1 << kDebugShowMemoryUsage) | - //(1 << kDebugShowNops) | - //(1 << kDebugCountOpcodes) | - //(1 << kDebugDumpCheckStats) | - //(1 << kDebugDumpBitcodeFile) | - //(1 << kDebugVerifyBitcode) | - //(1 << kDebugShowSummaryMemoryUsage) | + // (1 << kDebugDisplayMissingTargets) | + // (1 << kDebugVerbose) | + // (1 << kDebugDumpCFG) | + // (1 << kDebugSlowFieldPath) | + // (1 << kDebugSlowInvokePath) | + // (1 << kDebugSlowStringPath) | + // (1 << kDebugSlowestFieldPath) | + // (1 << kDebugSlowestStringPath) | + // (1 << kDebugExerciseResolveMethod) | + // (1 << kDebugVerifyDataflow) | + // (1 << kDebugShowMemoryUsage) | + // (1 << kDebugShowNops) | + // (1 << kDebugCountOpcodes) | + // (1 << kDebugDumpCheckStats) | + // (1 << kDebugDumpBitcodeFile) | + // (1 << kDebugVerifyBitcode) | + // (1 << kDebugShowSummaryMemoryUsage) | 0; static CompiledMethod* CompileMethod(CompilerDriver& compiler, @@ -277,7 +277,7 @@ CompiledMethod* CompileOneMethod(CompilerDriver& compiler, #if defined(ART_USE_PORTABLE_COMPILER) , llvm_compilation_unit #endif - ); // NOLINT(whitespace/parens) + ); // NOLINT(whitespace/parens) } } // namespace art diff --git a/compiler/dex/frontend.h b/compiler/dex/frontend.h index a86338950c..5c68ab4244 100644 --- a/compiler/dex/frontend.h +++ b/compiler/dex/frontend.h @@ -102,7 +102,7 @@ class LLVMInfo { private: UniquePtr< ::llvm::LLVMContext> llvm_context_; - ::llvm::Module* llvm_module_; // Managed by context_. + ::llvm::Module* llvm_module_; // Managed by context_. UniquePtr intrinsic_helper_; UniquePtr ir_builder_; }; diff --git a/compiler/dex/local_value_numbering.h b/compiler/dex/local_value_numbering.h index e3fd7ad2da..33ca8f1ad8 100644 --- a/compiler/dex/local_value_numbering.h +++ b/compiler/dex/local_value_numbering.h @@ -137,6 +137,6 @@ class LocalValueNumbering { std::set null_checked_; }; -} // namespace art +} // namespace art #endif // ART_COMPILER_DEX_LOCAL_VALUE_NUMBERING_H_ diff --git a/compiler/dex/mir_graph.cc b/compiler/dex/mir_graph.cc index 264604c355..6b010ed9b3 100644 --- a/compiler/dex/mir_graph.cc +++ b/compiler/dex/mir_graph.cc @@ -972,23 +972,23 @@ char* MIRGraph::GetDalvikDisassembly(const MIR* mir) { } } switch (dalvik_format) { - case Instruction::k11n: // Add one immediate from vB + case Instruction::k11n: // Add one immediate from vB case Instruction::k21s: case Instruction::k31i: case Instruction::k21h: str.append(StringPrintf(", #%d", insn.vB)); break; - case Instruction::k51l: // Add one wide immediate + case Instruction::k51l: // Add one wide immediate str.append(StringPrintf(", #%lld", insn.vB_wide)); break; - case Instruction::k21c: // One register, one string/type/method index + case Instruction::k21c: // One register, one string/type/method index case Instruction::k31c: str.append(StringPrintf(", index #%d", insn.vB)); break; - case Instruction::k22c: // Two registers, one string/type/method index + case Instruction::k22c: // Two registers, one string/type/method index str.append(StringPrintf(", index #%d", insn.vC)); break; - case Instruction::k22s: // Add one immediate from vC + case Instruction::k22s: // Add one immediate from vC case Instruction::k22b: str.append(StringPrintf(", #%d", insn.vC)); break; @@ -1154,4 +1154,4 @@ BasicBlock* MIRGraph::NewMemBB(BBType block_type, int block_id) { return bb; } -} // namespace art +} // namespace art diff --git a/compiler/dex/mir_graph.h b/compiler/dex/mir_graph.h index 342d2a296a..e9ec949f23 100644 --- a/compiler/dex/mir_graph.h +++ b/compiler/dex/mir_graph.h @@ -273,7 +273,7 @@ struct RegLocation { unsigned fp:1; // Floating point? unsigned core:1; // Non-floating point? unsigned ref:1; // Something GC cares about. - unsigned high_word:1; // High word of pair? + unsigned high_word:1; // High word of pair? unsigned home:1; // Does this represent the home location? uint8_t low_reg; // First physical register. uint8_t high_reg; // 2nd physical register (if wide). @@ -650,7 +650,7 @@ class MIRGraph { BasicBlock* cur_block_; int num_blocks_; const DexFile::CodeItem* current_code_item_; - SafeMap block_map_; // FindBlock lookup cache. + SafeMap block_map_; // FindBlock lookup cache. std::vector m_units_; // List of methods included in this graph typedef std::pair MIRLocation; // Insert point, (m_unit_ index, offset) std::vector method_stack_; // Include stack @@ -659,7 +659,7 @@ class MIRGraph { int def_count_; // Used to estimate size of ssa name storage. int* opcode_count_; // Dex opcode coverage stats. int num_ssa_regs_; // Number of names following SSA transformation. - std::vector extended_basic_blocks_; // Heads of block "traces". + std::vector extended_basic_blocks_; // Heads of block "traces". int method_sreg_; unsigned int attributes_; Checkstats* checkstats_; diff --git a/compiler/dex/mir_optimization.cc b/compiler/dex/mir_optimization.cc index d79b26e4b9..a6314f4cab 100644 --- a/compiler/dex/mir_optimization.cc +++ b/compiler/dex/mir_optimization.cc @@ -845,7 +845,7 @@ bool MIRGraph::BuildExtendedBBList(struct BasicBlock* bb) { bb = NextDominatedBlock(bb); } } - return false; // Not iterative - return value will be ignored + return false; // Not iterative - return value will be ignored } diff --git a/compiler/dex/portable/mir_to_gbc.cc b/compiler/dex/portable/mir_to_gbc.cc index 6fc01bdff2..7831cf6f7a 100644 --- a/compiler/dex/portable/mir_to_gbc.cc +++ b/compiler/dex/portable/mir_to_gbc.cc @@ -1648,7 +1648,7 @@ bool MirConverter::BlockBitcodeConversion(BasicBlock* bb) { if (bb->block_type == kEntryBlock) { SetMethodInfo(); - { // Allocate shadowframe. + { // Allocate shadowframe. art::llvm::IntrinsicHelper::IntrinsicId id = art::llvm::IntrinsicHelper::AllocaShadowFrame; ::llvm::Function* func = intrinsic_helper_->GetIntrinsicFunction(id); @@ -1656,7 +1656,7 @@ bool MirConverter::BlockBitcodeConversion(BasicBlock* bb) { irb_->CreateCall(func, entries); } - { // Store arguments to vregs. + { // Store arguments to vregs. uint16_t arg_reg = cu_->num_regs; ::llvm::Function::arg_iterator arg_iter(func_->arg_begin()); @@ -1666,7 +1666,7 @@ bool MirConverter::BlockBitcodeConversion(BasicBlock* bb) { uint32_t shorty_size = strlen(shorty); CHECK_GE(shorty_size, 1u); - ++arg_iter; // skip method object + ++arg_iter; // skip method object if ((cu_->access_flags & kAccStatic) == 0) { SetVregOnValue(arg_iter, arg_reg); diff --git a/compiler/dex/quick/arm/arm_lir.h b/compiler/dex/quick/arm/arm_lir.h index 93fee05e4e..2f54190ae7 100644 --- a/compiler/dex/quick/arm/arm_lir.h +++ b/compiler/dex/quick/arm/arm_lir.h @@ -239,7 +239,7 @@ enum ArmShiftEncodings { */ enum ArmOpcode { kArmFirst = 0, - kArm16BitData = kArmFirst, // DATA [0] rd[15..0]. + kArm16BitData = kArmFirst, // DATA [0] rd[15..0]. kThumbAdcRR, // adc [0100000101] rm[5..3] rd[2..0]. kThumbAddRRI3, // add(1) [0001110] imm_3[8..6] rn[5..3] rd[2..0]*/ kThumbAddRI8, // add(2) [00110] rd[10..8] imm_8[7..0]. @@ -332,12 +332,12 @@ enum ArmOpcode { kThumb2VcvtDF, // vcvt.F32.F64 vd, vm [1110111010110111] vd[15..12] [10111100] vm[3..0]. kThumb2Vsqrts, // vsqrt.f32 vd, vm [1110111010110001] vd[15..12] [10101100] vm[3..0]. kThumb2Vsqrtd, // vsqrt.f64 vd, vm [1110111010110001] vd[15..12] [10111100] vm[3..0]. - kThumb2MovImmShift,// mov(T2) rd, # [11110] i [00001001111] imm3 rd[11..8] imm8. + kThumb2MovImmShift, // mov(T2) rd, # [11110] i [00001001111] imm3 rd[11..8] imm8. kThumb2MovImm16, // mov(T3) rd, # [11110] i [0010100] imm4 [0] imm3 rd[11..8] imm8. kThumb2StrRRI12, // str(Imm,T3) rd,[rn,#imm12] [111110001100] rn[19..16] rt[15..12] imm12[11..0]. kThumb2LdrRRI12, // str(Imm,T3) rd,[rn,#imm12] [111110001100] rn[19..16] rt[15..12] imm12[11..0]. - kThumb2StrRRI8Predec, // str(Imm,T4) rd,[rn,#-imm8] [111110000100] rn[19..16] rt[15..12] [1100] imm[7..0]*/ - kThumb2LdrRRI8Predec, // ldr(Imm,T4) rd,[rn,#-imm8] [111110000101] rn[19..16] rt[15..12] [1100] imm[7..0]*/ + kThumb2StrRRI8Predec, // str(Imm,T4) rd,[rn,#-imm8] [111110000100] rn[19..16] rt[15..12] [1100] imm[7..0]*/ + kThumb2LdrRRI8Predec, // ldr(Imm,T4) rd,[rn,#-imm8] [111110000101] rn[19..16] rt[15..12] [1100] imm[7..0]*/ kThumb2Cbnz, // cbnz rd,