aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-dictionary.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2011-11-02 16:58:08 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2011-11-02 16:58:35 +0100
commitedea4122b1c725a9f7873c02fe04100995472ddc (patch)
tree3334347495150cfd3a68909489689c112457ae07 /deps/v8/test/cctest/test-dictionary.cc
parentcc9223406837e7610b5f36b16b6a0e51861370cb (diff)
downloadandroid-node-v8-edea4122b1c725a9f7873c02fe04100995472ddc.tar.gz
android-node-v8-edea4122b1c725a9f7873c02fe04100995472ddc.tar.bz2
android-node-v8-edea4122b1c725a9f7873c02fe04100995472ddc.zip
Revert "Upgrade V8 to 3.7.1"
This reverts commit 92f5a5d3caf01f382f90c235e9057590a5e76870. V8 3.7.1 in debug mode on ia32 has a curious race-like bug where an fs.Stats object is not fully formed until some time after it's created. This is easy to demonstrate by running `make test-debug`. V8 3.7.0 does not exhibit this behaviour so back we go. Fixes #1981.
Diffstat (limited to 'deps/v8/test/cctest/test-dictionary.cc')
-rw-r--r--deps/v8/test/cctest/test-dictionary.cc69
1 files changed, 6 insertions, 63 deletions
diff --git a/deps/v8/test/cctest/test-dictionary.cc b/deps/v8/test/cctest/test-dictionary.cc
index 793e228a97..15a854b363 100644
--- a/deps/v8/test/cctest/test-dictionary.cc
+++ b/deps/v8/test/cctest/test-dictionary.cc
@@ -38,7 +38,6 @@
using namespace v8::internal;
-
TEST(ObjectHashTable) {
v8::HandleScope scope;
LocalContext context;
@@ -67,8 +66,7 @@ TEST(ObjectHashTable) {
CHECK_EQ(table->NumberOfDeletedElements(), 1);
CHECK_EQ(table->Lookup(*a), HEAP->undefined_value());
- // Keys should map back to their respective values and also should get
- // an identity hash code generated.
+ // Keys should map back to their respective values.
for (int i = 0; i < 100; i++) {
Handle<JSObject> key = FACTORY->NewJSArray(7);
Handle<JSObject> value = FACTORY->NewJSArray(11);
@@ -76,67 +74,12 @@ TEST(ObjectHashTable) {
CHECK_EQ(table->NumberOfElements(), i + 1);
CHECK_NE(table->FindEntry(*key), ObjectHashTable::kNotFound);
CHECK_EQ(table->Lookup(*key), *value);
- CHECK(key->GetIdentityHash(OMIT_CREATION)->ToObjectChecked()->IsSmi());
- }
-
- // Keys never added to the map which already have an identity hash
- // code should not be found.
- for (int i = 0; i < 100; i++) {
- Handle<JSObject> key = FACTORY->NewJSArray(7);
- CHECK(key->GetIdentityHash(ALLOW_CREATION)->ToObjectChecked()->IsSmi());
- CHECK_EQ(table->FindEntry(*key), ObjectHashTable::kNotFound);
- CHECK_EQ(table->Lookup(*key), HEAP->undefined_value());
- CHECK(key->GetIdentityHash(OMIT_CREATION)->ToObjectChecked()->IsSmi());
}
- // Keys that don't have an identity hash should not be found and also
- // should not get an identity hash code generated.
- for (int i = 0; i < 100; i++) {
- Handle<JSObject> key = FACTORY->NewJSArray(7);
- CHECK_EQ(table->Lookup(*key), HEAP->undefined_value());
- CHECK_EQ(key->GetIdentityHash(OMIT_CREATION), HEAP->undefined_value());
+ // Keys never added to the map should not be found.
+ for (int i = 0; i < 1000; i++) {
+ Handle<JSObject> o = FACTORY->NewJSArray(100);
+ CHECK_EQ(table->FindEntry(*o), ObjectHashTable::kNotFound);
+ CHECK_EQ(table->Lookup(*o), HEAP->undefined_value());
}
}
-
-
-#ifdef DEBUG
-TEST(ObjectHashSetCausesGC) {
- v8::HandleScope scope;
- LocalContext context;
- Handle<ObjectHashSet> table = FACTORY->NewObjectHashSet(1);
- Handle<JSObject> key = FACTORY->NewJSArray(0);
-
- // Simulate a full heap so that generating an identity hash code
- // in subsequent calls will request GC.
- FLAG_gc_interval = 0;
-
- // Calling Contains() should not cause GC ever.
- CHECK(!table->Contains(*key));
-
- // Calling Remove() should not cause GC ever.
- CHECK(!table->Remove(*key)->IsFailure());
-
- // Calling Add() should request GC by returning a failure.
- CHECK(table->Add(*key)->IsRetryAfterGC());
-}
-#endif
-
-
-#ifdef DEBUG
-TEST(ObjectHashTableCausesGC) {
- v8::HandleScope scope;
- LocalContext context;
- Handle<ObjectHashTable> table = FACTORY->NewObjectHashTable(1);
- Handle<JSObject> key = FACTORY->NewJSArray(0);
-
- // Simulate a full heap so that generating an identity hash code
- // in subsequent calls will request GC.
- FLAG_gc_interval = 0;
-
- // Calling Lookup() should not cause GC ever.
- CHECK(table->Lookup(*key)->IsUndefined());
-
- // Calling Put() should request GC by returning a failure.
- CHECK(table->Put(*key, *key)->IsRetryAfterGC());
-}
-#endif