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_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 class RegExpBuiltinsAssembler : public CodeStubAssembler { | 13 class RegExpBuiltinsAssembler : public CodeStubAssembler { |
14 public: | 14 public: |
15 explicit RegExpBuiltinsAssembler(compiler::CodeAssemblerState* state) | 15 explicit RegExpBuiltinsAssembler(compiler::CodeAssemblerState* state) |
16 : CodeStubAssembler(state) {} | 16 : CodeStubAssembler(state) {} |
17 | 17 |
18 void BranchIfFastRegExp(Node* const context, Node* const map, | 18 void BranchIfFastRegExp(Node* const context, Node* const object, |
19 Label* const if_isunmodified, | 19 Node* const map, Label* const if_isunmodified, |
20 Label* const if_ismodified); | 20 Label* const if_ismodified); |
21 | 21 |
22 protected: | 22 protected: |
23 Node* FastLoadLastIndex(Node* regexp); | 23 Node* FastLoadLastIndex(Node* regexp); |
24 Node* SlowLoadLastIndex(Node* context, Node* regexp); | 24 Node* SlowLoadLastIndex(Node* context, Node* regexp); |
25 Node* LoadLastIndex(Node* context, Node* regexp, bool is_fastpath); | 25 Node* LoadLastIndex(Node* context, Node* regexp, bool is_fastpath); |
26 | 26 |
27 void FastStoreLastIndex(Node* regexp, Node* value); | 27 void FastStoreLastIndex(Node* regexp, Node* value); |
28 void SlowStoreLastIndex(Node* context, Node* regexp, Node* value); | 28 void SlowStoreLastIndex(Node* context, Node* regexp, Node* value); |
29 void StoreLastIndex(Node* context, Node* regexp, Node* value, | 29 void StoreLastIndex(Node* context, Node* regexp, Node* value, |
(...skipping 21 matching lines...) Expand all Loading... |
51 Label* if_didnotmatch, | 51 Label* if_didnotmatch, |
52 const bool is_fastpath); | 52 const bool is_fastpath); |
53 Node* RegExpPrototypeExecBody(Node* const context, Node* const regexp, | 53 Node* RegExpPrototypeExecBody(Node* const context, Node* const regexp, |
54 Node* const string, const bool is_fastpath); | 54 Node* const string, const bool is_fastpath); |
55 | 55 |
56 Node* ThrowIfNotJSReceiver(Node* context, Node* maybe_receiver, | 56 Node* ThrowIfNotJSReceiver(Node* context, Node* maybe_receiver, |
57 MessageTemplate::Template msg_template, | 57 MessageTemplate::Template msg_template, |
58 char const* method_name); | 58 char const* method_name); |
59 | 59 |
60 // Analogous to BranchIfFastRegExp, for use in asserts. | 60 // Analogous to BranchIfFastRegExp, for use in asserts. |
61 Node* IsFastRegExpMap(Node* const context, Node* const map); | 61 Node* IsFastRegExp(Node* const context, Node* const object, Node* const map); |
62 | 62 |
63 Node* IsInitialRegExpMap(Node* context, Node* map); | 63 // Performs fast path checks on the given object itself, but omits prototype |
| 64 // checks. |
| 65 Node* IsFastRegExpNoPrototype(Node* const context, Node* const object, |
| 66 Node* const map); |
| 67 |
64 void BranchIfFastRegExpResult(Node* context, Node* map, | 68 void BranchIfFastRegExpResult(Node* context, Node* map, |
65 Label* if_isunmodified, Label* if_ismodified); | 69 Label* if_isunmodified, Label* if_ismodified); |
66 | 70 |
67 Node* FlagsGetter(Node* const context, Node* const regexp, bool is_fastpath); | 71 Node* FlagsGetter(Node* const context, Node* const regexp, bool is_fastpath); |
68 | 72 |
69 Node* FastFlagGetter(Node* const regexp, JSRegExp::Flag flag); | 73 Node* FastFlagGetter(Node* const regexp, JSRegExp::Flag flag); |
70 Node* SlowFlagGetter(Node* const context, Node* const regexp, | 74 Node* SlowFlagGetter(Node* const context, Node* const regexp, |
71 JSRegExp::Flag flag); | 75 JSRegExp::Flag flag); |
72 Node* FlagGetter(Node* const context, Node* const regexp, JSRegExp::Flag flag, | 76 Node* FlagGetter(Node* const context, Node* const regexp, JSRegExp::Flag flag, |
73 bool is_fastpath); | 77 bool is_fastpath); |
(...skipping 26 matching lines...) Expand all Loading... |
100 Node* ReplaceGlobalCallableFastPath(Node* context, Node* regexp, Node* string, | 104 Node* ReplaceGlobalCallableFastPath(Node* context, Node* regexp, Node* string, |
101 Node* replace_callable); | 105 Node* replace_callable); |
102 Node* ReplaceSimpleStringFastPath(Node* context, Node* regexp, Node* string, | 106 Node* ReplaceSimpleStringFastPath(Node* context, Node* regexp, Node* string, |
103 Node* replace_string); | 107 Node* replace_string); |
104 }; | 108 }; |
105 | 109 |
106 } // namespace internal | 110 } // namespace internal |
107 } // namespace v8 | 111 } // namespace v8 |
108 | 112 |
109 #endif // V8_BUILTINS_BUILTINS_REGEXP_H_ | 113 #endif // V8_BUILTINS_BUILTINS_REGEXP_H_ |
OLD | NEW |