| OLD | NEW | 
|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "src/heap/heap.h" | 5 #include "src/heap/heap.h" | 
| 6 | 6 | 
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" | 
| 8 #include "src/api.h" | 8 #include "src/api.h" | 
| 9 #include "src/ast/context-slot-cache.h" | 9 #include "src/ast/context-slot-cache.h" | 
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" | 
| (...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 896     } | 896     } | 
| 897   } | 897   } | 
| 898   set_current_gc_flags(kNoGCFlags); | 898   set_current_gc_flags(kNoGCFlags); | 
| 899   new_space_.Shrink(); | 899   new_space_.Shrink(); | 
| 900   UncommitFromSpace(); | 900   UncommitFromSpace(); | 
| 901 } | 901 } | 
| 902 | 902 | 
| 903 | 903 | 
| 904 void Heap::ReportExternalMemoryPressure(const char* gc_reason) { | 904 void Heap::ReportExternalMemoryPressure(const char* gc_reason) { | 
| 905   if (incremental_marking()->IsStopped()) { | 905   if (incremental_marking()->IsStopped()) { | 
|  | 906     v8::GCCallbackFlags flags = static_cast<v8::GCCallbackFlags>( | 
|  | 907         kGCCallbackFlagSynchronousPhantomCallbackProcessing | | 
|  | 908         kGCCallbackFlagCollectAllExternalMemory); | 
| 906     if (incremental_marking()->CanBeActivated()) { | 909     if (incremental_marking()->CanBeActivated()) { | 
| 907       StartIncrementalMarking( | 910       StartIncrementalMarking(i::Heap::kNoGCFlags, flags, gc_reason); | 
| 908           i::Heap::kNoGCFlags, |  | 
| 909           kGCCallbackFlagSynchronousPhantomCallbackProcessing, gc_reason); |  | 
| 910     } else { | 911     } else { | 
| 911       CollectAllGarbage(i::Heap::kNoGCFlags, gc_reason, | 912       CollectAllGarbage(i::Heap::kNoGCFlags, gc_reason, flags); | 
| 912                         kGCCallbackFlagSynchronousPhantomCallbackProcessing); |  | 
| 913     } | 913     } | 
| 914   } else { | 914   } else { | 
| 915     // Incremental marking is turned on an has already been started. | 915     // Incremental marking is turned on an has already been started. | 
| 916 | 916 | 
| 917     // TODO(mlippautz): Compute the time slice for incremental marking based on | 917     // TODO(mlippautz): Compute the time slice for incremental marking based on | 
| 918     // memory pressure. | 918     // memory pressure. | 
| 919     double deadline = MonotonicallyIncreasingTimeInMs() + | 919     double deadline = MonotonicallyIncreasingTimeInMs() + | 
| 920                       FLAG_external_allocation_limit_incremental_time; | 920                       FLAG_external_allocation_limit_incremental_time; | 
| 921     incremental_marking()->AdvanceIncrementalMarking( | 921     incremental_marking()->AdvanceIncrementalMarking( | 
| 922         deadline, | 922         deadline, | 
| (...skipping 5538 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 6461 } | 6461 } | 
| 6462 | 6462 | 
| 6463 | 6463 | 
| 6464 // static | 6464 // static | 
| 6465 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6465 int Heap::GetStaticVisitorIdForMap(Map* map) { | 
| 6466   return StaticVisitorBase::GetVisitorId(map); | 6466   return StaticVisitorBase::GetVisitorId(map); | 
| 6467 } | 6467 } | 
| 6468 | 6468 | 
| 6469 }  // namespace internal | 6469 }  // namespace internal | 
| 6470 }  // namespace v8 | 6470 }  // namespace v8 | 
| OLD | NEW | 
|---|