Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Unified Diff: test/unittests/interpreter/constant-array-builder-unittest.cc

Issue 2204243003: [Interpreter] Avoid dereferencing handles in ConstantPoolArrayBuilder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/unittests/interpreter/bytecode-array-builder-unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/interpreter/constant-array-builder-unittest.cc
diff --git a/test/unittests/interpreter/constant-array-builder-unittest.cc b/test/unittests/interpreter/constant-array-builder-unittest.cc
index 8bee2452da2466d60b1b838f3eaf1782353f0f33..ee77423175d8e8213ce8d8add1f6465933cafc88 100644
--- a/test/unittests/interpreter/constant-array-builder-unittest.cc
+++ b/test/unittests/interpreter/constant-array-builder-unittest.cc
@@ -29,6 +29,7 @@ STATIC_CONST_MEMBER_DEFINITION const size_t
ConstantArrayBuilderTest::k8BitCapacity;
TEST_F(ConstantArrayBuilderTest, AllocateAllEntries) {
+ CanonicalHandleScope canonical(isolate());
ConstantArrayBuilder builder(isolate(), zone());
for (size_t i = 0; i < k16BitCapacity; i++) {
builder.Insert(handle(Smi::FromInt(static_cast<int>(i)), isolate()));
@@ -40,6 +41,7 @@ TEST_F(ConstantArrayBuilderTest, AllocateAllEntries) {
}
TEST_F(ConstantArrayBuilderTest, AllocateEntriesWithIdx8Reservations) {
+ CanonicalHandleScope canonical(isolate());
for (size_t reserved = 1; reserved < k8BitCapacity; reserved *= 3) {
ConstantArrayBuilder builder(isolate(), zone());
for (size_t i = 0; i < reserved; i++) {
@@ -109,6 +111,7 @@ TEST_F(ConstantArrayBuilderTest, AllocateEntriesWithIdx8Reservations) {
}
TEST_F(ConstantArrayBuilderTest, AllocateEntriesWithWideReservations) {
+ CanonicalHandleScope canonical(isolate());
for (size_t reserved = 1; reserved < k8BitCapacity; reserved *= 3) {
ConstantArrayBuilder builder(isolate(), zone());
for (size_t i = 0; i < k8BitCapacity; i++) {
@@ -145,6 +148,7 @@ TEST_F(ConstantArrayBuilderTest, AllocateEntriesWithWideReservations) {
TEST_F(ConstantArrayBuilderTest, ToFixedArray) {
+ CanonicalHandleScope canonical(isolate());
ConstantArrayBuilder builder(isolate(), zone());
static const size_t kNumberOfElements = 37;
for (size_t i = 0; i < kNumberOfElements; i++) {
@@ -160,6 +164,7 @@ TEST_F(ConstantArrayBuilderTest, ToFixedArray) {
}
TEST_F(ConstantArrayBuilderTest, ToLargeFixedArray) {
+ CanonicalHandleScope canonical(isolate());
ConstantArrayBuilder builder(isolate(), zone());
static const size_t kNumberOfElements = 37373;
for (size_t i = 0; i < kNumberOfElements; i++) {
@@ -175,6 +180,7 @@ TEST_F(ConstantArrayBuilderTest, ToLargeFixedArray) {
}
TEST_F(ConstantArrayBuilderTest, GapFilledWhenLowReservationCommitted) {
+ CanonicalHandleScope canonical(isolate());
ConstantArrayBuilder builder(isolate(), zone());
for (size_t i = 0; i < k8BitCapacity; i++) {
OperandSize operand_size = builder.CreateReservedEntry();
@@ -201,6 +207,7 @@ TEST_F(ConstantArrayBuilderTest, GapFilledWhenLowReservationCommitted) {
}
TEST_F(ConstantArrayBuilderTest, GapNotFilledWhenLowReservationDiscarded) {
+ CanonicalHandleScope canonical(isolate());
ConstantArrayBuilder builder(isolate(), zone());
for (size_t i = 0; i < k8BitCapacity; i++) {
OperandSize operand_size = builder.CreateReservedEntry();
@@ -227,6 +234,7 @@ TEST_F(ConstantArrayBuilderTest, GapNotFilledWhenLowReservationDiscarded) {
}
TEST_F(ConstantArrayBuilderTest, HolesWithUnusedReservations) {
+ CanonicalHandleScope canonical(isolate());
static int kNumberOfHoles = 128;
ConstantArrayBuilder builder(isolate(), zone());
for (int i = 0; i < kNumberOfHoles; ++i) {
@@ -250,6 +258,7 @@ TEST_F(ConstantArrayBuilderTest, HolesWithUnusedReservations) {
}
TEST_F(ConstantArrayBuilderTest, ReservationsAtAllScales) {
+ CanonicalHandleScope canonical(isolate());
ConstantArrayBuilder builder(isolate(), zone());
for (int i = 0; i < 256; i++) {
CHECK_EQ(builder.CreateReservedEntry(), OperandSize::kByte);
@@ -284,6 +293,7 @@ TEST_F(ConstantArrayBuilderTest, ReservationsAtAllScales) {
}
TEST_F(ConstantArrayBuilderTest, AllocateEntriesWithFixedReservations) {
+ CanonicalHandleScope canonical(isolate());
ConstantArrayBuilder builder(isolate(), zone());
for (size_t i = 0; i < k16BitCapacity; i++) {
if ((i % 2) == 0) {
« no previous file with comments | « test/unittests/interpreter/bytecode-array-builder-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698