summaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-dictionary.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/cctest/test-dictionary.cc')
-rw-r--r--deps/v8/test/cctest/test-dictionary.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/deps/v8/test/cctest/test-dictionary.cc b/deps/v8/test/cctest/test-dictionary.cc
index b0d429f5c8..fd015639af 100644
--- a/deps/v8/test/cctest/test-dictionary.cc
+++ b/deps/v8/test/cctest/test-dictionary.cc
@@ -29,6 +29,7 @@
#include "test/cctest/cctest.h"
#include "src/api.h"
+#include "src/builtins/builtins-constructor.h"
#include "src/debug/debug.h"
#include "src/execution.h"
#include "src/factory.h"
@@ -311,4 +312,15 @@ TEST(SetRequiresCopyOnCapacityChange) {
CHECK_NE(*dict, *new_dict);
}
+TEST(MaximumClonedShallowObjectProperties) {
+ // Assert that a NameDictionary with kMaximumClonedShallowObjectProperties is
+ // not in large-object space.
+ const int max_capacity = NameDictionary::ComputeCapacity(
+ ConstructorBuiltins::kMaximumClonedShallowObjectProperties);
+ const int max_literal_entry = max_capacity / NameDictionary::kEntrySize;
+ const int max_literal_index = NameDictionary::EntryToIndex(max_literal_entry);
+ CHECK_LE(NameDictionary::OffsetOfElementAt(max_literal_index),
+ kMaxRegularHeapObjectSize);
+}
+
} // namespace