Revision: 14752
Author:   [email protected]
Date:     Wed May 22 08:29:02 2013
Log:      Fix corner case in optimized code map zapping.

[email protected]
TEST=mjsunit/math-floor-part2

Review URL: https://codereview.chromium.org/15743005
http://code.google.com/p/v8/source/detail?r=14752

Modified:
 /branches/bleeding_edge/src/objects-printer.cc
 /branches/bleeding_edge/src/objects.cc
 /branches/bleeding_edge/src/objects.h

=======================================
--- /branches/bleeding_edge/src/objects-printer.cc      Wed May 15 07:03:42 2013
+++ /branches/bleeding_edge/src/objects-printer.cc      Wed May 22 08:29:02 2013
@@ -889,6 +889,8 @@
          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");
 }

=======================================
--- /branches/bleeding_edge/src/objects.cc      Wed May 22 03:46:33 2013
+++ /branches/bleeding_edge/src/objects.cc      Wed May 22 08:29:02 2013
@@ -9043,7 +9043,10 @@
     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) {
@@ -9135,14 +9138,6 @@
     ClearOptimizedCodeMap();
   }
 }
-
-
-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,
=======================================
--- /branches/bleeding_edge/src/objects.h       Wed May 22 03:46:33 2013
+++ /branches/bleeding_edge/src/objects.h       Wed May 22 08:29:02 2013
@@ -5829,9 +5829,6 @@
   // 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.


Reply via email to