39 using namespace v8::internal;
49 CHECK_EQ(table->NumberOfElements(), 1);
55 CHECK_EQ(table->NumberOfElements(), 1);
61 CHECK_EQ(table->NumberOfElements(), 1);
66 CHECK_EQ(table->NumberOfElements(), 0);
67 CHECK_EQ(table->NumberOfDeletedElements(), 1);
72 for (
int i = 0; i < 100; i++) {
76 CHECK_EQ(table->NumberOfElements(), i + 1);
78 CHECK_EQ(table->Lookup(*key), *value);
84 for (
int i = 0; i < 100; i++) {
94 for (
int i = 0; i < 100; i++) {
103 TEST(ObjectHashSetCausesGC) {
111 FLAG_gc_interval = 0;
114 CHECK(!table->Contains(*key));
117 CHECK(!table->Remove(*key)->IsFailure());
120 CHECK(table->Add(*key)->IsRetryAfterGC());
126 TEST(ObjectHashTableCausesGC) {
134 FLAG_gc_interval = 0;
137 CHECK(table->Lookup(*key)->IsUndefined());
140 CHECK(table->Put(*key, *key)->IsRetryAfterGC());
static const int kNotFound
#define CHECK_EQ(expected, value)
#define CHECK_NE(unexpected, value)
Handle< ObjectHashTable > PutIntoObjectHashTable(Handle< ObjectHashTable > table, Handle< Object > key, Handle< Object > value)