Chromium Code Reviews| Index: src/heap/mark-compact.cc |
| diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc |
| index f7899c960440932a1a6c3c931755632a1bd7e497..502e618b449a6932e05db71981f8dfc8b9d4218b 100644 |
| --- a/src/heap/mark-compact.cc |
| +++ b/src/heap/mark-compact.cc |
| @@ -1349,8 +1349,13 @@ class MarkCompactMarkingVisitor |
| if (re->TypeTag() != JSRegExp::IRREGEXP) return; |
| Object* code = re->DataAt(JSRegExp::code_index(is_one_byte)); |
| - if (!code->IsSmi() && |
| - HeapObject::cast(code)->map()->instance_type() == CODE_TYPE) { |
| + if (heap->flush_eagerly()) { |
| + re->SetDataAt(JSRegExp::code_index(is_one_byte), |
| + Smi::FromInt(JSRegExp::kUninitializedValue)); |
| + re->SetDataAt(JSRegExp::saved_code_index(is_one_byte), |
| + Smi::FromInt(JSRegExp::kUninitializedValue)); |
|
rmcilroy
2014/10/24 11:46:07
Could you split this out so that it's shared with
|
| + } else if (!code->IsSmi() && |
| + HeapObject::cast(code)->map()->instance_type() == CODE_TYPE) { |
| // Save a copy that can be reinstated if we need the code again. |
| re->SetDataAt(JSRegExp::saved_code_index(is_one_byte), code); |