From 9922f00cf68aac69209216a0726a45eb6338763c Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Mon, 8 Jun 2020 15:05:15 +0100 Subject: arm/arm64: Clean up intrinsic slow paths. Generalize and use the slow path template IntrinsicSlowPath from intrinsics_utils.h. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Test: aosp_taimen-userdebug boot image is unchanged. Change-Id: Ia8fa4e1b31c1f190fc5f02671336caec15e4cf4d --- compiler/optimizing/intrinsics_utils.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'compiler/optimizing/intrinsics_utils.h') diff --git a/compiler/optimizing/intrinsics_utils.h b/compiler/optimizing/intrinsics_utils.h index 41947f1ccd..e24d541c96 100644 --- a/compiler/optimizing/intrinsics_utils.h +++ b/compiler/optimizing/intrinsics_utils.h @@ -17,6 +17,7 @@ #ifndef ART_COMPILER_OPTIMIZING_INTRINSICS_UTILS_H_ #define ART_COMPILER_OPTIMIZING_INTRINSICS_UTILS_H_ +#include "base/casts.h" #include "base/macros.h" #include "code_generator.h" #include "locations.h" @@ -36,10 +37,12 @@ namespace art { // Note: If an invoke wasn't sharpened, we will put down an invoke-virtual here. That's potentially // sub-optimal (compared to a direct pointer call), but this is a slow-path. -template -class IntrinsicSlowPath : public SlowPathCode { +template +class IntrinsicSlowPath : public TSlowPathCode { public: - explicit IntrinsicSlowPath(HInvoke* invoke) : SlowPathCode(invoke), invoke_(invoke) { } + explicit IntrinsicSlowPath(HInvoke* invoke) : TSlowPathCode(invoke), invoke_(invoke) { } Location MoveArguments(CodeGenerator* codegen) { TDexCallingConvention calling_convention_visitor; @@ -48,10 +51,10 @@ class IntrinsicSlowPath : public SlowPathCode { } void EmitNativeCode(CodeGenerator* codegen) override { - Assembler* assembler = codegen->GetAssembler(); - assembler->Bind(GetEntryLabel()); + TAssembler* assembler = down_cast(codegen->GetAssembler()); + assembler->Bind(this->GetEntryLabel()); - SaveLiveRegisters(codegen, invoke_->GetLocations()); + this->SaveLiveRegisters(codegen, invoke_->GetLocations()); Location method_loc = MoveArguments(codegen); @@ -69,8 +72,8 @@ class IntrinsicSlowPath : public SlowPathCode { codegen->MoveFromReturnRegister(out, invoke_->GetType()); } - RestoreLiveRegisters(codegen, invoke_->GetLocations()); - assembler->Jump(GetExitLabel()); + this->RestoreLiveRegisters(codegen, invoke_->GetLocations()); + assembler->Jump(this->GetExitLabel()); } const char* GetDescription() const override { return "IntrinsicSlowPath"; } -- cgit v1.2.3-59-g8ed1b