Visit code objects in native contexts only during full GCs.

BUG=

Review URL: https://codereview.chromium.org/887943002

Cr-Commit-Position: refs/heads/master@{#26351}
This commit is contained in:
hpayer 2015-01-30 03:26:28 -08:00 committed by Commit bot
parent 6149d5ec76
commit 11aa116f1f

View File

@ -303,8 +303,13 @@ struct WeakListVisitor<Context> {
// Process the three weak lists linked off the context.
DoWeakList<JSFunction>(heap, context, retainer,
Context::OPTIMIZED_FUNCTIONS_LIST);
DoWeakList<Code>(heap, context, retainer, Context::OPTIMIZED_CODE_LIST);
DoWeakList<Code>(heap, context, retainer, Context::DEOPTIMIZED_CODE_LIST);
// Code objects are always allocated in Code space, we do not have to visit
// them during scavenges.
if (heap->gc_state() == Heap::MARK_COMPACT) {
DoWeakList<Code>(heap, context, retainer, Context::OPTIMIZED_CODE_LIST);
DoWeakList<Code>(heap, context, retainer, Context::DEOPTIMIZED_CODE_LIST);
}
}
template <class T>