| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 UNREACHABLE(); | 1534 UNREACHABLE(); |
| 1535 return false; | 1535 return false; |
| 1536 } | 1536 } |
| 1537 return on_success()->GoTo(compiler); | 1537 return on_success()->GoTo(compiler); |
| 1538 } | 1538 } |
| 1539 | 1539 |
| 1540 | 1540 |
| 1541 bool BackReferenceNode::Emit(RegExpCompiler* compiler) { | 1541 bool BackReferenceNode::Emit(RegExpCompiler* compiler) { |
| 1542 RegExpMacroAssembler* macro = compiler->macro_assembler(); | 1542 RegExpMacroAssembler* macro = compiler->macro_assembler(); |
| 1543 Bind(macro); | 1543 Bind(macro); |
| 1544 // Check whether the registers are uninitialized and always | |
| 1545 // succeed if they are. | |
| 1546 macro->IfRegisterLT(start_reg_, 0, on_success()->label()); | |
| 1547 macro->IfRegisterLT(end_reg_, 0, on_success()->label()); | |
| 1548 ASSERT_EQ(start_reg_ + 1, end_reg_); | 1544 ASSERT_EQ(start_reg_ + 1, end_reg_); |
| 1549 if (info()->at_end) { | 1545 if (info()->at_end) { |
| 1550 // If we are constrained to match at the end of the input then succeed | 1546 // If we are constrained to match at the end of the input then succeed |
| 1551 // iff the back reference is empty. | 1547 // iff the back reference is empty. |
| 1552 macro->CheckNotRegistersEqual(start_reg_, end_reg_, on_failure_->label()); | 1548 macro->CheckNotRegistersEqual(start_reg_, end_reg_, on_failure_->label()); |
| 1553 } else { | 1549 } else { |
| 1554 if (compiler->ignore_case()) { | 1550 if (compiler->ignore_case()) { |
| 1555 macro->CheckNotBackReferenceIgnoreCase(start_reg_, on_failure_->label()); | 1551 macro->CheckNotBackReferenceIgnoreCase(start_reg_, on_failure_->label()); |
| 1556 } else { | 1552 } else { |
| 1557 macro->CheckNotBackReference(start_reg_, on_failure_->label()); | 1553 macro->CheckNotBackReference(start_reg_, on_failure_->label()); |
| (...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3033 } | 3029 } |
| 3034 EmbeddedVector<byte, 1024> codes; | 3030 EmbeddedVector<byte, 1024> codes; |
| 3035 RegExpMacroAssemblerIrregexp macro_assembler(codes); | 3031 RegExpMacroAssemblerIrregexp macro_assembler(codes); |
| 3036 return compiler.Assemble(¯o_assembler, | 3032 return compiler.Assemble(¯o_assembler, |
| 3037 node, | 3033 node, |
| 3038 input->capture_count); | 3034 input->capture_count); |
| 3039 } | 3035 } |
| 3040 | 3036 |
| 3041 | 3037 |
| 3042 }} // namespace v8::internal | 3038 }} // namespace v8::internal |
| OLD | NEW |