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

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

Issue 370553002: ARM64: use direct conditional branches for regexp (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_ARM64 7 #if V8_TARGET_ARCH_ARM64
8 8
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/cpu-profiler.h" 10 #include "src/cpu-profiler.h"
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 if (to == NULL) { 1454 if (to == NULL) {
1455 Backtrack(); 1455 Backtrack();
1456 return; 1456 return;
1457 } 1457 }
1458 __ B(to); 1458 __ B(to);
1459 return; 1459 return;
1460 } 1460 }
1461 if (to == NULL) { 1461 if (to == NULL) {
1462 to = &backtrack_label_; 1462 to = &backtrack_label_;
1463 } 1463 }
1464 // TODO(ulan): do direct jump when jump distance is known and fits in imm19. 1464 __ B(condition, to);
1465 Condition inverted_condition = NegateCondition(condition);
1466 Label no_branch;
1467 __ B(inverted_condition, &no_branch);
1468 __ B(to);
1469 __ Bind(&no_branch);
1470 } 1465 }
1471 1466
1472 void RegExpMacroAssemblerARM64::CompareAndBranchOrBacktrack(Register reg, 1467 void RegExpMacroAssemblerARM64::CompareAndBranchOrBacktrack(Register reg,
1473 int immediate, 1468 int immediate,
1474 Condition condition, 1469 Condition condition,
1475 Label* to) { 1470 Label* to) {
1476 if ((immediate == 0) && ((condition == eq) || (condition == ne))) { 1471 if ((immediate == 0) && ((condition == eq) || (condition == ne))) {
1477 if (to == NULL) { 1472 if (to == NULL) {
1478 to = &backtrack_label_; 1473 to = &backtrack_label_;
1479 } 1474 }
1480 // TODO(ulan): do direct jump when jump distance is known and fits in imm19.
1481 Label no_branch;
1482 if (condition == eq) { 1475 if (condition == eq) {
1483 __ Cbnz(reg, &no_branch); 1476 __ Cbz(reg, to);
1484 } else { 1477 } else {
1485 __ Cbz(reg, &no_branch); 1478 __ Cbnz(reg, to);
1486 } 1479 }
1487 __ B(to);
1488 __ Bind(&no_branch);
1489 } else { 1480 } else {
1490 __ Cmp(reg, immediate); 1481 __ Cmp(reg, immediate);
1491 BranchOrBacktrack(condition, to); 1482 BranchOrBacktrack(condition, to);
1492 } 1483 }
1493 } 1484 }
1494 1485
1495 1486
1496 void RegExpMacroAssemblerARM64::CheckPreemption() { 1487 void RegExpMacroAssemblerARM64::CheckPreemption() {
1497 // Check for preemption. 1488 // Check for preemption.
1498 ExternalReference stack_limit = 1489 ExternalReference stack_limit =
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1699 __ Ldrh(current_character(), MemOperand(input_end(), offset, SXTW)); 1690 __ Ldrh(current_character(), MemOperand(input_end(), offset, SXTW));
1700 } 1691 }
1701 } 1692 }
1702 } 1693 }
1703 1694
1704 #endif // V8_INTERPRETED_REGEXP 1695 #endif // V8_INTERPRETED_REGEXP
1705 1696
1706 }} // namespace v8::internal 1697 }} // namespace v8::internal
1707 1698
1708 #endif // V8_TARGET_ARCH_ARM64 1699 #endif // V8_TARGET_ARCH_ARM64
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