Chromium Code Reviews| 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(); |