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/intrinsics.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/intrinsics.h')
-rw-r--r-- | compiler/optimizing/intrinsics.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/compiler/optimizing/intrinsics.h b/compiler/optimizing/intrinsics.h index fbcc613e8c..d901f7e10c 100644 --- a/compiler/optimizing/intrinsics.h +++ b/compiler/optimizing/intrinsics.h @@ -95,17 +95,18 @@ class IntrinsicVisitor : public ValueObject { codegen->GetMoveResolver()->EmitNativeCode(¶llel_move); } - static void ComputeIntegerValueOfLocations(HInvoke* invoke, - CodeGenerator* codegen, - Location return_location, - Location first_argument_location); - - // Temporary data structure for holding Integer.valueOf data for generating code. - // We only use it if the boot image contains the IntegerCache objects. - struct IntegerValueOfInfo { + static void ComputeValueOfLocations(HInvoke* invoke, + CodeGenerator* codegen, + int32_t low, + int32_t length, + Location return_location, + Location first_argument_location); + + // Temporary data structure for holding BoxedType.valueOf data for generating code. + struct ValueOfInfo { static constexpr uint32_t kInvalidReference = static_cast<uint32_t>(-1); - IntegerValueOfInfo(); + ValueOfInfo(); // Offset of the Integer.value field for initializing a newly allocated instance. uint32_t value_offset; @@ -130,10 +131,13 @@ class IntrinsicVisitor : public ValueObject { }; }; - static IntegerValueOfInfo ComputeIntegerValueOfInfo( - HInvoke* invoke, const CompilerOptions& compiler_options); - static bool CheckIntegerCacheFields(ObjPtr<mirror::ObjectArray<mirror::Object>> cache) - REQUIRES_SHARED(Locks::mutator_lock_); + static ValueOfInfo ComputeValueOfInfo( + HInvoke* invoke, + const CompilerOptions& compiler_options, + ArtField* value_field, + int32_t low, + int32_t length, + size_t base); static MemberOffset GetReferenceDisableIntrinsicOffset(); static MemberOffset GetReferenceSlowPathEnabledOffset(); |