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

Unified Diff: src/mark-compact.cc

Issue 8715004: Fix assertion while marking Harmony weak maps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month 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 | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 74c077758b5fc81ae2a5f006966aff61b829dae9..493fe666aec09d0528d247b8de7e12c9da8f8a1f 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -966,12 +966,11 @@ class StaticMarkingVisitor : public StaticVisitorBase {
object_size);
// Mark the backing hash table without pushing it on the marking stack.
- ASSERT(!MarkCompactCollector::IsMarked(weak_map->unchecked_table()));
- ASSERT(MarkCompactCollector::IsMarked(weak_map->unchecked_table()->map()));
-
- HeapObject* unchecked_table = weak_map->unchecked_table();
- MarkBit mark_bit = Marking::MarkBitFrom(unchecked_table);
- collector->SetMark(unchecked_table, mark_bit);
+ ObjectHashTable* table = ObjectHashTable::cast(weak_map->table());
+ ASSERT(!MarkCompactCollector::IsMarked(table));
+ collector->SetMark(table, Marking::MarkBitFrom(table));
+ collector->MarkObject(table->map(), Marking::MarkBitFrom(table->map()));
+ ASSERT(MarkCompactCollector::IsMarked(table->map()));
}
static void VisitCode(Map* map, HeapObject* object) {
@@ -2297,7 +2296,7 @@ void MarkCompactCollector::ProcessWeakMaps() {
while (weak_map_obj != Smi::FromInt(0)) {
ASSERT(MarkCompactCollector::IsMarked(HeapObject::cast(weak_map_obj)));
JSWeakMap* weak_map = reinterpret_cast<JSWeakMap*>(weak_map_obj);
- ObjectHashTable* table = weak_map->unchecked_table();
+ ObjectHashTable* table = ObjectHashTable::cast(weak_map->table());
for (int i = 0; i < table->Capacity(); i++) {
if (MarkCompactCollector::IsMarked(HeapObject::cast(table->KeyAt(i)))) {
Object* value = table->get(table->EntryToValueIndex(i));
@@ -2318,7 +2317,7 @@ void MarkCompactCollector::ClearWeakMaps() {
while (weak_map_obj != Smi::FromInt(0)) {
ASSERT(MarkCompactCollector::IsMarked(HeapObject::cast(weak_map_obj)));
JSWeakMap* weak_map = reinterpret_cast<JSWeakMap*>(weak_map_obj);
- ObjectHashTable* table = weak_map->unchecked_table();
+ ObjectHashTable* table = ObjectHashTable::cast(weak_map->table());
for (int i = 0; i < table->Capacity(); i++) {
if (!MarkCompactCollector::IsMarked(HeapObject::cast(table->KeyAt(i)))) {
table->RemoveEntry(i);
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698