diff options
Diffstat (limited to 'compiler/dex/quick/mir_to_lir.h')
-rw-r--r-- | compiler/dex/quick/mir_to_lir.h | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/compiler/dex/quick/mir_to_lir.h b/compiler/dex/quick/mir_to_lir.h index 64ef48db59..d101a13b29 100644 --- a/compiler/dex/quick/mir_to_lir.h +++ b/compiler/dex/quick/mir_to_lir.h @@ -831,14 +831,14 @@ class Mir2Lir : public Backend { void GenNewArray(uint32_t type_idx, RegLocation rl_dest, RegLocation rl_src); void GenFilledNewArray(CallInfo* info); - void GenSput(MIR* mir, RegLocation rl_src, - bool is_long_or_double, bool is_object); - void GenSget(MIR* mir, RegLocation rl_dest, - bool is_long_or_double, bool is_object); - void GenIGet(MIR* mir, int opt_flags, OpSize size, - RegLocation rl_dest, RegLocation rl_obj, bool is_long_or_double, bool is_object); + void GenSput(MIR* mir, RegLocation rl_src, OpSize size); + // Get entrypoints are specific for types, size alone is not sufficient to safely infer + // entrypoint. + void GenSget(MIR* mir, RegLocation rl_dest, OpSize size, Primitive::Type type); + void GenIGet(MIR* mir, int opt_flags, OpSize size, Primitive::Type type, + RegLocation rl_dest, RegLocation rl_obj); void GenIPut(MIR* mir, int opt_flags, OpSize size, - RegLocation rl_src, RegLocation rl_obj, bool is_long_or_double, bool is_object); + RegLocation rl_src, RegLocation rl_obj); void GenArrayObjPut(int opt_flags, RegLocation rl_array, RegLocation rl_index, RegLocation rl_src); @@ -978,6 +978,10 @@ class Mir2Lir : public Backend { virtual LIR* LoadWordDisp(RegStorage r_base, int displacement, RegStorage r_dest) { return LoadBaseDisp(r_base, displacement, r_dest, kWord, kNotVolatile); } + // Load 8 bits, regardless of target. + virtual LIR* Load8Disp(RegStorage r_base, int displacement, RegStorage r_dest) { + return LoadBaseDisp(r_base, displacement, r_dest, kSignedByte, kNotVolatile); + } // Load 32 bits, regardless of target. virtual LIR* Load32Disp(RegStorage r_base, int displacement, RegStorage r_dest) { return LoadBaseDisp(r_base, displacement, r_dest, k32, kNotVolatile); @@ -1149,6 +1153,14 @@ class Mir2Lir : public Backend { (info1->StorageMask() & info2->StorageMask()) != 0); } + static constexpr bool IsWide(OpSize size) { + return size == k64 || size == kDouble; + } + + static constexpr bool IsRef(OpSize size) { + return size == kReference; + } + /** * @brief Portable way of getting special registers from the backend. * @param reg Enumeration describing the purpose of the register. @@ -1483,10 +1495,6 @@ class Mir2Lir : public Backend { */ virtual RegLocation ForceTempWide(RegLocation loc); - static constexpr OpSize LoadStoreOpSize(bool wide, bool ref) { - return wide ? k64 : ref ? kReference : k32; - } - virtual void GenInstanceofFinal(bool use_declaring_class, uint32_t type_idx, RegLocation rl_dest, RegLocation rl_src); @@ -1724,6 +1732,9 @@ class Mir2Lir : public Backend { // (i.e. 8 bytes on 32-bit arch, 16 bytes on 64-bit arch) and we use ResourceMaskCache // to deduplicate the masks. ResourceMaskCache mask_cache_; + + private: + static bool SizeMatchesTypeForEntrypoint(OpSize size, Primitive::Type type); }; // Class Mir2Lir } // namespace art |