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
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 @@
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 @@
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 @@
}
// 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 Operand {
+class Operand : public ValueObject {
public:
uint8_t mod() const {
return (encoding_at(0) >> 6) & 3;
@@ -129,8 +129,6 @@
}
friend class X86Assembler;
-
- DISALLOW_COPY_AND_ASSIGN(Operand);
};
@@ -168,7 +166,6 @@
}
}
-
Address(Register index, ScaleFactor scale, int32_t disp) {
CHECK_NE(index, ESP); // Illegal addressing mode.
SetModRM(0, ESP);
@@ -205,14 +202,12 @@
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 @@
//
// 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 @@
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 @@
}
friend class X86_64Assembler;
-
- DISALLOW_COPY_AND_ASSIGN(Operand);
};
@@ -247,8 +243,6 @@
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 @@
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: