OLD | NEW |
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 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1474 if (to == NULL) { | 1474 if (to == NULL) { |
1475 Backtrack(); | 1475 Backtrack(); |
1476 return; | 1476 return; |
1477 } | 1477 } |
1478 __ B(to); | 1478 __ B(to); |
1479 return; | 1479 return; |
1480 } | 1480 } |
1481 if (to == NULL) { | 1481 if (to == NULL) { |
1482 to = &backtrack_label_; | 1482 to = &backtrack_label_; |
1483 } | 1483 } |
1484 __ B(condition, to); | 1484 // TODO(ulan): do direct jump when jump distance is known and fits in imm19. |
| 1485 Condition inverted_condition = InvertCondition(condition); |
| 1486 Label no_branch; |
| 1487 __ B(inverted_condition, &no_branch); |
| 1488 __ B(to); |
| 1489 __ Bind(&no_branch); |
1485 } | 1490 } |
1486 | 1491 |
1487 void RegExpMacroAssemblerARM64::CompareAndBranchOrBacktrack(Register reg, | 1492 void RegExpMacroAssemblerARM64::CompareAndBranchOrBacktrack(Register reg, |
1488 int immediate, | 1493 int immediate, |
1489 Condition condition, | 1494 Condition condition, |
1490 Label* to) { | 1495 Label* to) { |
1491 if ((immediate == 0) && ((condition == eq) || (condition == ne))) { | 1496 if ((immediate == 0) && ((condition == eq) || (condition == ne))) { |
1492 if (to == NULL) { | 1497 if (to == NULL) { |
1493 to = &backtrack_label_; | 1498 to = &backtrack_label_; |
1494 } | 1499 } |
| 1500 // TODO(ulan): do direct jump when jump distance is known and fits in imm19. |
| 1501 Label no_branch; |
1495 if (condition == eq) { | 1502 if (condition == eq) { |
1496 __ Cbz(reg, to); | 1503 __ Cbnz(reg, &no_branch); |
1497 } else { | 1504 } else { |
1498 __ Cbnz(reg, to); | 1505 __ Cbz(reg, &no_branch); |
1499 } | 1506 } |
| 1507 __ B(to); |
| 1508 __ Bind(&no_branch); |
1500 } else { | 1509 } else { |
1501 __ Cmp(reg, immediate); | 1510 __ Cmp(reg, immediate); |
1502 BranchOrBacktrack(condition, to); | 1511 BranchOrBacktrack(condition, to); |
1503 } | 1512 } |
1504 } | 1513 } |
1505 | 1514 |
1506 | 1515 |
1507 void RegExpMacroAssemblerARM64::CheckPreemption() { | 1516 void RegExpMacroAssemblerARM64::CheckPreemption() { |
1508 // Check for preemption. | 1517 // Check for preemption. |
1509 ExternalReference stack_limit = | 1518 ExternalReference stack_limit = |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 __ Ldrh(current_character(), MemOperand(input_end(), offset, SXTW)); | 1719 __ Ldrh(current_character(), MemOperand(input_end(), offset, SXTW)); |
1711 } | 1720 } |
1712 } | 1721 } |
1713 } | 1722 } |
1714 | 1723 |
1715 #endif // V8_INTERPRETED_REGEXP | 1724 #endif // V8_INTERPRETED_REGEXP |
1716 | 1725 |
1717 }} // namespace v8::internal | 1726 }} // namespace v8::internal |
1718 | 1727 |
1719 #endif // V8_TARGET_ARCH_ARM64 | 1728 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |