Revision: 10647
Author:   [email protected]
Date:     Wed Feb  8 07:44:07 2012
Log:      Ensure that regexp code flushing correctly updates slots buffer.

Enable code compaction again.

[email protected]

Review URL: https://chromiumcodereview.appspot.com/9365019
http://code.google.com/p/v8/source/detail?r=10647

Modified:
 /branches/bleeding_edge/src/flag-definitions.h
 /branches/bleeding_edge/src/mark-compact.cc

=======================================
--- /branches/bleeding_edge/src/flag-definitions.h      Wed Feb  8 07:39:41 2012
+++ /branches/bleeding_edge/src/flag-definitions.h      Wed Feb  8 07:44:07 2012
@@ -302,7 +302,7 @@
             "Use lazy sweeping for old pointer and data spaces")
 DEFINE_bool(never_compact, false,
             "Never perform compaction on full GC - testing only")
-DEFINE_bool(compact_code_space, false,
+DEFINE_bool(compact_code_space, true,
             "Compact code space on full non-incremental collections")
 DEFINE_bool(cleanup_code_caches_at_gc, true,
             "Flush inline caches prior to mark compact collection and "
=======================================
--- /branches/bleeding_edge/src/mark-compact.cc Tue Feb  7 06:43:51 2012
+++ /branches/bleeding_edge/src/mark-compact.cc Wed Feb  8 07:44:07 2012
@@ -1325,6 +1325,16 @@
       re->SetDataAtUnchecked(JSRegExp::saved_code_index(is_ascii),
                              code,
                              heap);
+
+      // Saving a copy might create a pointer into compaction candidate
+ // that was not observed by marker. This might happen if JSRegExp data + // was marked through the compilation cache before marker reached JSRegExp
+      // object.
+      FixedArray* data = FixedArray::cast(re->data());
+ Object** slot = data->data_start() + JSRegExp::saved_code_index(is_ascii);
+      heap->mark_compact_collector()->
+          RecordSlot(slot, slot, code);
+
       // Set a number in the 0-255 range to guarantee no smi overflow.
       re->SetDataAtUnchecked(JSRegExp::code_index(is_ascii),
                              Smi::FromInt(heap->sweep_generation() & 0xff),

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to