Chromium Code Reviews| 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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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(a1, a1, Operand(ByteArray::kHeaderSize - kHeapObjectTag)); | |
| 512 } else { | |
| 513 __ Addu(a1, | |
| 514 current_character(), | |
| 515 Operand(ByteArray::kHeaderSize - kHeapObjectTag)); | |
| 516 } | |
| 517 __ Addu(a0, a0, a1); | |
| 518 __ lbu(a0, MemOperand(a0)); | |
|
Erik Corry
2012/03/31 20:10:15
Since lbu supports memory-displacement operation s
kalmard
2012/04/02 09:43:28
Done.
| |
| 519 BranchOrBacktrack(on_bit_set, ne, a0, Operand(zero_reg)); | |
| 520 } | |
| 521 | |
| 522 | |
| 485 bool RegExpMacroAssemblerMIPS::CheckSpecialCharacterClass(uc16 type, | 523 bool RegExpMacroAssemblerMIPS::CheckSpecialCharacterClass(uc16 type, |
| 486 Label* on_no_match) { | 524 Label* on_no_match) { |
| 487 // Range checks (c in min..max) are generally implemented by an unsigned | 525 // Range checks (c in min..max) are generally implemented by an unsigned |
| 488 // (c - min) <= (max - min) check. | 526 // (c - min) <= (max - min) check. |
| 489 switch (type) { | 527 switch (type) { |
| 490 case 's': | 528 case 's': |
| 491 // Match space-characters. | 529 // Match space-characters. |
| 492 if (mode_ == ASCII) { | 530 if (mode_ == ASCII) { |
| 493 // ASCII space characters are '\t'..'\r' and ' '. | 531 // ASCII space characters are '\t'..'\r' and ' '. |
| 494 Label success; | 532 Label success; |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1270 } | 1308 } |
| 1271 | 1309 |
| 1272 | 1310 |
| 1273 #undef __ | 1311 #undef __ |
| 1274 | 1312 |
| 1275 #endif // V8_INTERPRETED_REGEXP | 1313 #endif // V8_INTERPRETED_REGEXP |
| 1276 | 1314 |
| 1277 }} // namespace v8::internal | 1315 }} // namespace v8::internal |
| 1278 | 1316 |
| 1279 #endif // V8_TARGET_ARCH_MIPS | 1317 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |