Skip to content

Commit

Permalink
[super ic] Fix receiver vs lookup start object confusion related to m…
Browse files Browse the repository at this point in the history
…odule 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}
  • Loading branch information
marjakh authored and V8 LUCI CQ committed Oct 18, 2021
1 parent 63dc736 commit e4dba97
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ic/accessor-assembler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
8 changes: 7 additions & 1 deletion src/ic/ic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e4dba97

Please sign in to comment.