Commit b120f3e6 authored by Leszek Swirski's avatar Leszek Swirski Committed by V8 LUCI CQ

[ic] Fix getter-in-IC for LoadAccessMode::kHas case

When testing for "has" rather than loading, we can immediately return
true when there is an accessor (this is already what the LoadHandler
path does but was missed in the inlined case).

Fixed: chromium:1361434
Fixed: chromium:1361560
Fixed: chromium:1361566
Fixed: chromium:1361654
Fixed: chromium:1361830
Change-Id: I69073eccbb39b08da597297fa597f53f260b242e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3885879
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83097}
parent 72d6dc6d
...@@ -227,10 +227,14 @@ void AccessorAssembler::HandleLoadICHandlerCase( ...@@ -227,10 +227,14 @@ void AccessorAssembler::HandleLoadICHandlerCase(
BIND(&call_getter); BIND(&call_getter);
{ {
if (access_mode == LoadAccessMode::kHas) {
exit_point->Return(TrueConstant());
} else {
TNode<HeapObject> strong_handler = GetHeapObjectAssumeWeak(handler, miss); TNode<HeapObject> strong_handler = GetHeapObjectAssumeWeak(handler, miss);
TNode<Object> getter = LoadAccessorPairGetter(CAST(strong_handler)); TNode<Object> getter = LoadAccessorPairGetter(CAST(strong_handler));
exit_point->Return(Call(p->context(), getter, p->receiver())); exit_point->Return(Call(p->context(), getter, p->receiver()));
} }
}
BIND(&call_code_handler); BIND(&call_code_handler);
{ {
......
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