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

Side by Side Diff: src/heap.cc

Issue 137783016: Refactor DeoptimizeDependentCodeGroup. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/objects.h » ('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 // 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 1965 matching lines...) Expand 10 before | Expand all | Expand 10 after
1976 bool record_slots) { 1976 bool record_slots) {
1977 Object* allocation_site_obj = 1977 Object* allocation_site_obj =
1978 VisitWeakList<AllocationSite>(this, 1978 VisitWeakList<AllocationSite>(this,
1979 allocation_sites_list(), 1979 allocation_sites_list(),
1980 retainer, record_slots); 1980 retainer, record_slots);
1981 set_allocation_sites_list(allocation_site_obj); 1981 set_allocation_sites_list(allocation_site_obj);
1982 } 1982 }
1983 1983
1984 1984
1985 void Heap::ResetAllAllocationSitesDependentCode(PretenureFlag flag) { 1985 void Heap::ResetAllAllocationSitesDependentCode(PretenureFlag flag) {
1986 ASSERT(AllowCodeDependencyChange::IsAllowed());
1987 DisallowHeapAllocation no_allocation_scope;
1986 Object* cur = allocation_sites_list(); 1988 Object* cur = allocation_sites_list();
1989 bool marked = false;
1987 while (cur->IsAllocationSite()) { 1990 while (cur->IsAllocationSite()) {
1988 AllocationSite* casted = AllocationSite::cast(cur); 1991 AllocationSite* casted = AllocationSite::cast(cur);
1989 if (casted->GetPretenureMode() == flag) { 1992 if (casted->GetPretenureMode() == flag) {
1990 casted->ResetPretenureDecision(); 1993 casted->ResetPretenureDecision();
1994 bool got_marked = casted->dependent_code()->MarkCodeForDeoptimization(
1995 isolate_,
1996 DependentCode::kAllocationSiteTenuringChangedGroup);
1997 if (got_marked) marked = true;
1991 } 1998 }
1992 cur = casted->weak_next(); 1999 cur = casted->weak_next();
1993 } 2000 }
2001 if (marked) Deoptimizer::DeoptimizeMarkedCode(isolate_);
1994 } 2002 }
1995 2003
1996 2004
1997 void Heap::EvaluateOldSpaceLocalPretenuring( 2005 void Heap::EvaluateOldSpaceLocalPretenuring(
1998 uint64_t size_of_objects_before_gc) { 2006 uint64_t size_of_objects_before_gc) {
1999 uint64_t size_of_objects_after_gc = SizeOfObjects(); 2007 uint64_t size_of_objects_after_gc = SizeOfObjects();
2000 double old_generation_survival_rate = 2008 double old_generation_survival_rate =
2001 (static_cast<double>(size_of_objects_after_gc) * 100) / 2009 (static_cast<double>(size_of_objects_after_gc) * 100) /
2002 static_cast<double>(size_of_objects_before_gc); 2010 static_cast<double>(size_of_objects_before_gc);
2003 2011
(...skipping 5780 matching lines...) Expand 10 before | Expand all | Expand 10 after
7784 static_cast<int>(object_sizes_last_time_[index])); 7792 static_cast<int>(object_sizes_last_time_[index]));
7785 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 7793 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
7786 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7794 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7787 7795
7788 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7796 OS::MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7789 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7797 OS::MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7790 ClearObjectStats(); 7798 ClearObjectStats();
7791 } 7799 }
7792 7800
7793 } } // namespace v8::internal 7801 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698