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

[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/+/3225936Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77427}
parent 63dc736d
......@@ -836,8 +836,8 @@ void AccessorAssembler::HandleLoadICSmiHandlerLoadNamedCase(
Comment("module export");
TNode<UintPtrT> index =
DecodeWord<LoadHandler::ExportsIndexBits>(handler_word);
TNode<Module> module = LoadObjectField<Module>(
CAST(p->receiver()), JSModuleNamespace::kModuleOffset);
TNode<Module> module =
LoadObjectField<Module>(CAST(holder), JSModuleNamespace::kModuleOffset);
TNode<ObjectHashTable> exports =
LoadObjectField<ObjectHashTable>(module, Module::kExportsOffset);
TNode<Cell> cell = CAST(LoadFixedArrayElement(exports, index));
......
......@@ -996,7 +996,13 @@ Handle<Object> LoadIC::ComputeHandler(LookupIterator* lookup) {
// We found the accessor, so the entry must exist.
DCHECK(entry.is_found());
int value_index = ObjectHashTable::EntryToValueIndex(entry);
return LoadHandler::LoadModuleExport(isolate(), value_index);
Handle<Smi> smi_handler =
LoadHandler::LoadModuleExport(isolate(), value_index);
if (holder_is_lookup_start_object) {
return smi_handler;
}
return LoadHandler::LoadFromPrototype(isolate(), map, holder,
smi_handler);
}
Handle<Object> accessors = lookup->GetAccessors();
......
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