Commit 8b0bfea3 authored by Marja Hölttä's avatar Marja Hölttä Committed by V8 LUCI CQ

[cleanup] Make interpreter/ Wshadow compatible

Bug: v8:12244, v8:12245
Change-Id: I46cc6fca7d4dda82c825ac15c97bba41ec61378a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3183347Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77166}
parent 76f50dff
......@@ -1670,7 +1670,7 @@ void BytecodeGenerator::VisitModuleDeclarations(Declaration::List* decls) {
top_level_builder()->record_module_variable_declaration();
}
} else {
RegisterAllocationScope register_scope(this);
RegisterAllocationScope inner_register_scope(this);
Visit(decl);
}
}
......@@ -3930,7 +3930,7 @@ void BytecodeGenerator::BuildFinalizeIteration(
ToBooleanMode::kConvertToBoolean, iterator_is_done.New());
{
RegisterAllocationScope register_scope(this);
RegisterAllocationScope inner_register_scope(this);
BuildTryCatch(
// try {
// let method = iterator.return
......@@ -4229,7 +4229,7 @@ void BytecodeGenerator::BuildDestructuringArrayAssignment(
void BytecodeGenerator::BuildDestructuringObjectAssignment(
ObjectLiteral* pattern, Token::Value op,
LookupHoistingMode lookup_hoisting_mode) {
RegisterAllocationScope scope(this);
RegisterAllocationScope register_scope(this);
// Store the assignment value in a register.
Register value;
......@@ -4272,7 +4272,7 @@ void BytecodeGenerator::BuildDestructuringObjectAssignment(
int i = 0;
for (ObjectLiteralProperty* pattern_property : *pattern->properties()) {
RegisterAllocationScope scope(this);
RegisterAllocationScope inner_register_scope(this);
// The key of the pattern becomes the key into the RHS value, and the value
// of the pattern becomes the target of the assignment.
......@@ -4369,12 +4369,16 @@ void BytecodeGenerator::BuildAssignment(
// Assign the value to the LHS.
switch (lhs_data.assign_type()) {
case NON_PROPERTY: {
if (ObjectLiteral* pattern = lhs_data.expr()->AsObjectLiteral()) {
if (ObjectLiteral* pattern_as_object =
lhs_data.expr()->AsObjectLiteral()) {
// Split object literals into destructuring.
BuildDestructuringObjectAssignment(pattern, op, lookup_hoisting_mode);
} else if (ArrayLiteral* pattern = lhs_data.expr()->AsArrayLiteral()) {
BuildDestructuringObjectAssignment(pattern_as_object, op,
lookup_hoisting_mode);
} else if (ArrayLiteral* pattern_as_array =
lhs_data.expr()->AsArrayLiteral()) {
// Split object literals into destructuring.
BuildDestructuringArrayAssignment(pattern, op, lookup_hoisting_mode);
BuildDestructuringArrayAssignment(pattern_as_array, op,
lookup_hoisting_mode);
} else {
DCHECK(lhs_data.expr()->IsVariableProxy());
VariableProxy* proxy = lhs_data.expr()->AsVariableProxy();
......@@ -4857,7 +4861,7 @@ void BytecodeGenerator::VisitYieldStar(YieldStar* expr) {
if (iterator_type == IteratorType::kNormal) {
builder()->LoadAccumulatorWithRegister(output);
} else {
RegisterAllocationScope register_scope(this);
RegisterAllocationScope inner_register_scope(this);
DCHECK_EQ(iterator_type, IteratorType::kAsync);
// If generatorKind is async, perform AsyncGeneratorYield(output.value),
// which will await `output.value` before resolving the current
......@@ -6312,7 +6316,7 @@ void BytecodeGenerator::BuildIteratorClose(const IteratorRecord& iterator,
builder()->JumpIfJSReceiver(done.New());
{
RegisterAllocationScope register_scope(this);
RegisterAllocationScope inner_register_scope(this);
Register return_result = register_allocator()->NewRegister();
builder()
->StoreAccumulatorInRegister(return_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