summaryrefslogtreecommitdiffstats
path: root/compiler/utils
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-09-09 19:53:48 -0700
committerAndreas Gampe <agampe@google.com>2014-09-10 15:50:42 -0700
commit928f72bd75c385ba2708c58521171a77264d4486 (patch)
tree86f7fa7a21e3f6d21c9cab2d4fffe4aaa42dc458 /compiler/utils
parentdab9ed52f2df7189b81ccf3237b030ff638a492a (diff)
downloadart-928f72bd75c385ba2708c58521171a77264d4486.zip
art-928f72bd75c385ba2708c58521171a77264d4486.tar.gz
art-928f72bd75c385ba2708c58521171a77264d4486.tar.bz2
ART: Fix things for valgrind
Wire up valgrind gtests. Add valgrind-test-art-host, currently only depending on valgrind-test-art-host-gtest32. Fix an Alloc setting to allow running valgrind. Refactor the fault handler to manage (and correctly release) the handlers. Fix minor failure-case leaks exposed by tests. Failing tests: The optimizing compiler is leaking non-arena-ed structures (e.g., assembler buffers), as code generators are not destroyed. The solution has been moved to a follow-up CL. Note: All 64b tests are failing as we cannot allocate a heap. Change-Id: I7f854cfd098d9f68107ce492363e7dba9a82b9fa
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/assembler.cc1
-rw-r--r--compiler/utils/x86_64/assembler_x86_64.h2
-rw-r--r--compiler/utils/x86_64/assembler_x86_64_test.cc7
3 files changed, 9 insertions, 1 deletions
diff --git a/compiler/utils/assembler.cc b/compiler/utils/assembler.cc
index 68b784a..e3045e1 100644
--- a/compiler/utils/assembler.cc
+++ b/compiler/utils/assembler.cc
@@ -92,6 +92,7 @@ void AssemblerBuffer::ExtendCapacity() {
// Compute the relocation delta and switch to the new contents area.
ptrdiff_t delta = new_contents - contents_;
+ delete[] contents_;
contents_ = new_contents;
// Update the cursor and recompute the limit.
diff --git a/compiler/utils/x86_64/assembler_x86_64.h b/compiler/utils/x86_64/assembler_x86_64.h
index 3f9f007..763dafe 100644
--- a/compiler/utils/x86_64/assembler_x86_64.h
+++ b/compiler/utils/x86_64/assembler_x86_64.h
@@ -253,7 +253,7 @@ class Address : public Operand {
class X86_64Assembler FINAL : public Assembler {
public:
- X86_64Assembler() {}
+ X86_64Assembler() : cfi_cfa_offset_(0), cfi_pc_(0) {}
virtual ~X86_64Assembler() {}
/*
diff --git a/compiler/utils/x86_64/assembler_x86_64_test.cc b/compiler/utils/x86_64/assembler_x86_64_test.cc
index 4ed7b20..7a48b63 100644
--- a/compiler/utils/x86_64/assembler_x86_64_test.cc
+++ b/compiler/utils/x86_64/assembler_x86_64_test.cc
@@ -16,6 +16,7 @@
#include "assembler_x86_64.h"
+#include "base/stl_util.h"
#include "utils/assembler_test.h"
namespace art {
@@ -62,6 +63,11 @@ class AssemblerX86_64Test : public AssemblerTest<x86_64::X86_64Assembler, x86_64
}
}
+ void TearDown() OVERRIDE {
+ AssemblerTest::TearDown();
+ STLDeleteElements(&registers_);
+ }
+
std::vector<x86_64::CpuRegister*> GetRegisters() OVERRIDE {
return registers_;
}
@@ -219,6 +225,7 @@ std::string setcc_test_fn(x86_64::X86_64Assembler* assembler) {
}
}
+ STLDeleteElements(&registers);
return str.str();
}