ARM64: use direct conditional branches for regexp
authorm.m.capewell@googlemail.com <m.m.capewell@googlemail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 3 Jul 2014 13:16:51 +0000 (13:16 +0000)
committerm.m.capewell@googlemail.com <m.m.capewell@googlemail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 3 Jul 2014 13:16:51 +0000 (13:16 +0000)
R=ulan@chromium.org, bmeurer@chromium.org

BUG=

Review URL: https://codereview.chromium.org/370553002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22199 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/arm64/regexp-macro-assembler-arm64.cc

index 6896704..762a7f1 100644 (file)
@@ -1461,12 +1461,7 @@ void RegExpMacroAssemblerARM64::BranchOrBacktrack(Condition condition,
   if (to == NULL) {
     to = &backtrack_label_;
   }
-  // TODO(ulan): do direct jump when jump distance is known and fits in imm19.
-  Condition inverted_condition = NegateCondition(condition);
-  Label no_branch;
-  __ B(inverted_condition, &no_branch);
-  __ B(to);
-  __ Bind(&no_branch);
+  __ B(condition, to);
 }
 
 void RegExpMacroAssemblerARM64::CompareAndBranchOrBacktrack(Register reg,
@@ -1477,15 +1472,11 @@ void RegExpMacroAssemblerARM64::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) {
-      __ Cbnz(reg, &no_branch);
+      __ Cbz(reg, to);
     } else {
-      __ Cbz(reg, &no_branch);
+      __ Cbnz(reg, to);
     }
-    __ B(to);
-    __ Bind(&no_branch);
   } else {
     __ Cmp(reg, immediate);
     BranchOrBacktrack(condition, to);