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

Side by Side Diff: src/objects-inl.h

Issue 1535723002: [heap] Use HashMap as scratchpad backing store (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Revive the founder counter on the AllocationSite Created 4 years, 11 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 | « src/objects.h ('k') | tools/v8heapconst.py » ('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 // Review notes: 5 // Review notes:
6 // 6 //
7 // - The use of macros in these inline functions may seem superfluous 7 // - The use of macros in these inline functions may seem superfluous
8 // but it is absolutely needed to make sure gcc generates optimal 8 // but it is absolutely needed to make sure gcc generates optimal
9 // code. gcc is not happy when attempting to inline too deep. 9 // code. gcc is not happy when attempting to inline too deep.
10 // 10 //
(...skipping 1755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1766 1766
1767 1767
1768 int AllocationSite::memento_create_count() { return pretenure_create_count(); } 1768 int AllocationSite::memento_create_count() { return pretenure_create_count(); }
1769 1769
1770 1770
1771 void AllocationSite::set_memento_create_count(int count) { 1771 void AllocationSite::set_memento_create_count(int count) {
1772 set_pretenure_create_count(count); 1772 set_pretenure_create_count(count);
1773 } 1773 }
1774 1774
1775 1775
1776 inline bool AllocationSite::IncrementMementoFoundCount() { 1776 bool AllocationSite::IncrementMementoFoundCount(int increment) {
1777 if (IsZombie()) return false; 1777 if (IsZombie()) return false;
1778 1778
1779 int value = memento_found_count(); 1779 int value = memento_found_count();
1780 set_memento_found_count(value + 1); 1780 set_memento_found_count(value + increment);
1781 return memento_found_count() == kPretenureMinimumCreated; 1781 return memento_found_count() >= kPretenureMinimumCreated;
1782 } 1782 }
1783 1783
1784 1784
1785 inline void AllocationSite::IncrementMementoCreateCount() { 1785 inline void AllocationSite::IncrementMementoCreateCount() {
1786 DCHECK(FLAG_allocation_site_pretenuring); 1786 DCHECK(FLAG_allocation_site_pretenuring);
1787 int value = memento_create_count(); 1787 int value = memento_create_count();
1788 set_memento_create_count(value + 1); 1788 set_memento_create_count(value + 1);
1789 } 1789 }
1790 1790
1791 1791
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1825 minimum_mementos_created || FLAG_trace_pretenuring_statistics ? 1825 minimum_mementos_created || FLAG_trace_pretenuring_statistics ?
1826 static_cast<double>(found_count) / create_count : 0.0; 1826 static_cast<double>(found_count) / create_count : 0.0;
1827 PretenureDecision current_decision = pretenure_decision(); 1827 PretenureDecision current_decision = pretenure_decision();
1828 1828
1829 if (minimum_mementos_created) { 1829 if (minimum_mementos_created) {
1830 deopt = MakePretenureDecision( 1830 deopt = MakePretenureDecision(
1831 current_decision, ratio, maximum_size_scavenge); 1831 current_decision, ratio, maximum_size_scavenge);
1832 } 1832 }
1833 1833
1834 if (FLAG_trace_pretenuring_statistics) { 1834 if (FLAG_trace_pretenuring_statistics) {
1835 PrintF( 1835 PrintIsolate(GetIsolate(),
1836 "AllocationSite(%p): (created, found, ratio) (%d, %d, %f) %s => %s\n", 1836 "pretenuring: AllocationSite(%p): (created, found, ratio) "
1837 static_cast<void*>(this), create_count, found_count, ratio, 1837 "(%d, %d, %f) %s => %s\n",
1838 PretenureDecisionName(current_decision), 1838 this, create_count, found_count, ratio,
1839 PretenureDecisionName(pretenure_decision())); 1839 PretenureDecisionName(current_decision),
1840 PretenureDecisionName(pretenure_decision()));
1840 } 1841 }
1841 1842
1842 // Clear feedback calculation fields until the next gc. 1843 // Clear feedback calculation fields until the next gc.
1843 set_memento_found_count(0); 1844 set_memento_found_count(0);
1844 set_memento_create_count(0); 1845 set_memento_create_count(0);
1845 return deopt; 1846 return deopt;
1846 } 1847 }
1847 1848
1848 1849
1849 bool AllocationMemento::IsValid() { 1850 bool AllocationMemento::IsValid() {
(...skipping 5945 matching lines...) Expand 10 before | Expand all | Expand 10 after
7795 #undef WRITE_INT64_FIELD 7796 #undef WRITE_INT64_FIELD
7796 #undef READ_BYTE_FIELD 7797 #undef READ_BYTE_FIELD
7797 #undef WRITE_BYTE_FIELD 7798 #undef WRITE_BYTE_FIELD
7798 #undef NOBARRIER_READ_BYTE_FIELD 7799 #undef NOBARRIER_READ_BYTE_FIELD
7799 #undef NOBARRIER_WRITE_BYTE_FIELD 7800 #undef NOBARRIER_WRITE_BYTE_FIELD
7800 7801
7801 } // namespace internal 7802 } // namespace internal
7802 } // namespace v8 7803 } // namespace v8
7803 7804
7804 #endif // V8_OBJECTS_INL_H_ 7805 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.h ('k') | tools/v8heapconst.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698