Remove Frame, merge shadow and quick representations.
Change-Id: I5ae03a5e52111792d2df7e83cbd89ab25777844b
diff --git a/test/ReferenceMap/stack_walk_refmap_jni.cc b/test/ReferenceMap/stack_walk_refmap_jni.cc
index 20be7a1..d7910af 100644
--- a/test/ReferenceMap/stack_walk_refmap_jni.cc
+++ b/test/ReferenceMap/stack_walk_refmap_jni.cc
@@ -40,23 +40,21 @@
<< "Error: Reg @ " << i << "-th argument is not in GC map"; \
} while (false)
-struct ReferenceMap2Visitor : public Thread::StackVisitor {
- ReferenceMap2Visitor() {
+struct ReferenceMap2Visitor : public StackVisitor {
+ explicit ReferenceMap2Visitor(const ManagedStack* stack,
+ const std::vector<TraceStackFrame>* trace_stack) :
+ StackVisitor(stack, trace_stack) {
}
- bool VisitFrame(const Frame& frame, uintptr_t pc) {
- Method* m = frame.GetMethod();
- if (!m || m->IsNative()) {
+ bool VisitFrame() {
+ Method* m = GetMethod();
+ if (!m || m->IsNative() || m->IsRuntimeMethod() || IsShadowFrame()) {
return true;
}
LOG(INFO) << "At " << PrettyMethod(m, false);
verifier::PcToReferenceMap map(m->GetGcMap(), m->GetGcMapLength());
- if (!pc) {
- // pc == NULL: m is either a native method or a phony method
- return true;
- }
if (m->IsCalleeSaveMethod()) {
LOG(WARNING) << "no PC for " << PrettyMethod(m);
return true;
@@ -283,8 +281,9 @@
extern "C" JNIEXPORT jint JNICALL Java_ReferenceMap_refmap(JNIEnv*, jobject, jint count) {
// Visitor
- ReferenceMap2Visitor mapper;
- Thread::Current()->WalkStack(&mapper);
+ ReferenceMap2Visitor mapper(Thread::Current()->GetManagedStack(),
+ Thread::Current()->GetTraceStack());
+ mapper.WalkStack();
return count + 1;
}