summaryrefslogtreecommitdiff
path: root/runtime/mirror/class_flags.h
diff options
context:
space:
mode:
author Lokesh Gidra <lokeshgidra@google.com> 2024-07-17 21:14:29 +0000
committer Lokesh Gidra <lokeshgidra@google.com> 2024-07-22 15:53:08 +0000
commitb2f1766aeb7b442a1cc821f8dcda44a06fab7f85 (patch)
tree14c20ac6fa8d81275bb0660f85e077868eecfcc6 /runtime/mirror/class_flags.h
parent841e48f39dad0e560ec45df0d5ff805a74ddb3fe (diff)
Embed component-size shift in class-flags
This helps by eliminating the need to dereference component_type_ reference in Class each time we need to compute the array's size. Bug: 304325190 Test: art/test/testrunner/testrunner.py --host Change-Id: I745b794066fa24787800f0e0baaf5c4188842bc1
Diffstat (limited to 'runtime/mirror/class_flags.h')
-rw-r--r--runtime/mirror/class_flags.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/mirror/class_flags.h b/runtime/mirror/class_flags.h
index 26a87c9546..b3d38b0ba8 100644
--- a/runtime/mirror/class_flags.h
+++ b/runtime/mirror/class_flags.h
@@ -61,6 +61,14 @@ static constexpr uint32_t kClassFlagPhantomReference = 0x00000400;
// Class is a record class. See doc at java.lang.Class#isRecord().
static constexpr uint32_t kClassFlagRecord = 0x00000800;
+// Class is a primitive array class.
+static constexpr uint32_t kClassFlagPrimitiveArray = 0x00001000;
+
+// NOTE: The most significant 2 bits are used to store the component size shift
+// for arrays (both primitive and object). See Primitive::ComponentSizeShift()
+// for size shift of different types.
+static constexpr uint32_t kArrayComponentSizeShiftShift = 30;
+
// Combination of flags to figure out if the class is either the weak/soft/phantom/finalizer
// reference class.
static constexpr uint32_t kClassFlagReference =