Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 3030b8a1e03879085f6d801682c8ac4839136d3a..7d2657387fd0b3cec4e34f2c340b518d38b6a8e9 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -7426,9 +7426,11 @@ void HandleScopeImplementer::IterateThis(ObjectVisitor* v) { |
v->VisitPointers(blocks()->last(), handle_scope_data_.next); |
} |
- if (!saved_contexts_.is_empty()) { |
- Object** start = reinterpret_cast<Object**>(&saved_contexts_.first()); |
- v->VisitPointers(start, start + saved_contexts_.length()); |
+ List<Context*>* context_lists[2] = { &saved_contexts_, &entered_contexts_}; |
+ for (unsigned i = 0; i < ARRAY_SIZE(context_lists); i++) { |
+ if (context_lists[i]->is_empty()) continue; |
+ Object** start = reinterpret_cast<Object**>(&context_lists[i]->first()); |
Michael Starzinger
2013/09/24 11:30:46
Better use context_lists[i]->ToVector().start() in
|
+ v->VisitPointers(start, start + context_lists[i]->length()); |
} |
} |