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

[cctest] Fix -Wshadow warnings in test-weakmaps test-weaksets

No functionality change expected.

Most scopes are renamed new_scope.

Bug: v8:12244,v8:12245
Change-Id: I85d23b0ba6971f51b9bbfc1f3afeb89fb70f035e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3227268
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77443}
parent 9611ceaf
...@@ -68,7 +68,7 @@ TEST(Weakness) { ...@@ -68,7 +68,7 @@ TEST(Weakness) {
// Keep global reference to the key. // Keep global reference to the key.
Handle<Object> key; Handle<Object> key;
{ {
HandleScope scope(isolate); HandleScope inner_scope(isolate);
Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
Handle<JSObject> object = factory->NewJSObjectFromMap(map); Handle<JSObject> object = factory->NewJSObjectFromMap(map);
key = global_handles->Create(*object); key = global_handles->Create(*object);
...@@ -77,7 +77,7 @@ TEST(Weakness) { ...@@ -77,7 +77,7 @@ TEST(Weakness) {
// Put two chained entries into weak map. // Put two chained entries into weak map.
{ {
HandleScope scope(isolate); HandleScope inner_scope(isolate);
Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
Handle<JSObject> object = factory->NewJSObjectFromMap(map); Handle<JSObject> object = factory->NewJSObjectFromMap(map);
Handle<Smi> smi(Smi::FromInt(23), isolate); Handle<Smi> smi(Smi::FromInt(23), isolate);
...@@ -122,7 +122,7 @@ TEST(Shrinking) { ...@@ -122,7 +122,7 @@ TEST(Shrinking) {
// Fill up weak map to trigger capacity change. // Fill up weak map to trigger capacity change.
{ {
HandleScope scope(isolate); HandleScope inner_scope(isolate);
Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
for (int i = 0; i < 32; i++) { for (int i = 0; i < 32; i++) {
Handle<JSObject> object = factory->NewJSObjectFromMap(map); Handle<JSObject> object = factory->NewJSObjectFromMap(map);
...@@ -249,7 +249,7 @@ TEST(Regress2060a) { ...@@ -249,7 +249,7 @@ TEST(Regress2060a) {
// Fill up weak map with values on an evacuation candidate. // Fill up weak map with values on an evacuation candidate.
{ {
HandleScope scope(isolate); HandleScope inner_scope(isolate);
for (int i = 0; i < 32; i++) { for (int i = 0; i < 32; i++) {
Handle<JSObject> object = Handle<JSObject> object =
factory->NewJSObject(function, AllocationType::kOld); factory->NewJSObject(function, AllocationType::kOld);
...@@ -320,7 +320,7 @@ TEST(Regress399527) { ...@@ -320,7 +320,7 @@ TEST(Regress399527) {
Isolate* isolate = CcTest::i_isolate(); Isolate* isolate = CcTest::i_isolate();
Heap* heap = isolate->heap(); Heap* heap = isolate->heap();
{ {
HandleScope scope(isolate); HandleScope inner_scope(isolate);
isolate->factory()->NewJSWeakMap(); isolate->factory()->NewJSWeakMap();
heap::SimulateIncrementalMarking(heap); heap::SimulateIncrementalMarking(heap);
} }
...@@ -343,7 +343,7 @@ TEST(WeakMapsWithChainedEntries) { ...@@ -343,7 +343,7 @@ TEST(WeakMapsWithChainedEntries) {
v8::Global<v8::Object> g1; v8::Global<v8::Object> g1;
v8::Global<v8::Object> g2; v8::Global<v8::Object> g2;
{ {
v8::HandleScope scope(isolate); v8::HandleScope inner_scope(isolate);
v8::Local<v8::Object> o1 = v8::Object::New(isolate); v8::Local<v8::Object> o1 = v8::Object::New(isolate);
g1.Reset(isolate, o1); g1.Reset(isolate, o1);
g1.SetWeak(); g1.SetWeak();
......
...@@ -83,7 +83,7 @@ TEST(WeakSet_Weakness) { ...@@ -83,7 +83,7 @@ TEST(WeakSet_Weakness) {
// Keep global reference to the key. // Keep global reference to the key.
Handle<Object> key; Handle<Object> key;
{ {
HandleScope scope(isolate); HandleScope inner_scope(isolate);
Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
Handle<JSObject> object = factory->NewJSObjectFromMap(map); Handle<JSObject> object = factory->NewJSObjectFromMap(map);
key = global_handles->Create(*object); key = global_handles->Create(*object);
...@@ -92,7 +92,7 @@ TEST(WeakSet_Weakness) { ...@@ -92,7 +92,7 @@ TEST(WeakSet_Weakness) {
// Put entry into weak set. // Put entry into weak set.
{ {
HandleScope scope(isolate); HandleScope inner_scope(isolate);
Handle<Smi> smi(Smi::FromInt(23), isolate); Handle<Smi> smi(Smi::FromInt(23), isolate);
int32_t hash = key->GetOrCreateHash(isolate).value(); int32_t hash = key->GetOrCreateHash(isolate).value();
JSWeakCollection::Set(weakset, key, smi, hash); JSWeakCollection::Set(weakset, key, smi, hash);
...@@ -133,7 +133,7 @@ TEST(WeakSet_Shrinking) { ...@@ -133,7 +133,7 @@ TEST(WeakSet_Shrinking) {
// Fill up weak set to trigger capacity change. // Fill up weak set to trigger capacity change.
{ {
HandleScope scope(isolate); HandleScope inner_scope(isolate);
Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize); Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, JSObject::kHeaderSize);
for (int i = 0; i < 32; i++) { for (int i = 0; i < 32; i++) {
Handle<JSObject> object = factory->NewJSObjectFromMap(map); Handle<JSObject> object = factory->NewJSObjectFromMap(map);
...@@ -183,7 +183,7 @@ TEST(WeakSet_Regress2060a) { ...@@ -183,7 +183,7 @@ TEST(WeakSet_Regress2060a) {
// Fill up weak set with values on an evacuation candidate. // Fill up weak set with values on an evacuation candidate.
{ {
HandleScope scope(isolate); HandleScope inner_scope(isolate);
for (int i = 0; i < 32; i++) { for (int i = 0; i < 32; i++) {
Handle<JSObject> object = Handle<JSObject> object =
factory->NewJSObject(function, AllocationType::kOld); factory->NewJSObject(function, AllocationType::kOld);
......
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