[debug] consider Object.keys free of side effects

R=szuend@chromium.org

Fixed: v8:10910
Change-Id: I8706026db5dfa815ae5c1580a6ebbeb11adeb23e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2442615
Commit-Queue: Yang Guo <yangguo@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70254}
This commit is contained in:
Yang Guo 2020-10-01 11:54:45 +02:00 committed by Commit Bot
parent be3550bf70
commit 371b1a618c
2 changed files with 4 additions and 0 deletions

View File

@ -357,6 +357,7 @@ bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) {
V(ObjectEntries) \
V(ObjectEntriesSkipFastPath) \
V(ObjectHasOwnProperty) \
V(ObjectKeys) \
V(ObjectValues) \
V(ObjectValuesSkipFastPath) \
V(ObjectGetOwnPropertyNames) \
@ -547,6 +548,7 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) {
case Builtins::kObjectIsExtensible:
case Builtins::kObjectIsFrozen:
case Builtins::kObjectIsSealed:
case Builtins::kObjectKeys:
case Builtins::kObjectPrototypeValueOf:
case Builtins::kObjectValues:
case Builtins::kObjectPrototypeHasOwnProperty:

View File

@ -45,6 +45,8 @@ function listener(event, exec_state, event_data, data) {
success(false, `Object.isFrozen({})`);
success(false, `Object.isSealed({})`);
success([1, 2], `Object.values({a:1, b:2})`);
success(["a", 1, "b", 2], `Object.entries({a:1, b:2}).flat()`);
success(["a", "b"], `Object.keys({a:1, b:2})`);
fail(`Object.assign({}, {})`);
fail(`Object.defineProperties({}, [{p:{value:3}}])`);