Commit 96baf602 authored by vegorov@chromium.org's avatar vegorov@chromium.org

Ensure that regexp code flushing correctly updates slots buffer.

Enable code compaction again.

R=erik.corry@gmail.com

Review URL: https://chromiumcodereview.appspot.com/9365019

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10647 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 53c6838c
......@@ -302,7 +302,7 @@ DEFINE_bool(lazy_sweeping, true,
"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 "
......
......@@ -1325,6 +1325,16 @@ class StaticMarkingVisitor : public StaticVisitorBase {
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),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment