Fix incremental marking of native context when bootstrapping.
authorjarin@chromium.org <jarin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 13 May 2014 08:48:39 +0000 (08:48 +0000)
committerjarin@chromium.org <jarin@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 13 May 2014 08:48:39 +0000 (08:48 +0000)
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

index 0cf6a9e..b726a9b 100644 (file)
@@ -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);
   }