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

Unified Diff: src/objects-inl.h

Issue 42115: Faster string.replace with regexp pattern. (Closed)
Patch Set: Addressed review comments Created 11 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 | « src/objects-debug.cc ('k') | src/regexp-delay.js » ('j') | src/runtime.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 9aee342f96850537e93b14fd8849de04fc9945cf..b317ef022fc8bc8ccd8eb3d82f5e7ef138fc596e 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2316,6 +2316,19 @@ JSRegExp::Type JSRegExp::TypeTag() {
}
+int JSRegExp::CaptureCount() {
+ switch (TypeTag()) {
+ case ATOM:
+ return 0;
+ case IRREGEXP:
+ return Smi::cast(DataAt(kIrregexpCaptureCountIndex))->value();
+ default:
+ UNREACHABLE();
+ return -1;
+ }
+}
+
+
JSRegExp::Flags JSRegExp::GetFlags() {
ASSERT(this->data()->IsFixedArray());
Object* data = this->data();
« no previous file with comments | « src/objects-debug.cc ('k') | src/regexp-delay.js » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698