Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(584)

Unified Diff: test/cctest/test-api.cc

Issue 7285031: Remove unmarked entries from per context map caches. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/v8-counters.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 097743dd1fdb3b6e4f3ff4aad4e6978281378d0d..1531f905d1b078f6286418e3c0096e98350a8a66 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -14659,3 +14659,28 @@ THREADED_TEST(ReadOnlyIndexedProperties) {
obj->Set(v8_str("2000000000"), v8_str("foobar"));
CHECK_EQ(v8_str("DONT_CHANGE"), obj->Get(v8_str("2000000000")));
}
+
+
+THREADED_TEST(Regress1516) {
+ v8::HandleScope scope;
+
+ LocalContext context;
+ { v8::HandleScope temp_scope;
+ CompileRun("({'a': 0})");
+ }
+
+ int elements;
+ { i::MapCache* map_cache =
+ i::MapCache::cast(i::Isolate::Current()->context()->map_cache());
+ elements = map_cache->NumberOfElements();
+ CHECK_LE(1, elements);
+ }
+
+ i::Isolate::Current()->heap()->CollectAllGarbage(true);
+ { i::Object* raw_map_cache = i::Isolate::Current()->context()->map_cache();
+ if (raw_map_cache != i::Isolate::Current()->heap()->undefined_value()) {
+ i::MapCache* map_cache = i::MapCache::cast(raw_map_cache);
+ CHECK_GT(elements, map_cache->NumberOfElements());
+ }
+ }
+}
« no previous file with comments | « src/v8-counters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698