diff options
author | Ian Rogers <irogers@google.com> | 2014-10-22 22:06:39 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-10-22 22:21:57 -0700 |
commit | cf7f19135f0e273f7b0136315633c2abfc715343 (patch) | |
tree | ffa4d9efd9c45f4b6789acc1f534bb9327052b7e /compiler | |
parent | aea6888b056be21adf762e066c7f33b8939b8a06 (diff) | |
download | art-cf7f19135f0e273f7b0136315633c2abfc715343.zip art-cf7f19135f0e273f7b0136315633c2abfc715343.tar.gz art-cf7f19135f0e273f7b0136315633c2abfc715343.tar.bz2 |
C++11 related clean-up of DISALLOW_..
Move DISALLOW_COPY_AND_ASSIGN to delete functions. By no having declarations
with no definitions this prompts better warning messages so deal with these
by correcting the code.
Add a DISALLOW_ALLOCATION and use for ValueObject and mirror::Object.
Make X86 assembly operand types ValueObjects to fix compilation errors.
Tidy the use of iostream and ostream.
Avoid making cutils a dependency via mutex-inl.h for tests that link against
libart. Push tracing dependencies into appropriate files and mutex.cc.
x86 32-bit host symbols size is increased for libarttest, avoid copying this
in run-test 115 by using symlinks and remove this test's higher than normal
ulimit.
Fix the RunningOnValgrind test in RosAllocSpace to not use GetHeap as it
returns NULL when the heap is under construction by Runtime.
Change-Id: Ia246f7ac0c11f73072b30d70566a196e9b78472b
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/driver/compiler_driver.cc | 4 | ||||
-rw-r--r-- | compiler/driver/compiler_driver.h | 10 | ||||
-rw-r--r-- | compiler/optimizing/graph_visualizer.h | 2 | ||||
-rw-r--r-- | compiler/optimizing/nodes.h | 2 | ||||
-rw-r--r-- | compiler/optimizing/ssa_liveness_analysis.h | 1 | ||||
-rw-r--r-- | compiler/utils/assembler_test.h | 13 | ||||
-rw-r--r-- | compiler/utils/x86/assembler_x86.h | 11 | ||||
-rw-r--r-- | compiler/utils/x86_64/assembler_x86_64.h | 10 | ||||
-rw-r--r-- | compiler/utils/x86_64/assembler_x86_64_test.cc | 4 |
9 files changed, 16 insertions, 41 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 4528688..a60c5bc 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -347,15 +347,11 @@ CompilerDriver::CompilerDriver(const CompilerOptions* compiler_options, image_(image), image_classes_(image_classes), thread_count_(thread_count), - start_ns_(0), stats_(new AOTCompilationStats), dump_stats_(dump_stats), dump_passes_(dump_passes), timings_logger_(timer), - compiler_library_(nullptr), compiler_context_(nullptr), - compiler_enable_auto_elf_loading_(nullptr), - compiler_get_method_code_addr_(nullptr), support_boot_image_fixup_(instruction_set != kMips), dedupe_code_("dedupe code"), dedupe_src_mapping_table_("dedupe source mapping table"), diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 3d59ef1..0796f48 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -503,7 +503,6 @@ class CompilerDriver { std::unique_ptr<std::set<std::string>> image_classes_; size_t thread_count_; - uint64_t start_ns_; class AOTCompilationStats; std::unique_ptr<AOTCompilationStats> stats_; @@ -516,8 +515,6 @@ class CompilerDriver { typedef void (*CompilerCallbackFn)(CompilerDriver& driver); typedef MutexLock* (*CompilerMutexLockFn)(CompilerDriver& driver); - void* compiler_library_; - typedef void (*DexToDexCompilerFn)(CompilerDriver& driver, const DexFile::CodeItem* code_item, uint32_t access_flags, InvokeType invoke_type, @@ -533,13 +530,6 @@ class CompilerDriver { // Arena pool used by the compiler. ArenaPool arena_pool_; - typedef void (*CompilerEnableAutoElfLoadingFn)(CompilerDriver& driver); - CompilerEnableAutoElfLoadingFn compiler_enable_auto_elf_loading_; - - typedef const void* (*CompilerGetMethodCodeAddrFn) - (const CompilerDriver& driver, const CompiledMethod* cm, const mirror::ArtMethod* method); - CompilerGetMethodCodeAddrFn compiler_get_method_code_addr_; - bool support_boot_image_fixup_; // DeDuplication data structures, these own the corresponding byte arrays. diff --git a/compiler/optimizing/graph_visualizer.h b/compiler/optimizing/graph_visualizer.h index 05984a0..4d8bec2 100644 --- a/compiler/optimizing/graph_visualizer.h +++ b/compiler/optimizing/graph_visualizer.h @@ -17,6 +17,8 @@ #ifndef ART_COMPILER_OPTIMIZING_GRAPH_VISUALIZER_H_ #define ART_COMPILER_OPTIMIZING_GRAPH_VISUALIZER_H_ +#include <ostream> + #include "base/value_object.h" namespace art { diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 9b7ff88..e9b6b41 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -2123,7 +2123,7 @@ class HGraphVisitor : public ValueObject { #undef DECLARE_VISIT_INSTRUCTION private: - HGraph* graph_; + HGraph* const graph_; DISALLOW_COPY_AND_ASSIGN(HGraphVisitor); }; diff --git a/compiler/optimizing/ssa_liveness_analysis.h b/compiler/optimizing/ssa_liveness_analysis.h index 8f71848..7dda4f6 100644 --- a/compiler/optimizing/ssa_liveness_analysis.h +++ b/compiler/optimizing/ssa_liveness_analysis.h @@ -32,6 +32,7 @@ class BlockInfo : public ArenaObject { live_in_(allocator, number_of_ssa_values, false), live_out_(allocator, number_of_ssa_values, false), kill_(allocator, number_of_ssa_values, false) { + UNUSED(block_); live_in_.ClearAllBits(); live_out_.ClearAllBits(); kill_.ClearAllBits(); diff --git a/compiler/utils/assembler_test.h b/compiler/utils/assembler_test.h index 5bfa462..91237ae 100644 --- a/compiler/utils/assembler_test.h +++ b/compiler/utils/assembler_test.h @@ -24,7 +24,6 @@ #include <cstdio> #include <cstdlib> #include <fstream> -#include <iostream> #include <iterator> #include <sys/stat.h> @@ -118,9 +117,8 @@ class AssemblerTest : public testing::Test { std::vector<int64_t> imms = CreateImmediateValues(imm_bytes); for (auto reg : registers) { for (int64_t imm : imms) { - Imm* new_imm = CreateImmediate(imm); - (assembler_.get()->*f)(*reg, *new_imm); - delete new_imm; + Imm new_imm = CreateImmediate(imm); + (assembler_.get()->*f)(*reg, new_imm); std::string base = fmt; size_t reg_index = base.find("{reg}"); @@ -154,9 +152,8 @@ class AssemblerTest : public testing::Test { std::string str; std::vector<int64_t> imms = CreateImmediateValues(imm_bytes); for (int64_t imm : imms) { - Imm* new_imm = CreateImmediate(imm); - (assembler_.get()->*f)(*new_imm); - delete new_imm; + Imm new_imm = CreateImmediate(imm); + (assembler_.get()->*f)(new_imm); std::string base = fmt; size_t imm_index = base.find("{imm}"); @@ -333,7 +330,7 @@ class AssemblerTest : public testing::Test { } // Create an immediate from the specific value. - virtual Imm* CreateImmediate(int64_t imm_value) = 0; + virtual Imm CreateImmediate(int64_t imm_value) = 0; private: // Driver() assembles and compares the results. If the results are not equal and we have a diff --git a/compiler/utils/x86/assembler_x86.h b/compiler/utils/x86/assembler_x86.h index c7eada3..b5bf31b 100644 --- a/compiler/utils/x86/assembler_x86.h +++ b/compiler/utils/x86/assembler_x86.h @@ -29,7 +29,7 @@ namespace art { namespace x86 { -class Immediate { +class Immediate : public ValueObject { public: explicit Immediate(int32_t value) : value_(value) {} @@ -47,7 +47,7 @@ class Immediate { }; -class Operand { +class Operand : public ValueObject { public: uint8_t mod() const { return (encoding_at(0) >> 6) & 3; @@ -129,8 +129,6 @@ class Operand { } friend class X86Assembler; - - DISALLOW_COPY_AND_ASSIGN(Operand); }; @@ -168,7 +166,6 @@ class Address : public Operand { } } - Address(Register index, ScaleFactor scale, int32_t disp) { CHECK_NE(index, ESP); // Illegal addressing mode. SetModRM(0, ESP); @@ -205,14 +202,12 @@ class Address : public Operand { private: Address() {} - - DISALLOW_COPY_AND_ASSIGN(Address); }; class X86Assembler FINAL : public Assembler { public: - explicit X86Assembler() {} + explicit X86Assembler() : cfi_cfa_offset_(0), cfi_pc_(0) {} virtual ~X86Assembler() {} /* diff --git a/compiler/utils/x86_64/assembler_x86_64.h b/compiler/utils/x86_64/assembler_x86_64.h index 7e5859c..92b81ec 100644 --- a/compiler/utils/x86_64/assembler_x86_64.h +++ b/compiler/utils/x86_64/assembler_x86_64.h @@ -36,7 +36,7 @@ namespace x86_64 { // // Note: As we support cross-compilation, the value type must be int64_t. Please be aware of // conversion rules in expressions regarding negation, especially size_t on 32b. -class Immediate { +class Immediate : public ValueObject { public: explicit Immediate(int64_t value) : value_(value) {} @@ -54,12 +54,10 @@ class Immediate { private: const int64_t value_; - - DISALLOW_COPY_AND_ASSIGN(Immediate); }; -class Operand { +class Operand : public ValueObject { public: uint8_t mod() const { return (encoding_at(0) >> 6) & 3; @@ -157,8 +155,6 @@ class Operand { } friend class X86_64Assembler; - - DISALLOW_COPY_AND_ASSIGN(Operand); }; @@ -247,8 +243,6 @@ class Address : public Operand { private: Address() {} - - DISALLOW_COPY_AND_ASSIGN(Address); }; diff --git a/compiler/utils/x86_64/assembler_x86_64_test.cc b/compiler/utils/x86_64/assembler_x86_64_test.cc index 37a0932..18c5cbc 100644 --- a/compiler/utils/x86_64/assembler_x86_64_test.cc +++ b/compiler/utils/x86_64/assembler_x86_64_test.cc @@ -72,8 +72,8 @@ class AssemblerX86_64Test : public AssemblerTest<x86_64::X86_64Assembler, x86_64 return registers_; } - x86_64::Immediate* CreateImmediate(int64_t imm_value) OVERRIDE { - return new x86_64::Immediate(imm_value); + x86_64::Immediate CreateImmediate(int64_t imm_value) OVERRIDE { + return x86_64::Immediate(imm_value); } private: |