| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index e193dfc97710ba18b06d19282b011f9f6f87b372..d50b7be61132944a333a4543d7df9913c731baa8 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -2968,35 +2968,30 @@ int Runtime::StringMatch(Isolate* isolate,
|
| if (!pat->IsFlat()) FlattenString(pat);
|
|
|
| AssertNoAllocation no_heap_allocation; // ensure vectors stay valid
|
| - // Extract flattened substrings of cons strings before determining asciiness.
|
| - String* seq_sub = *sub;
|
| - if (seq_sub->IsConsString()) seq_sub = ConsString::cast(seq_sub)->first();
|
| - String* seq_pat = *pat;
|
| - if (seq_pat->IsConsString()) seq_pat = ConsString::cast(seq_pat)->first();
|
|
|
| // dispatch on type of strings
|
| - if (seq_pat->IsAsciiRepresentation()) {
|
| - Vector<const char> pat_vector = seq_pat->ToAsciiVector();
|
| - if (seq_sub->IsAsciiRepresentation()) {
|
| + if (pat->IsAsciiRepresentationUnderneath()) {
|
| + Vector<const char> pat_vector = pat->ToAsciiVector();
|
| + if (sub->IsAsciiRepresentationUnderneath()) {
|
| return SearchString(isolate,
|
| - seq_sub->ToAsciiVector(),
|
| + sub->ToAsciiVector(),
|
| pat_vector,
|
| start_index);
|
| }
|
| return SearchString(isolate,
|
| - seq_sub->ToUC16Vector(),
|
| + sub->ToUC16Vector(),
|
| pat_vector,
|
| start_index);
|
| }
|
| - Vector<const uc16> pat_vector = seq_pat->ToUC16Vector();
|
| - if (seq_sub->IsAsciiRepresentation()) {
|
| + Vector<const uc16> pat_vector = pat->ToUC16Vector();
|
| + if (sub->IsAsciiRepresentationUnderneath()) {
|
| return SearchString(isolate,
|
| - seq_sub->ToAsciiVector(),
|
| + sub->ToAsciiVector(),
|
| pat_vector,
|
| start_index);
|
| }
|
| return SearchString(isolate,
|
| - seq_sub->ToUC16Vector(),
|
| + sub->ToUC16Vector(),
|
| pat_vector,
|
| start_index);
|
| }
|
| @@ -3581,7 +3576,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpExecMultiple) {
|
| HandleScope handles(isolate);
|
|
|
| CONVERT_ARG_CHECKED(String, subject, 1);
|
| - if (!subject->IsFlat()) { FlattenString(subject); }
|
| + if (!subject->IsFlat()) FlattenString(subject);
|
| CONVERT_ARG_CHECKED(JSRegExp, regexp, 0);
|
| CONVERT_ARG_CHECKED(JSArray, last_match_info, 2);
|
| CONVERT_ARG_CHECKED(JSArray, result_array, 3);
|
|
|