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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // If length is negative, this code will fail (it's a symptom of a partial or | 346 // If length is negative, this code will fail (it's a symptom of a partial or |
347 // illegal capture where start of capture after end of capture). | 347 // illegal capture where start of capture after end of capture). |
348 // This must not happen (no back-reference can reference a capture that wasn't | 348 // This must not happen (no back-reference can reference a capture that wasn't |
349 // closed before in the reg-exp, and we must not generate code that can cause | 349 // closed before in the reg-exp, and we must not generate code that can cause |
350 // this condition). | 350 // this condition). |
351 | 351 |
352 // If length is zero, either the capture is empty or it is nonparticipating. | 352 // If length is zero, either the capture is empty or it is nonparticipating. |
353 // In either case succeed immediately. | 353 // In either case succeed immediately. |
354 __ j(equal, &fallthrough); | 354 __ j(equal, &fallthrough); |
355 | 355 |
| 356 // ----------------------- |
| 357 // rdx - Start of capture |
| 358 // rbx - length of capture |
| 359 // Check that there are sufficient characters left in the input. |
| 360 __ movl(rax, rdi); |
| 361 __ addl(rax, rbx); |
| 362 BranchOrBacktrack(greater, on_no_match); |
| 363 |
356 if (mode_ == ASCII) { | 364 if (mode_ == ASCII) { |
357 Label loop_increment; | 365 Label loop_increment; |
358 if (on_no_match == NULL) { | 366 if (on_no_match == NULL) { |
359 on_no_match = &backtrack_label_; | 367 on_no_match = &backtrack_label_; |
360 } | 368 } |
361 | 369 |
362 __ lea(r9, Operand(rsi, rdx, times_1, 0)); | 370 __ lea(r9, Operand(rsi, rdx, times_1, 0)); |
363 __ lea(r11, Operand(rsi, rdi, times_1, 0)); | 371 __ lea(r11, Operand(rsi, rdi, times_1, 0)); |
364 __ addq(rbx, r9); // End of capture | 372 __ addq(rbx, r9); // End of capture |
365 // --------------------- | 373 // --------------------- |
(...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1527 } | 1535 } |
1528 } | 1536 } |
1529 | 1537 |
1530 #undef __ | 1538 #undef __ |
1531 | 1539 |
1532 #endif // V8_INTERPRETED_REGEXP | 1540 #endif // V8_INTERPRETED_REGEXP |
1533 | 1541 |
1534 }} // namespace v8::internal | 1542 }} // namespace v8::internal |
1535 | 1543 |
1536 #endif // V8_TARGET_ARCH_X64 | 1544 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |