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.cc

Issue 207613004: Do not left-trim arrays when concurrent sweeping is active. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | src/mark-compact.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 3950 matching lines...) Expand 10 before | Expand all | Expand 10 after
3961 filler->set_map_no_write_barrier(one_pointer_filler_map()); 3961 filler->set_map_no_write_barrier(one_pointer_filler_map());
3962 } else if (size == 2 * kPointerSize) { 3962 } else if (size == 2 * kPointerSize) {
3963 filler->set_map_no_write_barrier(two_pointer_filler_map()); 3963 filler->set_map_no_write_barrier(two_pointer_filler_map());
3964 } else { 3964 } else {
3965 filler->set_map_no_write_barrier(free_space_map()); 3965 filler->set_map_no_write_barrier(free_space_map());
3966 FreeSpace::cast(filler)->set_size(size); 3966 FreeSpace::cast(filler)->set_size(size);
3967 } 3967 }
3968 } 3968 }
3969 3969
3970 3970
3971 bool Heap::CanMoveObjectStart(HeapObject* object) {
3972 Address address = object->address();
3973 bool is_in_old_pointer_space = InOldPointerSpace(address);
3974 bool is_in_old_data_space = InOldDataSpace(address);
3975
3976 if (lo_space()->Contains(object)) return false;
3977
3978 // We cannot move the object start if the given old space page is
3979 // concurrently swept.
3980 return (!is_in_old_pointer_space && !is_in_old_data_space) ||
3981 Page::FromAddress(address)->parallel_sweeping() <=
3982 MemoryChunk::PARALLEL_SWEEPING_FINALIZE;
3983 }
3984
3985
3971 void Heap::AdjustLiveBytes(Address address, int by, InvocationMode mode) { 3986 void Heap::AdjustLiveBytes(Address address, int by, InvocationMode mode) {
3972 if (incremental_marking()->IsMarking() && 3987 if (incremental_marking()->IsMarking() &&
3973 Marking::IsBlack(Marking::MarkBitFrom(address))) { 3988 Marking::IsBlack(Marking::MarkBitFrom(address))) {
3974 if (mode == FROM_GC) { 3989 if (mode == FROM_GC) {
3975 MemoryChunk::IncrementLiveBytesFromGC(address, by); 3990 MemoryChunk::IncrementLiveBytesFromGC(address, by);
3976 } else { 3991 } else {
3977 MemoryChunk::IncrementLiveBytesFromMutator(address, by); 3992 MemoryChunk::IncrementLiveBytesFromMutator(address, by);
3978 } 3993 }
3979 } 3994 }
3980 } 3995 }
(...skipping 3820 matching lines...) Expand 10 before | Expand all | Expand 10 after
7801 static_cast<int>(object_sizes_last_time_[index])); 7816 static_cast<int>(object_sizes_last_time_[index]));
7802 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 7817 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
7803 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7818 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7804 7819
7805 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7820 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7806 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7821 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7807 ClearObjectStats(); 7822 ClearObjectStats();
7808 } 7823 }
7809 7824
7810 } } // namespace v8::internal 7825 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698