summaryrefslogtreecommitdiffstats
path: root/test/StackWalk
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2011-11-30 16:24:48 -0800
committerIan Rogers <irogers@google.com>2011-12-06 14:02:09 -0800
commit6d4d9fcb4f01e287ee29e81cd1c941ee5d11d379 (patch)
tree4c715bef86a3c5a47f9cea43c4a092cf4766ed4b /test/StackWalk
parent86b0010c79ef95b5333cd540b7d3af34a9f1a643 (diff)
downloadart-6d4d9fcb4f01e287ee29e81cd1c941ee5d11d379.zip
art-6d4d9fcb4f01e287ee29e81cd1c941ee5d11d379.tar.gz
art-6d4d9fcb4f01e287ee29e81cd1c941ee5d11d379.tar.bz2
Reduce meta-data object sizes, introduce meta-data helper classes.
Change-Id: Id14ad218f1c74c659701352fdf1a45bf6444daa3
Diffstat (limited to 'test/StackWalk')
-rw-r--r--test/StackWalk/stack_walk_jni.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/StackWalk/stack_walk_jni.cc b/test/StackWalk/stack_walk_jni.cc
index ad9c674..06b3d41 100644
--- a/test/StackWalk/stack_walk_jni.cc
+++ b/test/StackWalk/stack_walk_jni.cc
@@ -6,19 +6,20 @@
#include "class_linker.h"
#include "dex_verifier.h"
#include "object.h"
+#include "object_utils.h"
#include "jni.h"
namespace art {
-#define REG(method, reg_bitmap, reg) \
- ( ((reg) < (method)->NumRegisters()) && \
+#define REG(mh, reg_bitmap, reg) \
+ ( ((reg) < mh.GetCodeItem()->registers_size_) && \
(( *((reg_bitmap) + (reg)/8) >> ((reg) % 8) ) & 0x01) )
#define CHECK_REGS(...) do { \
int t[] = {__VA_ARGS__}; \
int t_size = sizeof(t) / sizeof(*t); \
for (int i = 0; i < t_size; ++i) \
- CHECK(REG(m, reg_bitmap, t[i])) << "Error: Reg " << i << " is not in RegisterMap"; \
+ CHECK(REG(mh, reg_bitmap, t[i])) << "Error: Reg " << i << " is not in RegisterMap"; \
} while(false)
static int gJava_StackWalk_refmap_calls = 0;
@@ -39,12 +40,13 @@ struct ReferenceMapVisitor : public Thread::StackVisitor {
}
verifier::PcToReferenceMap map(m);
const uint8_t* reg_bitmap = map.FindBitMap(m->ToDexPC(pc));
- String* m_name = m->GetName();
+ MethodHelper mh(m);
+ StringPiece m_name(mh.GetName());
// Given the method name and the number of times the method has been called,
// we know the Dex registers with live reference values. Assert that what we
// find is what is expected.
- if (m_name->Equals("f")) {
+ if (m_name == "f") {
if (gJava_StackWalk_refmap_calls == 1) {
CHECK_EQ(1U, m->ToDexPC(pc));
CHECK_REGS(1);
@@ -53,7 +55,7 @@ struct ReferenceMapVisitor : public Thread::StackVisitor {
CHECK_EQ(5U, m->ToDexPC(pc));
CHECK_REGS(1);
}
- } else if (m_name->Equals("g")) {
+ } else if (m_name == "g") {
if (gJava_StackWalk_refmap_calls == 1) {
CHECK_EQ(0xcU, m->ToDexPC(pc));
CHECK_REGS(0, 2); // Note that v1 is not in the minimal root set
@@ -62,7 +64,7 @@ struct ReferenceMapVisitor : public Thread::StackVisitor {
CHECK_EQ(0xcU, m->ToDexPC(pc));
CHECK_REGS(0, 2);
}
- } else if (m_name->Equals("shlemiel")) {
+ } else if (m_name == "shlemiel") {
if (gJava_StackWalk_refmap_calls == 1) {
CHECK_EQ(0x380U, m->ToDexPC(pc));
CHECK_REGS(2, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 25);