Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: src/a64/regexp-macro-assembler-a64.cc

Issue 132033006: A64: fix out-of-range conditional jump in RegExpMacroAssemblerA64. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after
1448 Label* to) { 1448 Label* to) {
1449 if (condition == al) { // Unconditional. 1449 if (condition == al) { // Unconditional.
1450 if (to == NULL) { 1450 if (to == NULL) {
1451 Backtrack(); 1451 Backtrack();
1452 return; 1452 return;
1453 } 1453 }
1454 __ B(to); 1454 __ B(to);
1455 return; 1455 return;
1456 } 1456 }
1457 if (to == NULL) { 1457 if (to == NULL) {
1458 __ B(condition, &backtrack_label_); 1458 to = &backtrack_label_;
1459 return;
1460 } 1459 }
1461 __ B(condition, to); 1460 // TODO(ulan): do direct jump when jump distance is known and fits in imm19.
1461 Condition inverted_condition = InvertCondition(condition);
1462 Label no_branch;
1463 __ B(inverted_condition, &no_branch);
1464 __ B(to);
1465 __ Bind(&no_branch);
1462 } 1466 }
1463 1467
1464 void RegExpMacroAssemblerA64::CompareAndBranchOrBacktrack(Register reg, 1468 void RegExpMacroAssemblerA64::CompareAndBranchOrBacktrack(Register reg,
1465 int immediate, 1469 int immediate,
1466 Condition condition, 1470 Condition condition,
1467 Label* to) { 1471 Label* to) {
1468 if ((immediate == 0) && ((condition == eq) || (condition == ne))) { 1472 if ((immediate == 0) && ((condition == eq) || (condition == ne))) {
1469 if (to == NULL) { 1473 if (to == NULL) {
1470 to = &backtrack_label_; 1474 to = &backtrack_label_;
1471 } 1475 }
1476 // TODO(ulan): do direct jump when jump distance is known and fits in imm19.
1477 Label no_branch;
1472 if (condition == eq) { 1478 if (condition == eq) {
1473 __ Cbz(reg, to); 1479 __ Cbnz(reg, &no_branch);
1474 } else { 1480 } else {
1475 __ Cbnz(reg, to); 1481 __ Cbz(reg, &no_branch);
1476 } 1482 }
1483 __ B(to);
1484 __ Bind(&no_branch);
1477 } else { 1485 } else {
1478 __ Cmp(reg, immediate); 1486 __ Cmp(reg, immediate);
1479 BranchOrBacktrack(condition, to); 1487 BranchOrBacktrack(condition, to);
1480 } 1488 }
1481 } 1489 }
1482 1490
1483 1491
1484 void RegExpMacroAssemblerA64::CheckPreemption() { 1492 void RegExpMacroAssemblerA64::CheckPreemption() {
1485 // Check for preemption. 1493 // Check for preemption.
1486 ExternalReference stack_limit = 1494 ExternalReference stack_limit =
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 __ Ldrh(current_character(), MemOperand(input_end(), offset, SXTW)); 1691 __ Ldrh(current_character(), MemOperand(input_end(), offset, SXTW));
1684 } 1692 }
1685 } 1693 }
1686 } 1694 }
1687 1695
1688 #endif // V8_INTERPRETED_REGEXP 1696 #endif // V8_INTERPRETED_REGEXP
1689 1697
1690 }} // namespace v8::internal 1698 }} // namespace v8::internal
1691 1699
1692 #endif // V8_TARGET_ARCH_A64 1700 #endif // V8_TARGET_ARCH_A64
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698