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

[cleanup] Fix Wshadow warnings in cctests

Bug: v8:12244, v8:12245
Change-Id: I5745daaa18dba962b45a05d1064face610d05e2b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3185460Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77083}
parent c1700c56
......@@ -373,8 +373,8 @@ TEST(Utf8ChunkBoundaries) {
v8::internal::ScannerStream::For(
&chunk_source, v8::ScriptCompiler::StreamedSource::UTF8));
for (size_t i = 0; unicode_ucs2[i]; i++) {
CHECK_EQ(unicode_ucs2[i], stream->Advance());
for (size_t j = 0; unicode_ucs2[j]; j++) {
CHECK_EQ(unicode_ucs2[j], stream->Advance());
}
CHECK_EQ(v8::internal::Utf16CharacterStream::kEndOfInput,
stream->Advance());
......
......@@ -316,7 +316,7 @@ THREADED_TEST(HandleScopePop) {
int count_before =
i::HandleScope::NumberOfHandles(reinterpret_cast<i::Isolate*>(isolate));
{
v8::HandleScope scope(isolate);
v8::HandleScope inner_scope(isolate);
CompileRun(
"for (var i = 0; i < 1000; i++) {"
" obj.one;"
......
This diff is collapsed.
......@@ -3036,12 +3036,15 @@ TEST(NewPromiseCapability) {
handle(JSFunction::cast(result->reject()), isolate)};
for (auto&& callback : callbacks) {
Handle<Context> context(Context::cast(callback->context()), isolate);
Handle<Context> callback_context(Context::cast(callback->context()),
isolate);
CHECK_EQ(isolate->root(RootIndex::kEmptyScopeInfo),
context->scope_info());
CHECK_EQ(*isolate->native_context(), context->native_context());
CHECK_EQ(PromiseBuiltins::kPromiseContextLength, context->length());
CHECK_EQ(context->get(PromiseBuiltins::kPromiseSlot), result->promise());
callback_context->scope_info());
CHECK_EQ(*isolate->native_context(), callback_context->native_context());
CHECK_EQ(PromiseBuiltins::kPromiseContextLength,
callback_context->length());
CHECK_EQ(callback_context->get(PromiseBuiltins::kPromiseSlot),
result->promise());
}
}
......
......@@ -68,8 +68,8 @@ class FeedbackVectorExplorationThread final : public v8::base::Thread {
if (state == MONOMORPHIC || state == POLYMORPHIC) {
MapHandles maps;
nexus.ExtractMaps(&maps);
for (unsigned int i = 0; i < maps.size(); i++) {
CHECK(maps[i]->IsMap());
for (unsigned int j = 0; j < maps.size(); j++) {
CHECK(maps[j]->IsMap());
}
}
......
......@@ -184,10 +184,10 @@ TEST(ScriptContextTable_AccessScriptContextTable) {
sema_started.Wait();
for (; initialized_entries < 1000; ++initialized_entries) {
Handle<Context> context =
Handle<Context> new_context =
factory->NewScriptContext(native_context, scope_info);
script_context_table =
ScriptContextTable::Extend(script_context_table, context);
ScriptContextTable::Extend(script_context_table, new_context);
native_context->synchronized_set_script_context_table(
*script_context_table);
// Update with relaxed semantics to not introduce ordering constraints.
......
......@@ -4277,7 +4277,7 @@ TEST(BytecodeFlushEventsEagerLogging) {
// This compile will add the code to the compilation cache.
{
v8::HandleScope scope(isolate);
v8::HandleScope inner_scope(isolate);
CompileRun(source);
}
......
......@@ -3269,15 +3269,16 @@ TEST(DebugScriptLineEndsAreAscending) {
v8::HandleScope scope(isolate);
// Compile a test script.
v8::Local<v8::String> script = v8_str(isolate,
"function f() {\n"
" debugger;\n"
"}\n");
v8::Local<v8::String> script_source = v8_str(isolate,
"function f() {\n"
" debugger;\n"
"}\n");
v8::ScriptOrigin origin1 = v8::ScriptOrigin(isolate, v8_str(isolate, "name"));
v8::Local<v8::Script> script1 =
v8::Script::Compile(env.local(), script, &origin1).ToLocalChecked();
USE(script1);
v8::Local<v8::Script> script =
v8::Script::Compile(env.local(), script_source, &origin1)
.ToLocalChecked();
USE(script);
Handle<v8::internal::FixedArray> instances;
{
......@@ -3287,12 +3288,12 @@ TEST(DebugScriptLineEndsAreAscending) {
CHECK_GT(instances->length(), 0);
for (int i = 0; i < instances->length(); i++) {
Handle<v8::internal::Script> script = Handle<v8::internal::Script>(
Handle<v8::internal::Script> new_script = Handle<v8::internal::Script>(
v8::internal::Script::cast(instances->get(i)), CcTest::i_isolate());
v8::internal::Script::InitLineEnds(CcTest::i_isolate(), script);
v8::internal::Script::InitLineEnds(CcTest::i_isolate(), new_script);
v8::internal::FixedArray ends =
v8::internal::FixedArray::cast(script->line_ends());
v8::internal::FixedArray::cast(new_script->line_ends());
CHECK_GT(ends.length(), 0);
int prev_end = -1;
......
......@@ -785,9 +785,9 @@ void TestGeneralizeField(const CRFTData& from, const CRFTData& to,
// Check the cases when the map being reconfigured is NOT a part of the
// transition tree. "None -> anything" representation changes make sense
// only for "attached" maps.
int indices[] = {0, kPropCount - 1};
for (int i = 0; i < static_cast<int>(arraysize(indices)); i++) {
TestGeneralizeField(indices[i], 2, from, to, expected, expected_alert);
int indices2[] = {0, kPropCount - 1};
for (int i = 0; i < static_cast<int>(arraysize(indices2)); i++) {
TestGeneralizeField(indices2[i], 2, from, to, expected, expected_alert);
}
// Check that reconfiguration to the very same field works correctly.
......@@ -2196,8 +2196,8 @@ static void TestGeneralizeFieldWithSpecialTransition(
if (config->is_non_equivalent_transition()) {
// In case of non-equivalent transition currently we generalize all
// representations.
for (int i = 0; i < kPropCount; i++) {
expectations2.GeneralizeField(i);
for (int j = 0; j < kPropCount; j++) {
expectations2.GeneralizeField(j);
}
CHECK(new_map2->GetBackPointer().IsUndefined(isolate));
CHECK(expectations2.Check(*new_map2));
......
......@@ -504,7 +504,7 @@ TEST(FinalizerOnUnmodifiedJSApiObjectDoesNotCrash) {
v8::WeakCallbackType::kFinalizer);
fp.flag = false;
{
v8::HandleScope scope(isolate);
v8::HandleScope inner_scope(isolate);
v8::Local<v8::Object> tmp = v8::Local<v8::Object>::New(isolate, fp.handle);
USE(tmp);
InvokeScavenge();
......
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