Skip to content

Commit

Permalink
chore: cherry-pick 014e1f857c33 from v8
Browse files Browse the repository at this point in the history
  • Loading branch information
ppontes committed Nov 2, 2021
1 parent be34c32 commit 19d8ee0
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions patches/v8/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ regexp_allow_reentrant_irregexp_execution.patch
regexp_remove_the_stack_parameter_from_regexp_matchers.patch
cherry-pick-5c4acf2ae64a.patch
cherry-pick-6de4e210688e.patch
cherry-pick-014e1f857c33.patch
56 changes: 56 additions & 0 deletions patches/v8/cherry-pick-014e1f857c33.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
From 014e1f857c335ce403447b4aca84f21243ad091b Mon Sep 17 00:00:00 2001
From: Marja Hölttä <marja@chromium.org>
Date: Mon, 25 Oct 2021 12:17:15 +0200
Subject: [PATCH] Merged: [super ic] Fix receiver vs lookup start object confusion related to module exports

Revision: e4dba97006ca20337deafb85ac00524a94a62fe

BUG=chromium:1260577
NOTRY=true
NOPRESUBMIT=true
NOTREECHECKS=true
R=ishell@chromium.org

Change-Id: Ia85235fecdb37a5da6a28f7a0092a754a8620552
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3240826
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/branch-heads/9.4@{#48}
Cr-Branched-From: 3b51863bc25492549a8bf96ff67ce481b1a3337b-refs/heads/9.4.146@{#1}
Cr-Branched-From: 2890419fc8fb9bdb507fdd801d76fa7dd9f022b5-refs/heads/master@{#76233}
---

diff --git a/src/ic/accessor-assembler.cc b/src/ic/accessor-assembler.cc
index 64d64cd..f27e3b7 100644
--- a/src/ic/accessor-assembler.cc
+++ b/src/ic/accessor-assembler.cc
@@ -846,8 +846,8 @@
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));
diff --git a/src/ic/ic.cc b/src/ic/ic.cc
index a2b920a..68eee92 100644
--- a/src/ic/ic.cc
+++ b/src/ic/ic.cc
@@ -989,7 +989,13 @@
// We found the accessor, so the entry must exist.
DCHECK(entry.is_found());
int index = ObjectHashTable::EntryToValueIndex(entry);
- return LoadHandler::LoadModuleExport(isolate(), index);
+ Handle<Smi> smi_handler =
+ LoadHandler::LoadModuleExport(isolate(), index);
+ if (holder_is_lookup_start_object) {
+ return smi_handler;
+ }
+ return LoadHandler::LoadFromPrototype(isolate(), map, holder,
+ smi_handler);
}

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

0 comments on commit 19d8ee0

Please sign in to comment.