| 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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 PagedSpaces spaces(this); | 499 PagedSpaces spaces(this); |
| 500 for (PagedSpace* space = spaces.next(); | 500 for (PagedSpace* space = spaces.next(); |
| 501 space != NULL; | 501 space != NULL; |
| 502 space = spaces.next()) { | 502 space = spaces.next()) { |
| 503 space->RepairFreeListsAfterBoot(); | 503 space->RepairFreeListsAfterBoot(); |
| 504 } | 504 } |
| 505 } | 505 } |
| 506 | 506 |
| 507 | 507 |
| 508 void Heap::ProcessPretenuringFeedback() { | 508 void Heap::ProcessPretenuringFeedback() { |
| 509 if (FLAG_allocation_site_pretenuring && | 509 if (FLAG_allocation_site_pretenuring) { |
| 510 new_space_high_promotion_mode_active_) { | |
| 511 int tenure_decisions = 0; | 510 int tenure_decisions = 0; |
| 512 int dont_tenure_decisions = 0; | 511 int dont_tenure_decisions = 0; |
| 513 int allocation_mementos_found = 0; | 512 int allocation_mementos_found = 0; |
| 514 int allocation_sites = 0; | 513 int allocation_sites = 0; |
| 515 int active_allocation_sites = 0; | 514 int active_allocation_sites = 0; |
| 516 | 515 |
| 517 // If the scratchpad overflowed, we have to iterate over the allocation | 516 // If the scratchpad overflowed, we have to iterate over the allocation |
| 518 // sites list. | 517 // sites list. |
| 519 bool use_scratchpad = | 518 bool use_scratchpad = |
| 520 allocation_sites_scratchpad_length < kAllocationSiteScratchpadSize; | 519 allocation_sites_scratchpad_length < kAllocationSiteScratchpadSize; |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1106 // have to limit maximal capacity of the young generation. | 1105 // have to limit maximal capacity of the young generation. |
| 1107 SetNewSpaceHighPromotionModeActive(true); | 1106 SetNewSpaceHighPromotionModeActive(true); |
| 1108 if (FLAG_trace_gc) { | 1107 if (FLAG_trace_gc) { |
| 1109 PrintPID("Limited new space size due to high promotion rate: %d MB\n", | 1108 PrintPID("Limited new space size due to high promotion rate: %d MB\n", |
| 1110 new_space_.InitialCapacity() / MB); | 1109 new_space_.InitialCapacity() / MB); |
| 1111 } | 1110 } |
| 1112 // The high promotion mode is our indicator to turn on pretenuring. We have | 1111 // The high promotion mode is our indicator to turn on pretenuring. We have |
| 1113 // to deoptimize all optimized code in global pretenuring mode and all | 1112 // to deoptimize all optimized code in global pretenuring mode and all |
| 1114 // code which should be tenured in local pretenuring mode. | 1113 // code which should be tenured in local pretenuring mode. |
| 1115 if (FLAG_pretenuring) { | 1114 if (FLAG_pretenuring) { |
| 1116 if (FLAG_allocation_site_pretenuring) { | 1115 if (!FLAG_allocation_site_pretenuring) { |
| 1117 ResetAllAllocationSitesDependentCode(NOT_TENURED); | |
| 1118 } else { | |
| 1119 isolate_->stack_guard()->FullDeopt(); | 1116 isolate_->stack_guard()->FullDeopt(); |
| 1120 } | 1117 } |
| 1121 } | 1118 } |
| 1122 } else if (new_space_high_promotion_mode_active_ && | 1119 } else if (new_space_high_promotion_mode_active_ && |
| 1123 IsStableOrDecreasingSurvivalTrend() && | 1120 IsStableOrDecreasingSurvivalTrend() && |
| 1124 IsLowSurvivalRate()) { | 1121 IsLowSurvivalRate()) { |
| 1125 // Decreasing low survival rates might indicate that the above high | 1122 // Decreasing low survival rates might indicate that the above high |
| 1126 // promotion mode is over and we should allow the young generation | 1123 // promotion mode is over and we should allow the young generation |
| 1127 // to grow again. | 1124 // to grow again. |
| 1128 SetNewSpaceHighPromotionModeActive(false); | 1125 SetNewSpaceHighPromotionModeActive(false); |
| (...skipping 6532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7661 static_cast<int>(object_sizes_last_time_[index])); | 7658 static_cast<int>(object_sizes_last_time_[index])); |
| 7662 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 7659 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 7663 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7660 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 7664 | 7661 |
| 7665 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7662 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 7666 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7663 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 7667 ClearObjectStats(); | 7664 ClearObjectStats(); |
| 7668 } | 7665 } |
| 7669 | 7666 |
| 7670 } } // namespace v8::internal | 7667 } } // namespace v8::internal |
| OLD | NEW |