| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 | 445 |
| 446 Handle<String> pattern(re->Pattern()); | 446 Handle<String> pattern(re->Pattern()); |
| 447 pattern = String::Flatten(pattern); | 447 pattern = String::Flatten(pattern); |
| 448 RegExpCompileData compile_data; | 448 RegExpCompileData compile_data; |
| 449 FlatStringReader reader(isolate, pattern); | 449 FlatStringReader reader(isolate, pattern); |
| 450 if (!RegExpParser::ParseRegExp(&reader, flags.is_multiline(), | 450 if (!RegExpParser::ParseRegExp(&reader, flags.is_multiline(), |
| 451 &compile_data, | 451 &compile_data, |
| 452 &zone)) { | 452 &zone)) { |
| 453 // Throw an exception if we fail to parse the pattern. | 453 // Throw an exception if we fail to parse the pattern. |
| 454 // THIS SHOULD NOT HAPPEN. We already pre-parsed it successfully once. | 454 // THIS SHOULD NOT HAPPEN. We already pre-parsed it successfully once. |
| 455 ThrowRegExpException(re, | 455 USE(ThrowRegExpException(re, |
| 456 pattern, | 456 pattern, |
| 457 compile_data.error, | 457 compile_data.error, |
| 458 "malformed_regexp"); | 458 "malformed_regexp")); |
| 459 return false; | 459 return false; |
| 460 } | 460 } |
| 461 RegExpEngine::CompilationResult result = | 461 RegExpEngine::CompilationResult result = |
| 462 RegExpEngine::Compile(&compile_data, | 462 RegExpEngine::Compile(&compile_data, |
| 463 flags.is_ignore_case(), | 463 flags.is_ignore_case(), |
| 464 flags.is_global(), | 464 flags.is_global(), |
| 465 flags.is_multiline(), | 465 flags.is_multiline(), |
| 466 pattern, | 466 pattern, |
| 467 sample_subject, | 467 sample_subject, |
| 468 is_ascii, | 468 is_ascii, |
| (...skipping 5660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6129 } | 6129 } |
| 6130 | 6130 |
| 6131 return compiler.Assemble(¯o_assembler, | 6131 return compiler.Assemble(¯o_assembler, |
| 6132 node, | 6132 node, |
| 6133 data->capture_count, | 6133 data->capture_count, |
| 6134 pattern); | 6134 pattern); |
| 6135 } | 6135 } |
| 6136 | 6136 |
| 6137 | 6137 |
| 6138 }} // namespace v8::internal | 6138 }} // namespace v8::internal |
| OLD | NEW |