Opt compiler: Add a description to slow paths.
Change-Id: I22160d90de3fe0ab3e6a2acc440bda8daa00e0f0
diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h
index 5b0abd7..b1f1674 100644
--- a/compiler/optimizing/code_generator.h
+++ b/compiler/optimizing/code_generator.h
@@ -97,6 +97,8 @@
return saved_fpu_stack_offsets_[reg];
}
+ virtual const char* GetDescription() const = 0;
+
protected:
static constexpr size_t kMaximumNumberOfExpectedRegisters = 32;
static constexpr uint32_t kRegisterNotSaved = -1;
diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc
index f6ae452..7169679 100644
--- a/compiler/optimizing/code_generator_arm.cc
+++ b/compiler/optimizing/code_generator_arm.cc
@@ -69,6 +69,8 @@
QUICK_ENTRY_POINT(pThrowNullPointer), instruction_, instruction_->GetDexPc(), this);
}
+ const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathARM"; }
+
private:
HNullCheck* const instruction_;
DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathARM);
@@ -85,6 +87,8 @@
QUICK_ENTRY_POINT(pThrowDivZero), instruction_, instruction_->GetDexPc(), this);
}
+ const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathARM"; }
+
private:
HDivZeroCheck* const instruction_;
DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathARM);
@@ -118,6 +122,8 @@
return successor_;
}
+ const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathARM"; }
+
private:
HSuspendCheck* const instruction_;
// If not null, the block to branch to after the suspend check.
@@ -155,6 +161,8 @@
QUICK_ENTRY_POINT(pThrowArrayBounds), instruction_, instruction_->GetDexPc(), this);
}
+ const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathARM"; }
+
private:
HBoundsCheck* const instruction_;
const Location index_location_;
@@ -197,6 +205,8 @@
__ b(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathARM"; }
+
private:
// The class this slow path will load.
HLoadClass* const cls_;
@@ -236,6 +246,8 @@
__ b(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathARM"; }
+
private:
HLoadString* const instruction_;
@@ -286,6 +298,8 @@
__ b(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathARM"; }
+
private:
HInstruction* const instruction_;
const Location class_to_check_;
@@ -310,6 +324,8 @@
arm_codegen->InvokeRuntime(QUICK_ENTRY_POINT(pDeoptimize), instruction_, dex_pc, this);
}
+ const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathARM"; }
+
private:
HInstruction* const instruction_;
DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathARM);
diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc
index 3c8f117..7ec6b54 100644
--- a/compiler/optimizing/code_generator_arm64.cc
+++ b/compiler/optimizing/code_generator_arm64.cc
@@ -213,6 +213,8 @@
CheckEntrypointTypes<kQuickThrowArrayBounds, void, int32_t, int32_t>();
}
+ const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathARM64"; }
+
private:
HBoundsCheck* const instruction_;
const Location index_location_;
@@ -233,6 +235,8 @@
CheckEntrypointTypes<kQuickThrowDivZero, void, void>();
}
+ const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathARM64"; }
+
private:
HDivZeroCheck* const instruction_;
DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathARM64);
@@ -278,6 +282,8 @@
__ B(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathARM64"; }
+
private:
// The class this slow path will load.
HLoadClass* const cls_;
@@ -319,6 +325,8 @@
__ B(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathARM64"; }
+
private:
HLoadString* const instruction_;
@@ -337,6 +345,8 @@
CheckEntrypointTypes<kQuickThrowNullPointer, void, void>();
}
+ const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathARM64"; }
+
private:
HNullCheck* const instruction_;
@@ -373,6 +383,8 @@
return successor_;
}
+ const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathARM64"; }
+
private:
HSuspendCheck* const instruction_;
// If not null, the block to branch to after the suspend check.
@@ -429,6 +441,8 @@
__ B(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathARM64"; }
+
private:
HInstruction* const instruction_;
const Location class_to_check_;
@@ -453,6 +467,8 @@
arm64_codegen->InvokeRuntime(QUICK_ENTRY_POINT(pDeoptimize), instruction_, dex_pc, this);
}
+ const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathARM64"; }
+
private:
HInstruction* const instruction_;
DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathARM64);
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc
index e39a1c2..4d106c4 100644
--- a/compiler/optimizing/code_generator_x86.cc
+++ b/compiler/optimizing/code_generator_x86.cc
@@ -56,6 +56,8 @@
RecordPcInfo(codegen, instruction_, instruction_->GetDexPc());
}
+ const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathX86"; }
+
private:
HNullCheck* const instruction_;
DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathX86);
@@ -71,6 +73,8 @@
RecordPcInfo(codegen, instruction_, instruction_->GetDexPc());
}
+ const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathX86"; }
+
private:
HDivZeroCheck* const instruction_;
DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathX86);
@@ -90,6 +94,8 @@
__ jmp(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "DivRemMinusOneSlowPathX86"; }
+
private:
Register reg_;
bool is_div_;
@@ -122,6 +128,8 @@
RecordPcInfo(codegen, instruction_, instruction_->GetDexPc());
}
+ const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathX86"; }
+
private:
HBoundsCheck* const instruction_;
const Location index_location_;
@@ -158,6 +166,8 @@
return successor_;
}
+ const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathX86"; }
+
private:
HSuspendCheck* const instruction_;
HBasicBlock* const successor_;
@@ -188,6 +198,8 @@
__ jmp(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathX86"; }
+
private:
HLoadString* const instruction_;
@@ -228,6 +240,8 @@
__ jmp(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathX86"; }
+
private:
// The class this slow path will load.
HLoadClass* const cls_;
@@ -293,6 +307,8 @@
__ jmp(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathX86"; }
+
private:
HInstruction* const instruction_;
const Location class_to_check_;
@@ -318,6 +334,8 @@
codegen->RecordPcInfo(instruction_, dex_pc, this);
}
+ const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathX86"; }
+
private:
HInstruction* const instruction_;
DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathX86);
diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc
index bfc827d..e64540b 100644
--- a/compiler/optimizing/code_generator_x86_64.cc
+++ b/compiler/optimizing/code_generator_x86_64.cc
@@ -59,6 +59,8 @@
RecordPcInfo(codegen, instruction_, instruction_->GetDexPc());
}
+ const char* GetDescription() const OVERRIDE { return "NullCheckSlowPathX86_64"; }
+
private:
HNullCheck* const instruction_;
DISALLOW_COPY_AND_ASSIGN(NullCheckSlowPathX86_64);
@@ -75,6 +77,8 @@
RecordPcInfo(codegen, instruction_, instruction_->GetDexPc());
}
+ const char* GetDescription() const OVERRIDE { return "DivZeroCheckSlowPathX86_64"; }
+
private:
HDivZeroCheck* const instruction_;
DISALLOW_COPY_AND_ASSIGN(DivZeroCheckSlowPathX86_64);
@@ -105,6 +109,8 @@
__ jmp(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "DivRemMinusOneSlowPathX86_64"; }
+
private:
const CpuRegister cpu_reg_;
const Primitive::Type type_;
@@ -140,6 +146,8 @@
return successor_;
}
+ const char* GetDescription() const OVERRIDE { return "SuspendCheckSlowPathX86_64"; }
+
private:
HSuspendCheck* const instruction_;
HBasicBlock* const successor_;
@@ -174,6 +182,8 @@
RecordPcInfo(codegen, instruction_, instruction_->GetDexPc());
}
+ const char* GetDescription() const OVERRIDE { return "BoundsCheckSlowPathX86_64"; }
+
private:
HBoundsCheck* const instruction_;
const Location index_location_;
@@ -217,6 +227,8 @@
__ jmp(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "LoadClassSlowPathX86_64"; }
+
private:
// The class this slow path will load.
HLoadClass* const cls_;
@@ -257,6 +269,8 @@
__ jmp(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "LoadStringSlowPathX86_64"; }
+
private:
HLoadString* const instruction_;
@@ -312,6 +326,8 @@
__ jmp(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "TypeCheckSlowPathX86_64"; }
+
private:
HInstruction* const instruction_;
const Location class_to_check_;
@@ -337,6 +353,8 @@
codegen->RecordPcInfo(instruction_, dex_pc, this);
}
+ const char* GetDescription() const OVERRIDE { return "DeoptimizationSlowPathX86_64"; }
+
private:
HInstruction* const instruction_;
DISALLOW_COPY_AND_ASSIGN(DeoptimizationSlowPathX86_64);
diff --git a/compiler/optimizing/intrinsics_arm.cc b/compiler/optimizing/intrinsics_arm.cc
index 749bedf..71fadfb 100644
--- a/compiler/optimizing/intrinsics_arm.cc
+++ b/compiler/optimizing/intrinsics_arm.cc
@@ -121,6 +121,8 @@
__ b(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "IntrinsicSlowPathARM"; }
+
private:
// The instruction where this slow path is happening.
HInvoke* const invoke_;
diff --git a/compiler/optimizing/intrinsics_arm64.cc b/compiler/optimizing/intrinsics_arm64.cc
index c108ad5..8bcb88b 100644
--- a/compiler/optimizing/intrinsics_arm64.cc
+++ b/compiler/optimizing/intrinsics_arm64.cc
@@ -130,6 +130,8 @@
__ B(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "IntrinsicSlowPathARM64"; }
+
private:
// The instruction where this slow path is happening.
HInvoke* const invoke_;
diff --git a/compiler/optimizing/intrinsics_x86.cc b/compiler/optimizing/intrinsics_x86.cc
index 424ac7c..b04cc5c 100644
--- a/compiler/optimizing/intrinsics_x86.cc
+++ b/compiler/optimizing/intrinsics_x86.cc
@@ -158,6 +158,8 @@
__ jmp(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "IntrinsicSlowPathX86"; }
+
private:
// The instruction where this slow path is happening.
HInvoke* const invoke_;
diff --git a/compiler/optimizing/intrinsics_x86_64.cc b/compiler/optimizing/intrinsics_x86_64.cc
index 8915314..888c7b8 100644
--- a/compiler/optimizing/intrinsics_x86_64.cc
+++ b/compiler/optimizing/intrinsics_x86_64.cc
@@ -149,6 +149,8 @@
__ jmp(GetExitLabel());
}
+ const char* GetDescription() const OVERRIDE { return "IntrinsicSlowPathX86_64"; }
+
private:
// The instruction where this slow path is happening.
HInvoke* const invoke_;