Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: src/jsregexp.cc

Issue 207613005: No longer OOM on invalid string length. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase + addressed nits Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/json-stringifier.h ('k') | src/liveedit.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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());
469 CreateRegExpErrorObjectAndThrow(re, is_ascii, error_message, isolate); 470 CreateRegExpErrorObjectAndThrow(re, is_ascii, error_message, isolate);
470 return false; 471 return false;
471 } 472 }
472 473
473 Handle<FixedArray> data = Handle<FixedArray>(FixedArray::cast(re->data())); 474 Handle<FixedArray> data = Handle<FixedArray>(FixedArray::cast(re->data()));
474 data->set(JSRegExp::code_index(is_ascii), result.code); 475 data->set(JSRegExp::code_index(is_ascii), result.code);
475 int register_max = IrregexpMaxRegisterCount(*data); 476 int register_max = IrregexpMaxRegisterCount(*data);
476 if (result.num_registers > register_max) { 477 if (result.num_registers > register_max) {
477 SetIrregexpMaxRegisterCount(*data, result.num_registers); 478 SetIrregexpMaxRegisterCount(*data, result.num_registers);
478 } 479 }
(...skipping 5644 matching lines...) Expand 10 before | Expand all | Expand 10 after
6123 } 6124 }
6124 6125
6125 return compiler.Assemble(&macro_assembler, 6126 return compiler.Assemble(&macro_assembler,
6126 node, 6127 node,
6127 data->capture_count, 6128 data->capture_count,
6128 pattern); 6129 pattern);
6129 } 6130 }
6130 6131
6131 6132
6132 }} // namespace v8::internal 6133 }} // namespace v8::internal
OLDNEW
« no previous file with comments | « src/json-stringifier.h ('k') | src/liveedit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698