OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 uc16 mask, | 473 uc16 mask, |
474 Label* on_not_equal) { | 474 Label* on_not_equal) { |
475 ASSERT(minus < String::kMaxUtf16CodeUnit); | 475 ASSERT(minus < String::kMaxUtf16CodeUnit); |
476 __ sub(r0, current_character(), Operand(minus)); | 476 __ sub(r0, current_character(), Operand(minus)); |
477 __ and_(r0, r0, Operand(mask)); | 477 __ and_(r0, r0, Operand(mask)); |
478 __ cmp(r0, Operand(c)); | 478 __ cmp(r0, Operand(c)); |
479 BranchOrBacktrack(ne, on_not_equal); | 479 BranchOrBacktrack(ne, on_not_equal); |
480 } | 480 } |
481 | 481 |
482 | 482 |
| 483 void RegExpMacroAssemblerARM::CheckCharacterInRange( |
| 484 uc16 from, |
| 485 uc16 to, |
| 486 Label* on_in_range) { |
| 487 __ sub(r0, current_character(), Operand(from)); |
| 488 __ cmp(r0, Operand(to - from)); |
| 489 BranchOrBacktrack(ls, on_in_range); // Unsigned lower-or-same condition. |
| 490 } |
| 491 |
| 492 |
| 493 void RegExpMacroAssemblerARM::CheckCharacterNotInRange( |
| 494 uc16 from, |
| 495 uc16 to, |
| 496 Label* on_not_in_range) { |
| 497 __ sub(r0, current_character(), Operand(from)); |
| 498 __ cmp(r0, Operand(to - from)); |
| 499 BranchOrBacktrack(hi, on_not_in_range); // Unsigned higher condition. |
| 500 } |
| 501 |
| 502 |
| 503 void RegExpMacroAssemblerARM::CheckBitInTable( |
| 504 Handle<ByteArray> table, |
| 505 Label* on_bit_set) { |
| 506 __ mov(r0, Operand(table)); |
| 507 __ and_(r1, current_character(), Operand(kTableSize - 1)); |
| 508 __ add(r1, r1, Operand(ByteArray::kHeaderSize - kHeapObjectTag)); |
| 509 __ ldrb(r0, MemOperand(r0, r1)); |
| 510 __ cmp(r0, Operand(0)); |
| 511 BranchOrBacktrack(ne, on_bit_set); |
| 512 } |
| 513 |
| 514 |
483 bool RegExpMacroAssemblerARM::CheckSpecialCharacterClass(uc16 type, | 515 bool RegExpMacroAssemblerARM::CheckSpecialCharacterClass(uc16 type, |
484 Label* on_no_match) { | 516 Label* on_no_match) { |
485 // Range checks (c in min..max) are generally implemented by an unsigned | 517 // Range checks (c in min..max) are generally implemented by an unsigned |
486 // (c - min) <= (max - min) check | 518 // (c - min) <= (max - min) check |
487 switch (type) { | 519 switch (type) { |
488 case 's': | 520 case 's': |
489 // Match space-characters | 521 // Match space-characters |
490 if (mode_ == ASCII) { | 522 if (mode_ == ASCII) { |
491 // ASCII space characters are '\t'..'\r' and ' '. | 523 // ASCII space characters are '\t'..'\r' and ' '. |
492 Label success; | 524 Label success; |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1304 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); | 1336 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); |
1305 } | 1337 } |
1306 | 1338 |
1307 #undef __ | 1339 #undef __ |
1308 | 1340 |
1309 #endif // V8_INTERPRETED_REGEXP | 1341 #endif // V8_INTERPRETED_REGEXP |
1310 | 1342 |
1311 }} // namespace v8::internal | 1343 }} // namespace v8::internal |
1312 | 1344 |
1313 #endif // V8_TARGET_ARCH_ARM | 1345 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |