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

[runtime] Fix -Wshadow warnings

Bug: v8:12244,v8:12245
Change-Id: I4bc0378a7d4ad3033485f98e446daa7ff2e83e0a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3264646Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77769}
parent a3c0baf6
...@@ -298,7 +298,7 @@ BytecodeOffset DetermineEntryAndDisarmOSRForUnoptimized( ...@@ -298,7 +298,7 @@ BytecodeOffset DetermineEntryAndDisarmOSRForUnoptimized(
} // namespace } // namespace
RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) { RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) {
HandleScope scope(isolate); HandleScope handle_scope(isolate);
DCHECK_EQ(0, args.length()); DCHECK_EQ(0, args.length());
// Only reachable when OST is enabled. // Only reachable when OST is enabled.
......
...@@ -410,16 +410,16 @@ Handle<JSObject> CreateObjectLiteral( ...@@ -410,16 +410,16 @@ Handle<JSObject> CreateObjectLiteral(
if (value->IsHeapObject()) { if (value->IsHeapObject()) {
if (HeapObject::cast(*value).IsArrayBoilerplateDescription(isolate)) { if (HeapObject::cast(*value).IsArrayBoilerplateDescription(isolate)) {
Handle<ArrayBoilerplateDescription> boilerplate = Handle<ArrayBoilerplateDescription> array_boilerplate =
Handle<ArrayBoilerplateDescription>::cast(value); Handle<ArrayBoilerplateDescription>::cast(value);
value = CreateArrayLiteral(isolate, boilerplate, allocation); value = CreateArrayLiteral(isolate, array_boilerplate, allocation);
} else if (HeapObject::cast(*value).IsObjectBoilerplateDescription( } else if (HeapObject::cast(*value).IsObjectBoilerplateDescription(
isolate)) { isolate)) {
Handle<ObjectBoilerplateDescription> boilerplate = Handle<ObjectBoilerplateDescription> object_boilerplate =
Handle<ObjectBoilerplateDescription>::cast(value); Handle<ObjectBoilerplateDescription>::cast(value);
value = CreateObjectLiteral(isolate, boilerplate, boilerplate->flags(), value = CreateObjectLiteral(isolate, object_boilerplate,
allocation); object_boilerplate->flags(), allocation);
} }
} }
......
...@@ -825,11 +825,11 @@ RUNTIME_FUNCTION(Runtime_GetProperty) { ...@@ -825,11 +825,11 @@ RUNTIME_FUNCTION(Runtime_GetProperty) {
} else if (lookup_start_obj->IsString() && key_obj->IsSmi()) { } else if (lookup_start_obj->IsString() && key_obj->IsSmi()) {
// Fast case for string indexing using [] with a smi index. // Fast case for string indexing using [] with a smi index.
Handle<String> str = Handle<String>::cast(lookup_start_obj); Handle<String> str = Handle<String>::cast(lookup_start_obj);
int index = Handle<Smi>::cast(key_obj)->value(); int smi_index = Handle<Smi>::cast(key_obj)->value();
if (index >= 0 && index < str->length()) { if (smi_index >= 0 && smi_index < str->length()) {
Factory* factory = isolate->factory(); Factory* factory = isolate->factory();
return *factory->LookupSingleCharacterStringFromCode( return *factory->LookupSingleCharacterStringFromCode(
String::Flatten(isolate, str)->Get(index)); String::Flatten(isolate, str)->Get(smi_index));
} }
} }
......
...@@ -423,17 +423,17 @@ RUNTIME_FUNCTION(Runtime_StringEscapeQuotes) { ...@@ -423,17 +423,17 @@ RUNTIME_FUNCTION(Runtime_StringEscapeQuotes) {
Handle<String> quotes = Handle<String> quotes =
isolate->factory()->LookupSingleCharacterStringFromCode('"'); isolate->factory()->LookupSingleCharacterStringFromCode('"');
int index = String::IndexOf(isolate, string, quotes, 0); int quote_index = String::IndexOf(isolate, string, quotes, 0);
// No quotes, nothing to do. // No quotes, nothing to do.
if (index == -1) return *string; if (quote_index == -1) return *string;
// Find all quotes. // Find all quotes.
std::vector<int> indices = {index}; std::vector<int> indices = {quote_index};
while (index + 1 < string_length) { while (quote_index + 1 < string_length) {
index = String::IndexOf(isolate, string, quotes, index + 1); quote_index = String::IndexOf(isolate, string, quotes, quote_index + 1);
if (index == -1) break; if (quote_index == -1) break;
indices.emplace_back(index); indices.emplace_back(quote_index);
} }
// Build the replacement string. // Build the replacement string.
......
...@@ -474,7 +474,7 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionForTopTier) { ...@@ -474,7 +474,7 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionForTopTier) {
} }
RUNTIME_FUNCTION(Runtime_OptimizeOsr) { RUNTIME_FUNCTION(Runtime_OptimizeOsr) {
HandleScope scope(isolate); HandleScope handle_scope(isolate);
DCHECK(args.length() == 0 || args.length() == 1); DCHECK(args.length() == 0 || args.length() == 1);
Handle<JSFunction> function; Handle<JSFunction> function;
......
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