Commit 211b4e54 authored by Z Duong Nguyen-Huu's avatar Z Duong Nguyen-Huu Committed by Commit Bot

Freeze proxy from sealed elements-kind object can normalize elements

Bug: chromium:966460
Change-Id: I418eab656510fe3f799f552e75be10140d25bcab
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1625864Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Z Nguyen-Huu <duongn@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#61922}
parent 863e2085
...@@ -2697,6 +2697,13 @@ class FastFrozenObjectElementsAccessor ...@@ -2697,6 +2697,13 @@ class FastFrozenObjectElementsAccessor
Handle<FixedArrayBase> backing_store) { Handle<FixedArrayBase> backing_store) {
UNREACHABLE(); UNREACHABLE();
} }
static void ReconfigureImpl(Handle<JSObject> object,
Handle<FixedArrayBase> store, uint32_t entry,
Handle<Object> value,
PropertyAttributes attributes) {
UNREACHABLE();
}
}; };
class FastPackedFrozenObjectElementsAccessor class FastPackedFrozenObjectElementsAccessor
......
...@@ -822,6 +822,10 @@ bool JSObject::HasFrozenOrSealedElements() { ...@@ -822,6 +822,10 @@ bool JSObject::HasFrozenOrSealedElements() {
return IsFrozenOrSealedElementsKind(GetElementsKind()); return IsFrozenOrSealedElementsKind(GetElementsKind());
} }
bool JSObject::HasSealedElements() {
return IsSealedElementsKind(GetElementsKind());
}
bool JSObject::HasFastArgumentsElements() { bool JSObject::HasFastArgumentsElements() {
return GetElementsKind() == FAST_SLOPPY_ARGUMENTS_ELEMENTS; return GetElementsKind() == FAST_SLOPPY_ARGUMENTS_ELEMENTS;
} }
......
...@@ -3462,7 +3462,7 @@ Handle<NumberDictionary> JSObject::NormalizeElements(Handle<JSObject> object) { ...@@ -3462,7 +3462,7 @@ Handle<NumberDictionary> JSObject::NormalizeElements(Handle<JSObject> object) {
DCHECK(object->HasSmiOrObjectElements() || object->HasDoubleElements() || DCHECK(object->HasSmiOrObjectElements() || object->HasDoubleElements() ||
object->HasFastArgumentsElements() || object->HasFastArgumentsElements() ||
object->HasFastStringWrapperElements()); object->HasFastStringWrapperElements() || object->HasSealedElements());
Handle<NumberDictionary> dictionary = Handle<NumberDictionary> dictionary =
object->GetElementsAccessor()->Normalize(object); object->GetElementsAccessor()->Normalize(object);
......
...@@ -338,6 +338,7 @@ class JSObject : public JSReceiver { ...@@ -338,6 +338,7 @@ class JSObject : public JSReceiver {
// Returns true if an object has elements of PACKED_ELEMENTS // Returns true if an object has elements of PACKED_ELEMENTS
inline bool HasPackedElements(); inline bool HasPackedElements();
inline bool HasFrozenOrSealedElements(); inline bool HasFrozenOrSealedElements();
inline bool HasSealedElements();
inline bool HasTypedArrayElements(); inline bool HasTypedArrayElements();
......
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
PI = [];
PI[250] = PI;
Object.seal(PI);
assertTrue(Object.isSealed(PI));
var proxy = new Proxy(PI, PI);
Object.freeze(proxy);
assertTrue(Object.isFrozen(proxy));
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