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

Unified Diff: src/objects.cc

Issue 12315077: Zap holes in dependent code array after deoptimizing a code group. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | 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 d9da23f363ed1e18e363ff3e79b0fe02d348cc29..4e5a434ddbe314b944b680fd681e6f1c88cf59b0 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9601,9 +9601,15 @@ void DependentCode::DeoptimizeDependentCodeGroup(
Code* code = code_at(i);
code->set_marked_for_deoptimization(true);
}
+ // Compact the array by moving all subsequent groups to fill in the new holes.
for (int src = end, dst = start; src < number_of_entries; src++, dst++) {
set_code_at(dst, code_at(src));
}
+ // Now the holes are at the end of the array, zap them.
Michael Starzinger 2013/02/25 12:18:22 Maybe we should add a comment saying that this is
+ int removed = end - start;
+ for (int i = number_of_entries - removed; i < number_of_entries; i++) {
+ clear_code_at(i);
+ }
set_number_of_entries(group, 0);
DeoptimizeDependentCodeFilter filter;
Deoptimizer::DeoptimizeAllFunctionsWith(&filter);
« 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