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

[compiler] Fix -Wshadow warnings

Bug: v8:12244,v8:12245
Change-Id: I7f5067c9a329ac27bb4ec72d97a7509028ae648a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3269176Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77803}
parent 1b439747
...@@ -597,9 +597,10 @@ Reduction JSNativeContextSpecialization::ReduceJSHasInPrototypeChain( ...@@ -597,9 +597,10 @@ Reduction JSNativeContextSpecialization::ReduceJSHasInPrototypeChain(
InferHasInPrototypeChainResult result = InferHasInPrototypeChainResult result =
InferHasInPrototypeChain(value, effect, m.Ref(broker())); InferHasInPrototypeChain(value, effect, m.Ref(broker()));
if (result != kMayBeInPrototypeChain) { if (result != kMayBeInPrototypeChain) {
Node* value = jsgraph()->BooleanConstant(result == kIsInPrototypeChain); Node* result_in_chain =
ReplaceWithValue(node, value); jsgraph()->BooleanConstant(result == kIsInPrototypeChain);
return Replace(value); ReplaceWithValue(node, result_in_chain);
return Replace(result_in_chain);
} }
} }
...@@ -1130,19 +1131,19 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess( ...@@ -1130,19 +1131,19 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
} }
// Either infer maps from the graph or use the feedback. // Either infer maps from the graph or use the feedback.
ZoneVector<MapRef> lookup_start_object_maps(zone()); ZoneVector<MapRef> inferred_maps(zone());
if (!InferMaps(lookup_start_object, effect, &lookup_start_object_maps)) { if (!InferMaps(lookup_start_object, effect, &inferred_maps)) {
for (const MapRef& map : feedback.maps()) { for (const MapRef& map : feedback.maps()) {
lookup_start_object_maps.push_back(map); inferred_maps.push_back(map);
} }
} }
RemoveImpossibleMaps(lookup_start_object, &lookup_start_object_maps); RemoveImpossibleMaps(lookup_start_object, &inferred_maps);
// Check if we have an access o.x or o.x=v where o is the target native // Check if we have an access o.x or o.x=v where o is the target native
// contexts' global proxy, and turn that into a direct access to the // contexts' global proxy, and turn that into a direct access to the
// corresponding global object instead. // corresponding global object instead.
if (lookup_start_object_maps.size() == 1) { if (inferred_maps.size() == 1) {
MapRef lookup_start_object_map = lookup_start_object_maps[0]; MapRef lookup_start_object_map = inferred_maps[0];
if (lookup_start_object_map.equals( if (lookup_start_object_map.equals(
native_context().global_proxy_object().map())) { native_context().global_proxy_object().map())) {
if (!native_context().GlobalIsDetached()) { if (!native_context().GlobalIsDetached()) {
...@@ -1161,7 +1162,7 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess( ...@@ -1161,7 +1162,7 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
ZoneVector<PropertyAccessInfo> access_infos(zone()); ZoneVector<PropertyAccessInfo> access_infos(zone());
{ {
ZoneVector<PropertyAccessInfo> access_infos_for_feedback(zone()); ZoneVector<PropertyAccessInfo> access_infos_for_feedback(zone());
for (const MapRef& map : lookup_start_object_maps) { for (const MapRef& map : inferred_maps) {
if (map.is_deprecated()) continue; if (map.is_deprecated()) continue;
PropertyAccessInfo access_info = broker()->GetPropertyAccessInfo( PropertyAccessInfo access_info = broker()->GetPropertyAccessInfo(
map, feedback.name(), access_mode, dependencies()); map, feedback.name(), access_mode, dependencies());
......
...@@ -325,9 +325,8 @@ JSTypeHintLowering::LoweringResult JSTypeHintLowering::ReduceUnaryOperation( ...@@ -325,9 +325,8 @@ JSTypeHintLowering::LoweringResult JSTypeHintLowering::ReduceUnaryOperation(
if (!node) { if (!node) {
if (jsgraph()->machine()->Is64()) { if (jsgraph()->machine()->Is64()) {
if (GetBinaryOperationHint(slot) == BinaryOperationHint::kBigInt) { if (GetBinaryOperationHint(slot) == BinaryOperationHint::kBigInt) {
const Operator* op = op = jsgraph()->simplified()->SpeculativeBigIntNegate(
jsgraph()->simplified()->SpeculativeBigIntNegate( BigIntOperationHint::kBigInt);
BigIntOperationHint::kBigInt);
node = jsgraph()->graph()->NewNode(op, operand, effect, control); node = jsgraph()->graph()->NewNode(op, operand, effect, control);
} }
} }
......
...@@ -1197,7 +1197,7 @@ Reduction JSTypedLowering::ReduceJSHasInPrototypeChain(Node* node) { ...@@ -1197,7 +1197,7 @@ Reduction JSTypedLowering::ReduceJSHasInPrototypeChain(Node* node) {
// If {value} cannot be a receiver, then it cannot have {prototype} in // If {value} cannot be a receiver, then it cannot have {prototype} in
// it's prototype chain (all Primitive values have a null prototype). // it's prototype chain (all Primitive values have a null prototype).
if (value_type.Is(Type::Primitive())) { if (value_type.Is(Type::Primitive())) {
Node* value = jsgraph()->FalseConstant(); value = jsgraph()->FalseConstant();
ReplaceWithValue(node, value, effect, control); ReplaceWithValue(node, value, effect, control);
return Replace(value); return Replace(value);
} }
...@@ -1789,7 +1789,6 @@ Reduction JSTypedLowering::ReduceJSCall(Node* node) { ...@@ -1789,7 +1789,6 @@ Reduction JSTypedLowering::ReduceJSCall(Node* node) {
// Patch {node} to a direct code object call. // Patch {node} to a direct code object call.
Callable callable = Callable callable =
Builtins::CallableFor(isolate(), shared->builtin_id()); Builtins::CallableFor(isolate(), shared->builtin_id());
CallDescriptor::Flags flags = CallDescriptor::kNeedsFrameState;
const CallInterfaceDescriptor& descriptor = callable.descriptor(); const CallInterfaceDescriptor& descriptor = callable.descriptor();
auto call_descriptor = Linkage::GetStubCallDescriptor( auto call_descriptor = Linkage::GetStubCallDescriptor(
...@@ -2232,11 +2231,11 @@ Reduction JSTypedLowering::ReduceObjectIsArray(Node* node) { ...@@ -2232,11 +2231,11 @@ Reduction JSTypedLowering::ReduceObjectIsArray(Node* node) {
// Constant-fold based on {value} type. // Constant-fold based on {value} type.
if (value_type.Is(Type::Array())) { if (value_type.Is(Type::Array())) {
Node* value = jsgraph()->TrueConstant(); value = jsgraph()->TrueConstant();
ReplaceWithValue(node, value); ReplaceWithValue(node, value);
return Replace(value); return Replace(value);
} else if (!value_type.Maybe(Type::ArrayOrProxy())) { } else if (!value_type.Maybe(Type::ArrayOrProxy())) {
Node* value = jsgraph()->FalseConstant(); value = jsgraph()->FalseConstant();
ReplaceWithValue(node, value); ReplaceWithValue(node, value);
return Replace(value); return Replace(value);
} }
......
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