Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: src/mips/regexp-macro-assembler-mips.cc

Issue 9968032: MIPS: RegExp: Add support for table-based character class code generation. (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: Updated based on review recommendation. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 475
476 void RegExpMacroAssemblerMIPS::CheckNotCharacterAfterMinusAnd( 476 void RegExpMacroAssemblerMIPS::CheckNotCharacterAfterMinusAnd(
477 uc16 c, 477 uc16 c,
478 uc16 minus, 478 uc16 minus,
479 uc16 mask, 479 uc16 mask,
480 Label* on_not_equal) { 480 Label* on_not_equal) {
481 UNIMPLEMENTED_MIPS(); 481 UNIMPLEMENTED_MIPS();
482 } 482 }
483 483
484 484
485 void RegExpMacroAssemblerMIPS::CheckCharacterInRange(
486 uc16 from,
487 uc16 to,
488 Label* on_in_range) {
489 __ Subu(a0, current_character(), Operand(from));
490 // Unsigned lower-or-same condition.
491 BranchOrBacktrack(on_in_range, ls, a0, Operand(to - from));
492 }
493
494
495 void RegExpMacroAssemblerMIPS::CheckCharacterNotInRange(
496 uc16 from,
497 uc16 to,
498 Label* on_not_in_range) {
499 __ Subu(a0, current_character(), Operand(from));
500 // Unsigned higher condition.
501 BranchOrBacktrack(on_not_in_range, hi, a0, Operand(to - from));
502 }
503
504
505 void RegExpMacroAssemblerMIPS::CheckBitInTable(
506 Handle<ByteArray> table,
507 Label* on_bit_set) {
508 __ li(a0, Operand(table));
509 if (mode_ != ASCII || kTableMask != String::kMaxAsciiCharCode) {
510 __ And(a1, current_character(), Operand(kTableSize - 1));
511 __ Addu(a0, a0, a1);
512 } else {
513 __ Addu(a0, a0, current_character());
514 }
515
516 __ lbu(a0, MemOperand(a0, ByteArray::kHeaderSize - kHeapObjectTag));
517 BranchOrBacktrack(on_bit_set, ne, a0, Operand(zero_reg));
518 }
519
520
485 bool RegExpMacroAssemblerMIPS::CheckSpecialCharacterClass(uc16 type, 521 bool RegExpMacroAssemblerMIPS::CheckSpecialCharacterClass(uc16 type,
486 Label* on_no_match) { 522 Label* on_no_match) {
487 // Range checks (c in min..max) are generally implemented by an unsigned 523 // Range checks (c in min..max) are generally implemented by an unsigned
488 // (c - min) <= (max - min) check. 524 // (c - min) <= (max - min) check.
489 switch (type) { 525 switch (type) {
490 case 's': 526 case 's':
491 // Match space-characters. 527 // Match space-characters.
492 if (mode_ == ASCII) { 528 if (mode_ == ASCII) {
493 // ASCII space characters are '\t'..'\r' and ' '. 529 // ASCII space characters are '\t'..'\r' and ' '.
494 Label success; 530 Label success;
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
1270 } 1306 }
1271 1307
1272 1308
1273 #undef __ 1309 #undef __
1274 1310
1275 #endif // V8_INTERPRETED_REGEXP 1311 #endif // V8_INTERPRETED_REGEXP
1276 1312
1277 }} // namespace v8::internal 1313 }} // namespace v8::internal
1278 1314
1279 #endif // V8_TARGET_ARCH_MIPS 1315 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698