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

Side by Side Diff: src/jsregexp.cc

Issue 7316018: Ensure that regexps always have code object, even if GC happened while running multiple times in ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 5 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 | « no previous file | test/mjsunit/regress/regress-regexp-codeflush.js » ('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 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
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
5362 } 5363 }
5363 5364
5364 return compiler.Assemble(&macro_assembler, 5365 return compiler.Assemble(&macro_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
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-regexp-codeflush.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698