OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_REGEXP_REGEXP_UTILS_H_ | 5 #ifndef V8_REGEXP_REGEXP_UTILS_H_ |
6 #define V8_REGEXP_REGEXP_UTILS_H_ | 6 #define V8_REGEXP_REGEXP_UTILS_H_ |
7 | 7 |
8 #include "src/objects.h" | 8 #include "src/objects.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 // Helper methods for C++ regexp builtins. | 13 // Helper methods for C++ regexp builtins. |
14 class RegExpUtils : public AllStatic { | 14 class RegExpUtils : public AllStatic { |
15 public: | 15 public: |
16 // Last match info accessors. | 16 // Last match info accessors. |
17 static Handle<Object> GetLastMatchField(Isolate* isolate, | |
18 Handle<JSObject> match_info, | |
19 int index); | |
20 static void SetLastMatchField(Isolate* isolate, Handle<JSObject> match_info, | |
21 int index, Handle<Object> value); | |
22 static int GetLastMatchNumberOfCaptures(Isolate* isolate, | |
23 Handle<JSObject> match_info); | |
24 static Handle<String> GetLastMatchSubject(Isolate* isolate, | |
25 Handle<JSObject> match_info); | |
26 static Handle<Object> GetLastMatchInput(Isolate* isolate, | |
27 Handle<JSObject> match_info); | |
28 static int GetLastMatchCapture(Isolate* isolate, Handle<JSObject> match_info, | |
29 int i); | |
30 static Handle<String> GenericCaptureGetter(Isolate* isolate, | 17 static Handle<String> GenericCaptureGetter(Isolate* isolate, |
31 Handle<JSObject> match_info, | 18 Handle<RegExpMatchInfo> match_info, |
32 int capture, bool* ok = nullptr); | 19 int capture, bool* ok = nullptr); |
33 | 20 |
34 // Last index (RegExp.lastIndex) accessors. | 21 // Last index (RegExp.lastIndex) accessors. |
35 static MaybeHandle<Object> SetLastIndex(Isolate* isolate, | 22 static MaybeHandle<Object> SetLastIndex(Isolate* isolate, |
36 Handle<JSReceiver> regexp, int value); | 23 Handle<JSReceiver> regexp, int value); |
37 static MaybeHandle<Object> GetLastIndex(Isolate* isolate, | 24 static MaybeHandle<Object> GetLastIndex(Isolate* isolate, |
38 Handle<JSReceiver> recv); | 25 Handle<JSReceiver> recv); |
39 | 26 |
40 // ES#sec-regexpexec Runtime Semantics: RegExpExec ( R, S ) | 27 // ES#sec-regexpexec Runtime Semantics: RegExpExec ( R, S ) |
41 static MaybeHandle<Object> RegExpExec(Isolate* isolate, | 28 static MaybeHandle<Object> RegExpExec(Isolate* isolate, |
(...skipping 14 matching lines...) Loading... |
56 static MaybeHandle<Object> SetAdvancedStringIndex(Isolate* isolate, | 43 static MaybeHandle<Object> SetAdvancedStringIndex(Isolate* isolate, |
57 Handle<JSReceiver> regexp, | 44 Handle<JSReceiver> regexp, |
58 Handle<String> string, | 45 Handle<String> string, |
59 bool unicode); | 46 bool unicode); |
60 }; | 47 }; |
61 | 48 |
62 } // namespace internal | 49 } // namespace internal |
63 } // namespace v8 | 50 } // namespace v8 |
64 | 51 |
65 #endif // V8_REGEXP_REGEXP_UTILS_H_ | 52 #endif // V8_REGEXP_REGEXP_UTILS_H_ |
OLD | NEW |