Commit 196f49e0 authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

PPC/s390: [regexp] Add an offset argument CheckAtStart

Port 2e0bc516

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.

R=jgruber@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I255ed27bd0d5bccfb9851696ca25f2bb4a984981
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1775721Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#63452}
parent f884e2fa
...@@ -189,15 +189,14 @@ void RegExpMacroAssemblerPPC::CheckCharacterGT(uc16 limit, Label* on_greater) { ...@@ -189,15 +189,14 @@ void RegExpMacroAssemblerPPC::CheckCharacterGT(uc16 limit, Label* on_greater) {
BranchOrBacktrack(gt, on_greater); BranchOrBacktrack(gt, on_greater);
} }
void RegExpMacroAssemblerPPC::CheckAtStart(int cp_offset, Label* on_at_start) {
void RegExpMacroAssemblerPPC::CheckAtStart(Label* on_at_start) {
__ LoadP(r4, MemOperand(frame_pointer(), kStringStartMinusOne)); __ LoadP(r4, MemOperand(frame_pointer(), kStringStartMinusOne));
__ addi(r3, current_input_offset(), Operand(-char_size())); __ addi(r3, current_input_offset(),
Operand(-char_size() + cp_offset * char_size()));
__ cmp(r3, r4); __ cmp(r3, r4);
BranchOrBacktrack(eq, on_at_start); BranchOrBacktrack(eq, on_at_start);
} }
void RegExpMacroAssemblerPPC::CheckNotAtStart(int cp_offset, void RegExpMacroAssemblerPPC::CheckNotAtStart(int cp_offset,
Label* on_not_at_start) { Label* on_not_at_start) {
__ LoadP(r4, MemOperand(frame_pointer(), kStringStartMinusOne)); __ LoadP(r4, MemOperand(frame_pointer(), kStringStartMinusOne));
......
...@@ -23,7 +23,7 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerPPC ...@@ -23,7 +23,7 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerPPC
virtual void AdvanceRegister(int reg, int by); virtual void AdvanceRegister(int reg, int by);
virtual void Backtrack(); virtual void Backtrack();
virtual void Bind(Label* label); 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(unsigned c, Label* on_equal); virtual void CheckCharacter(unsigned c, Label* on_equal);
virtual void CheckCharacterAfterAnd(unsigned c, unsigned mask, virtual void CheckCharacterAfterAnd(unsigned c, unsigned mask,
Label* on_equal); Label* on_equal);
......
...@@ -178,9 +178,10 @@ void RegExpMacroAssemblerS390::CheckCharacterGT(uc16 limit, Label* on_greater) { ...@@ -178,9 +178,10 @@ void RegExpMacroAssemblerS390::CheckCharacterGT(uc16 limit, Label* on_greater) {
BranchOrBacktrack(gt, on_greater); BranchOrBacktrack(gt, on_greater);
} }
void RegExpMacroAssemblerS390::CheckAtStart(Label* on_at_start) { void RegExpMacroAssemblerS390::CheckAtStart(int cp_offset, Label* on_at_start) {
__ LoadP(r3, MemOperand(frame_pointer(), kStringStartMinusOne)); __ LoadP(r3, MemOperand(frame_pointer(), kStringStartMinusOne));
__ AddP(r2, current_input_offset(), Operand(-char_size())); __ AddP(r2, current_input_offset(),
Operand(-char_size() + cp_offset * char_size()));
__ CmpP(r2, r3); __ CmpP(r2, r3);
BranchOrBacktrack(eq, on_at_start); BranchOrBacktrack(eq, on_at_start);
} }
......
...@@ -23,7 +23,7 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerS390 ...@@ -23,7 +23,7 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerS390
virtual void AdvanceRegister(int reg, int by); virtual void AdvanceRegister(int reg, int by);
virtual void Backtrack(); virtual void Backtrack();
virtual void Bind(Label* label); 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(unsigned c, Label* on_equal); virtual void CheckCharacter(unsigned c, Label* on_equal);
virtual void CheckCharacterAfterAnd(unsigned c, unsigned mask, virtual void CheckCharacterAfterAnd(unsigned c, unsigned mask,
Label* on_equal); Label* on_equal);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment