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 2551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2562 } | 2562 } |
2563 ASSERT(variant->stop_node() == NULL); | 2563 ASSERT(variant->stop_node() == NULL); |
2564 if (!variant->is_trivial()) { | 2564 if (!variant->is_trivial()) { |
2565 return variant->Flush(compiler, this); | 2565 return variant->Flush(compiler, this); |
2566 } | 2566 } |
2567 return ChoiceNode::Emit(compiler, variant); | 2567 return ChoiceNode::Emit(compiler, variant); |
2568 } | 2568 } |
2569 | 2569 |
2570 | 2570 |
2571 int ChoiceNode::CalculatePreloadCharacters(RegExpCompiler* compiler) { | 2571 int ChoiceNode::CalculatePreloadCharacters(RegExpCompiler* compiler) { |
2572 bool ascii = compiler->ascii(); | |
2573 int preload_characters = EatsAtLeast(0); | 2572 int preload_characters = EatsAtLeast(0); |
2574 #ifdef CAN_READ_UNALIGNED | 2573 #ifdef CAN_READ_UNALIGNED |
| 2574 bool ascii = compiler->ascii(); |
2575 if (ascii) { | 2575 if (ascii) { |
2576 if (preload_characters > 4) preload_characters = 4; | 2576 if (preload_characters > 4) preload_characters = 4; |
2577 // We can't preload 3 characters because there is no machine instruction | 2577 // We can't preload 3 characters because there is no machine instruction |
2578 // to do that. We can't just load 4 because we could be reading | 2578 // to do that. We can't just load 4 because we could be reading |
2579 // beyond the end of the string, which could cause a memory fault. | 2579 // beyond the end of the string, which could cause a memory fault. |
2580 if (preload_characters == 3) preload_characters = 2; | 2580 if (preload_characters == 3) preload_characters = 2; |
2581 } else { | 2581 } else { |
2582 if (preload_characters > 2) preload_characters = 2; | 2582 if (preload_characters > 2) preload_characters = 2; |
2583 } | 2583 } |
2584 #else | 2584 #else |
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4295 EmbeddedVector<byte, 1024> codes; | 4295 EmbeddedVector<byte, 1024> codes; |
4296 RegExpMacroAssemblerIrregexp macro_assembler(codes); | 4296 RegExpMacroAssemblerIrregexp macro_assembler(codes); |
4297 return compiler.Assemble(¯o_assembler, | 4297 return compiler.Assemble(¯o_assembler, |
4298 node, | 4298 node, |
4299 data->capture_count, | 4299 data->capture_count, |
4300 pattern); | 4300 pattern); |
4301 } | 4301 } |
4302 | 4302 |
4303 | 4303 |
4304 }} // namespace v8::internal | 4304 }} // namespace v8::internal |
OLD | NEW |