From 5097f83c4719a76fdfab1044ab745273841aca45 Mon Sep 17 00:00:00 2001 From: Mythri Alle Date: Tue, 2 Nov 2021 14:52:30 +0000 Subject: Revert^2 "Add support for calling entry / exit hooks directly from JIT code"" This reverts commit 72be14ed06b76cd0e83392145cec9025ff43d174. Reason for revert: A reland of commit 2d4feeb67912d64b9e980e6687794826a5c22f9d with a fix for no-image tests Change-Id: I79f719f0d4d9b903db301a1636fde5689da35a29 --- compiler/optimizing/instruction_builder.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'compiler/optimizing/instruction_builder.cc') diff --git a/compiler/optimizing/instruction_builder.cc b/compiler/optimizing/instruction_builder.cc index 390a2bb0be..ed760f190d 100644 --- a/compiler/optimizing/instruction_builder.cc +++ b/compiler/optimizing/instruction_builder.cc @@ -372,6 +372,9 @@ bool HInstructionBuilder::Build() { if (current_block_->IsEntryBlock()) { InitializeParameters(); AppendInstruction(new (allocator_) HSuspendCheck(0u)); + if (graph_->IsDebuggable() && code_generator_->GetCompilerOptions().IsJitCompiler()) { + AppendInstruction(new (allocator_) HMethodEntryHook(0u)); + } AppendInstruction(new (allocator_) HGoto(0u)); continue; } else if (current_block_->IsExitBlock()) { @@ -822,10 +825,18 @@ void HInstructionBuilder::BuildReturn(const Instruction& instruction, compilation_stats_, MethodCompilationStat::kConstructorFenceGeneratedFinal); } + if (graph_->IsDebuggable() && code_generator_->GetCompilerOptions().IsJitCompiler()) { + // Return value is not used for void functions. We pass NullConstant to + // avoid special cases when generating code. + AppendInstruction(new (allocator_) HMethodExitHook(graph_->GetNullConstant(), dex_pc)); + } AppendInstruction(new (allocator_) HReturnVoid(dex_pc)); } else { DCHECK(!RequiresConstructorBarrier(dex_compilation_unit_)); HInstruction* value = LoadLocal(instruction.VRegA(), type); + if (graph_->IsDebuggable() && code_generator_->GetCompilerOptions().IsJitCompiler()) { + AppendInstruction(new (allocator_) HMethodExitHook(value, dex_pc)); + } AppendInstruction(new (allocator_) HReturn(value, dex_pc)); } current_block_ = nullptr; -- cgit v1.2.3-59-g8ed1b