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 mark_compact_collector()->RecordSlot(
Michael Starzinger 2014/03/05 13:58:11 Can we get a short comment explaining why IGNORE_O
Hannes Payer (out of office) 2014/03/05 14:02:06 Done.
3670 slot, slot, *slot, SlotsBuffer::IGNORE_OVERFLOW);
3671 }
3667 allocation_sites_scratchpad_length_++; 3672 allocation_sites_scratchpad_length_++;
3668 } 3673 }
3669 } 3674 }
3670 3675
3671 3676
3672 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) { 3677 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) {
3673 return Map::cast(roots_[RootIndexForExternalArrayType(array_type)]); 3678 return Map::cast(roots_[RootIndexForExternalArrayType(array_type)]);
3674 } 3679 }
3675 3680
3676 3681
(...skipping 4000 matching lines...) Expand 10 before | Expand all | Expand 10 after
7677 static_cast<int>(object_sizes_last_time_[index])); 7682 static_cast<int>(object_sizes_last_time_[index]));
7678 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 7683 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
7679 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7684 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7680 7685
7681 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7686 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7682 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7687 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7683 ClearObjectStats(); 7688 ClearObjectStats();
7684 } 7689 }
7685 7690
7686 } } // namespace v8::internal 7691 } } // 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