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 5270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5333 NativeRegExpMacroAssembler::Mode mode = | 5335 NativeRegExpMacroAssembler::Mode mode = |
5334 is_ascii ? NativeRegExpMacroAssembler::ASCII | 5336 is_ascii ? NativeRegExpMacroAssembler::ASCII |
5335 : NativeRegExpMacroAssembler::UC16; | 5337 : NativeRegExpMacroAssembler::UC16; |
5336 | 5338 |
5337 #if V8_TARGET_ARCH_IA32 | 5339 #if V8_TARGET_ARCH_IA32 |
5338 RegExpMacroAssemblerIA32 macro_assembler(mode, (data->capture_count + 1) * 2); | 5340 RegExpMacroAssemblerIA32 macro_assembler(mode, (data->capture_count + 1) * 2); |
5339 #elif V8_TARGET_ARCH_X64 | 5341 #elif V8_TARGET_ARCH_X64 |
5340 RegExpMacroAssemblerX64 macro_assembler(mode, (data->capture_count + 1) * 2); | 5342 RegExpMacroAssemblerX64 macro_assembler(mode, (data->capture_count + 1) * 2); |
5341 #elif V8_TARGET_ARCH_ARM | 5343 #elif V8_TARGET_ARCH_ARM |
5342 RegExpMacroAssemblerARM macro_assembler(mode, (data->capture_count + 1) * 2); | 5344 RegExpMacroAssemblerARM macro_assembler(mode, (data->capture_count + 1) * 2); |
| 5345 #elif V8_TARGET_ARCH_MIPS |
| 5346 RegExpMacroAssemblerMIPS macro_assembler(mode, (data->capture_count + 1) * 2); |
5343 #endif | 5347 #endif |
5344 | 5348 |
5345 #else // V8_INTERPRETED_REGEXP | 5349 #else // V8_INTERPRETED_REGEXP |
5346 // Interpreted regexp implementation. | 5350 // Interpreted regexp implementation. |
5347 EmbeddedVector<byte, 1024> codes; | 5351 EmbeddedVector<byte, 1024> codes; |
5348 RegExpMacroAssemblerIrregexp macro_assembler(codes); | 5352 RegExpMacroAssemblerIrregexp macro_assembler(codes); |
5349 #endif // V8_INTERPRETED_REGEXP | 5353 #endif // V8_INTERPRETED_REGEXP |
5350 | 5354 |
5351 // Inserted here, instead of in Assembler, because it depends on information | 5355 // Inserted here, instead of in Assembler, because it depends on information |
5352 // in the AST that isn't replicated in the Node structure. | 5356 // in the AST that isn't replicated in the Node structure. |
5353 static const int kMaxBacksearchLimit = 1024; | 5357 static const int kMaxBacksearchLimit = 1024; |
5354 if (is_end_anchored && | 5358 if (is_end_anchored && |
5355 !is_start_anchored && | 5359 !is_start_anchored && |
5356 max_length < kMaxBacksearchLimit) { | 5360 max_length < kMaxBacksearchLimit) { |
5357 macro_assembler.SetCurrentPositionFromEnd(max_length); | 5361 macro_assembler.SetCurrentPositionFromEnd(max_length); |
5358 } | 5362 } |
5359 | 5363 |
5360 return compiler.Assemble(¯o_assembler, | 5364 return compiler.Assemble(¯o_assembler, |
5361 node, | 5365 node, |
5362 data->capture_count, | 5366 data->capture_count, |
5363 pattern); | 5367 pattern); |
5364 } | 5368 } |
5365 | 5369 |
5366 | 5370 |
5367 }} // namespace v8::internal | 5371 }} // namespace v8::internal |
OLD | NEW |