Skip to content

Commit 456d250

Browse files
targosaddaleax
authored andcommitted
deps: V8: backport 93f189f19a03
Original commit message: [ic] Fix non-GlobalIC store to interceptor on the global object We possibly need to load the global object from the global proxy as the holder of the named interceptor. Change-Id: I0f9f2e448630608ae853588f6751b55574a9efd9 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1930903 Commit-Queue: Igor Sheludko <[email protected]> Reviewed-by: Igor Sheludko <[email protected]> Cr-Commit-Position: refs/heads/master@{#65119} Refs: v8/v8@93f189f Fixes: #30586 PR-URL: #30681 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 83861fb commit 456d250

File tree

3 files changed

+12
-29
lines changed

3 files changed

+12
-29
lines changed

Diff for: common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
# Reset this number to 0 on major V8 upgrades.
4141
# Increment by one for each non-official patch applied to deps/v8.
42-
'v8_embedder_string': '-node.21',
42+
'v8_embedder_string': '-node.22',
4343

4444
##### V8 defaults for Node.js #####
4545

Diff for: deps/v8/src/ic/accessor-assembler.cc

+2-15
Original file line numberDiff line numberDiff line change
@@ -1053,8 +1053,7 @@ void AccessorAssembler::HandleStoreICHandlerCase(
10531053
{
10541054
Comment("store_interceptor");
10551055
TailCallRuntime(Runtime::kStorePropertyWithInterceptor, p->context(),
1056-
p->value(), p->slot(), p->vector(), p->receiver(),
1057-
p->name());
1056+
p->value(), p->receiver(), p->name());
10581057
}
10591058

10601059
BIND(&if_slow);
@@ -1516,8 +1515,7 @@ void AccessorAssembler::HandleStoreICProtoHandler(
15161515

15171516
{
15181517
Label if_add_normal(this), if_store_global_proxy(this), if_api_setter(this),
1519-
if_accessor(this), if_native_data_property(this), if_slow(this),
1520-
if_interceptor(this);
1518+
if_accessor(this), if_native_data_property(this), if_slow(this);
15211519

15221520
CSA_ASSERT(this, TaggedIsSmi(smi_handler));
15231521
TNode<Int32T> handler_word = SmiToInt32(CAST(smi_handler));
@@ -1547,9 +1545,6 @@ void AccessorAssembler::HandleStoreICProtoHandler(
15471545
GotoIf(Word32Equal(handler_kind, Int32Constant(StoreHandler::kSlow)),
15481546
&if_slow);
15491547

1550-
GotoIf(Word32Equal(handler_kind, Int32Constant(StoreHandler::kInterceptor)),
1551-
&if_interceptor);
1552-
15531548
GotoIf(
15541549
Word32Equal(handler_kind,
15551550
Int32Constant(StoreHandler::kApiSetterHolderIsPrototype)),
@@ -1574,14 +1569,6 @@ void AccessorAssembler::HandleStoreICProtoHandler(
15741569
}
15751570
}
15761571

1577-
BIND(&if_interceptor);
1578-
{
1579-
Comment("store_interceptor");
1580-
TailCallRuntime(Runtime::kStorePropertyWithInterceptor, p->context(),
1581-
p->value(), p->slot(), p->vector(), p->receiver(),
1582-
p->name());
1583-
}
1584-
15851572
BIND(&if_add_normal);
15861573
{
15871574
// This is a case of "transitioning store" to a dictionary mode object

Diff for: deps/v8/src/ic/ic.cc

+9-13
Original file line numberDiff line numberDiff line change
@@ -1308,8 +1308,7 @@ bool StoreIC::LookupForWrite(LookupIterator* it, Handle<Object> value,
13081308
case LookupIterator::INTERCEPTOR: {
13091309
Handle<JSObject> holder = it->GetHolder<JSObject>();
13101310
InterceptorInfo info = holder->GetNamedInterceptor();
1311-
if ((it->HolderIsReceiverOrHiddenPrototype() &&
1312-
!info.non_masking()) ||
1311+
if (it->HolderIsReceiverOrHiddenPrototype() ||
13131312
!info.getter().IsUndefined(isolate()) ||
13141313
!info.query().IsUndefined(isolate())) {
13151314
return true;
@@ -2718,23 +2717,20 @@ RUNTIME_FUNCTION(Runtime_LoadPropertyWithInterceptor) {
27182717

27192718
RUNTIME_FUNCTION(Runtime_StorePropertyWithInterceptor) {
27202719
HandleScope scope(isolate);
2721-
DCHECK_EQ(5, args.length());
2720+
DCHECK_EQ(3, args.length());
27222721
// Runtime functions don't follow the IC's calling convention.
27232722
Handle<Object> value = args.at(0);
2724-
Handle<Smi> slot = args.at<Smi>(1);
2725-
Handle<FeedbackVector> vector = args.at<FeedbackVector>(2);
2726-
Handle<JSObject> receiver = args.at<JSObject>(3);
2727-
Handle<Name> name = args.at<Name>(4);
2728-
FeedbackSlot vector_slot = FeedbackVector::ToSlot(slot->value());
2723+
Handle<JSObject> receiver = args.at<JSObject>(1);
2724+
Handle<Name> name = args.at<Name>(2);
27292725

27302726
// TODO(ishell): Cache interceptor_holder in the store handler like we do
27312727
// for LoadHandler::kInterceptor case.
27322728
Handle<JSObject> interceptor_holder = receiver;
2733-
if (receiver->IsJSGlobalProxy()) {
2734-
FeedbackSlotKind kind = vector->GetKind(vector_slot);
2735-
if (IsStoreGlobalICKind(kind)) {
2736-
interceptor_holder = Handle<JSObject>::cast(isolate->global_object());
2737-
}
2729+
if (receiver->IsJSGlobalProxy() &&
2730+
(!receiver->HasNamedInterceptor() ||
2731+
receiver->GetNamedInterceptor().non_masking())) {
2732+
interceptor_holder =
2733+
handle(JSObject::cast(receiver->map().prototype()), isolate);
27382734
}
27392735
DCHECK(interceptor_holder->HasNamedInterceptor());
27402736
Handle<InterceptorInfo> interceptor(interceptor_holder->GetNamedInterceptor(),

0 commit comments

Comments
 (0)