| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 void RegExpMacroAssemblerX64::CheckNotCharacter(uint32_t c, | 535 void RegExpMacroAssemblerX64::CheckNotCharacter(uint32_t c, |
| 536 Label* on_not_equal) { | 536 Label* on_not_equal) { |
| 537 __ cmpl(current_character(), Immediate(c)); | 537 __ cmpl(current_character(), Immediate(c)); |
| 538 BranchOrBacktrack(not_equal, on_not_equal); | 538 BranchOrBacktrack(not_equal, on_not_equal); |
| 539 } | 539 } |
| 540 | 540 |
| 541 | 541 |
| 542 void RegExpMacroAssemblerX64::CheckCharacterAfterAnd(uint32_t c, | 542 void RegExpMacroAssemblerX64::CheckCharacterAfterAnd(uint32_t c, |
| 543 uint32_t mask, | 543 uint32_t mask, |
| 544 Label* on_equal) { | 544 Label* on_equal) { |
| 545 __ movl(rax, current_character()); | 545 if (c == 0) { |
| 546 __ and_(rax, Immediate(mask)); | 546 __ testl(current_character(), Immediate(mask)); |
| 547 __ cmpl(rax, Immediate(c)); | 547 } else { |
| 548 __ movl(rax, Immediate(mask)); |
| 549 __ and_(rax, current_character()); |
| 550 __ cmpl(rax, Immediate(c)); |
| 551 } |
| 548 BranchOrBacktrack(equal, on_equal); | 552 BranchOrBacktrack(equal, on_equal); |
| 549 } | 553 } |
| 550 | 554 |
| 551 | 555 |
| 552 void RegExpMacroAssemblerX64::CheckNotCharacterAfterAnd(uint32_t c, | 556 void RegExpMacroAssemblerX64::CheckNotCharacterAfterAnd(uint32_t c, |
| 553 uint32_t mask, | 557 uint32_t mask, |
| 554 Label* on_not_equal) { | 558 Label* on_not_equal) { |
| 555 __ movl(rax, current_character()); | 559 if (c == 0) { |
| 556 __ and_(rax, Immediate(mask)); | 560 __ testl(current_character(), Immediate(mask)); |
| 557 __ cmpl(rax, Immediate(c)); | 561 } else { |
| 562 __ movl(rax, Immediate(mask)); |
| 563 __ and_(rax, current_character()); |
| 564 __ cmpl(rax, Immediate(c)); |
| 565 } |
| 558 BranchOrBacktrack(not_equal, on_not_equal); | 566 BranchOrBacktrack(not_equal, on_not_equal); |
| 559 } | 567 } |
| 560 | 568 |
| 561 | 569 |
| 562 void RegExpMacroAssemblerX64::CheckNotCharacterAfterMinusAnd( | 570 void RegExpMacroAssemblerX64::CheckNotCharacterAfterMinusAnd( |
| 563 uc16 c, | 571 uc16 c, |
| 564 uc16 minus, | 572 uc16 minus, |
| 565 uc16 mask, | 573 uc16 mask, |
| 566 Label* on_not_equal) { | 574 Label* on_not_equal) { |
| 567 ASSERT(minus < String::kMaxUtf16CodeUnit); | 575 ASSERT(minus < String::kMaxUtf16CodeUnit); |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1452 } | 1460 } |
| 1453 } | 1461 } |
| 1454 | 1462 |
| 1455 #undef __ | 1463 #undef __ |
| 1456 | 1464 |
| 1457 #endif // V8_INTERPRETED_REGEXP | 1465 #endif // V8_INTERPRETED_REGEXP |
| 1458 | 1466 |
| 1459 }} // namespace v8::internal | 1467 }} // namespace v8::internal |
| 1460 | 1468 |
| 1461 #endif // V8_TARGET_ARCH_X64 | 1469 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |