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