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) {
117 FLAG_gc_interval = 0;
120 CHECK(!table->Contains(*key));
123 CHECK(!table->Remove(*key)->IsFailure());
126 CHECK(table->Add(*key)->IsRetryAfterGC());
132 TEST(ObjectHashTableCausesGC) {
146 FLAG_gc_interval = 0;
149 CHECK(table->Lookup(*key)->IsTheHole());
152 CHECK(table->Put(*key, *key)->IsRetryAfterGC());
static const int kNotFound
#define CHECK_EQ(expected, value)
V8EXPORT bool SetHiddenValue(Handle< String > key, Handle< Value > value)
#define CHECK_NE(unexpected, value)
Handle< ObjectHashTable > PutIntoObjectHashTable(Handle< ObjectHashTable > table, Handle< Object > key, Handle< Object > value)
static Local< Context > ToLocal(v8::internal::Handle< v8::internal::Context > obj)