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

Unified Diff: src/jsregexp.h

Issue 1014005: Attempt at pre-calculating replace regexp matches. (Closed)
Patch Set: Reuse result array. Avoid using apply. Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jsregexp.h
diff --git a/src/jsregexp.h b/src/jsregexp.h
index 46d53c215e043087ae7fae8f1aac81f364ddb887..de886caa484fe2d6841c73ad59946d44c572b677 100644
--- a/src/jsregexp.h
+++ b/src/jsregexp.h
@@ -145,6 +145,14 @@ class RegExpImpl {
}
// For acting on the JSRegExp data FixedArray.
+ static bool RegExpIsAtom(FixedArray* re) {
+ return re->get(JSRegExp::kTagIndex) == Smi::FromInt(JSRegExp::ATOM);
+ }
+ static int RegExpNumberOfCaptures(FixedArray* re) {
+ return (re->get(JSRegExp::kTagIndex) == Smi::FromInt(JSRegExp::ATOM))
+ ? 0
+ : IrregexpNumberOfCaptures(re);
+ }
static int IrregexpMaxRegisterCount(FixedArray* re);
static void SetIrregexpMaxRegisterCount(FixedArray* re, int value);
static int IrregexpNumberOfCaptures(FixedArray* re);
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698