| Index: src/heap/objects-visiting-inl.h
|
| diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h
|
| index 493dce7179c54125f98f614058990679556db2b6..ebf1b919f6394d7d4bd13c114e888c773f5909a1 100644
|
| --- a/src/heap/objects-visiting-inl.h
|
| +++ b/src/heap/objects-visiting-inl.h
|
| @@ -295,6 +295,13 @@ void StaticMarkingVisitor<StaticVisitor>::VisitBytecodeArray(
|
| template <typename StaticVisitor>
|
| void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext(
|
| Map* map, HeapObject* object) {
|
| + // GC can happen when the context is not fully initialized,
|
| + // so the cache can be undefined.
|
| + Object* cache =
|
| + Context::cast(object)->get(Context::NORMALIZED_MAP_CACHE_INDEX);
|
| + if (cache->IsNormalizedMapCache()) {
|
| + NormalizedMapCache::cast(cache)->Clear();
|
| + }
|
| FixedBodyVisitor<StaticVisitor, Context::MarkCompactBodyDescriptor,
|
| void>::Visit(map, object);
|
| }
|
|
|