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