| Index: src/a64/regexp-macro-assembler-a64.cc
|
| diff --git a/src/a64/regexp-macro-assembler-a64.cc b/src/a64/regexp-macro-assembler-a64.cc
|
| index 8bd9c60b0e9421bbffc7b6e4f6ba2ce82b01931c..49feba6f76a0c4db6a0ceec279d5890c87972c0c 100644
|
| --- a/src/a64/regexp-macro-assembler-a64.cc
|
| +++ b/src/a64/regexp-macro-assembler-a64.cc
|
| @@ -1455,10 +1455,14 @@ void RegExpMacroAssemblerA64::BranchOrBacktrack(Condition condition,
|
| return;
|
| }
|
| if (to == NULL) {
|
| - __ B(condition, &backtrack_label_);
|
| - return;
|
| + to = &backtrack_label_;
|
| }
|
| - __ B(condition, to);
|
| + // TODO(ulan): do direct jump when jump distance is known and fits in imm19.
|
| + Condition inverted_condition = InvertCondition(condition);
|
| + Label no_branch;
|
| + __ B(inverted_condition, &no_branch);
|
| + __ B(to);
|
| + __ Bind(&no_branch);
|
| }
|
|
|
| void RegExpMacroAssemblerA64::CompareAndBranchOrBacktrack(Register reg,
|
| @@ -1469,11 +1473,15 @@ void RegExpMacroAssemblerA64::CompareAndBranchOrBacktrack(Register reg,
|
| if (to == NULL) {
|
| to = &backtrack_label_;
|
| }
|
| + // TODO(ulan): do direct jump when jump distance is known and fits in imm19.
|
| + Label no_branch;
|
| if (condition == eq) {
|
| - __ Cbz(reg, to);
|
| + __ Cbnz(reg, &no_branch);
|
| } else {
|
| - __ Cbnz(reg, to);
|
| + __ Cbz(reg, &no_branch);
|
| }
|
| + __ B(to);
|
| + __ Bind(&no_branch);
|
| } else {
|
| __ Cmp(reg, immediate);
|
| BranchOrBacktrack(condition, to);
|
|
|