| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "regexp-macro-assembler-irregexp.h" | 43 #include "regexp-macro-assembler-irregexp.h" |
| 44 #include "regexp-stack.h" | 44 #include "regexp-stack.h" |
| 45 | 45 |
| 46 #ifndef V8_INTERPRETED_REGEXP | 46 #ifndef V8_INTERPRETED_REGEXP |
| 47 #if V8_TARGET_ARCH_IA32 | 47 #if V8_TARGET_ARCH_IA32 |
| 48 #include "ia32/regexp-macro-assembler-ia32.h" | 48 #include "ia32/regexp-macro-assembler-ia32.h" |
| 49 #elif V8_TARGET_ARCH_X64 | 49 #elif V8_TARGET_ARCH_X64 |
| 50 #include "x64/regexp-macro-assembler-x64.h" | 50 #include "x64/regexp-macro-assembler-x64.h" |
| 51 #elif V8_TARGET_ARCH_ARM | 51 #elif V8_TARGET_ARCH_ARM |
| 52 #include "arm/regexp-macro-assembler-arm.h" | 52 #include "arm/regexp-macro-assembler-arm.h" |
| 53 #elif V8_TARGET_ARCH_MIPS |
| 54 #include "mips/regexp-macro-assembler-mips.h" |
| 53 #else | 55 #else |
| 54 #error Unsupported target architecture. | 56 #error Unsupported target architecture. |
| 55 #endif | 57 #endif |
| 56 #endif | 58 #endif |
| 57 | 59 |
| 58 #include "interpreter-irregexp.h" | 60 #include "interpreter-irregexp.h" |
| 59 | 61 |
| 60 | 62 |
| 61 namespace v8 { | 63 namespace v8 { |
| 62 namespace internal { | 64 namespace internal { |
| (...skipping 5269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5332 NativeRegExpMacroAssembler::Mode mode = | 5334 NativeRegExpMacroAssembler::Mode mode = |
| 5333 is_ascii ? NativeRegExpMacroAssembler::ASCII | 5335 is_ascii ? NativeRegExpMacroAssembler::ASCII |
| 5334 : NativeRegExpMacroAssembler::UC16; | 5336 : NativeRegExpMacroAssembler::UC16; |
| 5335 | 5337 |
| 5336 #if V8_TARGET_ARCH_IA32 | 5338 #if V8_TARGET_ARCH_IA32 |
| 5337 RegExpMacroAssemblerIA32 macro_assembler(mode, (data->capture_count + 1) * 2); | 5339 RegExpMacroAssemblerIA32 macro_assembler(mode, (data->capture_count + 1) * 2); |
| 5338 #elif V8_TARGET_ARCH_X64 | 5340 #elif V8_TARGET_ARCH_X64 |
| 5339 RegExpMacroAssemblerX64 macro_assembler(mode, (data->capture_count + 1) * 2); | 5341 RegExpMacroAssemblerX64 macro_assembler(mode, (data->capture_count + 1) * 2); |
| 5340 #elif V8_TARGET_ARCH_ARM | 5342 #elif V8_TARGET_ARCH_ARM |
| 5341 RegExpMacroAssemblerARM macro_assembler(mode, (data->capture_count + 1) * 2); | 5343 RegExpMacroAssemblerARM macro_assembler(mode, (data->capture_count + 1) * 2); |
| 5344 #elif V8_TARGET_ARCH_MIPS |
| 5345 RegExpMacroAssemblerMIPS macro_assembler(mode, (data->capture_count + 1) * 2); |
| 5342 #endif | 5346 #endif |
| 5343 | 5347 |
| 5344 #else // V8_INTERPRETED_REGEXP | 5348 #else // V8_INTERPRETED_REGEXP |
| 5345 // Interpreted regexp implementation. | 5349 // Interpreted regexp implementation. |
| 5346 EmbeddedVector<byte, 1024> codes; | 5350 EmbeddedVector<byte, 1024> codes; |
| 5347 RegExpMacroAssemblerIrregexp macro_assembler(codes); | 5351 RegExpMacroAssemblerIrregexp macro_assembler(codes); |
| 5348 #endif // V8_INTERPRETED_REGEXP | 5352 #endif // V8_INTERPRETED_REGEXP |
| 5349 | 5353 |
| 5350 // Inserted here, instead of in Assembler, because it depends on information | 5354 // Inserted here, instead of in Assembler, because it depends on information |
| 5351 // in the AST that isn't replicated in the Node structure. | 5355 // in the AST that isn't replicated in the Node structure. |
| 5352 static const int kMaxBacksearchLimit = 1024; | 5356 static const int kMaxBacksearchLimit = 1024; |
| 5353 if (is_end_anchored && | 5357 if (is_end_anchored && |
| 5354 !is_start_anchored && | 5358 !is_start_anchored && |
| 5355 max_length < kMaxBacksearchLimit) { | 5359 max_length < kMaxBacksearchLimit) { |
| 5356 macro_assembler.SetCurrentPositionFromEnd(max_length); | 5360 macro_assembler.SetCurrentPositionFromEnd(max_length); |
| 5357 } | 5361 } |
| 5358 | 5362 |
| 5359 return compiler.Assemble(¯o_assembler, | 5363 return compiler.Assemble(¯o_assembler, |
| 5360 node, | 5364 node, |
| 5361 data->capture_count, | 5365 data->capture_count, |
| 5362 pattern); | 5366 pattern); |
| 5363 } | 5367 } |
| 5364 | 5368 |
| 5365 | 5369 |
| 5366 }} // namespace v8::internal | 5370 }} // namespace v8::internal |
| OLD | NEW |