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

Unified Diff: src/x64/regexp-macro-assembler-x64.cc

Issue 9854020: RegExp: Add support for table-based character class (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/regexp-macro-assembler-x64.h ('k') | test/mjsunit/unicodelctest.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/regexp-macro-assembler-x64.cc
===================================================================
--- src/x64/regexp-macro-assembler-x64.cc (revision 11134)
+++ src/x64/regexp-macro-assembler-x64.cc (working copy)
@@ -572,6 +572,42 @@
}
+void RegExpMacroAssemblerX64::CheckCharacterInRange(
+ uc16 from,
+ uc16 to,
+ Label* on_in_range) {
Lasse Reichstein Nielsen 2012/03/28 14:02:10 Maybe special-case if 'from' is zero (or even if '
Erik Corry 2012/03/29 14:49:00 Never happens.
+ __ lea(rax, Operand(current_character(), -from));
Lasse Reichstein Nielsen 2012/03/28 14:02:10 lea->leal (saves a byte).
Erik Corry 2012/03/29 14:49:00 I think you mean on x64. Fixed.
+ __ cmpl(rax, Immediate(to - from));
+ BranchOrBacktrack(below_equal, on_in_range);
+}
+
+
+void RegExpMacroAssemblerX64::CheckCharacterNotInRange(
+ uc16 from,
+ uc16 to,
+ Label* on_not_in_range) {
+ __ lea(rax, Operand(current_character(), -from));
+ __ cmpl(rax, Immediate(to - from));
+ BranchOrBacktrack(above, on_not_in_range);
+}
+
+
+void RegExpMacroAssemblerX64::CheckBitInTable(
+ Handle<ByteArray> table,
+ Label* on_bit_set) {
+ __ Move(rax, table);
+ Register index = current_character();
+ if (mode_ != ASCII || kTableMask != String::kMaxAsciiCharCode) {
+ __ movq(rbx, current_character());
+ __ and_(rbx, Immediate(kTableMask));
Lasse Reichstein Nielsen 2012/03/28 14:02:10 I'd consider swapping these: movq(rbx, Immediate
Erik Corry 2012/03/29 14:49:00 OTOH a mov can be eliminated completely by the reg
Lasse Reichstein 2012/03/29 15:25:32 I don't think the register renamer will do that si
Erik Corry 2012/03/30 07:46:28 My understanding is that after renaming you have g
Erik Corry 2012/03/31 20:04:04 But I tested it and your version is marginally fas
+ index = rbx;
+ }
+ __ cmpb(FieldOperand(rax, index, times_1, ByteArray::kHeaderSize),
+ Immediate(0));
+ BranchOrBacktrack(not_equal, on_bit_set);
+}
+
+
bool RegExpMacroAssemblerX64::CheckSpecialCharacterClass(uc16 type,
Label* on_no_match) {
// Range checks (c in min..max) are generally implemented by an unsigned
« no previous file with comments | « src/x64/regexp-macro-assembler-x64.h ('k') | test/mjsunit/unicodelctest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698