| OLD | NEW |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_OBJECTS_REGEXP_MATCH_INFO_H_ | 5 #ifndef V8_OBJECTS_REGEXP_MATCH_INFO_H_ |
| 6 #define V8_OBJECTS_REGEXP_MATCH_INFO_H_ | 6 #define V8_OBJECTS_REGEXP_MATCH_INFO_H_ |
| 7 | 7 |
| 8 #include "src/base/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
| 9 #include "src/objects.h" | 9 #include "src/objects.h" |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 // Returns the i'th capture index, 0 <= i < NumberOfCaptures(). Capture(0) and | 42 // Returns the i'th capture index, 0 <= i < NumberOfCaptures(). Capture(0) and |
| 43 // Capture(1) determine the start- and endpoint of the match itself. | 43 // Capture(1) determine the start- and endpoint of the match itself. |
| 44 inline int Capture(int i); | 44 inline int Capture(int i); |
| 45 inline void SetCapture(int i, int value); | 45 inline void SetCapture(int i, int value); |
| 46 | 46 |
| 47 // Reserves space for captures. | 47 // Reserves space for captures. |
| 48 static Handle<RegExpMatchInfo> ReserveCaptures( | 48 static Handle<RegExpMatchInfo> ReserveCaptures( |
| 49 Handle<RegExpMatchInfo> match_info, int capture_count); | 49 Handle<RegExpMatchInfo> match_info, int capture_count); |
| 50 | 50 |
| 51 DECLARE_CAST(RegExpMatchInfo) | 51 DECL_CAST(RegExpMatchInfo) |
| 52 | 52 |
| 53 static const int kNumberOfCapturesIndex = 0; | 53 static const int kNumberOfCapturesIndex = 0; |
| 54 static const int kLastSubjectIndex = 1; | 54 static const int kLastSubjectIndex = 1; |
| 55 static const int kLastInputIndex = 2; | 55 static const int kLastInputIndex = 2; |
| 56 static const int kFirstCaptureIndex = 3; | 56 static const int kFirstCaptureIndex = 3; |
| 57 static const int kLastMatchOverhead = kFirstCaptureIndex; | 57 static const int kLastMatchOverhead = kFirstCaptureIndex; |
| 58 | 58 |
| 59 static const int kNumberOfCapturesOffset = FixedArray::kHeaderSize; | 59 static const int kNumberOfCapturesOffset = FixedArray::kHeaderSize; |
| 60 static const int kLastSubjectOffset = kNumberOfCapturesOffset + kPointerSize; | 60 static const int kLastSubjectOffset = kNumberOfCapturesOffset + kPointerSize; |
| 61 static const int kLastInputOffset = kLastSubjectOffset + kPointerSize; | 61 static const int kLastInputOffset = kLastSubjectOffset + kPointerSize; |
| 62 static const int kFirstCaptureOffset = kLastInputOffset + kPointerSize; | 62 static const int kFirstCaptureOffset = kLastInputOffset + kPointerSize; |
| 63 | 63 |
| 64 // Every match info is guaranteed to have enough space to store two captures. | 64 // Every match info is guaranteed to have enough space to store two captures. |
| 65 static const int kInitialCaptureIndices = 2; | 65 static const int kInitialCaptureIndices = 2; |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 DISALLOW_IMPLICIT_CONSTRUCTORS(RegExpMatchInfo); | 68 DISALLOW_IMPLICIT_CONSTRUCTORS(RegExpMatchInfo); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace internal | 71 } // namespace internal |
| 72 } // namespace v8 | 72 } // namespace v8 |
| 73 | 73 |
| 74 #include "src/objects/object-macros-undef.h" | 74 #include "src/objects/object-macros-undef.h" |
| 75 | 75 |
| 76 #endif // V8_OBJECTS_REGEXP_MATCH_INFO_H_ | 76 #endif // V8_OBJECTS_REGEXP_MATCH_INFO_H_ |
| OLD | NEW |