| 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...) Expand 10 before | Expand all | Expand 10 after 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 #ifndef ENABLE_LATIN_1 | |
| 348 __ j(above, &fail); // Weren't letters anyway. | |
| 349 #else | |
| 350 Label convert_capture; | 347 Label convert_capture; |
| 351 __ j(below_equal, &convert_capture); // In range 'a'-'z'. | 348 __ j(below_equal, &convert_capture); // In range 'a'-'z'. |
| 352 // Latin-1: Check for values in range [224,254] but not 247. | 349 // Latin-1: Check for values in range [224,254] but not 247. |
| 353 __ sub(ecx, Immediate(224 - 'a')); | 350 __ sub(ecx, Immediate(224 - 'a')); |
| 354 __ cmp(ecx, Immediate(254 - 224)); | 351 __ cmp(ecx, Immediate(254 - 224)); |
| 355 __ j(above, &fail); // Weren't Latin-1 letters. | 352 __ j(above, &fail); // Weren't Latin-1 letters. |
| 356 __ cmp(ecx, Immediate(247 - 224)); // Check for 247. | 353 __ cmp(ecx, Immediate(247 - 224)); // Check for 247. |
| 357 __ j(equal, &fail); | 354 __ j(equal, &fail); |
| 358 __ bind(&convert_capture); | 355 __ bind(&convert_capture); |
| 359 #endif | |
| 360 // Also convert capture character. | 356 // Also convert capture character. |
| 361 __ movzx_b(ecx, Operand(edx, 0)); | 357 __ movzx_b(ecx, Operand(edx, 0)); |
| 362 __ or_(ecx, 0x20); | 358 __ or_(ecx, 0x20); |
| 363 | 359 |
| 364 __ cmp(eax, ecx); | 360 __ cmp(eax, ecx); |
| 365 __ j(not_equal, &fail); | 361 __ j(not_equal, &fail); |
| 366 | 362 |
| 367 __ bind(&loop_increment); | 363 __ bind(&loop_increment); |
| 368 // Increment pointers into match and capture strings. | 364 // Increment pointers into match and capture strings. |
| 369 __ add(edx, Immediate(1)); | 365 __ add(edx, Immediate(1)); |
| (...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1405 } | 1401 } |
| 1406 | 1402 |
| 1407 | 1403 |
| 1408 #undef __ | 1404 #undef __ |
| 1409 | 1405 |
| 1410 #endif // V8_INTERPRETED_REGEXP | 1406 #endif // V8_INTERPRETED_REGEXP |
| 1411 | 1407 |
| 1412 }} // namespace v8::internal | 1408 }} // namespace v8::internal |
| 1413 | 1409 |
| 1414 #endif // V8_TARGET_ARCH_IA32 | 1410 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |