Commit e5909eca authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

Change static constant to static method

Introduced in a8a1776e. The chromium build checks against an explicit
list of compilation units with static initializers, thus it's easier
to use

 static Constant() { ... }

than

 static const kConstant;

Bug: v8:8888
Change-Id: I2625130dd3d92607b46c0cc615623907149f800e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2413255
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Maya Lekova <mslekova@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69931}
parent 9fa28082
......@@ -74,7 +74,9 @@ class BytecodeGraphBuilder {
return native_context_independent();
}
static const JSTypeHintLowering::LoweringResult kNoChange;
static JSTypeHintLowering::LoweringResult NoChange() {
return JSTypeHintLowering::LoweringResult::NoChange();
}
bool CanApplyTypeHintLowering(IrOpcode::Value opcode) const {
return !generate_full_feedback_collection() ||
!IrOpcode::IsFeedbackCollectingOpcode(opcode);
......@@ -482,9 +484,6 @@ class BytecodeGraphBuilder {
DISALLOW_COPY_AND_ASSIGN(BytecodeGraphBuilder);
};
const JSTypeHintLowering::LoweringResult BytecodeGraphBuilder::kNoChange =
JSTypeHintLowering::LoweringResult::NoChange();
// The abstract execution environment simulates the content of the interpreter
// register file. The environment performs SSA-renaming of all tracked nodes at
// split and merge points in the control flow.
......@@ -4085,7 +4084,7 @@ JSTypeHintLowering::LoweringResult
BytecodeGraphBuilder::TryBuildSimplifiedUnaryOp(const Operator* op,
Node* operand,
FeedbackSlot slot) {
if (!CanApplyTypeHintLowering(op)) return kNoChange;
if (!CanApplyTypeHintLowering(op)) return NoChange();
Node* effect = environment()->GetEffectDependency();
Node* control = environment()->GetControlDependency();
JSTypeHintLowering::LoweringResult result =
......@@ -4099,7 +4098,7 @@ JSTypeHintLowering::LoweringResult
BytecodeGraphBuilder::TryBuildSimplifiedBinaryOp(const Operator* op, Node* left,
Node* right,
FeedbackSlot slot) {
if (!CanApplyTypeHintLowering(op)) return kNoChange;
if (!CanApplyTypeHintLowering(op)) return NoChange();
Node* effect = environment()->GetEffectDependency();
Node* control = environment()->GetControlDependency();
JSTypeHintLowering::LoweringResult result =
......@@ -4114,7 +4113,7 @@ BytecodeGraphBuilder::TryBuildSimplifiedForInNext(Node* receiver,
Node* cache_array,
Node* cache_type, Node* index,
FeedbackSlot slot) {
if (!CanApplyTypeHintLowering(IrOpcode::kJSForInNext)) return kNoChange;
if (!CanApplyTypeHintLowering(IrOpcode::kJSForInNext)) return NoChange();
Node* effect = environment()->GetEffectDependency();
Node* control = environment()->GetControlDependency();
JSTypeHintLowering::LoweringResult result =
......@@ -4127,7 +4126,7 @@ BytecodeGraphBuilder::TryBuildSimplifiedForInNext(Node* receiver,
JSTypeHintLowering::LoweringResult
BytecodeGraphBuilder::TryBuildSimplifiedForInPrepare(Node* enumerator,
FeedbackSlot slot) {
if (!CanApplyTypeHintLowering(IrOpcode::kJSForInPrepare)) return kNoChange;
if (!CanApplyTypeHintLowering(IrOpcode::kJSForInPrepare)) return NoChange();
Node* effect = environment()->GetEffectDependency();
Node* control = environment()->GetControlDependency();
JSTypeHintLowering::LoweringResult result =
......@@ -4140,7 +4139,7 @@ BytecodeGraphBuilder::TryBuildSimplifiedForInPrepare(Node* enumerator,
JSTypeHintLowering::LoweringResult
BytecodeGraphBuilder::TryBuildSimplifiedToNumber(Node* value,
FeedbackSlot slot) {
if (!CanApplyTypeHintLowering(IrOpcode::kJSToNumber)) return kNoChange;
if (!CanApplyTypeHintLowering(IrOpcode::kJSToNumber)) return NoChange();
Node* effect = environment()->GetEffectDependency();
Node* control = environment()->GetControlDependency();
JSTypeHintLowering::LoweringResult result =
......@@ -4152,7 +4151,7 @@ BytecodeGraphBuilder::TryBuildSimplifiedToNumber(Node* value,
JSTypeHintLowering::LoweringResult BytecodeGraphBuilder::TryBuildSimplifiedCall(
const Operator* op, Node* const* args, int arg_count, FeedbackSlot slot) {
if (!CanApplyTypeHintLowering(op)) return kNoChange;
if (!CanApplyTypeHintLowering(op)) return NoChange();
Node* effect = environment()->GetEffectDependency();
Node* control = environment()->GetControlDependency();
JSTypeHintLowering::LoweringResult result =
......@@ -4167,7 +4166,7 @@ BytecodeGraphBuilder::TryBuildSimplifiedConstruct(const Operator* op,
Node* const* args,
int arg_count,
FeedbackSlot slot) {
if (!CanApplyTypeHintLowering(op)) return kNoChange;
if (!CanApplyTypeHintLowering(op)) return NoChange();
Node* effect = environment()->GetEffectDependency();
Node* control = environment()->GetControlDependency();
JSTypeHintLowering::LoweringResult result =
......@@ -4182,7 +4181,7 @@ BytecodeGraphBuilder::TryBuildSimplifiedGetIterator(const Operator* op,
Node* receiver,
FeedbackSlot load_slot,
FeedbackSlot call_slot) {
if (!CanApplyTypeHintLowering(op)) return kNoChange;
if (!CanApplyTypeHintLowering(op)) return NoChange();
Node* effect = environment()->GetEffectDependency();
Node* control = environment()->GetControlDependency();
JSTypeHintLowering::LoweringResult early_reduction =
......@@ -4196,7 +4195,7 @@ JSTypeHintLowering::LoweringResult
BytecodeGraphBuilder::TryBuildSimplifiedLoadNamed(const Operator* op,
Node* receiver,
FeedbackSlot slot) {
if (!CanApplyTypeHintLowering(op)) return kNoChange;
if (!CanApplyTypeHintLowering(op)) return NoChange();
Node* effect = environment()->GetEffectDependency();
Node* control = environment()->GetControlDependency();
JSTypeHintLowering::LoweringResult early_reduction =
......@@ -4210,7 +4209,7 @@ JSTypeHintLowering::LoweringResult
BytecodeGraphBuilder::TryBuildSimplifiedLoadKeyed(const Operator* op,
Node* receiver, Node* key,
FeedbackSlot slot) {
if (!CanApplyTypeHintLowering(op)) return kNoChange;
if (!CanApplyTypeHintLowering(op)) return NoChange();
Node* effect = environment()->GetEffectDependency();
Node* control = environment()->GetControlDependency();
JSTypeHintLowering::LoweringResult result =
......@@ -4224,7 +4223,7 @@ JSTypeHintLowering::LoweringResult
BytecodeGraphBuilder::TryBuildSimplifiedStoreNamed(const Operator* op,
Node* receiver, Node* value,
FeedbackSlot slot) {
if (!CanApplyTypeHintLowering(op)) return kNoChange;
if (!CanApplyTypeHintLowering(op)) return NoChange();
Node* effect = environment()->GetEffectDependency();
Node* control = environment()->GetControlDependency();
JSTypeHintLowering::LoweringResult result =
......@@ -4239,7 +4238,7 @@ BytecodeGraphBuilder::TryBuildSimplifiedStoreKeyed(const Operator* op,
Node* receiver, Node* key,
Node* value,
FeedbackSlot slot) {
if (!CanApplyTypeHintLowering(op)) return kNoChange;
if (!CanApplyTypeHintLowering(op)) return NoChange();
Node* effect = environment()->GetEffectDependency();
Node* control = environment()->GetControlDependency();
JSTypeHintLowering::LoweringResult result =
......
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