From: vegorov@chromium.org Date: Tue, 19 Oct 2010 08:14:41 +0000 (+0000) Subject: Clear normalized map caches in all global contexts not just in those reachable from... X-Git-Tag: upstream/4.7.83~21070 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82b380d3b855efa04756fe44d354dc5128ebf0dc;p=platform%2Fupstream%2Fv8.git Clear normalized map caches in all global contexts not just in those reachable from ThreadLocalTops. Issue reported by Mark Lam from Hewlett-Packard Development Company, LP. Review URL: http://codereview.chromium.org/3828011 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5654 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/heap.cc b/src/heap.cc index de0c294..d0f1f95 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); + } }