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

Unified Diff: src/jsregexp.cc

Issue 7282026: Introduce code flushing of RegExp code. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: src/jsregexp.cc
===================================================================
--- src/jsregexp.cc (revision 8431)
+++ src/jsregexp.cc (working copy)
@@ -295,6 +295,15 @@
#else // V8_INTERPRETED_REGEXP (RegExp native code)
if (compiled_code->IsCode()) return true;
#endif
+ // We could potentially have marked this as flushable, but have keept
Erik Corry 2011/06/30 18:48:25 keept -> kept
Rico 2011/07/01 05:58:09 Done.
+ // a saved version if we did not flush it yet.
+ Object* saved_code = re->DataAt(JSRegExp::saved_code_index(is_ascii));
+ if (saved_code->IsCode()) {
+ // Reinstate the code in the original place.
+ re->SetDataAt(JSRegExp::code_index(is_ascii), saved_code);
+ ASSERT(compiled_code->IsSmi());
+ return true;
+ }
return CompileIrregexp(re, is_ascii);
}
@@ -311,7 +320,7 @@
isolate->Throw(entry);
return false;
}
- ASSERT(entry->IsTheHole());
+ ASSERT(entry->IsSmi());
JSRegExp::Flags flags = re->GetFlags();

Powered by Google App Engine
This is Rietveld 408576698