[mips][regexp] Add an offset argument CheckAtStart

Port 2e0bc516b7

Original Commit Message:

    Similar to CheckNotAtStart, one can now apply an offset to the
    CheckAtStart operation. Due to a recent change, all callsites of
    CheckNotAtStart now need to pass an offset, whereas previously the
    offset was just assumed to be zero.

Change-Id: I8201ae7620809be3767ad32feab069074b3cbf86
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1775983
Auto-Submit: Mu Tao <pamilty@gmail.com>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63491}
This commit is contained in:
Mu Tao 2019-08-30 15:45:05 +08:00 committed by Commit Bot
parent 19b3ec7609
commit a5d85ba53c
4 changed files with 8 additions and 6 deletions

View File

@ -178,9 +178,10 @@ void RegExpMacroAssemblerMIPS::CheckCharacterGT(uc16 limit, Label* on_greater) {
}
void RegExpMacroAssemblerMIPS::CheckAtStart(Label* on_at_start) {
void RegExpMacroAssemblerMIPS::CheckAtStart(int cp_offset, Label* on_at_start) {
__ lw(a1, MemOperand(frame_pointer(), kStringStartMinusOne));
__ Addu(a0, current_input_offset(), Operand(-char_size()));
__ Addu(a0, current_input_offset(),
Operand(-char_size() + cp_offset * char_size()));
BranchOrBacktrack(on_at_start, eq, a0, Operand(a1));
}

View File

@ -23,7 +23,7 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerMIPS
virtual void AdvanceRegister(int reg, int by);
virtual void Backtrack();
virtual void Bind(Label* label);
virtual void CheckAtStart(Label* on_at_start);
virtual void CheckAtStart(int cp_offset, Label* on_at_start);
virtual void CheckCharacter(uint32_t c, Label* on_equal);
virtual void CheckCharacterAfterAnd(uint32_t c,
uint32_t mask,

View File

@ -214,9 +214,10 @@ void RegExpMacroAssemblerMIPS::CheckCharacterGT(uc16 limit, Label* on_greater) {
}
void RegExpMacroAssemblerMIPS::CheckAtStart(Label* on_at_start) {
void RegExpMacroAssemblerMIPS::CheckAtStart(int cp_offset, Label* on_at_start) {
__ Ld(a1, MemOperand(frame_pointer(), kStringStartMinusOne));
__ Daddu(a0, current_input_offset(), Operand(-char_size()));
__ Daddu(a0, current_input_offset(),
Operand(-char_size() + cp_offset * char_size()));
BranchOrBacktrack(on_at_start, eq, a0, Operand(a1));
}

View File

@ -23,7 +23,7 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerMIPS
virtual void AdvanceRegister(int reg, int by);
virtual void Backtrack();
virtual void Bind(Label* label);
virtual void CheckAtStart(Label* on_at_start);
virtual void CheckAtStart(int cp_offset, Label* on_at_start);
virtual void CheckCharacter(uint32_t c, Label* on_equal);
virtual void CheckCharacterAfterAnd(uint32_t c,
uint32_t mask,