diff options
author | 2023-11-17 15:28:08 +0000 | |
---|---|---|
committer | 2023-11-21 08:57:57 +0000 | |
commit | be953220a759a67179fb9462d72003d2f53e3e65 (patch) | |
tree | bb2c8968610f673ffeee0a41f2beec4b5e0ae20f /compiler/optimizing/intrinsic_objects.h | |
parent | 5a70049c2e9937c4034b0f0c639f0126a2e551f8 (diff) |
Implement Short/Byte/Character.valueOf intrinsics.
Also remove now obsolete IntegerCache checks - we can rely on the checks
done when generating the boot image.
Test: test.py
Change-Id: Ia8dfa97498e7aaefd4493e8ed67fa62874fe78c3
Diffstat (limited to 'compiler/optimizing/intrinsic_objects.h')
-rw-r--r-- | compiler/optimizing/intrinsic_objects.h | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/compiler/optimizing/intrinsic_objects.h b/compiler/optimizing/intrinsic_objects.h index c9ae449467..52a6b81f0e 100644 --- a/compiler/optimizing/intrinsic_objects.h +++ b/compiler/optimizing/intrinsic_objects.h @@ -52,14 +52,13 @@ template <class T> class ObjectArray; class IntrinsicObjects { public: enum class PatchType { - kIntegerValueOfObject, - kIntegerValueOfArray, + kValueOfObject, + kValueOfArray, - kLast = kIntegerValueOfArray + kLast = kValueOfArray }; static uint32_t EncodePatch(PatchType patch_type, uint32_t index = 0u) { - DCHECK(patch_type == PatchType::kIntegerValueOfObject || index == 0u); return PatchTypeField::Encode(static_cast<uint32_t>(patch_type)) | IndexField::Encode(index); } @@ -94,13 +93,6 @@ class IntrinsicObjects { return kNumberOfBoxedCaches; } - private: - static constexpr size_t kPatchTypeBits = - MinimumBitsToStore(static_cast<uint32_t>(PatchType::kLast)); - static constexpr size_t kIndexBits = BitSizeOf<uint32_t>() - kPatchTypeBits; - using PatchTypeField = BitField<uint32_t, 0u, kPatchTypeBits>; - using IndexField = BitField<uint32_t, kPatchTypeBits, kIndexBits>; - EXPORT static ObjPtr<mirror::Object> GetValueOfObject( ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects, size_t start_index, @@ -109,6 +101,13 @@ class IntrinsicObjects { EXPORT static MemberOffset GetValueOfArrayDataOffset( ObjPtr<mirror::ObjectArray<mirror::Object>> boot_image_live_objects, size_t start_index) REQUIRES_SHARED(Locks::mutator_lock_); + + private: + static constexpr size_t kPatchTypeBits = + MinimumBitsToStore(static_cast<uint32_t>(PatchType::kLast)); + static constexpr size_t kIndexBits = BitSizeOf<uint32_t>() - kPatchTypeBits; + using PatchTypeField = BitField<uint32_t, 0u, kPatchTypeBits>; + using IndexField = BitField<uint32_t, kPatchTypeBits, kIndexBits>; }; } // namespace art |