summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Mythri Alle <mythria@google.com> 2023-12-19 17:40:33 +0000
committer Mythri Alle <mythria@google.com> 2023-12-21 12:19:34 +0000
commita4fd8bb141fdb877bfd0d69700dad4e2859634a7 (patch)
tree8d95ef1ba0a2458786506e6b70ca0a5d48b8ac80 /compiler/optimizing/nodes.h
parente170e989bad0bcc3d178a679a692523e4b18786e (diff)
Use GetCurrentMethod to get the current method when tracing
The current method is passed in a register and we can use the GetCurrentMethod as an input to the method entry / exit hooks. In most cases we may just have the current method in the register on method entry. Bug: 259258187 Test: art/test.py Change-Id: Iea75f41b0ec5ebbc2aef857c84f39846b594e8e7
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index d84ff7be73..fceff877f1 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -3059,10 +3059,12 @@ class HExpression<0> : public HInstruction {
friend class SsaBuilder;
};
-class HMethodEntryHook : public HExpression<0> {
+class HMethodEntryHook : public HExpression<1> {
public:
- explicit HMethodEntryHook(uint32_t dex_pc)
- : HExpression(kMethodEntryHook, SideEffects::All(), dex_pc) {}
+ HMethodEntryHook(HInstruction* method, uint32_t dex_pc)
+ : HExpression(kMethodEntryHook, SideEffects::All(), dex_pc) {
+ SetRawInputAt(0, method);
+ }
bool NeedsEnvironment() const override {
return true;
@@ -3076,11 +3078,12 @@ class HMethodEntryHook : public HExpression<0> {
DEFAULT_COPY_CONSTRUCTOR(MethodEntryHook);
};
-class HMethodExitHook : public HExpression<1> {
+class HMethodExitHook : public HExpression<2> {
public:
- HMethodExitHook(HInstruction* value, uint32_t dex_pc)
+ HMethodExitHook(HInstruction* method, HInstruction* value, uint32_t dex_pc)
: HExpression(kMethodExitHook, SideEffects::All(), dex_pc) {
- SetRawInputAt(0, value);
+ SetRawInputAt(0, method);
+ SetRawInputAt(1, value);
}
bool NeedsEnvironment() const override {