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

Unified Diff: src/objects.cc

Issue 15743005: Fix corner case in optimized code map zapping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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') | src/objects-printer.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 31bbbdbeee74d4a29bc4145c6533fe1d814f85ae..527028a31409b3c5385659d82dd68afe297d7e49 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9043,7 +9043,10 @@ MaybeObject* SharedFunctionInfo::AddToOptimizedCodeMap(Context* native_context,
new_code_map->set(old_length + 1, code);
new_code_map->set(old_length + 2, literals);
// Zap the old map for the sake of the heap verifier.
- if (Heap::ShouldZapGarbage()) ZapOptimizedCodeMap();
+ if (Heap::ShouldZapGarbage()) {
+ Object** data = old_code_map->data_start();
+ MemsetPointer(data, heap->the_hole_value(), old_length);
+ }
}
#ifdef DEBUG
for (int i = kEntriesStart; i < new_code_map->length(); i += kEntryLength) {
@@ -9137,14 +9140,6 @@ void SharedFunctionInfo::TrimOptimizedCodeMap(int shrink_by) {
}
-void SharedFunctionInfo::ZapOptimizedCodeMap() {
- FixedArray* code_map = FixedArray::cast(optimized_code_map());
- MemsetPointer(code_map->data_start(),
- GetHeap()->the_hole_value(),
- code_map->length());
-}
-
-
bool JSFunction::CompileLazy(Handle<JSFunction> function,
ClearExceptionFlag flag) {
bool result = true;
« no previous file with comments | « src/objects.h ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698