Fix StackVisitor::GetVReg for Nterp.

If the required type is reference, we should look at the reference
array.

Test: 686-get-this
Bug: 112676029
Change-Id: Iee786723f67c576878d2f5d56f96694b75699cd1
diff --git a/runtime/nterp_helpers.h b/runtime/nterp_helpers.h
index 7dbf92e..aacd178 100644
--- a/runtime/nterp_helpers.h
+++ b/runtime/nterp_helpers.h
@@ -67,6 +67,13 @@
 uint32_t NterpGetVReg(ArtMethod** frame, uint16_t vreg)
     REQUIRES_SHARED(Locks::mutator_lock_);
 
+/**
+ * Returns the value of dex register number `vreg` in the given frame if it is a
+ * reference. Return 0 otehrwise.
+ */
+uint32_t NterpGetVRegReference(ArtMethod** frame, uint16_t vreg)
+    REQUIRES_SHARED(Locks::mutator_lock_);
+
 }  // namespace art
 
 #endif  // ART_RUNTIME_NTERP_HELPERS_H_