From 2b9de3866f1ae5b86e64a6dc41d3097eab4a14eb Mon Sep 17 00:00:00 2001 From: "jarin@chromium.org" Date: Tue, 13 May 2014 08:48:39 +0000 Subject: [PATCH] Fix incremental marking of native context when bootstrapping. This should fix one of the arm64 build breaks - we have tried to mark half-initialized native context there, but the normalized_map_cache entry was still undefined. R=hpayer@chromium.org BUG= Review URL: https://codereview.chromium.org/284633002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21283 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/incremental-marking.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/incremental-marking.cc b/src/incremental-marking.cc index 0cf6a9e..b726a9b 100644 --- a/src/incremental-marking.cc +++ b/src/incremental-marking.cc @@ -222,9 +222,13 @@ class IncrementalMarkingMarkingVisitor static void VisitNativeContextIncremental(Map* map, HeapObject* object) { Context* context = Context::cast(object); - // We will mark cache black with a separate pass - // when we finish marking. - MarkObjectGreyDoNotEnqueue(context->normalized_map_cache()); + // We will mark cache black with a separate pass when we finish marking. + // Note that GC can happen when the context is not fully initialized, + // so the cache can be undefined. + Object* cache = context->get(Context::NORMALIZED_MAP_CACHE_INDEX); + if (!cache->IsUndefined()) { + MarkObjectGreyDoNotEnqueue(cache); + } VisitNativeContext(map, context); } -- 2.7.4