BUG=v8:2073
R=mstarzinger@chromium.org
Review URL: https://chromiumcodereview.appspot.com/
25702008
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17141
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
"garbage collect maps from which no objects can be reached")
DEFINE_bool(weak_embedded_maps_in_optimized_code, true,
"make maps embedded in optimized code weak")
-DEFINE_bool(weak_embedded_objects_in_optimized_code, false,
+DEFINE_bool(weak_embedded_objects_in_optimized_code, true,
"make objects embedded in optimized code weak")
DEFINE_bool(flush_code, true,
"flush code that we expect not to use again (during full gc)")
WeakHashTable::cast(weak_object_to_code_table_)->Put(obj, dep);
WeakHashTable* table;
if (!maybe_obj->To(&table)) return maybe_obj;
+ if (ShouldZapGarbage() && weak_object_to_code_table_ != table) {
+ WeakHashTable::cast(weak_object_to_code_table_)->Zap(the_hole_value());
+ }
set_weak_object_to_code_table(table);
ASSERT_EQ(dep, WeakHashTable::cast(weak_object_to_code_table_)->Lookup(obj));
return weak_object_to_code_table_;
// key to the hole value causes removal of the whole entry.
MUST_USE_RESULT MaybeObject* Put(Object* key, Object* value);
+ // This function is called when heap verification is turned on.
+ void Zap(Object* value) {
+ int capacity = Capacity();
+ for (int i = 0; i < capacity; i++) {
+ set(EntryToIndex(i), value);
+ set(EntryToValueIndex(i), value);
+ }
+ }
+
private:
friend class MarkCompactCollector;