Commit 5a1364a5 authored by hpayer@chromium.org's avatar hpayer@chromium.org

Deopt maybe tenure allocation sites when semi-space is maximum size.

BUG=
R=mvstanton@chromium.org

Review URL: https://codereview.chromium.org/307363002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21635 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d19aaa2b
...@@ -497,10 +497,10 @@ void Heap::ProcessPretenuringFeedback() { ...@@ -497,10 +497,10 @@ void Heap::ProcessPretenuringFeedback() {
// we grew to the maximum semi-space size to deopt maybe tenured // we grew to the maximum semi-space size to deopt maybe tenured
// allocation sites. We could hold the maybe tenured allocation sites // allocation sites. We could hold the maybe tenured allocation sites
// in a seperate data structure if this is a performance problem. // in a seperate data structure if this is a performance problem.
bool deopt_maybe_tenured = DeoptMaybeTenuredAllocationSites();
bool use_scratchpad = bool use_scratchpad =
allocation_sites_scratchpad_length_ < kAllocationSiteScratchpadSize && allocation_sites_scratchpad_length_ < kAllocationSiteScratchpadSize &&
new_space_.IsAtMaximumCapacity() && !deopt_maybe_tenured;
maximum_size_scavenges_ == 0;
int i = 0; int i = 0;
Object* list_element = allocation_sites_list(); Object* list_element = allocation_sites_list();
...@@ -526,6 +526,11 @@ void Heap::ProcessPretenuringFeedback() { ...@@ -526,6 +526,11 @@ void Heap::ProcessPretenuringFeedback() {
allocation_sites++; allocation_sites++;
} }
if (deopt_maybe_tenured && site->IsMaybeTenure()) {
site->set_deopt_dependent_code(true);
trigger_deoptimization = true;
}
if (use_scratchpad) { if (use_scratchpad) {
i++; i++;
} else { } else {
......
...@@ -1363,6 +1363,10 @@ class Heap { ...@@ -1363,6 +1363,10 @@ class Heap {
return maximum_size_scavenges_ > 0; return maximum_size_scavenges_ > 0;
} }
bool DeoptMaybeTenuredAllocationSites() {
return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0;
}
// ObjectStats are kept in two arrays, counts and sizes. Related stats are // ObjectStats are kept in two arrays, counts and sizes. Related stats are
// stored in a contiguous linear buffer. Stats groups are stored one after // stored in a contiguous linear buffer. Stats groups are stored one after
// another. // another.
......
...@@ -8503,6 +8503,10 @@ class AllocationSite: public Struct { ...@@ -8503,6 +8503,10 @@ class AllocationSite: public Struct {
return pretenure_decision() == kZombie; return pretenure_decision() == kZombie;
} }
bool IsMaybeTenure() {
return pretenure_decision() == kMaybeTenure;
}
inline void MarkZombie(); inline void MarkZombie();
inline bool MakePretenureDecision(PretenureDecision current_decision, inline bool MakePretenureDecision(PretenureDecision current_decision,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment