Remove unnecessary HasOwnProperty check from Array#sort

During deletion in the write-back phase, we do not necessarly need
to check with HasOwnProperty before calling DeleteProperty. Since this
is observable behavior when using proxies, we remove the HasOwnProperty
check to mirror more closely what Spidermonkey does.

R=jgruber@chromium.org

Change-Id: I67768b1d8b13e695b956b2fa0624dcb28fd0664d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1809366
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63866}
This commit is contained in:
Simon Zünd 2019-09-18 11:46:58 +02:00 committed by Commit Bot
parent b946521f18
commit db3df9f67c

View File

@ -297,7 +297,6 @@ namespace array {
transitioning builtin Delete<ElementsAccessor: type>(
context: Context, sortState: SortState, index: Smi): Smi {
const receiver = sortState.receiver;
if (!HasProperty_Inline(receiver, index)) return kSuccess;
DeleteProperty(receiver, index, kStrict);
return kSuccess;
}