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

Unified Diff: src/objects.cc

Issue 1410833009: [heap] Simplify zapping of old optimized code maps. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 a315bc9010ce119b454f8ca460ca18f872229848..c0acdb9040b8e91792a15386b655f9e5f4be2507 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -11084,12 +11084,7 @@ void SharedFunctionInfo::AddToOptimizedCodeMap(
// flushed the optimized code map and the copy we created is full of holes.
// For now we just give up on adding the entry and pretend it got flushed.
if (shared->optimized_code_map()->IsSmi()) return;
- int old_length = old_code_map->length();
- // Zap the old map to avoid any stale entries. Note that this is required
- // for correctness because entries are being treated weakly by the GC.
- MemsetPointer(old_code_map->data_start(), isolate->heap()->the_hole_value(),
- old_length);
- entry = old_length;
+ entry = old_code_map->length();
}
new_code_map->set(entry + kContextOffset, *native_context);
new_code_map->set(entry + kCachedCodeOffset, *code);
@@ -11109,12 +11104,10 @@ void SharedFunctionInfo::AddToOptimizedCodeMap(
}
#endif
- if (Heap::ShouldZapGarbage()) {
- // Zap any old optimized code map for heap-verifier.
- if (!shared->optimized_code_map()->IsSmi()) {
- FixedArray* old_code_map = FixedArray::cast(shared->optimized_code_map());
- old_code_map->FillWithHoles(0, old_code_map->length());
- }
+ // Zap any old optimized code map.
+ if (!shared->optimized_code_map()->IsSmi()) {
+ FixedArray* old_code_map = FixedArray::cast(shared->optimized_code_map());
+ old_code_map->FillWithHoles(0, old_code_map->length());
}
shared->set_optimized_code_map(*new_code_map);
@@ -11122,12 +11115,10 @@ void SharedFunctionInfo::AddToOptimizedCodeMap(
void SharedFunctionInfo::ClearOptimizedCodeMap() {
- if (Heap::ShouldZapGarbage()) {
- // Zap any old optimized code map for heap-verifier.
- if (!optimized_code_map()->IsSmi()) {
- FixedArray* old_code_map = FixedArray::cast(optimized_code_map());
- old_code_map->FillWithHoles(0, old_code_map->length());
- }
+ // Zap any old optimized code map.
+ if (!optimized_code_map()->IsSmi()) {
+ FixedArray* old_code_map = FixedArray::cast(optimized_code_map());
+ old_code_map->FillWithHoles(0, old_code_map->length());
}
set_optimized_code_map(Smi::FromInt(0));
« 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