Index: src/regexp/jsregexp.cc |
diff --git a/src/regexp/jsregexp.cc b/src/regexp/jsregexp.cc |
index fe04fbc9cff40f6f9e31f1f01bc33bf39990ec9e..aba793723a30a7c06d6138b8a6eb490d8620bdd4 100644 |
--- a/src/regexp/jsregexp.cc |
+++ b/src/regexp/jsregexp.cc |
@@ -397,6 +397,7 @@ bool RegExpImpl::CompileIrregexp(Handle<JSRegExp> re, |
Handle<FixedArray> data = Handle<FixedArray>(FixedArray::cast(re->data())); |
data->set(JSRegExp::code_index(is_one_byte), result.code); |
+ SetIrregexpCaptureNameMap(*data, compile_data.capture_name_map); |
int register_max = IrregexpMaxRegisterCount(*data); |
if (result.num_registers > register_max) { |
SetIrregexpMaxRegisterCount(*data, result.num_registers); |
@@ -416,6 +417,14 @@ void RegExpImpl::SetIrregexpMaxRegisterCount(FixedArray* re, int value) { |
re->set(JSRegExp::kIrregexpMaxRegisterCountIndex, Smi::FromInt(value)); |
} |
+void RegExpImpl::SetIrregexpCaptureNameMap(FixedArray* re, |
+ Handle<FixedArray> value) { |
+ if (value.is_null()) { |
+ re->set(JSRegExp::kIrregexpCaptureNameMapIndex, Smi::FromInt(0)); |
+ } else { |
+ re->set(JSRegExp::kIrregexpCaptureNameMapIndex, *value); |
+ } |
+} |
int RegExpImpl::IrregexpNumberOfCaptures(FixedArray* re) { |
return Smi::cast(re->get(JSRegExp::kIrregexpCaptureCountIndex))->value(); |