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

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

Issue 1134293002: Version 4.3.61.21 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.3
Patch Set: Created 5 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 | « include/v8-version.h ('k') | test/cctest/test-mementos.cc » ('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/v8.h" 5 #include "src/v8.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 812 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 } 823 }
824 824
825 825
826 void Heap::EnsureFillerObjectAtTop() { 826 void Heap::EnsureFillerObjectAtTop() {
827 // There may be an allocation memento behind every object in new space. 827 // There may be an allocation memento behind every object in new space.
828 // If we evacuate a not full new space or if we are on the last page of 828 // If we evacuate a not full new space or if we are on the last page of
829 // the new space, then there may be uninitialized memory behind the top 829 // the new space, then there may be uninitialized memory behind the top
830 // pointer of the new space page. We store a filler object there to 830 // pointer of the new space page. We store a filler object there to
831 // identify the unused space. 831 // identify the unused space.
832 Address from_top = new_space_.top(); 832 Address from_top = new_space_.top();
833 Address from_limit = new_space_.limit(); 833 // Check that from_top is inside its page (i.e., not at the end).
834 if (from_top < from_limit) { 834 Address space_end = new_space_.ToSpaceEnd();
835 int remaining_in_page = static_cast<int>(from_limit - from_top); 835 if (from_top < space_end) {
836 CreateFillerObjectAt(from_top, remaining_in_page); 836 Page* page = Page::FromAddress(from_top);
837 if (page->Contains(from_top)) {
838 int remaining_in_page = static_cast<int>(page->area_end() - from_top);
839 CreateFillerObjectAt(from_top, remaining_in_page);
840 }
837 } 841 }
838 } 842 }
839 843
840 844
841 bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason, 845 bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
842 const char* collector_reason, 846 const char* collector_reason,
843 const v8::GCCallbackFlags gc_callback_flags) { 847 const v8::GCCallbackFlags gc_callback_flags) {
844 // The VM is in the GC state until exiting this function. 848 // The VM is in the GC state until exiting this function.
845 VMState<GC> state(isolate_); 849 VMState<GC> state(isolate_);
846 850
(...skipping 5592 matching lines...) Expand 10 before | Expand all | Expand 10 after
6439 static_cast<int>(object_sizes_last_time_[index])); 6443 static_cast<int>(object_sizes_last_time_[index]));
6440 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6444 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6441 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6445 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6442 6446
6443 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6447 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6444 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6448 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6445 ClearObjectStats(); 6449 ClearObjectStats();
6446 } 6450 }
6447 } 6451 }
6448 } // namespace v8::internal 6452 } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-version.h ('k') | test/cctest/test-mementos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698