Revision: 18777
Author:   [email protected]
Date:     Thu Jan 23 13:43:44 2014 UTC
Log:      A64: fix out-of-range conditional jump in RegExpMacroAssemblerA64.

BUG=314606
TEST=mjsunit/regress/regress-crbug-178790
[email protected]

Review URL: https://codereview.chromium.org/132033006
http://code.google.com/p/v8/source/detail?r=18777

Modified:
 /branches/experimental/a64/src/a64/regexp-macro-assembler-a64.cc

=======================================
--- /branches/experimental/a64/src/a64/regexp-macro-assembler-a64.cc Wed Jan 22 12:46:44 2014 UTC +++ /branches/experimental/a64/src/a64/regexp-macro-assembler-a64.cc Thu Jan 23 13:43:44 2014 UTC
@@ -1455,10 +1455,14 @@
     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 @@
     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);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to