summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.h
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2021-10-01 09:26:56 +0100
committer Treehugger Robot <treehugger-gerrit@google.com> 2021-10-26 13:51:31 +0000
commitd690f8ae8f8e2675bc52089a83ac18c749f8e6d2 (patch)
treedac10b65d901cad87d6dbb7b48453f6da214a76f /compiler/optimizing/nodes.h
parente91a954ee350cbc0b311f342c90697191e1ae495 (diff)
Inline across dex files for bootclaspath's methods
We can relax a bit the restriction for not inlining across dexfiles when we are AoT compiling and we need an environment. There's an added new restriction related to BSS entries. We could potentially inline across dex files for those cases too but are left to be solved in follow-up CLs. Bug: 154012332 Test: ART tests Change-Id: I5122b26c79b3e30d2643c0ccc05d595a0047953e
Diffstat (limited to 'compiler/optimizing/nodes.h')
-rw-r--r--compiler/optimizing/nodes.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index 06fb88e837..6ef29bf93e 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -2286,6 +2286,9 @@ class HInstruction : public ArenaObject<kArenaAllocInstruction> {
}
virtual bool NeedsEnvironment() const { return false; }
+ virtual bool NeedsBss() const {
+ return false;
+ }
uint32_t GetDexPc() const { return dex_pc_; }
@@ -4882,6 +4885,9 @@ class HInvokeStaticOrDirect final : public HInvoke {
}
bool IsClonable() const override { return true; }
+ bool NeedsBss() const override {
+ return GetMethodLoadKind() == MethodLoadKind::kBssEntry;
+ }
void SetDispatchInfo(DispatchInfo dispatch_info) {
bool had_current_method_input = HasCurrentMethodInput();
@@ -5167,6 +5173,9 @@ class HInvokeInterface final : public HInvoke {
}
bool IsClonable() const override { return true; }
+ bool NeedsBss() const override {
+ return GetHiddenArgumentLoadKind() == MethodLoadKind::kBssEntry;
+ }
bool CanDoImplicitNullCheckOn(HInstruction* obj) const override {
// TODO: Add implicit null checks in intrinsics.
@@ -6813,6 +6822,12 @@ class HLoadClass final : public HInstruction {
bool NeedsEnvironment() const override {
return CanCallRuntime();
}
+ bool NeedsBss() const override {
+ LoadKind load_kind = GetLoadKind();
+ return load_kind == LoadKind::kBssEntry ||
+ load_kind == LoadKind::kBssEntryPublic ||
+ load_kind == LoadKind::kBssEntryPackage;
+ }
void SetMustGenerateClinitCheck(bool generate_clinit_check) {
SetPackedFlag<kFlagGenerateClInitCheck>(generate_clinit_check);
@@ -7010,6 +7025,9 @@ class HLoadString final : public HInstruction {
}
bool IsClonable() const override { return true; }
+ bool NeedsBss() const override {
+ return GetLoadKind() == LoadKind::kBssEntry;
+ }
void SetLoadKind(LoadKind load_kind);