| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 5969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5980 RegExpMacroAssemblerARM macro_assembler(mode, (data->capture_count + 1) * 2, | 5980 RegExpMacroAssemblerARM macro_assembler(mode, (data->capture_count + 1) * 2, |
| 5981 zone); | 5981 zone); |
| 5982 #elif V8_TARGET_ARCH_MIPS | 5982 #elif V8_TARGET_ARCH_MIPS |
| 5983 RegExpMacroAssemblerMIPS macro_assembler(mode, (data->capture_count + 1) * 2, | 5983 RegExpMacroAssemblerMIPS macro_assembler(mode, (data->capture_count + 1) * 2, |
| 5984 zone); | 5984 zone); |
| 5985 #endif | 5985 #endif |
| 5986 | 5986 |
| 5987 #else // V8_INTERPRETED_REGEXP | 5987 #else // V8_INTERPRETED_REGEXP |
| 5988 // Interpreted regexp implementation. | 5988 // Interpreted regexp implementation. |
| 5989 EmbeddedVector<byte, 1024> codes; | 5989 EmbeddedVector<byte, 1024> codes; |
| 5990 RegExpMacroAssemblerIrregexp macro_assembler(codes); | 5990 RegExpMacroAssemblerIrregexp macro_assembler(codes, zone); |
| 5991 #endif // V8_INTERPRETED_REGEXP | 5991 #endif // V8_INTERPRETED_REGEXP |
| 5992 | 5992 |
| 5993 // Inserted here, instead of in Assembler, because it depends on information | 5993 // Inserted here, instead of in Assembler, because it depends on information |
| 5994 // in the AST that isn't replicated in the Node structure. | 5994 // in the AST that isn't replicated in the Node structure. |
| 5995 static const int kMaxBacksearchLimit = 1024; | 5995 static const int kMaxBacksearchLimit = 1024; |
| 5996 if (is_end_anchored && | 5996 if (is_end_anchored && |
| 5997 !is_start_anchored && | 5997 !is_start_anchored && |
| 5998 max_length < kMaxBacksearchLimit) { | 5998 max_length < kMaxBacksearchLimit) { |
| 5999 macro_assembler.SetCurrentPositionFromEnd(max_length); | 5999 macro_assembler.SetCurrentPositionFromEnd(max_length); |
| 6000 } | 6000 } |
| 6001 | 6001 |
| 6002 if (is_global) { | 6002 if (is_global) { |
| 6003 macro_assembler.set_global_mode( | 6003 macro_assembler.set_global_mode( |
| 6004 (data->tree->min_match() > 0) | 6004 (data->tree->min_match() > 0) |
| 6005 ? RegExpMacroAssembler::GLOBAL_NO_ZERO_LENGTH_CHECK | 6005 ? RegExpMacroAssembler::GLOBAL_NO_ZERO_LENGTH_CHECK |
| 6006 : RegExpMacroAssembler::GLOBAL); | 6006 : RegExpMacroAssembler::GLOBAL); |
| 6007 } | 6007 } |
| 6008 | 6008 |
| 6009 return compiler.Assemble(¯o_assembler, | 6009 return compiler.Assemble(¯o_assembler, |
| 6010 node, | 6010 node, |
| 6011 data->capture_count, | 6011 data->capture_count, |
| 6012 pattern); | 6012 pattern); |
| 6013 } | 6013 } |
| 6014 | 6014 |
| 6015 | 6015 |
| 6016 }} // namespace v8::internal | 6016 }} // namespace v8::internal |
| OLD | NEW |