Fix corner case in optimized code map zapping.

R=jkummerow@chromium.org
TEST=mjsunit/math-floor-part2

Review URL: https://codereview.chromium.org/15743005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14752 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
mstarzinger@chromium.org 2013-05-22 15:29:02 +00:00
parent aadfc39a12
commit d259e1cebd
3 changed files with 6 additions and 12 deletions

View File

@ -889,6 +889,8 @@ void SharedFunctionInfo::SharedFunctionInfoPrint(FILE* out) {
has_only_simple_this_property_assignments());
PrintF(out, "\n - this_property_assignments = ");
this_property_assignments()->ShortPrint(out);
PrintF(out, "\n - optimized_code_map = ");
optimized_code_map()->ShortPrint(out);
PrintF(out, "\n");
}

View File

@ -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;

View File

@ -5829,9 +5829,6 @@ class SharedFunctionInfo: public HeapObject {
// Trims the optimized code map after entries have been removed.
void TrimOptimizedCodeMap(int shrink_by);
// Zaps the contents of backing optimized code map.
void ZapOptimizedCodeMap();
// Add a new entry to the optimized code map.
MUST_USE_RESULT MaybeObject* AddToOptimizedCodeMap(Context* native_context,
Code* code,