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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 | 484 |
485 // A flat ASCII string might have a two-byte first part. | 485 // A flat ASCII string might have a two-byte first part. |
486 if (subject->IsConsString()) { | 486 if (subject->IsConsString()) { |
487 subject = Handle<String>(ConsString::cast(*subject)->first(), isolate); | 487 subject = Handle<String>(ConsString::cast(*subject)->first(), isolate); |
488 } | 488 } |
489 | 489 |
490 #ifndef V8_INTERPRETED_REGEXP | 490 #ifndef V8_INTERPRETED_REGEXP |
491 ASSERT(output.length() >= (IrregexpNumberOfCaptures(*irregexp) + 1) * 2); | 491 ASSERT(output.length() >= (IrregexpNumberOfCaptures(*irregexp) + 1) * 2); |
492 do { | 492 do { |
493 bool is_ascii = subject->IsAsciiRepresentation(); | 493 bool is_ascii = subject->IsAsciiRepresentation(); |
| 494 EnsureCompiledIrregexp(regexp, is_ascii); |
494 Handle<Code> code(IrregexpNativeCode(*irregexp, is_ascii), isolate); | 495 Handle<Code> code(IrregexpNativeCode(*irregexp, is_ascii), isolate); |
495 NativeRegExpMacroAssembler::Result res = | 496 NativeRegExpMacroAssembler::Result res = |
496 NativeRegExpMacroAssembler::Match(code, | 497 NativeRegExpMacroAssembler::Match(code, |
497 subject, | 498 subject, |
498 output.start(), | 499 output.start(), |
499 output.length(), | 500 output.length(), |
500 index, | 501 index, |
501 isolate); | 502 isolate); |
502 if (res != NativeRegExpMacroAssembler::RETRY) { | 503 if (res != NativeRegExpMacroAssembler::RETRY) { |
503 ASSERT(res != NativeRegExpMacroAssembler::EXCEPTION || | 504 ASSERT(res != NativeRegExpMacroAssembler::EXCEPTION || |
(...skipping 4858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5362 } | 5363 } |
5363 | 5364 |
5364 return compiler.Assemble(¯o_assembler, | 5365 return compiler.Assemble(¯o_assembler, |
5365 node, | 5366 node, |
5366 data->capture_count, | 5367 data->capture_count, |
5367 pattern); | 5368 pattern); |
5368 } | 5369 } |
5369 | 5370 |
5370 | 5371 |
5371 }} // namespace v8::internal | 5372 }} // namespace v8::internal |
OLD | NEW |