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

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

Issue 153863005: Just calculate pretenuring ratio when needed. (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 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(); 1553 int found_count = memento_found_count();
1554 double ratio = static_cast<double>(found_count) / create_count; 1554 bool minimum_mementos_created = create_count >= kPretenureMinimumCreated;
1555 double ratio =
1556 minimum_mementos_created || FLAG_trace_pretenuring_statistics ?
1557 static_cast<double>(found_count) / create_count : 0.0;
1555 PretenureFlag current_mode = GetPretenureMode(); 1558 PretenureFlag current_mode = GetPretenureMode();
1556 1559
1557 if (create_count >= kPretenureMinimumCreated) { 1560 if (minimum_mementos_created) {
1558 PretenureDecision result = ratio >= kPretenureRatio 1561 PretenureDecision result = ratio >= kPretenureRatio
1559 ? kTenure 1562 ? kTenure
1560 : kDontTenure; 1563 : kDontTenure;
1561 set_pretenure_decision(result); 1564 set_pretenure_decision(result);
1562 if (current_mode != GetPretenureMode()) { 1565 if (current_mode != GetPretenureMode()) {
1563 decision_changed = true; 1566 decision_changed = true;
1564 dependent_code()->MarkCodeForDeoptimization( 1567 dependent_code()->MarkCodeForDeoptimization(
1565 GetIsolate(), 1568 GetIsolate(),
1566 DependentCode::kAllocationSiteTenuringChangedGroup); 1569 DependentCode::kAllocationSiteTenuringChangedGroup);
1567 } 1570 }
(...skipping 5219 matching lines...) Expand 10 before | Expand all | Expand 10 after
6787 #undef READ_UINT32_FIELD 6790 #undef READ_UINT32_FIELD
6788 #undef WRITE_UINT32_FIELD 6791 #undef WRITE_UINT32_FIELD
6789 #undef READ_SHORT_FIELD 6792 #undef READ_SHORT_FIELD
6790 #undef WRITE_SHORT_FIELD 6793 #undef WRITE_SHORT_FIELD
6791 #undef READ_BYTE_FIELD 6794 #undef READ_BYTE_FIELD
6792 #undef WRITE_BYTE_FIELD 6795 #undef WRITE_BYTE_FIELD
6793 6796
6794 } } // namespace v8::internal 6797 } } // namespace v8::internal
6795 6798
6796 #endif // V8_OBJECTS_INL_H_ 6799 #endif // V8_OBJECTS_INL_H_
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