| Index: src/heap.cc
|
| diff --git a/src/heap.cc b/src/heap.cc
|
| index 55d6c97bedcdb94d5d2a03dbd0204f337b9479fe..193f082f355cb1bac86df83e06e7608bb05f2ad2 100644
|
| --- a/src/heap.cc
|
| +++ b/src/heap.cc
|
| @@ -306,6 +306,7 @@ void Heap::ReportStatisticsAfterGC() {
|
|
|
| void Heap::GarbageCollectionPrologue() {
|
| TranscendentalCache::Clear();
|
| + ClearJSFunctionResultCaches();
|
| gc_count_++;
|
| unflattened_strings_length_ = 0;
|
| #ifdef DEBUG
|
| @@ -541,6 +542,28 @@ void Heap::EnsureFromSpaceIsCommitted() {
|
| }
|
|
|
|
|
| +class ClearThreadJSFunctionResultCachesVisitor: public ThreadVisitor {
|
| + virtual void VisitThread(ThreadLocalTop* top) {
|
| + Context* context = top->context_;
|
| + if (context == NULL) return;
|
| +
|
| + FixedArray* caches =
|
| + context->global()->global_context()->jsfunction_result_caches();
|
| + int length = caches->length();
|
| + for (int i = 0; i < length; i++) {
|
| + JSFunctionResultCache::cast(caches->get(i))->Clear();
|
| + }
|
| + }
|
| +};
|
| +
|
| +
|
| +void Heap::ClearJSFunctionResultCaches() {
|
| + if (Bootstrapper::IsActive()) return;
|
| + ClearThreadJSFunctionResultCachesVisitor visitor;
|
| + ThreadManager::IterateThreads(&visitor);
|
| +}
|
| +
|
| +
|
| void Heap::PerformGarbageCollection(AllocationSpace space,
|
| GarbageCollector collector,
|
| GCTracer* tracer) {
|
|
|