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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 flags.is_global(), | 459 flags.is_global(), |
460 flags.is_multiline(), | 460 flags.is_multiline(), |
461 pattern, | 461 pattern, |
462 sample_subject, | 462 sample_subject, |
463 is_ascii, | 463 is_ascii, |
464 &zone); | 464 &zone); |
465 if (result.error_message != NULL) { | 465 if (result.error_message != NULL) { |
466 // Unable to compile regexp. | 466 // Unable to compile regexp. |
467 Handle<String> error_message = | 467 Handle<String> error_message = |
468 isolate->factory()->NewStringFromUtf8(CStrVector(result.error_message)); | 468 isolate->factory()->NewStringFromUtf8(CStrVector(result.error_message)); |
469 ASSERT(!error_message.is_null()); | |
470 CreateRegExpErrorObjectAndThrow(re, is_ascii, error_message, isolate); | 469 CreateRegExpErrorObjectAndThrow(re, is_ascii, error_message, isolate); |
471 return false; | 470 return false; |
472 } | 471 } |
473 | 472 |
474 Handle<FixedArray> data = Handle<FixedArray>(FixedArray::cast(re->data())); | 473 Handle<FixedArray> data = Handle<FixedArray>(FixedArray::cast(re->data())); |
475 data->set(JSRegExp::code_index(is_ascii), result.code); | 474 data->set(JSRegExp::code_index(is_ascii), result.code); |
476 int register_max = IrregexpMaxRegisterCount(*data); | 475 int register_max = IrregexpMaxRegisterCount(*data); |
477 if (result.num_registers > register_max) { | 476 if (result.num_registers > register_max) { |
478 SetIrregexpMaxRegisterCount(*data, result.num_registers); | 477 SetIrregexpMaxRegisterCount(*data, result.num_registers); |
479 } | 478 } |
(...skipping 5644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6124 } | 6123 } |
6125 | 6124 |
6126 return compiler.Assemble(¯o_assembler, | 6125 return compiler.Assemble(¯o_assembler, |
6127 node, | 6126 node, |
6128 data->capture_count, | 6127 data->capture_count, |
6129 pattern); | 6128 pattern); |
6130 } | 6129 } |
6131 | 6130 |
6132 | 6131 |
6133 }} // namespace v8::internal | 6132 }} // namespace v8::internal |
OLD | NEW |