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

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

Issue 9169088: Use cmp instead of tst to check for zero. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 | « src/arm/full-codegen-arm.cc ('k') | 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 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 } 564 }
565 case 'w': { 565 case 'w': {
566 if (mode_ != ASCII) { 566 if (mode_ != ASCII) {
567 // Table is 128 entries, so all ASCII characters can be tested. 567 // Table is 128 entries, so all ASCII characters can be tested.
568 __ cmp(current_character(), Operand('z')); 568 __ cmp(current_character(), Operand('z'));
569 BranchOrBacktrack(hi, on_no_match); 569 BranchOrBacktrack(hi, on_no_match);
570 } 570 }
571 ExternalReference map = ExternalReference::re_word_character_map(); 571 ExternalReference map = ExternalReference::re_word_character_map();
572 __ mov(r0, Operand(map)); 572 __ mov(r0, Operand(map));
573 __ ldrb(r0, MemOperand(r0, current_character())); 573 __ ldrb(r0, MemOperand(r0, current_character()));
574 __ tst(r0, Operand(r0)); 574 __ cmp(r0, Operand(0));
575 BranchOrBacktrack(eq, on_no_match); 575 BranchOrBacktrack(eq, on_no_match);
576 return true; 576 return true;
577 } 577 }
578 case 'W': { 578 case 'W': {
579 Label done; 579 Label done;
580 if (mode_ != ASCII) { 580 if (mode_ != ASCII) {
581 // Table is 128 entries, so all ASCII characters can be tested. 581 // Table is 128 entries, so all ASCII characters can be tested.
582 __ cmp(current_character(), Operand('z')); 582 __ cmp(current_character(), Operand('z'));
583 __ b(hi, &done); 583 __ b(hi, &done);
584 } 584 }
585 ExternalReference map = ExternalReference::re_word_character_map(); 585 ExternalReference map = ExternalReference::re_word_character_map();
586 __ mov(r0, Operand(map)); 586 __ mov(r0, Operand(map));
587 __ ldrb(r0, MemOperand(r0, current_character())); 587 __ ldrb(r0, MemOperand(r0, current_character()));
588 __ tst(r0, Operand(r0)); 588 __ cmp(r0, Operand(0));
589 BranchOrBacktrack(ne, on_no_match); 589 BranchOrBacktrack(ne, on_no_match);
590 if (mode_ != ASCII) { 590 if (mode_ != ASCII) {
591 __ bind(&done); 591 __ bind(&done);
592 } 592 }
593 return true; 593 return true;
594 } 594 }
595 case '*': 595 case '*':
596 // Match any character. 596 // Match any character.
597 return true; 597 return true;
598 // No custom implementation (yet): s(UC16), S(UC16). 598 // No custom implementation (yet): s(UC16), S(UC16).
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 // (effectively string position -1). 674 // (effectively string position -1).
675 __ ldr(r1, MemOperand(frame_pointer(), kStartIndex)); 675 __ ldr(r1, MemOperand(frame_pointer(), kStartIndex));
676 __ sub(r0, current_input_offset(), Operand(char_size())); 676 __ sub(r0, current_input_offset(), Operand(char_size()));
677 __ sub(r0, r0, Operand(r1, LSL, (mode_ == UC16) ? 1 : 0)); 677 __ sub(r0, r0, Operand(r1, LSL, (mode_ == UC16) ? 1 : 0));
678 // Store this value in a local variable, for use when clearing 678 // Store this value in a local variable, for use when clearing
679 // position registers. 679 // position registers.
680 __ str(r0, MemOperand(frame_pointer(), kInputStartMinusOne)); 680 __ str(r0, MemOperand(frame_pointer(), kInputStartMinusOne));
681 681
682 // Determine whether the start index is zero, that is at the start of the 682 // Determine whether the start index is zero, that is at the start of the
683 // string, and store that value in a local variable. 683 // string, and store that value in a local variable.
684 __ tst(r1, Operand(r1)); 684 __ cmp(r1, Operand(0));
685 __ mov(r1, Operand(1), LeaveCC, eq); 685 __ mov(r1, Operand(1), LeaveCC, eq);
686 __ mov(r1, Operand(0, RelocInfo::NONE), LeaveCC, ne); 686 __ mov(r1, Operand(0, RelocInfo::NONE), LeaveCC, ne);
687 __ str(r1, MemOperand(frame_pointer(), kAtStart)); 687 __ str(r1, MemOperand(frame_pointer(), kAtStart));
688 688
689 if (num_saved_registers_ > 0) { // Always is, if generated from a regexp. 689 if (num_saved_registers_ > 0) { // Always is, if generated from a regexp.
690 // Fill saved registers with initial value = start offset - 1 690 // Fill saved registers with initial value = start offset - 1
691 691
692 // Address of register 0. 692 // Address of register 0.
693 __ add(r1, frame_pointer(), Operand(kRegisterZero)); 693 __ add(r1, frame_pointer(), Operand(kRegisterZero));
694 __ mov(r2, Operand(num_saved_registers_)); 694 __ mov(r2, Operand(num_saved_registers_));
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex)); 1304 __ ldr(pc, MemOperand(sp, stack_alignment, PostIndex));
1305 } 1305 }
1306 1306
1307 #undef __ 1307 #undef __
1308 1308
1309 #endif // V8_INTERPRETED_REGEXP 1309 #endif // V8_INTERPRETED_REGEXP
1310 1310
1311 }} // namespace v8::internal 1311 }} // namespace v8::internal
1312 1312
1313 #endif // V8_TARGET_ARCH_ARM 1313 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698