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

Unified Diff: src/objects.cc

Issue 1249543005: Allow for optimized code map to have zero entries. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added test case. Created 5 years, 5 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/code-stubs-hydrogen.cc ('k') | test/cctest/test-compiler.cc » ('j') | 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 fb02d8dbaea7271a88f623f2f8f59c3b9adc22a1..1bb3cb6f7d017fbf3254a2e291757e286ef28fd3 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9542,7 +9542,10 @@ void SharedFunctionInfo::EvictFromOptimizedCodeMap(Code* optimized_code,
// Always trim even when array is cleared because of heap verifier.
GetHeap()->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>(code_map,
length - dst);
- if (code_map->length() == kEntriesStart) ClearOptimizedCodeMap();
+ if (code_map->length() == kEntriesStart &&
+ code_map->get(kSharedCodeIndex)->IsUndefined()) {
+ ClearOptimizedCodeMap();
+ }
}
}
@@ -9554,7 +9557,8 @@ void SharedFunctionInfo::TrimOptimizedCodeMap(int shrink_by) {
// Always trim even when array is cleared because of heap verifier.
GetHeap()->RightTrimFixedArray<Heap::SEQUENTIAL_TO_SWEEPER>(code_map,
shrink_by);
- if (code_map->length() == kEntriesStart) {
+ if (code_map->length() == kEntriesStart &&
+ code_map->get(kSharedCodeIndex)->IsUndefined()) {
ClearOptimizedCodeMap();
}
}
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | test/cctest/test-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698