Make WatchedFramePop instrumentation event pure-virtual
All the other events are pure virtual but this one had an (empty)
default implementation. Change the event to make it consistent with
all the others.
Test: Builds
Test: Treehugger
Change-Id: I3d81914d067b305f09d4072c443e5ac9027af443
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index af56810..b4931cf 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -268,6 +268,11 @@
LOG(ERROR) << "Unexpected exception handled event in debugger";
}
+ // TODO Might be worth it to implement this.
+ void WatchedFramePop(Thread* thread ATTRIBUTE_UNUSED,
+ const ShadowFrame& frame ATTRIBUTE_UNUSED) OVERRIDE {
+ LOG(ERROR) << "Unexpected WatchedFramePop event in debugger";
+ }
private:
static bool IsReturn(ArtMethod* method, uint32_t dex_pc)
diff --git a/runtime/instrumentation.h b/runtime/instrumentation.h
index fec027e..9bb49ea 100644
--- a/runtime/instrumentation.h
+++ b/runtime/instrumentation.h
@@ -154,9 +154,7 @@
// shadow-frames by deoptimizing stacks.
virtual void WatchedFramePop(Thread* thread ATTRIBUTE_UNUSED,
const ShadowFrame& frame ATTRIBUTE_UNUSED)
- REQUIRES_SHARED(Locks::mutator_lock_) {
- return;
- }
+ REQUIRES_SHARED(Locks::mutator_lock_) = 0;
};
// Instrumentation is a catch-all for when extra information is required from the runtime. The
diff --git a/runtime/trace.cc b/runtime/trace.cc
index b30de79..4c3fa20 100644
--- a/runtime/trace.cc
+++ b/runtime/trace.cc
@@ -832,6 +832,11 @@
<< " " << dex_pc;
}
+void Trace::WatchedFramePop(Thread* self ATTRIBUTE_UNUSED,
+ const ShadowFrame& frame ATTRIBUTE_UNUSED) {
+ LOG(ERROR) << "Unexpected WatchedFramePop event in tracing";
+}
+
void Trace::ReadClocks(Thread* thread, uint32_t* thread_clock_diff, uint32_t* wall_clock_diff) {
if (UseThreadCpuClock()) {
uint64_t clock_base = thread->GetTraceClockBase();
diff --git a/runtime/trace.h b/runtime/trace.h
index 49d5b22..a888dcb 100644
--- a/runtime/trace.h
+++ b/runtime/trace.h
@@ -38,6 +38,7 @@
class ArtField;
class ArtMethod;
class DexFile;
+class ShadowFrame;
class Thread;
using DexIndexBitSet = std::bitset<65536>;
@@ -194,6 +195,8 @@
uint32_t dex_pc,
ArtMethod* callee)
REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!*unique_methods_lock_) OVERRIDE;
+ void WatchedFramePop(Thread* thread, const ShadowFrame& frame)
+ REQUIRES_SHARED(Locks::mutator_lock_) OVERRIDE;
// Reuse an old stack trace if it exists, otherwise allocate a new one.
static std::vector<ArtMethod*>* AllocStackTrace();
// Clear and store an old stack trace for later use.