| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "regexp-macro-assembler-irregexp.h" | 44 #include "regexp-macro-assembler-irregexp.h" |
| 45 #include "regexp-stack.h" | 45 #include "regexp-stack.h" |
| 46 | 46 |
| 47 #ifndef V8_INTERPRETED_REGEXP | 47 #ifndef V8_INTERPRETED_REGEXP |
| 48 #if V8_TARGET_ARCH_IA32 | 48 #if V8_TARGET_ARCH_IA32 |
| 49 #include "ia32/regexp-macro-assembler-ia32.h" | 49 #include "ia32/regexp-macro-assembler-ia32.h" |
| 50 #elif V8_TARGET_ARCH_X64 | 50 #elif V8_TARGET_ARCH_X64 |
| 51 #include "x64/regexp-macro-assembler-x64.h" | 51 #include "x64/regexp-macro-assembler-x64.h" |
| 52 #elif V8_TARGET_ARCH_ARM | 52 #elif V8_TARGET_ARCH_ARM |
| 53 #include "arm/regexp-macro-assembler-arm.h" | 53 #include "arm/regexp-macro-assembler-arm.h" |
| 54 #elif V8_TARGET_ARCH_MIPS |
| 55 #include "mips/regexp-macro-assembler-mips.h" |
| 54 #else | 56 #else |
| 55 #error Unsupported target architecture. | 57 #error Unsupported target architecture. |
| 56 #endif | 58 #endif |
| 57 #endif | 59 #endif |
| 58 | 60 |
| 59 #include "interpreter-irregexp.h" | 61 #include "interpreter-irregexp.h" |
| 60 | 62 |
| 61 | 63 |
| 62 namespace v8 { | 64 namespace v8 { |
| 63 namespace internal { | 65 namespace internal { |
| (...skipping 5243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5307 NativeRegExpMacroAssembler::Mode mode = | 5309 NativeRegExpMacroAssembler::Mode mode = |
| 5308 is_ascii ? NativeRegExpMacroAssembler::ASCII | 5310 is_ascii ? NativeRegExpMacroAssembler::ASCII |
| 5309 : NativeRegExpMacroAssembler::UC16; | 5311 : NativeRegExpMacroAssembler::UC16; |
| 5310 | 5312 |
| 5311 #if V8_TARGET_ARCH_IA32 | 5313 #if V8_TARGET_ARCH_IA32 |
| 5312 RegExpMacroAssemblerIA32 macro_assembler(mode, (data->capture_count + 1) * 2); | 5314 RegExpMacroAssemblerIA32 macro_assembler(mode, (data->capture_count + 1) * 2); |
| 5313 #elif V8_TARGET_ARCH_X64 | 5315 #elif V8_TARGET_ARCH_X64 |
| 5314 RegExpMacroAssemblerX64 macro_assembler(mode, (data->capture_count + 1) * 2); | 5316 RegExpMacroAssemblerX64 macro_assembler(mode, (data->capture_count + 1) * 2); |
| 5315 #elif V8_TARGET_ARCH_ARM | 5317 #elif V8_TARGET_ARCH_ARM |
| 5316 RegExpMacroAssemblerARM macro_assembler(mode, (data->capture_count + 1) * 2); | 5318 RegExpMacroAssemblerARM macro_assembler(mode, (data->capture_count + 1) * 2); |
| 5319 #elif V8_TARGET_ARCH_MIPS |
| 5320 RegExpMacroAssemblerMIPS macro_assembler(mode, (data->capture_count + 1) * 2); |
| 5317 #endif | 5321 #endif |
| 5318 | 5322 |
| 5319 #else // V8_INTERPRETED_REGEXP | 5323 #else // V8_INTERPRETED_REGEXP |
| 5320 // Interpreted regexp implementation. | 5324 // Interpreted regexp implementation. |
| 5321 EmbeddedVector<byte, 1024> codes; | 5325 EmbeddedVector<byte, 1024> codes; |
| 5322 RegExpMacroAssemblerIrregexp macro_assembler(codes); | 5326 RegExpMacroAssemblerIrregexp macro_assembler(codes); |
| 5323 #endif // V8_INTERPRETED_REGEXP | 5327 #endif // V8_INTERPRETED_REGEXP |
| 5324 | 5328 |
| 5325 // Inserted here, instead of in Assembler, because it depends on information | 5329 // Inserted here, instead of in Assembler, because it depends on information |
| 5326 // in the AST that isn't replicated in the Node structure. | 5330 // in the AST that isn't replicated in the Node structure. |
| 5327 static const int kMaxBacksearchLimit = 1024; | 5331 static const int kMaxBacksearchLimit = 1024; |
| 5328 if (is_end_anchored && | 5332 if (is_end_anchored && |
| 5329 !is_start_anchored && | 5333 !is_start_anchored && |
| 5330 max_length < kMaxBacksearchLimit) { | 5334 max_length < kMaxBacksearchLimit) { |
| 5331 macro_assembler.SetCurrentPositionFromEnd(max_length); | 5335 macro_assembler.SetCurrentPositionFromEnd(max_length); |
| 5332 } | 5336 } |
| 5333 | 5337 |
| 5334 return compiler.Assemble(¯o_assembler, | 5338 return compiler.Assemble(¯o_assembler, |
| 5335 node, | 5339 node, |
| 5336 data->capture_count, | 5340 data->capture_count, |
| 5337 pattern); | 5341 pattern); |
| 5338 } | 5342 } |
| 5339 | 5343 |
| 5340 | 5344 |
| 5341 int OffsetsVector::static_offsets_vector_[ | 5345 int OffsetsVector::static_offsets_vector_[ |
| 5342 OffsetsVector::kStaticOffsetsVectorSize]; | 5346 OffsetsVector::kStaticOffsetsVectorSize]; |
| 5343 | 5347 |
| 5344 }} // namespace v8::internal | 5348 }} // namespace v8::internal |
| OLD | NEW |