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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 __ lbu(t0, MemOperand(a2, 0)); | 334 __ lbu(t0, MemOperand(a2, 0)); |
335 __ addiu(a2, a2, char_size()); | 335 __ addiu(a2, a2, char_size()); |
336 | 336 |
337 __ Branch(&loop_check, eq, t0, Operand(a3)); | 337 __ Branch(&loop_check, eq, t0, Operand(a3)); |
338 | 338 |
339 // Mismatch, try case-insensitive match (converting letters to lower-case). | 339 // Mismatch, try case-insensitive match (converting letters to lower-case). |
340 __ Or(a3, a3, Operand(0x20)); // Convert capture character to lower-case. | 340 __ Or(a3, a3, Operand(0x20)); // Convert capture character to lower-case. |
341 __ Or(t0, t0, Operand(0x20)); // Also convert input character. | 341 __ Or(t0, t0, Operand(0x20)); // Also convert input character. |
342 __ Branch(&fail, ne, t0, Operand(a3)); | 342 __ Branch(&fail, ne, t0, Operand(a3)); |
343 __ Subu(a3, a3, Operand('a')); | 343 __ Subu(a3, a3, Operand('a')); |
344 #ifndef ENABLE_LATIN_1 | |
345 __ Branch(&fail, hi, a3, Operand('z' - 'a')); // Is a3 a lowercase letter? | |
346 #else | |
347 __ Branch(&loop_check, ls, a3, Operand('z' - 'a')); | 344 __ Branch(&loop_check, ls, a3, Operand('z' - 'a')); |
348 // Latin-1: Check for values in range [224,254] but not 247. | 345 // Latin-1: Check for values in range [224,254] but not 247. |
349 __ Subu(a3, a3, Operand(224 - 'a')); | 346 __ Subu(a3, a3, Operand(224 - 'a')); |
350 // Weren't Latin-1 letters. | 347 // Weren't Latin-1 letters. |
351 __ Branch(&fail, hi, a3, Operand(254 - 224)); | 348 __ Branch(&fail, hi, a3, Operand(254 - 224)); |
352 // Check for 247. | 349 // Check for 247. |
353 __ Branch(&fail, eq, a3, Operand(247 - 224)); | 350 __ Branch(&fail, eq, a3, Operand(247 - 224)); |
354 #endif | |
355 | 351 |
356 __ bind(&loop_check); | 352 __ bind(&loop_check); |
357 __ Branch(&loop, lt, a0, Operand(a1)); | 353 __ Branch(&loop, lt, a0, Operand(a1)); |
358 __ jmp(&success); | 354 __ jmp(&success); |
359 | 355 |
360 __ bind(&fail); | 356 __ bind(&fail); |
361 GoTo(on_no_match); | 357 GoTo(on_no_match); |
362 | 358 |
363 __ bind(&success); | 359 __ bind(&success); |
364 // Compute new value of character position after the matched part. | 360 // Compute new value of character position after the matched part. |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1383 } | 1379 } |
1384 | 1380 |
1385 | 1381 |
1386 #undef __ | 1382 #undef __ |
1387 | 1383 |
1388 #endif // V8_INTERPRETED_REGEXP | 1384 #endif // V8_INTERPRETED_REGEXP |
1389 | 1385 |
1390 }} // namespace v8::internal | 1386 }} // namespace v8::internal |
1391 | 1387 |
1392 #endif // V8_TARGET_ARCH_MIPS | 1388 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |