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

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

Issue 1488593003: Optimize clearing of map transitions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: base Created 5 years 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
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/ast/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 2473 matching lines...) Expand 10 before | Expand all | Expand 10 after
2484 AllocationResult Heap::AllocateWeakCell(HeapObject* value) { 2484 AllocationResult Heap::AllocateWeakCell(HeapObject* value) {
2485 int size = WeakCell::kSize; 2485 int size = WeakCell::kSize;
2486 STATIC_ASSERT(WeakCell::kSize <= Page::kMaxRegularHeapObjectSize); 2486 STATIC_ASSERT(WeakCell::kSize <= Page::kMaxRegularHeapObjectSize);
2487 HeapObject* result = nullptr; 2487 HeapObject* result = nullptr;
2488 { 2488 {
2489 AllocationResult allocation = AllocateRaw(size, OLD_SPACE); 2489 AllocationResult allocation = AllocateRaw(size, OLD_SPACE);
2490 if (!allocation.To(&result)) return allocation; 2490 if (!allocation.To(&result)) return allocation;
2491 } 2491 }
2492 result->set_map_no_write_barrier(weak_cell_map()); 2492 result->set_map_no_write_barrier(weak_cell_map());
2493 WeakCell::cast(result)->initialize(value); 2493 WeakCell::cast(result)->initialize(value);
2494 WeakCell::cast(result)->clear_next(this); 2494 WeakCell::cast(result)->clear_next(the_hole_value());
2495 return result; 2495 return result;
2496 } 2496 }
2497 2497
2498 2498
2499 AllocationResult Heap::AllocateTransitionArray(int capacity) { 2499 AllocationResult Heap::AllocateTransitionArray(int capacity) {
2500 DCHECK(capacity > 0); 2500 DCHECK(capacity > 0);
2501 HeapObject* raw_array = nullptr; 2501 HeapObject* raw_array = nullptr;
2502 { 2502 {
2503 AllocationResult allocation = AllocateRawFixedArray(capacity, TENURED); 2503 AllocationResult allocation = AllocateRawFixedArray(capacity, TENURED);
2504 if (!allocation.To(&raw_array)) return allocation; 2504 if (!allocation.To(&raw_array)) return allocation;
(...skipping 3615 matching lines...) Expand 10 before | Expand all | Expand 10 after
6120 } 6120 }
6121 6121
6122 6122
6123 // static 6123 // static
6124 int Heap::GetStaticVisitorIdForMap(Map* map) { 6124 int Heap::GetStaticVisitorIdForMap(Map* map) {
6125 return StaticVisitorBase::GetVisitorId(map); 6125 return StaticVisitorBase::GetVisitorId(map);
6126 } 6126 }
6127 6127
6128 } // namespace internal 6128 } // namespace internal
6129 } // namespace v8 6129 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698