summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_builder.cc
diff options
context:
space:
mode:
author Mythri Alle <mythria@google.com> 2021-11-02 14:52:30 +0000
committer Mythri Alle <mythria@google.com> 2021-11-09 14:22:50 +0000
commit5097f83c4719a76fdfab1044ab745273841aca45 (patch)
treeadca5e53b3ef1807aa7dd9c3465ac3305fedc4fd /compiler/optimizing/instruction_builder.cc
parentd1e6bea2c502a72dc5d0c3d16deb591ba61c9d76 (diff)
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
Diffstat (limited to 'compiler/optimizing/instruction_builder.cc')
-rw-r--r--compiler/optimizing/instruction_builder.cc11
1 files changed, 11 insertions, 0 deletions
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;