summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/entrypoints/entrypoint_utils.h7
-rw-r--r--runtime/entrypoints/quick/quick_field_entrypoints.cc10
2 files changed, 10 insertions, 7 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h
index 455e53f750..a28376fadf 100644
--- a/runtime/entrypoints/entrypoint_utils.h
+++ b/runtime/entrypoints/entrypoint_utils.h
@@ -133,13 +133,6 @@ enum FindFieldType {
StaticPrimitiveWrite,
};
-inline constexpr bool FindFieldTypeIsRead(FindFieldType type) {
- return type == InstanceObjectRead ||
- type == InstancePrimitiveRead ||
- type == StaticObjectRead ||
- type == StaticPrimitiveRead;
-}
-
template<FindFieldType type, bool access_check>
inline ArtField* FindFieldFromCode(
uint32_t field_idx, ArtMethod* referrer, Thread* self, size_t expected_size)
diff --git a/runtime/entrypoints/quick/quick_field_entrypoints.cc b/runtime/entrypoints/quick/quick_field_entrypoints.cc
index bb90667381..a245f18d3f 100644
--- a/runtime/entrypoints/quick/quick_field_entrypoints.cc
+++ b/runtime/entrypoints/quick/quick_field_entrypoints.cc
@@ -27,6 +27,16 @@
namespace art {
+inline constexpr bool FindFieldTypeIsRead(FindFieldType type) {
+ return type == InstanceObjectRead ||
+ type == InstancePrimitiveRead ||
+ type == StaticObjectRead ||
+ type == StaticPrimitiveRead;
+}
+
+// Helper function to do a null check after trying to resolve the field. Not for statics since obj
+// does not exist there. There is a suspend check, object is a double pointer to update the value
+// in the caller in case it moves.
template<FindFieldType type, bool kAccessCheck>
ALWAYS_INLINE static inline ArtField* FindInstanceField(uint32_t field_idx,
ArtMethod* referrer,