Remove Dbg::VisitRoots().
We replace the GC strong roots with JNI.
jdwp_test passes.
Bug: 12687968
Change-Id: I841f1aaa5dffa784ca25953a251600f70df273b2
diff --git a/runtime/debugger.h b/runtime/debugger.h
index 2589638..1d3668c 100644
--- a/runtime/debugger.h
+++ b/runtime/debugger.h
@@ -131,7 +131,8 @@
};
// TODO rename to InstrumentationRequest.
-struct DeoptimizationRequest {
+class DeoptimizationRequest {
+ public:
enum Kind {
kNothing, // no action.
kRegisterForEvent, // start listening for instrumentation event.
@@ -142,21 +143,48 @@
kSelectiveUndeoptimization // undeoptimize one method.
};
- DeoptimizationRequest() : kind(kNothing), instrumentation_event(0), method(nullptr) {}
+ DeoptimizationRequest() : kind_(kNothing), instrumentation_event_(0), method_(nullptr) {}
- void VisitRoots(RootCallback* callback, void* arg);
+ DeoptimizationRequest(const DeoptimizationRequest& other)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
+ : kind_(other.kind_), instrumentation_event_(other.instrumentation_event_) {
+ // Create a new JNI global reference for the method.
+ SetMethod(other.Method());
+ }
- Kind kind;
+ mirror::ArtMethod* Method() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
+ void SetMethod(mirror::ArtMethod* m) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
+ // Name 'Kind()' would collide with the above enum name.
+ Kind GetKind() const {
+ return kind_;
+ }
+
+ void SetKind(Kind kind) {
+ kind_ = kind;
+ }
+
+ uint32_t InstrumentationEvent() const {
+ return instrumentation_event_;
+ }
+
+ void SetInstrumentationEvent(uint32_t instrumentation_event) {
+ instrumentation_event_ = instrumentation_event;
+ }
+
+ private:
+ Kind kind_;
// TODO we could use a union to hold the instrumentation_event and the method since they
// respectively have sense only for kRegisterForEvent/kUnregisterForEvent and
// kSelectiveDeoptimization/kSelectiveUndeoptimization.
// Event to start or stop listening to. Only for kRegisterForEvent and kUnregisterForEvent.
- uint32_t instrumentation_event;
+ uint32_t instrumentation_event_;
// Method for selective deoptimization.
- mirror::ArtMethod* method;
+ jmethodID method_;
};
class Dbg {