Skip to content

Commit 15e8c12

Browse files
dcharkescommit-bot@chromium.org
authored andcommitted
[vm] Do not inline force-optimized functions
Change-Id: I11b5e799f46be7631b148c479ccc19fc507cf56a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120660 Reviewed-by: Samir Jindel <[email protected]> Reviewed-by: Martin Kustermann <[email protected]>
1 parent 8f477fd commit 15e8c12

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

runtime/vm/object.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6623,6 +6623,15 @@ void Function::SetIsOptimizable(bool value) const {
66236623
}
66246624

66256625
bool Function::CanBeInlined() const {
6626+
// Our force-optimized functions cannot deoptimize to an unoptimized frame.
6627+
// If the instructions of the force-optimized function body get moved via
6628+
// code motion, we might attempt do deoptimize a frame where the force-
6629+
// optimized function has only partially finished. Since force-optimized
6630+
// functions cannot deoptimize to unoptimized frames we prevent them from
6631+
// being inlined (for now).
6632+
if (ForceOptimize()) {
6633+
return false;
6634+
}
66266635
#if defined(PRODUCT)
66276636
return is_inlinable() && !is_external() && !is_generated_body();
66286637
#else

runtime/vm/object.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5292,9 +5292,6 @@ class Code : public Object {
52925292
return ForceOptimizedBit::decode(raw_ptr()->state_bits_);
52935293
}
52945294
void set_is_force_optimized(bool value) const;
5295-
static bool IsForceOptimized(RawCode* code) {
5296-
return Code::ForceOptimizedBit::decode(code->ptr()->state_bits_);
5297-
}
52985295

52995296
bool is_alive() const { return AliveBit::decode(raw_ptr()->state_bits_); }
53005297
void set_is_alive(bool value) const;

0 commit comments

Comments
 (0)