764515cdb5
All existing usages are changed to Factory::NewFixedArray(). The motivation for the removal is that the function is unsafe and easy to misuse. Note that NewUninitializedFixedArray has been already changed to initialize the result as an experiment with 3%-13% regression on a few SixSpeed microbenchmarks and no impact on larger benchmarks. Change-Id: I2e084bc03b2636aa6d368ca255970566a7ce222e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2846895 Commit-Queue: Ulan Degenbaev <ulan@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/master@{#74186}
21 lines
619 B
C++
21 lines
619 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 NewUninitializedFixedArrayTest = TestWithIsolateAndZone;
|
|
|
|
TEST_F(NewUninitializedFixedArrayTest, ThrowOnNegativeLength) {
|
|
ASSERT_DEATH_IF_SUPPORTED({ factory()->NewFixedArray(-1); },
|
|
"Fatal JavaScript invalid size error -1");
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|