diff options
author | 2023-12-15 15:47:22 +0000 | |
---|---|---|
committer | 2024-01-03 15:29:48 +0000 | |
commit | 3f0981b56a1b9a415383c552c063b890c840b13e (patch) | |
tree | 4f5aae6900d024630a90401761905b5ce4847f08 /compiler/optimizing/nodes.h | |
parent | 41c5dde40d1c75d36a7f984c8d72ec65fbff3111 (diff) |
Revert^2 "x86_64: Store resolved MethodType-s in .bss."
This reverts commit d014fd019e84471665ac02f2de285541009892cd.
Reason for revert: fix codegen to do runtime call in JIT for now.
Bug: 297147201
Test: ./art/test/testrunner/testrunner.py --host --64 --optimizing -b
Test: ./art/test/testrunner/testrunner.py --jvm -b
Test: ./art/test.py --host -b
Test: ./art/test/testrunner/testrunner.py --host --64 --jit -b
Change-Id: I0f01c8391b09659bb6195955ecd8f88159141872
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index d84ff7be73..0efe8f4335 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -7313,6 +7313,16 @@ class HLoadMethodHandle final : public HInstruction { class HLoadMethodType final : public HInstruction { public: + // Determines how to load the MethodType. + enum class LoadKind { + // Load from an entry in the .bss section using a PC-relative load. + kBssEntry, + // Load using a single runtime call. + kRuntimeCall, + + kLast = kRuntimeCall, + }; + HLoadMethodType(HCurrentMethod* current_method, dex::ProtoIndex proto_index, const DexFile& dex_file, @@ -7324,6 +7334,7 @@ class HLoadMethodType final : public HInstruction { special_input_(HUserRecord<HInstruction*>(current_method)), proto_index_(proto_index), dex_file_(dex_file) { + SetPackedField<LoadKindField>(LoadKind::kRuntimeCall); } using HInstruction::GetInputRecords; // Keep the const version visible. @@ -7334,6 +7345,12 @@ class HLoadMethodType final : public HInstruction { bool IsClonable() const override { return true; } + void SetLoadKind(LoadKind load_kind); + + LoadKind GetLoadKind() const { + return GetPackedField<LoadKindField>(); + } + dex::ProtoIndex GetProtoIndex() const { return proto_index_; } const DexFile& GetDexFile() const { return dex_file_; } @@ -7352,6 +7369,14 @@ class HLoadMethodType final : public HInstruction { DEFAULT_COPY_CONSTRUCTOR(LoadMethodType); private: + static constexpr size_t kFieldLoadKind = kNumberOfGenericPackedBits; + static constexpr size_t kFieldLoadKindSize = + MinimumBitsToStore(static_cast<size_t>(LoadKind::kLast)); + static constexpr size_t kNumberOfLoadMethodTypePackedBits = kFieldLoadKind + kFieldLoadKindSize; + static_assert(kNumberOfLoadMethodTypePackedBits <= kMaxNumberOfPackedBits, + "Too many packed fields."); + using LoadKindField = BitField<LoadKind, kFieldLoadKind, kFieldLoadKindSize>; + // The special input is the HCurrentMethod for kRuntimeCall. HUserRecord<HInstruction*> special_input_; @@ -7359,6 +7384,17 @@ class HLoadMethodType final : public HInstruction { const DexFile& dex_file_; }; +std::ostream& operator<<(std::ostream& os, HLoadMethodType::LoadKind rhs); + +// Note: defined outside class to see operator<<(., HLoadMethodType::LoadKind). +inline void HLoadMethodType::SetLoadKind(LoadKind load_kind) { + // The load kind should be determined before inserting the instruction to the graph. + DCHECK(GetBlock() == nullptr); + DCHECK(GetEnvironment() == nullptr); + DCHECK_EQ(GetLoadKind(), LoadKind::kRuntimeCall); + SetPackedField<LoadKindField>(load_kind); +} + /** * Performs an initialization check on its Class object input. */ |