From d9e4d73b20d68aa387f5837e1535b6fc26b2859a Mon Sep 17 00:00:00 2001 From: "Gupta Kumar, Sanjiv" Date: Mon, 5 Feb 2018 13:35:03 +0530 Subject: Fix iCache misses for GetKind on x86,x86_64 GetKind() takes about 2.6% of total compilation time on x86_64. The primary reason is that the target call GetKindInternal() is often beyond the page boundary causing frequent i-cache misses. This patch removes the virtual call to GetKindInternal () and instead keeps the InstructionKind into each constructed instruction. Since we have about 121 instructions in total as of now, it takes about 7 extra bits in each instruction. dex2oat runs about 12% faster with --compiler-filter=everything on an APK of 25MB. Test: Tested the patch by running host art tests. Rebased. Change-Id: Ia7bbcd67180151e4565507164a718acbb6284885 Signed-off-by: Gupta Kumar, Sanjiv --- compiler/optimizing/nodes_mips.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'compiler/optimizing/nodes_mips.h') diff --git a/compiler/optimizing/nodes_mips.h b/compiler/optimizing/nodes_mips.h index 2c0595e3d8..d0e0fef946 100644 --- a/compiler/optimizing/nodes_mips.h +++ b/compiler/optimizing/nodes_mips.h @@ -24,7 +24,11 @@ class HMipsComputeBaseMethodAddress : public HExpression<0> { public: // Treat the value as an int32_t, but it is really a 32 bit native pointer. HMipsComputeBaseMethodAddress() - : HExpression(DataType::Type::kInt32, SideEffects::None(), kNoDexPc) {} + : HExpression(kMipsComputeBaseMethodAddress, + DataType::Type::kInt32, + SideEffects::None(), + kNoDexPc) { + } bool CanBeMoved() const OVERRIDE { return true; } @@ -42,7 +46,7 @@ class HMipsPackedSwitch FINAL : public HTemplateInstruction<2> { HInstruction* input, HMipsComputeBaseMethodAddress* method_base, uint32_t dex_pc) - : HTemplateInstruction(SideEffects::None(), dex_pc), + : HTemplateInstruction(kMipsPackedSwitch, SideEffects::None(), dex_pc), start_value_(start_value), num_entries_(num_entries) { SetRawInputAt(0, input); @@ -90,7 +94,10 @@ class HMipsPackedSwitch FINAL : public HTemplateInstruction<2> { class HIntermediateArrayAddressIndex FINAL : public HExpression<2> { public: HIntermediateArrayAddressIndex(HInstruction* index, HInstruction* shift, uint32_t dex_pc) - : HExpression(DataType::Type::kInt32, SideEffects::None(), dex_pc) { + : HExpression(kIntermediateArrayAddressIndex, + DataType::Type::kInt32, + SideEffects::None(), + dex_pc) { SetRawInputAt(0, index); SetRawInputAt(1, shift); } -- cgit v1.2.3-59-g8ed1b