Prepare for sharing JIT code after fork.

Only encode classes/strings/methods that are in a boot image.

Bug: 119800099
Test: boot
Change-Id: I7ed8ce2ce876ad1c6c1678939cafe4808a67bef4
diff --git a/runtime/jit/jit.h b/runtime/jit/jit.h
index e44e1c9..d272a18 100644
--- a/runtime/jit/jit.h
+++ b/runtime/jit/jit.h
@@ -326,7 +326,8 @@
 
   // Called by the compiler to know whether it can directly encode the
   // method/class/string.
-  bool CanEncodeMethod(ArtMethod* method, bool is_for_shared_region) const;
+  bool CanEncodeMethod(ArtMethod* method, bool is_for_shared_region) const
+      REQUIRES_SHARED(Locks::mutator_lock_);
   bool CanEncodeClass(ObjPtr<mirror::Class> cls, bool is_for_shared_region) const
       REQUIRES_SHARED(Locks::mutator_lock_);
   bool CanEncodeString(ObjPtr<mirror::String> string, bool is_for_shared_region) const