diff options
author | 2023-04-24 09:12:54 +0000 | |
---|---|---|
committer | 2023-04-25 08:46:29 +0000 | |
commit | cb008914fbc5a2334e3c00366afdb5f8af5a23ba (patch) | |
tree | 8d3776e8021da39b32ad377a5f0eda20c9490c93 /compiler/optimizing/nodes.h | |
parent | e834f1ec604e4c8e15dabfa9685de0eb646f3824 (diff) |
Don't enable intrinsic optimizations in debuggable runtime
We have optimizations that generate code inline for intrinsics instead
of leaving them as invoke for better performance. Some debug features
like method entry / exit or setting a breakpoint on intrinsics wouldn't
work if intrinsics are inlined. So disable those optimizations in
debuggable runtimes.
Also update 988-method-trace test to test intrinsics on JITed code.
Test: art/test.py -t 988
Bug: 279547861
Change-Id: Ic7c61d1b1541ff534faa24ccec5c2d0b574b0537
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r-- | compiler/optimizing/nodes.h | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index fc5d2196da..28112d176a 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -4756,7 +4756,7 @@ class HInvoke : public HVariableInputSizeInstruction { bool IsIntrinsic() const { return intrinsic_ != Intrinsics::kNone; } ArtMethod* GetResolvedMethod() const { return resolved_method_; } - void SetResolvedMethod(ArtMethod* method); + void SetResolvedMethod(ArtMethod* method, bool enable_intrinsic_opt); MethodReference GetMethodReference() const { return method_reference_; } @@ -4785,7 +4785,8 @@ class HInvoke : public HVariableInputSizeInstruction { MethodReference method_reference, ArtMethod* resolved_method, MethodReference resolved_method_reference, - InvokeType invoke_type) + InvokeType invoke_type, + bool enable_intrinsic_opt) : HVariableInputSizeInstruction( kind, return_type, @@ -4801,7 +4802,7 @@ class HInvoke : public HVariableInputSizeInstruction { intrinsic_optimizations_(0) { SetPackedField<InvokeTypeField>(invoke_type); SetPackedFlag<kFlagCanThrow>(true); - SetResolvedMethod(resolved_method); + SetResolvedMethod(resolved_method, enable_intrinsic_opt); } DEFAULT_COPY_CONSTRUCTOR(Invoke); @@ -4834,7 +4835,8 @@ class HInvokeUnresolved final : public HInvoke { method_reference, nullptr, MethodReference(nullptr, 0u), - invoke_type) { + invoke_type, + /* enable_intrinsic_opt= */ false) { } bool IsClonable() const override { return true; } @@ -4857,7 +4859,8 @@ class HInvokePolymorphic final : public HInvoke { // to pass intrinsic information to the HInvokePolymorphic node. ArtMethod* resolved_method, MethodReference resolved_method_reference, - dex::ProtoIndex proto_idx) + dex::ProtoIndex proto_idx, + bool enable_intrinsic_opt) : HInvoke(kInvokePolymorphic, allocator, number_of_arguments, @@ -4867,7 +4870,8 @@ class HInvokePolymorphic final : public HInvoke { method_reference, resolved_method, resolved_method_reference, - kPolymorphic), + kPolymorphic, + enable_intrinsic_opt), proto_idx_(proto_idx) { } @@ -4889,7 +4893,8 @@ class HInvokeCustom final : public HInvoke { uint32_t call_site_index, DataType::Type return_type, uint32_t dex_pc, - MethodReference method_reference) + MethodReference method_reference, + bool enable_intrinsic_opt) : HInvoke(kInvokeCustom, allocator, number_of_arguments, @@ -4899,7 +4904,8 @@ class HInvokeCustom final : public HInvoke { method_reference, /* resolved_method= */ nullptr, MethodReference(nullptr, 0u), - kStatic), + kStatic, + enable_intrinsic_opt), call_site_index_(call_site_index) { } @@ -4946,7 +4952,8 @@ class HInvokeStaticOrDirect final : public HInvoke { DispatchInfo dispatch_info, InvokeType invoke_type, MethodReference resolved_method_reference, - ClinitCheckRequirement clinit_check_requirement) + ClinitCheckRequirement clinit_check_requirement, + bool enable_intrinsic_opt) : HInvoke(kInvokeStaticOrDirect, allocator, number_of_arguments, @@ -4959,7 +4966,8 @@ class HInvokeStaticOrDirect final : public HInvoke { method_reference, resolved_method, resolved_method_reference, - invoke_type), + invoke_type, + enable_intrinsic_opt), dispatch_info_(dispatch_info) { SetPackedField<ClinitCheckRequirementField>(clinit_check_requirement); } @@ -5171,7 +5179,8 @@ class HInvokeVirtual final : public HInvoke { MethodReference method_reference, ArtMethod* resolved_method, MethodReference resolved_method_reference, - uint32_t vtable_index) + uint32_t vtable_index, + bool enable_intrinsic_opt) : HInvoke(kInvokeVirtual, allocator, number_of_arguments, @@ -5181,7 +5190,8 @@ class HInvokeVirtual final : public HInvoke { method_reference, resolved_method, resolved_method_reference, - kVirtual), + kVirtual, + enable_intrinsic_opt), vtable_index_(vtable_index) { } @@ -5233,7 +5243,8 @@ class HInvokeInterface final : public HInvoke { ArtMethod* resolved_method, MethodReference resolved_method_reference, uint32_t imt_index, - MethodLoadKind load_kind) + MethodLoadKind load_kind, + bool enable_intrinsic_opt) : HInvoke(kInvokeInterface, allocator, number_of_arguments + (NeedsCurrentMethod(load_kind) ? 1 : 0), @@ -5243,7 +5254,8 @@ class HInvokeInterface final : public HInvoke { method_reference, resolved_method, resolved_method_reference, - kInterface), + kInterface, + enable_intrinsic_opt), imt_index_(imt_index), hidden_argument_load_kind_(load_kind) { } |