| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 | 302 |
| 303 for (int i = 0; i < output_size; i += 2) { | 303 for (int i = 0; i < output_size; i += 2) { |
| 304 String::FlatContent needle_content = needle->GetFlatContent(); | 304 String::FlatContent needle_content = needle->GetFlatContent(); |
| 305 String::FlatContent subject_content = subject->GetFlatContent(); | 305 String::FlatContent subject_content = subject->GetFlatContent(); |
| 306 ASSERT(needle_content.IsFlat()); | 306 ASSERT(needle_content.IsFlat()); |
| 307 ASSERT(subject_content.IsFlat()); | 307 ASSERT(subject_content.IsFlat()); |
| 308 // dispatch on type of strings | 308 // dispatch on type of strings |
| 309 index = (needle_content.IsAscii() | 309 index = (needle_content.IsAscii() |
| 310 ? (subject_content.IsAscii() | 310 ? (subject_content.IsAscii() |
| 311 ? SearchString(isolate, | 311 ? SearchString(isolate, |
| 312 subject_content.ToAsciiVector(), | 312 subject_content.ToOneByteVector(), |
| 313 needle_content.ToAsciiVector(), | 313 needle_content.ToOneByteVector(), |
| 314 index) | 314 index) |
| 315 : SearchString(isolate, | 315 : SearchString(isolate, |
| 316 subject_content.ToUC16Vector(), | 316 subject_content.ToUC16Vector(), |
| 317 needle_content.ToAsciiVector(), | 317 needle_content.ToOneByteVector(), |
| 318 index)) | 318 index)) |
| 319 : (subject_content.IsAscii() | 319 : (subject_content.IsAscii() |
| 320 ? SearchString(isolate, | 320 ? SearchString(isolate, |
| 321 subject_content.ToAsciiVector(), | 321 subject_content.ToOneByteVector(), |
| 322 needle_content.ToUC16Vector(), | 322 needle_content.ToUC16Vector(), |
| 323 index) | 323 index) |
| 324 : SearchString(isolate, | 324 : SearchString(isolate, |
| 325 subject_content.ToUC16Vector(), | 325 subject_content.ToUC16Vector(), |
| 326 needle_content.ToUC16Vector(), | 326 needle_content.ToUC16Vector(), |
| 327 index))); | 327 index))); |
| 328 if (index == -1) { | 328 if (index == -1) { |
| 329 return i / 2; // Return number of matches. | 329 return i / 2; // Return number of matches. |
| 330 } else { | 330 } else { |
| 331 output[i] = index; | 331 output[i] = index; |
| (...skipping 5861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6193 } | 6193 } |
| 6194 | 6194 |
| 6195 return compiler.Assemble(¯o_assembler, | 6195 return compiler.Assemble(¯o_assembler, |
| 6196 node, | 6196 node, |
| 6197 data->capture_count, | 6197 data->capture_count, |
| 6198 pattern); | 6198 pattern); |
| 6199 } | 6199 } |
| 6200 | 6200 |
| 6201 | 6201 |
| 6202 }} // namespace v8::internal | 6202 }} // namespace v8::internal |
| OLD | NEW |