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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 | 386 |
387 // Mismatch, try case-insensitive match (converting letters to lower-case). | 387 // Mismatch, try case-insensitive match (converting letters to lower-case). |
388 // I.e., if or-ing with 0x20 makes values equal and in range 'a'-'z', it's | 388 // I.e., if or-ing with 0x20 makes values equal and in range 'a'-'z', it's |
389 // a match. | 389 // a match. |
390 __ or_(rax, Immediate(0x20)); // Convert match character to lower-case. | 390 __ or_(rax, Immediate(0x20)); // Convert match character to lower-case. |
391 __ or_(rdx, Immediate(0x20)); // Convert capture character to lower-case. | 391 __ or_(rdx, Immediate(0x20)); // Convert capture character to lower-case. |
392 __ cmpb(rax, rdx); | 392 __ cmpb(rax, rdx); |
393 __ j(not_equal, on_no_match); // Definitely not equal. | 393 __ j(not_equal, on_no_match); // Definitely not equal. |
394 __ subb(rax, Immediate('a')); | 394 __ subb(rax, Immediate('a')); |
395 __ cmpb(rax, Immediate('z' - 'a')); | 395 __ cmpb(rax, Immediate('z' - 'a')); |
| 396 #ifndef ENABLE_LATIN_1 |
396 __ j(above, on_no_match); // Weren't letters anyway. | 397 __ j(above, on_no_match); // Weren't letters anyway. |
397 | 398 #else |
| 399 __ j(below_equal, &loop_increment); // In range 'a'-'z'. |
| 400 // Latin-1: Check for values in range [224,254] but not 247. |
| 401 __ subb(rax, Immediate(224 - 'a')); |
| 402 __ cmpb(rax, Immediate(254 - 224)); |
| 403 __ j(above, on_no_match); // Weren't Latin-1 letters. |
| 404 __ cmpb(rax, Immediate(247 - 224)); // Check for 247. |
| 405 __ j(equal, on_no_match); |
| 406 #endif |
398 __ bind(&loop_increment); | 407 __ bind(&loop_increment); |
399 // Increment pointers into match and capture strings. | 408 // Increment pointers into match and capture strings. |
400 __ addq(r11, Immediate(1)); | 409 __ addq(r11, Immediate(1)); |
401 __ addq(r9, Immediate(1)); | 410 __ addq(r9, Immediate(1)); |
402 // Compare to end of capture, and loop if not done. | 411 // Compare to end of capture, and loop if not done. |
403 __ cmpq(r9, rbx); | 412 __ cmpq(r9, rbx); |
404 __ j(below, &loop); | 413 __ j(below, &loop); |
405 | 414 |
406 // Compute new value of character position after the matched part. | 415 // Compute new value of character position after the matched part. |
407 __ movq(rdi, r11); | 416 __ movq(rdi, r11); |
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 } | 1544 } |
1536 } | 1545 } |
1537 | 1546 |
1538 #undef __ | 1547 #undef __ |
1539 | 1548 |
1540 #endif // V8_INTERPRETED_REGEXP | 1549 #endif // V8_INTERPRETED_REGEXP |
1541 | 1550 |
1542 }} // namespace v8::internal | 1551 }} // namespace v8::internal |
1543 | 1552 |
1544 #endif // V8_TARGET_ARCH_X64 | 1553 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |