From b546163926889130354ccdbcccb80c0331c13f3c Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Mon, 15 Oct 2018 14:24:21 +0100 Subject: Fix HNewArray with unresolved primitive array type. And enable test 920-objects that was crashing because of this bug. Test: testrunner.py --host --jit-on-first-use -t 920 Test: testrunner.py --host --optimizing Test: m test-art-host-gtest Bug: 117638896 Change-Id: I47dc893b121c82de537b3147c86d37a6eecf2d62 --- compiler/optimizing/nodes.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/nodes.h') diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index 97b50d36da..6ebe89eae1 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -4849,10 +4849,11 @@ class HNeg final : public HUnaryOperation { class HNewArray final : public HExpression<2> { public: - HNewArray(HInstruction* cls, HInstruction* length, uint32_t dex_pc) + HNewArray(HInstruction* cls, HInstruction* length, uint32_t dex_pc, size_t component_size_shift) : HExpression(kNewArray, DataType::Type::kReference, SideEffects::CanTriggerGC(), dex_pc) { SetRawInputAt(0, cls); SetRawInputAt(1, length); + SetPackedField(component_size_shift); } bool IsClonable() const override { return true; } @@ -4874,10 +4875,23 @@ class HNewArray final : public HExpression<2> { return InputAt(1); } + size_t GetComponentSizeShift() { + return GetPackedField(); + } + DECLARE_INSTRUCTION(NewArray); protected: DEFAULT_COPY_CONSTRUCTOR(NewArray); + + private: + static constexpr size_t kFieldComponentSizeShift = kNumberOfGenericPackedBits; + static constexpr size_t kFieldComponentSizeShiftSize = MinimumBitsToStore(3u); + static constexpr size_t kNumberOfNewArrayPackedBits = + kFieldComponentSizeShift + kFieldComponentSizeShiftSize; + static_assert(kNumberOfNewArrayPackedBits <= kMaxNumberOfPackedBits, "Too many packed fields."); + using ComponentSizeShiftField = + BitField; }; class HAdd final : public HBinaryOperation { -- cgit v1.2.3-59-g8ed1b