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

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

Issue 301553003: Make incremental marker post-process JSWeakCollection. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Hide some visitor functions. Created 6 years, 7 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/runtime.cc ('k') | test/cctest/test-weaksets.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-weakmaps.cc
diff --git a/test/cctest/test-weakmaps.cc b/test/cctest/test-weakmaps.cc
index 369dae5e999f91205b5e877283cd318b9e09ee6d..2684deb4158efba23712c73c90be81d80cd857bb 100644
--- a/test/cctest/test-weakmaps.cc
+++ b/test/cctest/test-weakmaps.cc
@@ -46,10 +46,12 @@ static Handle<JSWeakMap> AllocateJSWeakMap(Isolate* isolate) {
Handle<Map> map = factory->NewMap(JS_WEAK_MAP_TYPE, JSWeakMap::kSize);
Handle<JSObject> weakmap_obj = factory->NewJSObjectFromMap(map);
Handle<JSWeakMap> weakmap(JSWeakMap::cast(*weakmap_obj));
- // Do not use handles for the hash table, it would make entries strong.
- Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 1);
- weakmap->set_table(*table);
- weakmap->set_next(Smi::FromInt(0));
+ // Do not leak handles for the hash table, it would make entries strong.
+ {
+ HandleScope scope(isolate);
+ Handle<ObjectHashTable> table = ObjectHashTable::New(isolate, 1);
+ weakmap->set_table(*table);
+ }
return weakmap;
}
« no previous file with comments | « src/runtime.cc ('k') | test/cctest/test-weaksets.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698