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

Side by Side Diff: src/heap.cc

Issue 153173008: Make sure that allocation site scratchpad entries get recorded. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | 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 3603 matching lines...) Expand 10 before | Expand all | Expand 10 after
3614 ASSERT(allocation_sites_scratchpad()->length() == 3614 ASSERT(allocation_sites_scratchpad()->length() ==
3615 kAllocationSiteScratchpadSize); 3615 kAllocationSiteScratchpadSize);
3616 for (int i = 0; i < kAllocationSiteScratchpadSize; i++) { 3616 for (int i = 0; i < kAllocationSiteScratchpadSize; i++) {
3617 allocation_sites_scratchpad()->set_undefined(i); 3617 allocation_sites_scratchpad()->set_undefined(i);
3618 } 3618 }
3619 } 3619 }
3620 3620
3621 3621
3622 void Heap::AddAllocationSiteToScratchpad(AllocationSite* site) { 3622 void Heap::AddAllocationSiteToScratchpad(AllocationSite* site) {
3623 if (allocation_sites_scratchpad_length_ < kAllocationSiteScratchpadSize) { 3623 if (allocation_sites_scratchpad_length_ < kAllocationSiteScratchpadSize) {
3624 // We cannot use the normal write-barrier because slots need to be
3625 // recorded with non-incremental marking as well. We have to explicitly
3626 // record the slot to take evacuation candidates into account.
3624 allocation_sites_scratchpad()->set( 3627 allocation_sites_scratchpad()->set(
3625 allocation_sites_scratchpad_length_, site); 3628 allocation_sites_scratchpad_length_, site, SKIP_WRITE_BARRIER);
3629 Object** slot = allocation_sites_scratchpad()->RawFieldOfElementAt(
3630 allocation_sites_scratchpad_length_);
3631 mark_compact_collector()->RecordSlot(slot, slot, *slot);
3626 allocation_sites_scratchpad_length_++; 3632 allocation_sites_scratchpad_length_++;
3627 } 3633 }
3628 } 3634 }
3629 3635
3630 3636
3631 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) { 3637 Map* Heap::MapForExternalArrayType(ExternalArrayType array_type) {
3632 return Map::cast(roots_[RootIndexForExternalArrayType(array_type)]); 3638 return Map::cast(roots_[RootIndexForExternalArrayType(array_type)]);
3633 } 3639 }
3634 3640
3635 3641
(...skipping 4063 matching lines...) Expand 10 before | Expand all | Expand 10 after
7699 static_cast<int>(object_sizes_last_time_[index])); 7705 static_cast<int>(object_sizes_last_time_[index]));
7700 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 7706 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
7701 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7707 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7702 7708
7703 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7709 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7704 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7710 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7705 ClearObjectStats(); 7711 ClearObjectStats();
7706 } 7712 }
7707 7713
7708 } } // namespace v8::internal 7714 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698