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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 4953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4964 | 4964 |
4965 // Update inline allocation limit for old spaces. | 4965 // Update inline allocation limit for old spaces. |
4966 PagedSpaces spaces(this); | 4966 PagedSpaces spaces(this); |
4967 for (PagedSpace* space = spaces.next(); space != NULL; | 4967 for (PagedSpace* space = spaces.next(); space != NULL; |
4968 space = spaces.next()) { | 4968 space = spaces.next()) { |
4969 space->EmptyAllocationInfo(); | 4969 space->EmptyAllocationInfo(); |
4970 } | 4970 } |
4971 } | 4971 } |
4972 | 4972 |
4973 | 4973 |
4974 void Heap::LowerInlineAllocationLimit(intptr_t step) { | |
4975 new_space()->LowerInlineAllocationLimit(step); | |
4976 } | |
4977 | |
4978 | |
4979 void Heap::ResetInlineAllocationLimit() { | |
4980 new_space()->LowerInlineAllocationLimit( | |
4981 ScavengeJob::kBytesAllocatedBeforeNextIdleTask); | |
4982 } | |
4983 | |
4984 | |
4985 V8_DECLARE_ONCE(initialize_gc_once); | 4974 V8_DECLARE_ONCE(initialize_gc_once); |
4986 | 4975 |
4987 static void InitializeGCOnce() { | 4976 static void InitializeGCOnce() { |
4988 Scavenger::Initialize(); | 4977 Scavenger::Initialize(); |
4989 StaticScavengeVisitor::Initialize(); | 4978 StaticScavengeVisitor::Initialize(); |
4990 MarkCompactCollector::Initialize(); | 4979 MarkCompactCollector::Initialize(); |
4991 } | 4980 } |
4992 | 4981 |
4993 | 4982 |
4994 bool Heap::SetUp() { | 4983 bool Heap::SetUp() { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5083 | 5072 |
5084 array_buffer_tracker_ = new ArrayBufferTracker(this); | 5073 array_buffer_tracker_ = new ArrayBufferTracker(this); |
5085 | 5074 |
5086 LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity())); | 5075 LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity())); |
5087 LOG(isolate_, IntPtrTEvent("heap-available", Available())); | 5076 LOG(isolate_, IntPtrTEvent("heap-available", Available())); |
5088 | 5077 |
5089 store_buffer()->SetUp(); | 5078 store_buffer()->SetUp(); |
5090 | 5079 |
5091 mark_compact_collector()->SetUp(); | 5080 mark_compact_collector()->SetUp(); |
5092 | 5081 |
5093 ResetInlineAllocationLimit(); | 5082 new_space()->SetIdleScavengeStep( |
| 5083 ScavengeJob::kBytesAllocatedBeforeNextIdleTask); |
5094 | 5084 |
5095 return true; | 5085 return true; |
5096 } | 5086 } |
5097 | 5087 |
5098 | 5088 |
5099 bool Heap::CreateHeapObjects() { | 5089 bool Heap::CreateHeapObjects() { |
5100 // Create initial maps. | 5090 // Create initial maps. |
5101 if (!CreateInitialMaps()) return false; | 5091 if (!CreateInitialMaps()) return false; |
5102 CreateApiObjects(); | 5092 CreateApiObjects(); |
5103 | 5093 |
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6120 } | 6110 } |
6121 | 6111 |
6122 | 6112 |
6123 // static | 6113 // static |
6124 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6114 int Heap::GetStaticVisitorIdForMap(Map* map) { |
6125 return StaticVisitorBase::GetVisitorId(map); | 6115 return StaticVisitorBase::GetVisitorId(map); |
6126 } | 6116 } |
6127 | 6117 |
6128 } // namespace internal | 6118 } // namespace internal |
6129 } // namespace v8 | 6119 } // namespace v8 |
OLD | NEW |