Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1246)

Side by Side Diff: src/heap/heap.cc

Issue 1415733004: Reland of "[heap] Divide available memory upon compaction tasks" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix size computation in TryRemoveMemory Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/mark-compact.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3029 matching lines...) Expand 10 before | Expand all | Expand 10 after
3040 void Heap::CreateFillerObjectAt(Address addr, int size) { 3040 void Heap::CreateFillerObjectAt(Address addr, int size) {
3041 if (size == 0) return; 3041 if (size == 0) return;
3042 HeapObject* filler = HeapObject::FromAddress(addr); 3042 HeapObject* filler = HeapObject::FromAddress(addr);
3043 if (size == kPointerSize) { 3043 if (size == kPointerSize) {
3044 filler->set_map_no_write_barrier( 3044 filler->set_map_no_write_barrier(
3045 reinterpret_cast<Map*>(root(kOnePointerFillerMapRootIndex))); 3045 reinterpret_cast<Map*>(root(kOnePointerFillerMapRootIndex)));
3046 } else if (size == 2 * kPointerSize) { 3046 } else if (size == 2 * kPointerSize) {
3047 filler->set_map_no_write_barrier( 3047 filler->set_map_no_write_barrier(
3048 reinterpret_cast<Map*>(root(kTwoPointerFillerMapRootIndex))); 3048 reinterpret_cast<Map*>(root(kTwoPointerFillerMapRootIndex)));
3049 } else { 3049 } else {
3050 DCHECK_GT(size, 2 * kPointerSize);
3050 filler->set_map_no_write_barrier( 3051 filler->set_map_no_write_barrier(
3051 reinterpret_cast<Map*>(root(kFreeSpaceMapRootIndex))); 3052 reinterpret_cast<Map*>(root(kFreeSpaceMapRootIndex)));
3052 FreeSpace::cast(filler)->nobarrier_set_size(size); 3053 FreeSpace::cast(filler)->nobarrier_set_size(size);
3053 } 3054 }
3054 // At this point, we may be deserializing the heap from a snapshot, and 3055 // At this point, we may be deserializing the heap from a snapshot, and
3055 // none of the maps have been created yet and are NULL. 3056 // none of the maps have been created yet and are NULL.
3056 DCHECK((filler->map() == NULL && !deserialization_complete_) || 3057 DCHECK((filler->map() == NULL && !deserialization_complete_) ||
3057 filler->map()->IsMap()); 3058 filler->map()->IsMap());
3058 } 3059 }
3059 3060
(...skipping 3060 matching lines...) Expand 10 before | Expand all | Expand 10 after
6120 } 6121 }
6121 6122
6122 6123
6123 // static 6124 // static
6124 int Heap::GetStaticVisitorIdForMap(Map* map) { 6125 int Heap::GetStaticVisitorIdForMap(Map* map) {
6125 return StaticVisitorBase::GetVisitorId(map); 6126 return StaticVisitorBase::GetVisitorId(map);
6126 } 6127 }
6127 6128
6128 } // namespace internal 6129 } // namespace internal
6129 } // namespace v8 6130 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698