Reviewers: Jakob,
Description:
Fix corner case in optimized code map zapping.
[email protected]
TEST=mjsunit/math-floor-part2
Please review this at https://codereview.chromium.org/15743005/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/objects-printer.cc
M src/objects.h
M src/objects.cc
Index: src/objects-printer.cc
diff --git a/src/objects-printer.cc b/src/objects-printer.cc
index
ddecae3bf539ef3a7e2462a13e034a445a722db6..f3127940988ce89133defe817fa718f2814aac05
100644
--- a/src/objects-printer.cc
+++ b/src/objects-printer.cc
@@ -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");
}
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;
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index
ac74162962229ccac9ff4c84c399d4903e6e1d68..441c6ef4e4b7ff222097d90c0021eeb19e5be298
100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -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,
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.