Move mirror::Class to use ObjPtr
Leave the return types as non ObjPtr for now. Fixed moving GC bugs
in tests.
Test: test-art-host
Bug: 31113334
Change-Id: I5da1b5ac55dfbc5cc97a64be2c870ba9f512d9b0
diff --git a/runtime/jvalue.h b/runtime/jvalue.h
index 7b91b0b..52a0f23 100644
--- a/runtime/jvalue.h
+++ b/runtime/jvalue.h
@@ -18,9 +18,12 @@
#define ART_RUNTIME_JVALUE_H_
#include "base/macros.h"
+#include "base/mutex.h"
#include <stdint.h>
+#include "obj_ptr.h"
+
namespace art {
namespace mirror {
class Object;
@@ -52,8 +55,10 @@
int64_t GetJ() const { return j; }
void SetJ(int64_t new_j) { j = new_j; }
- mirror::Object* GetL() const { return l; }
- void SetL(mirror::Object* new_l) { l = new_l; }
+ mirror::Object* GetL() const REQUIRES_SHARED(Locks::mutator_lock_) {
+ return l;
+ }
+ void SetL(ObjPtr<mirror::Object> new_l) REQUIRES_SHARED(Locks::mutator_lock_);
int16_t GetS() const { return s; }
void SetS(int16_t new_s) {