diff options
author | isaacs <i@izs.me> | 2012-05-15 19:53:16 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-05-16 14:22:33 -0700 |
commit | 3f3f958c14cf4e963a73d6f037ac381c77fe78bb (patch) | |
tree | 391e35b59e76d038534fbd375f1bbe0dc55076cf /deps/v8/src/arm/regexp-macro-assembler-arm.cc | |
parent | 4099d1eebae4e78864a6879c0b9e08f31d48d8cb (diff) | |
download | node-new-3f3f958c14cf4e963a73d6f037ac381c77fe78bb.tar.gz |
Upgrade V8 to 3.11.1
Diffstat (limited to 'deps/v8/src/arm/regexp-macro-assembler-arm.cc')
-rw-r--r-- | deps/v8/src/arm/regexp-macro-assembler-arm.cc | 54 |
1 files changed, 50 insertions, 4 deletions
diff --git a/deps/v8/src/arm/regexp-macro-assembler-arm.cc b/deps/v8/src/arm/regexp-macro-assembler-arm.cc index 10ff2dd96c..a833624ceb 100644 --- a/deps/v8/src/arm/regexp-macro-assembler-arm.cc +++ b/deps/v8/src/arm/regexp-macro-assembler-arm.cc @@ -452,8 +452,12 @@ void RegExpMacroAssemblerARM::CheckNotCharacter(unsigned c, void RegExpMacroAssemblerARM::CheckCharacterAfterAnd(uint32_t c, uint32_t mask, Label* on_equal) { - __ and_(r0, current_character(), Operand(mask)); - __ cmp(r0, Operand(c)); + if (c == 0) { + __ tst(current_character(), Operand(mask)); + } else { + __ and_(r0, current_character(), Operand(mask)); + __ cmp(r0, Operand(c)); + } BranchOrBacktrack(eq, on_equal); } @@ -461,8 +465,12 @@ void RegExpMacroAssemblerARM::CheckCharacterAfterAnd(uint32_t c, void RegExpMacroAssemblerARM::CheckNotCharacterAfterAnd(unsigned c, unsigned mask, Label* on_not_equal) { - __ and_(r0, current_character(), Operand(mask)); - __ cmp(r0, Operand(c)); + if (c == 0) { + __ tst(current_character(), Operand(mask)); + } else { + __ and_(r0, current_character(), Operand(mask)); + __ cmp(r0, Operand(c)); + } BranchOrBacktrack(ne, on_not_equal); } @@ -480,6 +488,44 @@ void RegExpMacroAssemblerARM::CheckNotCharacterAfterMinusAnd( } +void RegExpMacroAssemblerARM::CheckCharacterInRange( + uc16 from, + uc16 to, + Label* on_in_range) { + __ sub(r0, current_character(), Operand(from)); + __ cmp(r0, Operand(to - from)); + BranchOrBacktrack(ls, on_in_range); // Unsigned lower-or-same condition. +} + + +void RegExpMacroAssemblerARM::CheckCharacterNotInRange( + uc16 from, + uc16 to, + Label* on_not_in_range) { + __ sub(r0, current_character(), Operand(from)); + __ cmp(r0, Operand(to - from)); + BranchOrBacktrack(hi, on_not_in_range); // Unsigned higher condition. +} + + +void RegExpMacroAssemblerARM::CheckBitInTable( + Handle<ByteArray> table, + Label* on_bit_set) { + __ mov(r0, Operand(table)); + if (mode_ != ASCII || kTableMask != String::kMaxAsciiCharCode) { + __ and_(r1, current_character(), Operand(kTableSize - 1)); + __ add(r1, r1, Operand(ByteArray::kHeaderSize - kHeapObjectTag)); + } else { + __ add(r1, + current_character(), + Operand(ByteArray::kHeaderSize - kHeapObjectTag)); + } + __ ldrb(r0, MemOperand(r0, r1)); + __ cmp(r0, Operand(0)); + BranchOrBacktrack(ne, on_bit_set); +} + + bool RegExpMacroAssemblerARM::CheckSpecialCharacterClass(uc16 type, Label* on_no_match) { // Range checks (c in min..max) are generally implemented by an unsigned |