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 326 matching lines...) Loading... |
337 Label loop; | 337 Label loop; |
338 __ bind(&loop); | 338 __ bind(&loop); |
339 __ movzx_b(eax, Operand(edi, 0)); | 339 __ movzx_b(eax, Operand(edi, 0)); |
340 __ cmpb_al(Operand(edx, 0)); | 340 __ cmpb_al(Operand(edx, 0)); |
341 __ j(equal, &loop_increment); | 341 __ j(equal, &loop_increment); |
342 | 342 |
343 // Mismatch, try case-insensitive match (converting letters to lower-case). | 343 // Mismatch, try case-insensitive match (converting letters to lower-case). |
344 __ or_(eax, 0x20); // Convert match character to lower-case. | 344 __ or_(eax, 0x20); // Convert match character to lower-case. |
345 __ lea(ecx, Operand(eax, -'a')); | 345 __ lea(ecx, Operand(eax, -'a')); |
346 __ cmp(ecx, static_cast<int32_t>('z' - 'a')); // Is eax a lowercase letter? | 346 __ cmp(ecx, static_cast<int32_t>('z' - 'a')); // Is eax a lowercase letter? |
347 __ j(above, &fail); | 347 #ifndef ENABLE_LATIN_1 |
| 348 __ j(above, &fail); // Weren't letters anyway. |
| 349 #else |
| 350 Label convert_capture; |
| 351 __ j(below_equal, &convert_capture); // In range 'a'-'z'. |
| 352 // Latin-1: Check for values in range [224,254] but not 247. |
| 353 __ sub(ecx, Immediate(224 - 'a')); |
| 354 __ cmp(ecx, Immediate(254 - 224)); |
| 355 __ j(above, &fail); // Weren't Latin-1 letters. |
| 356 __ cmp(ecx, Immediate(247 - 224)); // Check for 247. |
| 357 __ j(equal, &fail); |
| 358 __ bind(&convert_capture); |
| 359 #endif |
348 // Also convert capture character. | 360 // Also convert capture character. |
349 __ movzx_b(ecx, Operand(edx, 0)); | 361 __ movzx_b(ecx, Operand(edx, 0)); |
350 __ or_(ecx, 0x20); | 362 __ or_(ecx, 0x20); |
351 | 363 |
352 __ cmp(eax, ecx); | 364 __ cmp(eax, ecx); |
353 __ j(not_equal, &fail); | 365 __ j(not_equal, &fail); |
354 | 366 |
355 __ bind(&loop_increment); | 367 __ bind(&loop_increment); |
356 // Increment pointers into match and capture strings. | 368 // Increment pointers into match and capture strings. |
357 __ add(edx, Immediate(1)); | 369 __ add(edx, Immediate(1)); |
(...skipping 1041 matching lines...) Loading... |
1399 } | 1411 } |
1400 | 1412 |
1401 | 1413 |
1402 #undef __ | 1414 #undef __ |
1403 | 1415 |
1404 #endif // V8_INTERPRETED_REGEXP | 1416 #endif // V8_INTERPRETED_REGEXP |
1405 | 1417 |
1406 }} // namespace v8::internal | 1418 }} // namespace v8::internal |
1407 | 1419 |
1408 #endif // V8_TARGET_ARCH_IA32 | 1420 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |