Commit 71bffcce authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[compiler] Simplify SFI flag initialisation

Some post-compile flag setting was unnecessary, since those flags
originally came from the SFI they were being set on.

Also, DontOptimizeReason was never actually set, so we can remove it
entirely.

Change-Id: Ic07821fc20ba4e16a2bd8b9e8ac8c1b266aa4067
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3260510
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Victor Gomes <victorgomes@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarVictor Gomes <victorgomes@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77702}
parent 4593f3c6
......@@ -2205,16 +2205,6 @@ class FunctionLiteral final : public Expression {
}
FunctionKind kind() const;
bool dont_optimize() {
return dont_optimize_reason() != BailoutReason::kNoReason;
}
BailoutReason dont_optimize_reason() {
return DontOptimizeReasonField::decode(bit_field_);
}
void set_dont_optimize_reason(BailoutReason reason) {
bit_field_ = DontOptimizeReasonField::update(bit_field_, reason);
}
bool IsAnonymousFunctionDefinition() const {
return is_anonymous_expression();
}
......@@ -2290,7 +2280,6 @@ class FunctionLiteral final : public Expression {
Pretenure::encode(false) |
HasDuplicateParameters::encode(has_duplicate_parameters ==
kHasDuplicateParameters) |
DontOptimizeReasonField::encode(BailoutReason::kNoReason) |
RequiresInstanceMembersInitializer::encode(false) |
HasBracesField::encode(has_braces);
if (eager_compile_hint == kShouldEagerCompile) SetShouldEagerCompile();
......@@ -2300,10 +2289,8 @@ class FunctionLiteral final : public Expression {
Expression::NextBitField<FunctionSyntaxKind, 3>;
using Pretenure = FunctionSyntaxKindBits::Next<bool, 1>;
using HasDuplicateParameters = Pretenure::Next<bool, 1>;
using DontOptimizeReasonField =
HasDuplicateParameters::Next<BailoutReason, 8>;
using RequiresInstanceMembersInitializer =
DontOptimizeReasonField::Next<bool, 1>;
HasDuplicateParameters::Next<bool, 1>;
using ClassScopeHasPrivateBrandField =
RequiresInstanceMembersInitializer::Next<bool, 1>;
using HasStaticPrivateMethodsOrAccessorsField =
......
......@@ -638,16 +638,18 @@ void UpdateSharedFunctionFlagsAfterCompilation(FunctionLiteral* literal,
SharedFunctionInfo shared_info) {
DCHECK_EQ(shared_info.language_mode(), literal->language_mode());
// These fields are all initialised in ParseInfo from the SharedFunctionInfo,
// and then set back on the literal after parse. Hence, they should already
// match.
DCHECK_EQ(shared_info.requires_instance_members_initializer(),
literal->requires_instance_members_initializer());
DCHECK_EQ(shared_info.class_scope_has_private_brand(),
literal->class_scope_has_private_brand());
DCHECK_EQ(shared_info.has_static_private_methods_or_accessors(),
literal->has_static_private_methods_or_accessors());
shared_info.set_has_duplicate_parameters(literal->has_duplicate_parameters());
shared_info.UpdateAndFinalizeExpectedNofPropertiesFromEstimate(literal);
if (literal->dont_optimize_reason() != BailoutReason::kNoReason) {
shared_info.DisableOptimization(literal->dont_optimize_reason());
}
shared_info.set_class_scope_has_private_brand(
literal->class_scope_has_private_brand());
shared_info.set_has_static_private_methods_or_accessors(
literal->has_static_private_methods_or_accessors());
shared_info.SetScopeInfo(*literal->scope()->scope_info());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment