OLD | NEW |
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 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1580 inline bool AllocationSite::DigestPretenuringFeedback() { | 1580 inline bool AllocationSite::DigestPretenuringFeedback() { |
1581 bool decision_changed = false; | 1581 bool decision_changed = false; |
1582 int create_count = memento_create_count(); | 1582 int create_count = memento_create_count(); |
1583 int found_count = memento_found_count(); | 1583 int found_count = memento_found_count(); |
1584 bool minimum_mementos_created = create_count >= kPretenureMinimumCreated; | 1584 bool minimum_mementos_created = create_count >= kPretenureMinimumCreated; |
1585 double ratio = | 1585 double ratio = |
1586 minimum_mementos_created || FLAG_trace_pretenuring_statistics ? | 1586 minimum_mementos_created || FLAG_trace_pretenuring_statistics ? |
1587 static_cast<double>(found_count) / create_count : 0.0; | 1587 static_cast<double>(found_count) / create_count : 0.0; |
1588 PretenureFlag current_mode = GetPretenureMode(); | 1588 PretenureFlag current_mode = GetPretenureMode(); |
1589 | 1589 |
1590 if (minimum_mementos_created) { | 1590 // TODO(hpayer): Add an intermediate state MAYBE_TENURE which collects |
| 1591 // more lifetime feedback for tenuring candidates. In the meantime, we |
| 1592 // just allow transitions from undecided to tenured or not tenured. |
| 1593 if (minimum_mementos_created && pretenure_decision() == kUndecided) { |
1591 PretenureDecision result = ratio >= kPretenureRatio | 1594 PretenureDecision result = ratio >= kPretenureRatio |
1592 ? kTenure | 1595 ? kTenure |
1593 : kDontTenure; | 1596 : kDontTenure; |
1594 set_pretenure_decision(result); | 1597 set_pretenure_decision(result); |
1595 if (current_mode != GetPretenureMode()) { | 1598 if (current_mode != GetPretenureMode()) { |
1596 decision_changed = true; | 1599 decision_changed = true; |
1597 set_deopt_dependent_code(true); | 1600 set_deopt_dependent_code(true); |
1598 } | 1601 } |
1599 } | 1602 } |
1600 | 1603 |
(...skipping 5254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6855 #undef READ_SHORT_FIELD | 6858 #undef READ_SHORT_FIELD |
6856 #undef WRITE_SHORT_FIELD | 6859 #undef WRITE_SHORT_FIELD |
6857 #undef READ_BYTE_FIELD | 6860 #undef READ_BYTE_FIELD |
6858 #undef WRITE_BYTE_FIELD | 6861 #undef WRITE_BYTE_FIELD |
6859 #undef NOBARRIER_READ_BYTE_FIELD | 6862 #undef NOBARRIER_READ_BYTE_FIELD |
6860 #undef NOBARRIER_WRITE_BYTE_FIELD | 6863 #undef NOBARRIER_WRITE_BYTE_FIELD |
6861 | 6864 |
6862 } } // namespace v8::internal | 6865 } } // namespace v8::internal |
6863 | 6866 |
6864 #endif // V8_OBJECTS_INL_H_ | 6867 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |