Skip to content

Commit e4dba97

Browse files
marjakhV8 LUCI CQ
authored andcommitted
[super ic] Fix receiver vs lookup start object confusion related to module exports
Bug: chromium:1260577 Change-Id: I8944f2f1dda22ab9a24e389a686c707deb5f18c4 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3225936 Reviewed-by: Igor Sheludko <ishell@chromium.org> Commit-Queue: Marja Hölttä <marja@chromium.org> Cr-Commit-Position: refs/heads/main@{#77427}
1 parent 63dc736 commit e4dba97

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎src/ic/accessor-assembler.cc‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,8 +836,8 @@ void AccessorAssembler::HandleLoadICSmiHandlerLoadNamedCase(
836836
Comment("module export");
837837
TNode<UintPtrT> index =
838838
DecodeWord<LoadHandler::ExportsIndexBits>(handler_word);
839-
TNode<Module> module = LoadObjectField<Module>(
840-
CAST(p->receiver()), JSModuleNamespace::kModuleOffset);
839+
TNode<Module> module =
840+
LoadObjectField<Module>(CAST(holder), JSModuleNamespace::kModuleOffset);
841841
TNode<ObjectHashTable> exports =
842842
LoadObjectField<ObjectHashTable>(module, Module::kExportsOffset);
843843
TNode<Cell> cell = CAST(LoadFixedArrayElement(exports, index));

‎src/ic/ic.cc‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,13 @@ Handle<Object> LoadIC::ComputeHandler(LookupIterator* lookup) {
996996
// We found the accessor, so the entry must exist.
997997
DCHECK(entry.is_found());
998998
int value_index = ObjectHashTable::EntryToValueIndex(entry);
999-
return LoadHandler::LoadModuleExport(isolate(), value_index);
999+
Handle<Smi> smi_handler =
1000+
LoadHandler::LoadModuleExport(isolate(), value_index);
1001+
if (holder_is_lookup_start_object) {
1002+
return smi_handler;
1003+
}
1004+
return LoadHandler::LoadFromPrototype(isolate(), map, holder,
1005+
smi_handler);
10001006
}
10011007

10021008
Handle<Object> accessors = lookup->GetAccessors();

0 commit comments

Comments
 (0)