OLD | NEW |
---|---|
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 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1543 inline void AllocationSite::IncrementMementoCreateCount() { | 1543 inline void AllocationSite::IncrementMementoCreateCount() { |
1544 ASSERT(FLAG_allocation_site_pretenuring); | 1544 ASSERT(FLAG_allocation_site_pretenuring); |
1545 int value = memento_create_count(); | 1545 int value = memento_create_count(); |
1546 set_memento_create_count(value + 1); | 1546 set_memento_create_count(value + 1); |
1547 } | 1547 } |
1548 | 1548 |
1549 | 1549 |
1550 inline bool AllocationSite::DigestPretenuringFeedback() { | 1550 inline bool AllocationSite::DigestPretenuringFeedback() { |
1551 bool decision_changed = false; | 1551 bool decision_changed = false; |
1552 int create_count = memento_create_count(); | 1552 int create_count = memento_create_count(); |
1553 int found_count = memento_found_count(); | |
1554 double ratio = static_cast<double>(found_count) / create_count; | |
1555 PretenureFlag current_mode = GetPretenureMode(); | |
mvstanton
2014/02/06 10:30:42
This is a little more expensive, because we are on
Hannes Payer (out of office)
2014/02/06 10:47:27
I do not think that this is an issue, but we can d
| |
1556 | |
1553 if (create_count >= kPretenureMinimumCreated) { | 1557 if (create_count >= kPretenureMinimumCreated) { |
1554 int found_count = memento_found_count(); | |
1555 double ratio = static_cast<double>(found_count) / create_count; | |
1556 if (FLAG_trace_track_allocation_sites) { | |
1557 PrintF("AllocationSite: %p (created, found, ratio) (%d, %d, %f)\n", | |
1558 static_cast<void*>(this), create_count, found_count, ratio); | |
1559 } | |
1560 int current_mode = GetPretenureMode(); | |
1561 PretenureDecision result = ratio >= kPretenureRatio | 1558 PretenureDecision result = ratio >= kPretenureRatio |
1562 ? kTenure | 1559 ? kTenure |
1563 : kDontTenure; | 1560 : kDontTenure; |
1564 set_pretenure_decision(result); | 1561 set_pretenure_decision(result); |
1565 if (current_mode != GetPretenureMode()) { | 1562 if (current_mode != GetPretenureMode()) { |
1566 decision_changed = true; | 1563 decision_changed = true; |
1567 dependent_code()->MarkCodeForDeoptimization( | 1564 dependent_code()->MarkCodeForDeoptimization( |
1568 GetIsolate(), | 1565 GetIsolate(), |
1569 DependentCode::kAllocationSiteTenuringChangedGroup); | 1566 DependentCode::kAllocationSiteTenuringChangedGroup); |
1570 } | 1567 } |
1571 } | 1568 } |
1572 | 1569 |
1570 if (FLAG_trace_pretenuring_statistics) { | |
1571 PrintF( | |
1572 "AllocationSite(%p): (created, found, ratio) (%d, %d, %f) %s => %s\n", | |
1573 static_cast<void*>(this), create_count, found_count, ratio, | |
1574 current_mode == TENURED ? "tenured" : "not tenured", | |
1575 GetPretenureMode() == TENURED ? "tenured" : "not tenured"); | |
1576 } | |
1577 | |
mvstanton
2014/02/06 10:30:42
Why drive a VW when you can have a Cadillac? Can t
Hannes Payer (out of office)
2014/02/06 10:47:27
We do exactly that in old state => new state.
| |
1573 // Clear feedback calculation fields until the next gc. | 1578 // Clear feedback calculation fields until the next gc. |
1574 set_memento_found_count(0); | 1579 set_memento_found_count(0); |
1575 set_memento_create_count(0); | 1580 set_memento_create_count(0); |
1576 return decision_changed; | 1581 return decision_changed; |
1577 } | 1582 } |
1578 | 1583 |
1579 | 1584 |
1580 void JSObject::EnsureCanContainHeapObjectElements(Handle<JSObject> object) { | 1585 void JSObject::EnsureCanContainHeapObjectElements(Handle<JSObject> object) { |
1581 object->ValidateElements(); | 1586 object->ValidateElements(); |
1582 ElementsKind elements_kind = object->map()->elements_kind(); | 1587 ElementsKind elements_kind = object->map()->elements_kind(); |
(...skipping 5199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6782 #undef READ_UINT32_FIELD | 6787 #undef READ_UINT32_FIELD |
6783 #undef WRITE_UINT32_FIELD | 6788 #undef WRITE_UINT32_FIELD |
6784 #undef READ_SHORT_FIELD | 6789 #undef READ_SHORT_FIELD |
6785 #undef WRITE_SHORT_FIELD | 6790 #undef WRITE_SHORT_FIELD |
6786 #undef READ_BYTE_FIELD | 6791 #undef READ_BYTE_FIELD |
6787 #undef WRITE_BYTE_FIELD | 6792 #undef WRITE_BYTE_FIELD |
6788 | 6793 |
6789 } } // namespace v8::internal | 6794 } } // namespace v8::internal |
6790 | 6795 |
6791 #endif // V8_OBJECTS_INL_H_ | 6796 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |