5cf5767552
This is a reland of 25d16574f8
Changes from original: replaced slow test with fast test
Original change's description:
> [runtime] Improve handling of enumeration index on global dictionary
>
> Bug: chromium:1056054
> Change-Id: Ie1f2da98bc54a2ad5189cbe2ee1686fe1ef7019a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2079035
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
> Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
> Cr-Commit-Position: refs/heads/master@{#66504}
Bug: chromium:1056054
Change-Id: I45b9a096b1e37bf1dc5e792f106cdfadd47fabf9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2080855
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#66535}
27 lines
909 B
C++
27 lines
909 B
C++
// Copyright 2020 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.
|
|
|
|
#include "src/execution/isolate.h"
|
|
#include "src/heap/factory.h"
|
|
#include "test/unittests/test-utils.h"
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
|
|
using EnumIndexOverflowTest = TestWithNativeContextAndZone;
|
|
|
|
TEST_F(EnumIndexOverflowTest, GlobalObject) {
|
|
Handle<GlobalDictionary> dictionary(
|
|
isolate()->global_object()->global_dictionary(), isolate());
|
|
dictionary->set_next_enumeration_index(
|
|
PropertyDetails::DictionaryStorageField::kMax);
|
|
Handle<Object> value(Smi::FromInt(static_cast<int>(42)), isolate());
|
|
Handle<Name> name = factory()->InternalizeUtf8String("eeeee");
|
|
JSObject::AddProperty(isolate(), isolate()->global_object(), name, value,
|
|
NONE);
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|