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(
} // namespace
RUNTIME_FUNCTION(Runtime_CompileForOnStackReplacement) {
HandleScope scope(isolate);
HandleScope handle_scope(isolate);
DCHECK_EQ(0, args.length());
// Only reachable when OST is enabled.
......
......@@ -410,16 +410,16 @@ Handle<JSObject> CreateObjectLiteral(
if (value->IsHeapObject()) {
if (HeapObject::cast(*value).IsArrayBoilerplateDescription(isolate)) {
Handle<ArrayBoilerplateDescription> boilerplate =
Handle<ArrayBoilerplateDescription> array_boilerplate =
Handle<ArrayBoilerplateDescription>::cast(value);
value = CreateArrayLiteral(isolate, boilerplate, allocation);
value = CreateArrayLiteral(isolate, array_boilerplate, allocation);
} else if (HeapObject::cast(*value).IsObjectBoilerplateDescription(
isolate)) {
Handle<ObjectBoilerplateDescription> boilerplate =
Handle<ObjectBoilerplateDescription> object_boilerplate =
Handle<ObjectBoilerplateDescription>::cast(value);
value = CreateObjectLiteral(isolate, boilerplate, boilerplate->flags(),
allocation);
value = CreateObjectLiteral(isolate, object_boilerplate,
object_boilerplate->flags(), allocation);
}
}
......
......@@ -825,11 +825,11 @@ RUNTIME_FUNCTION(Runtime_GetProperty) {
} else if (lookup_start_obj->IsString() && key_obj->IsSmi()) {
// Fast case for string indexing using [] with a smi index.
Handle<String> str = Handle<String>::cast(lookup_start_obj);
int index = Handle<Smi>::cast(key_obj)->value();
if (index >= 0 && index < str->length()) {
int smi_index = Handle<Smi>::cast(key_obj)->value();
if (smi_index >= 0 && smi_index < str->length()) {
Factory* factory = isolate->factory();
return *factory->LookupSingleCharacterStringFromCode(
String::Flatten(isolate, str)->Get(index));
String::Flatten(isolate, str)->Get(smi_index));
}
}
......
......@@ -423,17 +423,17 @@ RUNTIME_FUNCTION(Runtime_StringEscapeQuotes) {
Handle<String> quotes =
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.
if (index == -1) return *string;
if (quote_index == -1) return *string;
// Find all quotes.
std::vector<int> indices = {index};
while (index + 1 < string_length) {
index = String::IndexOf(isolate, string, quotes, index + 1);
if (index == -1) break;
indices.emplace_back(index);
std::vector<int> indices = {quote_index};
while (quote_index + 1 < string_length) {
quote_index = String::IndexOf(isolate, string, quotes, quote_index + 1);
if (quote_index == -1) break;
indices.emplace_back(quote_index);
}
// Build the replacement string.
......
......@@ -474,7 +474,7 @@ RUNTIME_FUNCTION(Runtime_OptimizeFunctionForTopTier) {
}
RUNTIME_FUNCTION(Runtime_OptimizeOsr) {
HandleScope scope(isolate);
HandleScope handle_scope(isolate);
DCHECK(args.length() == 0 || args.length() == 1);
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