Reviewers: sgjesse, Mark Lam,

Description:
Clear normalized map caches in all global contexts not just in those reachable
from ThreadLocalTops.

Issue reported by Mark Lam <[email protected]> from Hewlett-Packard Development
Company, LP.

Please review this at http://codereview.chromium.org/3828011/show

Affected files:
  M src/heap.cc


Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index de0c294f0da9a5ed03ec920dce35e3a0309ea7de..d0f1f956b14d3c28871a3948474ac480003b1da8 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -606,19 +606,14 @@ void Heap::ClearJSFunctionResultCaches() {
 }


-class ClearThreadNormalizedMapCachesVisitor: public ThreadVisitor {
-  virtual void VisitThread(ThreadLocalTop* top) {
-    Context* context = top->context_;
-    if (context == NULL) return;
-    context->global()->global_context()->normalized_map_cache()->Clear();
-  }
-};
-
-
 void Heap::ClearNormalizedMapCaches() {
   if (Bootstrapper::IsActive()) return;
-  ClearThreadNormalizedMapCachesVisitor visitor;
-  ThreadManager::IterateArchivedThreads(&visitor);
+
+  Object* context = global_contexts_list_;
+  while (!context->IsUndefined()) {
+    Context::cast(context)->normalized_map_cache()->Clear();
+    context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK);
+  }
 }




--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to