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

Issue 181063033: Ignore slots buffer overflow when recording entries of the allocation sites scratchpad. (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/heap-inl.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 // 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 3636 matching lines...) Expand 10 before | Expand all | Expand 10 after
3647 3647
3648 void Heap::InitializeAllocationSitesScratchpad() { 3648 void Heap::InitializeAllocationSitesScratchpad() {
3649 ASSERT(allocation_sites_scratchpad()->length() == 3649 ASSERT(allocation_sites_scratchpad()->length() ==
3650 kAllocationSiteScratchpadSize); 3650 kAllocationSiteScratchpadSize);
3651 for (int i = 0; i < kAllocationSiteScratchpadSize; i++) { 3651 for (int i = 0; i < kAllocationSiteScratchpadSize; i++) {
3652 allocation_sites_scratchpad()->set_undefined(i); 3652 allocation_sites_scratchpad()->set_undefined(i);
3653 } 3653 }
3654 } 3654 }
3655 3655
3656 3656
3657 void Heap::AddAllocationSiteToScratchpad(AllocationSite* site) { 3657 void Heap::AddAllocationSiteToScratchpad(AllocationSite* site,
3658 ScratchpadSlotMode mode) {
3658 if (allocation_sites_scratchpad_length_ < kAllocationSiteScratchpadSize) { 3659 if (allocation_sites_scratchpad_length_ < kAllocationSiteScratchpadSize) {
3659 // We cannot use the normal write-barrier because slots need to be 3660 // We cannot use the normal write-barrier because slots need to be
3660 // recorded with non-incremental marking as well. We have to explicitly 3661 // recorded with non-incremental marking as well. We have to explicitly
3661 // record the slot to take evacuation candidates into account. 3662 // record the slot to take evacuation candidates into account.
3662 allocation_sites_scratchpad()->set( 3663 allocation_sites_scratchpad()->set(
3663 allocation_sites_scratchpad_length_, site, SKIP_WRITE_BARRIER); 3664 allocation_sites_scratchpad_length_, site, SKIP_WRITE_BARRIER);
3664 Object** slot = allocation_sites_scratchpad()->RawFieldOfElementAt( 3665 Object** slot = allocation_sites_scratchpad()->RawFieldOfElementAt(
3665 allocation_sites_scratchpad_length_); 3666 allocation_sites_scratchpad_length_);
3666 mark_compact_collector()->RecordSlot(slot, slot, *slot); 3667
3668 if (mode == RECORD_SCRATCHPAD_SLOT) {
3669 // We need to allow slots buffer overflow here since the evacuation
3670 // candidates are not part of the global list of old space pages and
3671 // releasing an evacuation candidate due to a slots buffer overflow
3672 // results in lost pages.
3673 mark_compact_collector()->RecordSlot(
3674 slot, slot, *slot, SlotsBuffer::IGNORE_OVERFLOW);
3675 }
3667 allocation_sites_scratchpad_length_++; 3676 allocation_sites_scratchpad_length_++;
3668 } 3677 }
3669 } 3678 }
3670 3679
3671 3680
3672 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) { 3681 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) {
3673 return Map::cast(roots_[RootIndexForExternalArrayType(array_type)]); 3682 return Map::cast(roots_[RootIndexForExternalArrayType(array_type)]);
3674 } 3683 }
3675 3684
3676 3685
(...skipping 4000 matching lines...) Expand 10 before | Expand all | Expand 10 after
7677 static_cast<int>(object_sizes_last_time_[index])); 7686 static_cast<int>(object_sizes_last_time_[index]));
7678 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 7687 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
7679 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7688 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7680 7689
7681 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7690 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7682 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7691 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7683 ClearObjectStats(); 7692 ClearObjectStats();
7684 } 7693 }
7685 7694
7686 } } // namespace v8::internal 7695 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698