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

Unified Diff: src/objects.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698