Commit d085534f authored by Ng Zhi An's avatar Ng Zhi An Committed by V8 LUCI CQ

[compiler] Fix -Wshadow warnings in js-inlining

Bug: v8:12244,v8:12245
Change-Id: I2aaa01215276cbfdf269b2e60dc2482d0aebc0dc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3269174Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77800}
parent 4dc59509
......@@ -110,13 +110,13 @@ JSInliningHeuristic::Candidate JSInliningHeuristic::CollectFunctions(
return out;
}
for (int n = 0; n < value_input_count; ++n) {
HeapObjectMatcher m(callee->InputAt(n));
if (!m.HasResolvedValue() || !m.Ref(broker()).IsJSFunction()) {
HeapObjectMatcher m2(callee->InputAt(n));
if (!m2.HasResolvedValue() || !m2.Ref(broker()).IsJSFunction()) {
out.num_functions = 0;
return out;
}
out.functions[n] = m.Ref(broker()).AsJSFunction();
out.functions[n] = m2.Ref(broker()).AsJSFunction();
JSFunctionRef function = out.functions[n].value();
if (CanConsiderForInlining(broker(), function)) {
out.bytecode[n] = function.shared().GetBytecodeArray();
......@@ -602,7 +602,7 @@ bool JSInliningHeuristic::TryReuseDispatch(Node* node, Node* callee,
// frame state, and change all the uses of the callee to the constant
// callee.
Node* target = callee->InputAt(i);
Node* effect = effect_phi->InputAt(i);
Node* effect_phi_effect = effect_phi->InputAt(i);
Node* control = merge->InputAt(i);
if (checkpoint) {
......@@ -610,8 +610,8 @@ bool JSInliningHeuristic::TryReuseDispatch(Node* node, Node* callee,
FrameState new_checkpoint_state = DuplicateFrameStateAndRename(
FrameState{checkpoint_state}, callee, target,
(i == num_calls - 1) ? kChangeInPlace : kCloneState);
effect = graph()->NewNode(checkpoint->op(), new_checkpoint_state, effect,
control);
effect_phi_effect = graph()->NewNode(
checkpoint->op(), new_checkpoint_state, effect_phi_effect, control);
}
// Duplicate the call.
......@@ -620,7 +620,7 @@ bool JSInliningHeuristic::TryReuseDispatch(Node* node, Node* callee,
(i == num_calls - 1) ? kChangeInPlace : kCloneState);
inputs[0] = target;
inputs[input_count - 3] = new_lazy_frame_state;
inputs[input_count - 2] = effect;
inputs[input_count - 2] = effect_phi_effect;
inputs[input_count - 1] = control;
calls[i] = if_successes[i] =
graph()->NewNode(node->op(), input_count, inputs);
......@@ -765,13 +765,13 @@ Reduction JSInliningHeuristic::InlineCandidate(Candidate const& candidate,
if (candidate.can_inline_function[i] &&
(small_function || total_inlined_bytecode_size_ <
max_inlined_bytecode_size_cumulative_)) {
Node* node = calls[i];
Reduction const reduction = inliner_.ReduceJSCall(node);
Node* call = calls[i];
Reduction const reduction = inliner_.ReduceJSCall(call);
if (reduction.Changed()) {
total_inlined_bytecode_size_ += candidate.bytecode[i]->length();
// Killing the call node is not strictly necessary, but it is safer to
// make sure we do not resurrect the node.
node->Kill();
call->Kill();
}
}
}
......
......@@ -636,17 +636,17 @@ Reduction JSInliner::ReduceJSCall(Node* node) {
// instantiation but before the invocation (i.e. inside {JSConstructStub}
// where execution continues at {construct_stub_create_deopt_pc_offset}).
Node* receiver = jsgraph()->TheHoleConstant(); // Implicit receiver.
Node* context = NodeProperties::GetContextInput(node);
Node* caller_context = NodeProperties::GetContextInput(node);
if (NeedsImplicitReceiver(*shared_info)) {
Effect effect = n.effect();
Control control = n.control();
Node* frame_state_inside = CreateArtificialFrameState(
node, frame_state, n.ArgumentCount(),
BytecodeOffset::ConstructStubCreate(), FrameStateType::kConstructStub,
*shared_info, context);
*shared_info, caller_context);
Node* create =
graph()->NewNode(javascript()->Create(), call.target(), new_target,
context, frame_state_inside, effect, control);
caller_context, frame_state_inside, effect, control);
uncaught_subcalls.push_back(create); // Adds {IfSuccess} & {IfException}.
NodeProperties::ReplaceControlInput(node, create);
NodeProperties::ReplaceEffectInput(node, create);
......@@ -675,11 +675,11 @@ Reduction JSInliner::ReduceJSCall(Node* node) {
graph()->NewNode(common()->IfTrue(), branch_is_receiver);
Node* branch_is_receiver_false =
graph()->NewNode(common()->IfFalse(), branch_is_receiver);
branch_is_receiver_false =
graph()->NewNode(javascript()->CallRuntime(
branch_is_receiver_false = graph()->NewNode(
javascript()->CallRuntime(
Runtime::kThrowConstructorReturnedNonObject),
context, NodeProperties::GetFrameStateInput(node),
node, branch_is_receiver_false);
caller_context, NodeProperties::GetFrameStateInput(node), node,
branch_is_receiver_false);
uncaught_subcalls.push_back(branch_is_receiver_false);
branch_is_receiver_false =
graph()->NewNode(common()->Throw(), branch_is_receiver_false,
......@@ -698,7 +698,7 @@ Reduction JSInliner::ReduceJSCall(Node* node) {
frame_state = CreateArtificialFrameState(
node, frame_state, n.ArgumentCount(),
BytecodeOffset::ConstructStubInvoke(), FrameStateType::kConstructStub,
*shared_info, context);
*shared_info, caller_context);
}
// Insert a JSConvertReceiver node for sloppy callees. Note that the context
......
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