Commit ae16d614 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by V8 LUCI CQ

[cleanup] Fix -Wshadow in src/ic/

Bug: v8:12244,v8:12245
Change-Id: Ic09dcc473b9e853490a54b63f08e91e8f7b2d69c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3183164
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77081}
parent dba4f451
This diff is collapsed.
......@@ -39,27 +39,27 @@ LoadHandler::Kind LoadHandler::GetHandlerKind(Smi smi_handler) {
}
Handle<Smi> LoadHandler::LoadNormal(Isolate* isolate) {
int config = KindBits::encode(kNormal);
int config = KindBits::encode(Kind::kNormal);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> LoadHandler::LoadGlobal(Isolate* isolate) {
int config = KindBits::encode(kGlobal);
int config = KindBits::encode(Kind::kGlobal);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> LoadHandler::LoadInterceptor(Isolate* isolate) {
int config = KindBits::encode(kInterceptor);
int config = KindBits::encode(Kind::kInterceptor);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> LoadHandler::LoadSlow(Isolate* isolate) {
int config = KindBits::encode(kSlow);
int config = KindBits::encode(Kind::kSlow);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> LoadHandler::LoadField(Isolate* isolate, FieldIndex field_index) {
int config = KindBits::encode(kField) |
int config = KindBits::encode(Kind::kField) |
IsInobjectBits::encode(field_index.is_inobject()) |
IsDoubleBits::encode(field_index.is_double()) |
FieldIndexBits::encode(field_index.index());
......@@ -68,49 +68,51 @@ Handle<Smi> LoadHandler::LoadField(Isolate* isolate, FieldIndex field_index) {
Handle<Smi> LoadHandler::LoadWasmStructField(Isolate* isolate,
WasmValueType type, int offset) {
int config = KindBits::encode(kField) | IsWasmStructBits::encode(true) |
int config = KindBits::encode(Kind::kField) | IsWasmStructBits::encode(true) |
WasmFieldTypeBits::encode(type) |
WasmFieldOffsetBits::encode(offset);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> LoadHandler::LoadConstantFromPrototype(Isolate* isolate) {
int config = KindBits::encode(kConstantFromPrototype);
int config = KindBits::encode(Kind::kConstantFromPrototype);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> LoadHandler::LoadAccessor(Isolate* isolate, int descriptor) {
int config = KindBits::encode(kAccessor) | DescriptorBits::encode(descriptor);
int config =
KindBits::encode(Kind::kAccessor) | DescriptorBits::encode(descriptor);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> LoadHandler::LoadProxy(Isolate* isolate) {
int config = KindBits::encode(kProxy);
int config = KindBits::encode(Kind::kProxy);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> LoadHandler::LoadNativeDataProperty(Isolate* isolate,
int descriptor) {
int config = KindBits::encode(kNativeDataProperty) |
int config = KindBits::encode(Kind::kNativeDataProperty) |
DescriptorBits::encode(descriptor);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> LoadHandler::LoadApiGetter(Isolate* isolate,
bool holder_is_receiver) {
int config = KindBits::encode(
holder_is_receiver ? kApiGetter : kApiGetterHolderIsPrototype);
int config =
KindBits::encode(holder_is_receiver ? Kind::kApiGetter
: Kind::kApiGetterHolderIsPrototype);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> LoadHandler::LoadModuleExport(Isolate* isolate, int index) {
int config =
KindBits::encode(kModuleExport) | ExportsIndexBits::encode(index);
KindBits::encode(Kind::kModuleExport) | ExportsIndexBits::encode(index);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> LoadHandler::LoadNonExistent(Isolate* isolate) {
int config = KindBits::encode(kNonExistent);
int config = KindBits::encode(Kind::kNonExistent);
return handle(Smi::FromInt(config), isolate);
}
......@@ -120,7 +122,7 @@ Handle<Smi> LoadHandler::LoadElement(Isolate* isolate,
bool is_js_array,
KeyedAccessLoadMode load_mode) {
int config =
KindBits::encode(kElement) |
KindBits::encode(Kind::kElement) |
AllowOutOfBoundsBits::encode(load_mode == LOAD_IGNORE_OUT_OF_BOUNDS) |
ElementsKindBits::encode(elements_kind) |
ConvertHoleBits::encode(convert_hole_to_undefined) |
......@@ -131,15 +133,15 @@ Handle<Smi> LoadHandler::LoadElement(Isolate* isolate,
Handle<Smi> LoadHandler::LoadIndexedString(Isolate* isolate,
KeyedAccessLoadMode load_mode) {
int config =
KindBits::encode(kIndexedString) |
KindBits::encode(Kind::kIndexedString) |
AllowOutOfBoundsBits::encode(load_mode == LOAD_IGNORE_OUT_OF_BOUNDS);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> LoadHandler::LoadWasmArrayElement(Isolate* isolate,
WasmValueType type) {
int config = KindBits::encode(kElement) | IsWasmArrayBits::encode(true) |
WasmArrayTypeBits::encode(type);
int config = KindBits::encode(Kind::kElement) |
IsWasmArrayBits::encode(true) | WasmArrayTypeBits::encode(type);
return handle(Smi::FromInt(config), isolate);
}
......@@ -148,17 +150,17 @@ OBJECT_CONSTRUCTORS_IMPL(StoreHandler, DataHandler)
CAST_ACCESSOR(StoreHandler)
Handle<Smi> StoreHandler::StoreGlobalProxy(Isolate* isolate) {
int config = KindBits::encode(kGlobalProxy);
int config = KindBits::encode(Kind::kGlobalProxy);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> StoreHandler::StoreNormal(Isolate* isolate) {
int config = KindBits::encode(kNormal);
int config = KindBits::encode(Kind::kNormal);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> StoreHandler::StoreInterceptor(Isolate* isolate) {
int config = KindBits::encode(kInterceptor);
int config = KindBits::encode(Kind::kInterceptor);
return handle(Smi::FromInt(config), isolate);
}
......@@ -210,8 +212,8 @@ Builtin StoreHandler::ElementsTransitionAndStoreBuiltin(
Handle<Smi> StoreHandler::StoreSlow(Isolate* isolate,
KeyedAccessStoreMode store_mode) {
int config =
KindBits::encode(kSlow) | KeyedAccessStoreModeBits::encode(store_mode);
int config = KindBits::encode(Kind::kSlow) |
KeyedAccessStoreModeBits::encode(store_mode);
return handle(Smi::FromInt(config), isolate);
}
......@@ -220,7 +222,7 @@ Handle<Smi> StoreHandler::StoreProxy(Isolate* isolate) {
}
Smi StoreHandler::StoreProxy() {
int config = KindBits::encode(kProxy);
int config = KindBits::encode(Kind::kProxy);
return Smi::FromInt(config);
}
......@@ -228,7 +230,7 @@ Handle<Smi> StoreHandler::StoreField(Isolate* isolate, Kind kind,
int descriptor, FieldIndex field_index,
Representation representation) {
DCHECK(!representation.IsNone());
DCHECK(kind == kField || kind == kConstField);
DCHECK(kind == Kind::kField || kind == Kind::kConstField);
int config = KindBits::encode(kind) |
IsInobjectBits::encode(field_index.is_inobject()) |
......@@ -242,26 +244,29 @@ Handle<Smi> StoreHandler::StoreField(Isolate* isolate, int descriptor,
FieldIndex field_index,
PropertyConstness constness,
Representation representation) {
Kind kind = constness == PropertyConstness::kMutable ? kField : kConstField;
Kind kind = constness == PropertyConstness::kMutable ? Kind::kField
: Kind::kConstField;
return StoreField(isolate, kind, descriptor, field_index, representation);
}
Handle<Smi> StoreHandler::StoreNativeDataProperty(Isolate* isolate,
int descriptor) {
int config = KindBits::encode(kNativeDataProperty) |
int config = KindBits::encode(Kind::kNativeDataProperty) |
DescriptorBits::encode(descriptor);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> StoreHandler::StoreAccessor(Isolate* isolate, int descriptor) {
int config = KindBits::encode(kAccessor) | DescriptorBits::encode(descriptor);
int config =
KindBits::encode(Kind::kAccessor) | DescriptorBits::encode(descriptor);
return handle(Smi::FromInt(config), isolate);
}
Handle<Smi> StoreHandler::StoreApiSetter(Isolate* isolate,
bool holder_is_receiver) {
int config = KindBits::encode(
holder_is_receiver ? kApiSetter : kApiSetterHolderIsPrototype);
int config =
KindBits::encode(holder_is_receiver ? Kind::kApiSetter
: Kind::kApiSetterHolderIsPrototype);
return handle(Smi::FromInt(config), isolate);
}
......
......@@ -172,7 +172,7 @@ KeyedAccessLoadMode LoadHandler::GetKeyedAccessLoadMode(MaybeObject handler) {
if (handler->IsSmi()) {
int const raw_handler = handler.ToSmi().value();
Kind const kind = KindBits::decode(raw_handler);
if ((kind == kElement || kind == kIndexedString) &&
if ((kind == Kind::kElement || kind == Kind::kIndexedString) &&
AllowOutOfBoundsBits::decode(raw_handler)) {
return LOAD_IGNORE_OUT_OF_BOUNDS;
}
......@@ -191,7 +191,7 @@ KeyedAccessStoreMode StoreHandler::GetKeyedAccessStoreMode(
// KeyedAccessStoreMode, compute it using KeyedAccessStoreModeForBuiltin
// method. Hence if any other Handler get to this path, just return
// STANDARD_STORE.
if (kind != kSlow) {
if (kind != Kind::kSlow) {
return STANDARD_STORE;
}
KeyedAccessStoreMode store_mode =
......@@ -251,8 +251,8 @@ MaybeObjectHandle StoreHandler::StoreTransition(Isolate* isolate,
DCHECK(!transition_map->IsJSGlobalObjectMap());
Handle<StoreHandler> handler = isolate->factory()->NewStoreHandler(0);
// Store normal with enabled lookup on receiver.
int config =
KindBits::encode(kNormal) | LookupOnLookupStartObjectBits::encode(true);
int config = KindBits::encode(Kind::kNormal) |
LookupOnLookupStartObjectBits::encode(true);
handler->set_smi_handler(Smi::FromInt(config));
handler->set_validity_cell(*validity_cell);
return MaybeObjectHandle(handler);
......
......@@ -48,7 +48,7 @@ class LoadHandler final : public DataHandler {
DECL_PRINTER(LoadHandler)
DECL_VERIFIER(LoadHandler)
enum Kind {
enum class Kind {
kElement,
kIndexedString,
kNormal,
......@@ -245,7 +245,7 @@ class StoreHandler final : public DataHandler {
DECL_PRINTER(StoreHandler)
DECL_VERIFIER(StoreHandler)
enum Kind {
enum class Kind {
kField,
kConstField,
kAccessor,
......
......@@ -979,11 +979,11 @@ Handle<Object> LoadIC::ComputeHandler(LookupIterator* lookup) {
// Use simple field loads for some well-known callback properties.
// The method will only return true for absolute truths based on the
// lookup start object maps.
FieldIndex index;
FieldIndex field_index;
if (Accessors::IsJSObjectFieldAccessor(isolate(), map, lookup->name(),
&index)) {
&field_index)) {
TRACE_HANDLER_STATS(isolate(), LoadIC_LoadFieldDH);
return LoadHandler::LoadField(isolate(), index);
return LoadHandler::LoadField(isolate(), field_index);
}
if (holder->IsJSModuleNamespace()) {
Handle<ObjectHashTable> exports(
......@@ -994,8 +994,8 @@ Handle<Object> LoadIC::ComputeHandler(LookupIterator* lookup) {
Smi::ToInt(lookup->name()->GetHash()));
// We found the accessor, so the entry must exist.
DCHECK(entry.is_found());
int index = ObjectHashTable::EntryToValueIndex(entry);
return LoadHandler::LoadModuleExport(isolate(), index);
int value_index = ObjectHashTable::EntryToValueIndex(entry);
return LoadHandler::LoadModuleExport(isolate(), value_index);
}
Handle<Object> accessors = lookup->GetAccessors();
......
......@@ -891,7 +891,6 @@ void KeyedStoreGenericAssembler::EmitGenericPropertyStore(
GotoIf(IsJSTypedArrayMap(receiver_map), slow);
CheckForAssociatedProtector(name, slow);
Label extensible(this), is_private_symbol(this);
TNode<Uint32T> bitfield3 = LoadMapBitField3(receiver_map);
GotoIf(IsPrivateSymbol(name), &is_private_symbol);
Branch(IsSetWord32<Map::Bits3::IsExtensibleBit>(bitfield3), &extensible,
slow);
......
......@@ -145,7 +145,7 @@ class UnaryOpAssemblerImpl final : public CodeStubAssembler {
Label if_smi(this), if_heapnumber(this), if_oddball(this);
Label if_bigint(this, Label::kDeferred);
Label if_other(this, Label::kDeferred);
TNode<Object> value = var_value.value();
value = var_value.value();
GotoIf(TaggedIsSmi(value), &if_smi);
TNode<HeapObject> value_heap_object = CAST(value);
......
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