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

Side by Side Diff: src/heap/heap-inl.h

Issue 1932883002: Revert "[heap] Optimize NewSpace::AllocatedSinceLastGC" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « src/heap/heap.h ('k') | src/heap/spaces.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 #ifndef V8_HEAP_HEAP_INL_H_ 5 #ifndef V8_HEAP_HEAP_INL_H_
6 #define V8_HEAP_HEAP_INL_H_ 6 #define V8_HEAP_HEAP_INL_H_
7 7
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "src/base/platform/platform.h" 10 #include "src/base/platform/platform.h"
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 } 453 }
454 UNREACHABLE(); 454 UNREACHABLE();
455 return false; 455 return false;
456 } 456 }
457 457
458 void Heap::CopyBlock(Address dst, Address src, int byte_size) { 458 void Heap::CopyBlock(Address dst, Address src, int byte_size) {
459 CopyWords(reinterpret_cast<Object**>(dst), reinterpret_cast<Object**>(src), 459 CopyWords(reinterpret_cast<Object**>(dst), reinterpret_cast<Object**>(src),
460 static_cast<size_t>(byte_size / kPointerSize)); 460 static_cast<size_t>(byte_size / kPointerSize));
461 } 461 }
462 462
463 void Heap::UpdateNewSpaceAllocationCounter() {
464 new_space_allocation_counter_ = NewSpaceAllocationCounter();
465 }
466
467 size_t Heap::NewSpaceAllocationCounter() {
468 return new_space_allocation_counter_ + new_space()->AllocatedSinceLastGC();
469 }
470
471 template <Heap::FindMementoMode mode> 463 template <Heap::FindMementoMode mode>
472 AllocationMemento* Heap::FindAllocationMemento(HeapObject* object) { 464 AllocationMemento* Heap::FindAllocationMemento(HeapObject* object) {
473 // Check if there is potentially a memento behind the object. If 465 // Check if there is potentially a memento behind the object. If
474 // the last word of the memento is on another page we return 466 // the last word of the memento is on another page we return
475 // immediately. 467 // immediately.
476 Address object_address = object->address(); 468 Address object_address = object->address();
477 Address memento_address = object_address + object->Size(); 469 Address memento_address = object_address + object->Size();
478 Address last_memento_word_address = memento_address + kPointerSize; 470 Address last_memento_word_address = memento_address + kPointerSize;
479 if (!Page::OnSamePage(object_address, last_memento_word_address)) { 471 if (!Page::OnSamePage(object_address, last_memento_word_address)) {
480 return nullptr; 472 return nullptr;
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 734
743 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) { 735 void VerifySmisVisitor::VisitPointers(Object** start, Object** end) {
744 for (Object** current = start; current < end; current++) { 736 for (Object** current = start; current < end; current++) {
745 CHECK((*current)->IsSmi()); 737 CHECK((*current)->IsSmi());
746 } 738 }
747 } 739 }
748 } // namespace internal 740 } // namespace internal
749 } // namespace v8 741 } // namespace v8
750 742
751 #endif // V8_HEAP_HEAP_INL_H_ 743 #endif // V8_HEAP_HEAP_INL_H_
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698