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

Side by Side Diff: src/jsregexp.cc

Issue 210143002: Revert "No longer OOM on invalid string length." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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());
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
6124 } 6123 }
6125 6124
6126 return compiler.Assemble(&macro_assembler, 6125 return compiler.Assemble(&macro_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
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