aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-dictionary.cc
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-03-12 09:01:49 +0100
committerMichaël Zasso <targos@protonmail.com>2019-03-14 18:49:21 +0100
commit7b48713334469818661fe276cf571de9c7899f2d (patch)
tree4dbda49ac88db76ce09dc330a0cb587e68e139ba /deps/v8/test/cctest/test-dictionary.cc
parent8549ac09b256666cf5275224ec58fab9939ff32e (diff)
downloadandroid-node-v8-7b48713334469818661fe276cf571de9c7899f2d.tar.gz
android-node-v8-7b48713334469818661fe276cf571de9c7899f2d.tar.bz2
android-node-v8-7b48713334469818661fe276cf571de9c7899f2d.zip
deps: update V8 to 7.3.492.25
PR-URL: https://github.com/nodejs/node/pull/25852 Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'deps/v8/test/cctest/test-dictionary.cc')
-rw-r--r--deps/v8/test/cctest/test-dictionary.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/deps/v8/test/cctest/test-dictionary.cc b/deps/v8/test/cctest/test-dictionary.cc
index 1101ec06eb..feeaeb4214 100644
--- a/deps/v8/test/cctest/test-dictionary.cc
+++ b/deps/v8/test/cctest/test-dictionary.cc
@@ -34,7 +34,6 @@
#include "src/global-handles.h"
#include "src/heap/factory.h"
#include "src/heap/spaces.h"
-#include "src/macro-assembler.h"
#include "src/objects-inl.h"
#include "src/objects/hash-table-inl.h"
#include "test/cctest/heap/heap-utils.h"
@@ -86,7 +85,7 @@ static void TestHashMap(Handle<HashMap> table) {
CHECK_EQ(table->NumberOfElements(), i + 1);
CHECK_NE(table->FindEntry(isolate, key), HashMap::kNotFound);
CHECK_EQ(table->Lookup(key), *value);
- CHECK(key->GetIdentityHash(isolate)->IsSmi());
+ CHECK(key->GetIdentityHash()->IsSmi());
}
// Keys never added to the map which already have an identity hash
@@ -96,7 +95,7 @@ static void TestHashMap(Handle<HashMap> table) {
CHECK(key->GetOrCreateIdentityHash(isolate)->IsSmi());
CHECK_EQ(table->FindEntry(isolate, key), HashMap::kNotFound);
CHECK_EQ(table->Lookup(key), roots.the_hole_value());
- CHECK(key->GetIdentityHash(isolate)->IsSmi());
+ CHECK(key->GetIdentityHash()->IsSmi());
}
// Keys that don't have an identity hash should not be found and also
@@ -104,7 +103,7 @@ static void TestHashMap(Handle<HashMap> table) {
for (int i = 0; i < 100; i++) {
Handle<JSReceiver> key = factory->NewJSArray(7);
CHECK_EQ(table->Lookup(key), roots.the_hole_value());
- Object* identity_hash = key->GetIdentityHash(isolate);
+ Object identity_hash = key->GetIdentityHash();
CHECK_EQ(roots.undefined_value(), identity_hash);
}
}
@@ -157,7 +156,7 @@ static void TestHashSet(Handle<HashSet> table) {
table = HashSet::Add(isolate, table, key);
CHECK_EQ(table->NumberOfElements(), i + 2);
CHECK(table->Has(isolate, key));
- CHECK(key->GetIdentityHash(isolate)->IsSmi());
+ CHECK(key->GetIdentityHash()->IsSmi());
}
// Keys never added to the map which already have an identity hash
@@ -166,7 +165,7 @@ static void TestHashSet(Handle<HashSet> table) {
Handle<JSReceiver> key = factory->NewJSArray(7);
CHECK(key->GetOrCreateIdentityHash(isolate)->IsSmi());
CHECK(!table->Has(isolate, key));
- CHECK(key->GetIdentityHash(isolate)->IsSmi());
+ CHECK(key->GetIdentityHash()->IsSmi());
}
// Keys that don't have an identity hash should not be found and also
@@ -174,7 +173,7 @@ static void TestHashSet(Handle<HashSet> table) {
for (int i = 0; i < 100; i++) {
Handle<JSReceiver> key = factory->NewJSArray(7);
CHECK(!table->Has(isolate, key));
- Object* identity_hash = key->GetIdentityHash(isolate);
+ Object identity_hash = key->GetIdentityHash();
CHECK_EQ(ReadOnlyRoots(CcTest::heap()).undefined_value(), identity_hash);
}
}
@@ -188,6 +187,9 @@ TEST(HashSet) {
class ObjectHashTableTest: public ObjectHashTable {
public:
+ explicit ObjectHashTableTest(ObjectHashTable o) : ObjectHashTable(o) {}
+ ObjectHashTableTest* operator->() { return this; }
+
void insert(int entry, int key, int value) {
set(EntryToIndex(entry), Smi::FromInt(key));
set(EntryToIndex(entry) + 1, Smi::FromInt(value));
@@ -211,7 +213,7 @@ TEST(HashTableRehash) {
// Test almost filled table.
{
Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 100);
- ObjectHashTableTest* t = reinterpret_cast<ObjectHashTableTest*>(*table);
+ ObjectHashTableTest t(*table);
int capacity = t->capacity();
for (int i = 0; i < capacity - 1; i++) {
t->insert(i, i * i, i);
@@ -224,7 +226,7 @@ TEST(HashTableRehash) {
// Test half-filled table.
{
Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 100);
- ObjectHashTableTest* t = reinterpret_cast<ObjectHashTableTest*>(*table);
+ ObjectHashTableTest t(*table);
int capacity = t->capacity();
for (int i = 0; i < capacity / 2; i++) {
t->insert(i, i * i, i);