Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 23cd6d91752d1f6e360215b16e88e395f31f6571..bee38bd3e58a77efcd68fe4fcf76b516f9b4119f 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -11750,7 +11750,7 @@ bool DependentCode::Contains(DependencyGroup group, Code* code) { |
} |
-void DependentCode::DeoptimizeDependentCodeGroup( |
+bool DependentCode::MarkCodeForDeoptimization( |
Isolate* isolate, |
DependentCode::DependencyGroup group) { |
ASSERT(AllowCodeDependencyChange::IsAllowed()); |
@@ -11759,7 +11759,7 @@ void DependentCode::DeoptimizeDependentCodeGroup( |
int start = starts.at(group); |
int end = starts.at(group + 1); |
int code_entries = starts.number_of_entries(); |
- if (start == end) return; |
+ if (start == end) return false; |
// Mark all the code that needs to be deoptimized. |
bool marked = false; |
@@ -11785,6 +11785,16 @@ void DependentCode::DeoptimizeDependentCodeGroup( |
clear_at(i); |
} |
set_number_of_entries(group, 0); |
+ return marked; |
+} |
+ |
+ |
+void DependentCode::DeoptimizeDependentCodeGroup( |
+ Isolate* isolate, |
+ DependentCode::DependencyGroup group) { |
+ ASSERT(AllowCodeDependencyChange::IsAllowed()); |
+ DisallowHeapAllocation no_allocation_scope; |
+ bool marked = MarkCodeForDeoptimization(isolate, group); |
if (marked) Deoptimizer::DeoptimizeMarkedCode(isolate); |
} |
@@ -12760,9 +12770,6 @@ const double AllocationSite::kPretenureRatio = 0.60; |
void AllocationSite::ResetPretenureDecision() { |
- dependent_code()->DeoptimizeDependentCodeGroup( |
- GetIsolate(), |
- DependentCode::kAllocationSiteTenuringChangedGroup); |
set_pretenure_decision(kUndecided); |
set_memento_found_count(0); |
set_memento_create_count(0); |