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

Side by Side Diff: src/builtins/builtins-regexp.h

Issue 2668703002: [stubs] Add RegExpReplace and RegExpSplit stubs (Closed)
Patch Set: BranchIfFastRegExp/IsFastRegExpMap Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/builtins/builtins.h ('k') | src/builtins/builtins-regexp.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_BUILTINS_BUILTINS_REGEXP_H_ 5 #ifndef V8_BUILTINS_BUILTINS_REGEXP_H_
6 #define V8_BUILTINS_BUILTINS_REGEXP_H_ 6 #define V8_BUILTINS_BUILTINS_REGEXP_H_
7 7
8 #include "src/code-stub-assembler.h" 8 #include "src/code-stub-assembler.h"
9 9
10 namespace v8 { 10 namespace v8 {
11 namespace internal { 11 namespace internal {
12 12
13 typedef compiler::Node Node; 13 typedef compiler::Node Node;
14 typedef compiler::CodeAssemblerState CodeAssemblerState; 14 typedef compiler::CodeAssemblerState CodeAssemblerState;
15 typedef compiler::CodeAssemblerLabel CodeAssemblerLabel; 15 typedef compiler::CodeAssemblerLabel CodeAssemblerLabel;
16 16
17 class RegExpBuiltinsAssembler : public CodeStubAssembler { 17 class RegExpBuiltinsAssembler : public CodeStubAssembler {
18 public: 18 public:
19 explicit RegExpBuiltinsAssembler(CodeAssemblerState* state) 19 explicit RegExpBuiltinsAssembler(CodeAssemblerState* state)
20 : CodeStubAssembler(state) {} 20 : CodeStubAssembler(state) {}
21 21
22 void BranchIfFastRegExp(Node* context, Node* map, Label* if_isunmodified, 22 void BranchIfFastRegExp(Node* const context, Node* const map,
23 Label* if_ismodified); 23 Label* const if_isunmodified,
24 Label* const if_ismodified);
24 25
25 protected: 26 protected:
26 Node* FastLoadLastIndex(Node* regexp); 27 Node* FastLoadLastIndex(Node* regexp);
27 Node* SlowLoadLastIndex(Node* context, Node* regexp); 28 Node* SlowLoadLastIndex(Node* context, Node* regexp);
28 Node* LoadLastIndex(Node* context, Node* regexp, bool is_fastpath); 29 Node* LoadLastIndex(Node* context, Node* regexp, bool is_fastpath);
29 30
30 void FastStoreLastIndex(Node* regexp, Node* value); 31 void FastStoreLastIndex(Node* regexp, Node* value);
31 void SlowStoreLastIndex(Node* context, Node* regexp, Node* value); 32 void SlowStoreLastIndex(Node* context, Node* regexp, Node* value);
32 void StoreLastIndex(Node* context, Node* regexp, Node* value, 33 void StoreLastIndex(Node* context, Node* regexp, Node* value,
33 bool is_fastpath); 34 bool is_fastpath);
34 35
35 Node* ConstructNewResultFromMatchInfo(Node* const context, Node* const regexp, 36 Node* ConstructNewResultFromMatchInfo(Node* const context, Node* const regexp,
36 Node* const match_info, 37 Node* const match_info,
37 Node* const string); 38 Node* const string);
38 39
39 Node* RegExpPrototypeExecBodyWithoutResult(Node* const context, 40 Node* RegExpPrototypeExecBodyWithoutResult(Node* const context,
40 Node* const regexp, 41 Node* const regexp,
41 Node* const string, 42 Node* const string,
42 Label* if_didnotmatch, 43 Label* if_didnotmatch,
43 const bool is_fastpath); 44 const bool is_fastpath);
44 Node* RegExpPrototypeExecBody(Node* const context, Node* const regexp, 45 Node* RegExpPrototypeExecBody(Node* const context, Node* const regexp,
45 Node* const string, const bool is_fastpath); 46 Node* const string, const bool is_fastpath);
46 47
47 Node* ThrowIfNotJSReceiver(Node* context, Node* maybe_receiver, 48 Node* ThrowIfNotJSReceiver(Node* context, Node* maybe_receiver,
48 MessageTemplate::Template msg_template, 49 MessageTemplate::Template msg_template,
49 char const* method_name); 50 char const* method_name);
50 51
52 // Analogous to BranchIfFastRegExp, for use in asserts.
53 Node* IsFastRegExpMap(Node* const context, Node* const map);
54
51 Node* IsInitialRegExpMap(Node* context, Node* map); 55 Node* IsInitialRegExpMap(Node* context, Node* map);
52 void BranchIfFastRegExpResult(Node* context, Node* map, 56 void BranchIfFastRegExpResult(Node* context, Node* map,
53 Label* if_isunmodified, Label* if_ismodified); 57 Label* if_isunmodified, Label* if_ismodified);
54 58
55 Node* FlagsGetter(Node* const context, Node* const regexp, bool is_fastpath); 59 Node* FlagsGetter(Node* const context, Node* const regexp, bool is_fastpath);
56 60
57 Node* FastFlagGetter(Node* const regexp, JSRegExp::Flag flag); 61 Node* FastFlagGetter(Node* const regexp, JSRegExp::Flag flag);
58 Node* SlowFlagGetter(Node* const context, Node* const regexp, 62 Node* SlowFlagGetter(Node* const context, Node* const regexp,
59 JSRegExp::Flag flag); 63 JSRegExp::Flag flag);
60 Node* FlagGetter(Node* const context, Node* const regexp, JSRegExp::Flag flag, 64 Node* FlagGetter(Node* const context, Node* const regexp, JSRegExp::Flag flag,
(...skipping 24 matching lines...) Expand all
85 Node* ReplaceGlobalCallableFastPath(Node* context, Node* regexp, Node* string, 89 Node* ReplaceGlobalCallableFastPath(Node* context, Node* regexp, Node* string,
86 Node* replace_callable); 90 Node* replace_callable);
87 Node* ReplaceSimpleStringFastPath(Node* context, Node* regexp, Node* string, 91 Node* ReplaceSimpleStringFastPath(Node* context, Node* regexp, Node* string,
88 Node* replace_string); 92 Node* replace_string);
89 }; 93 };
90 94
91 } // namespace internal 95 } // namespace internal
92 } // namespace v8 96 } // namespace v8
93 97
94 #endif // V8_BUILTINS_BUILTINS_REGEXP_H_ 98 #endif // V8_BUILTINS_BUILTINS_REGEXP_H_
OLDNEW
« no previous file with comments | « src/builtins/builtins.h ('k') | src/builtins/builtins-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698