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 #include "src/builtins/builtins-regexp-gen.h" | 5 #include "src/builtins/builtins-regexp-gen.h" |
6 | 6 |
7 #include "src/builtins/builtins-constructor-gen.h" | 7 #include "src/builtins/builtins-constructor-gen.h" |
8 #include "src/builtins/builtins-utils-gen.h" | 8 #include "src/builtins/builtins-utils-gen.h" |
9 #include "src/builtins/builtins.h" | 9 #include "src/builtins/builtins.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2163 Node* const length = smi_zero; | 2163 Node* const length = smi_zero; |
2164 Node* const capacity = int_zero; | 2164 Node* const capacity = int_zero; |
2165 Node* const result = AllocateJSArray(kind, array_map, capacity, length, | 2165 Node* const result = AllocateJSArray(kind, array_map, capacity, length, |
2166 allocation_site, mode); | 2166 allocation_site, mode); |
2167 Return(result); | 2167 Return(result); |
2168 } | 2168 } |
2169 } | 2169 } |
2170 | 2170 |
2171 // Helper that skips a few initial checks. | 2171 // Helper that skips a few initial checks. |
2172 TF_BUILTIN(RegExpSplit, RegExpBuiltinsAssembler) { | 2172 TF_BUILTIN(RegExpSplit, RegExpBuiltinsAssembler) { |
2173 Node* const regexp = Parameter(Descriptor::kReceiver); | 2173 Node* const regexp = Parameter(Descriptor::kRegExp); |
2174 Node* const string = Parameter(Descriptor::kString); | 2174 Node* const string = Parameter(Descriptor::kString); |
2175 Node* const maybe_limit = Parameter(Descriptor::kLimit); | 2175 Node* const maybe_limit = Parameter(Descriptor::kLimit); |
2176 Node* const context = Parameter(Descriptor::kContext); | 2176 Node* const context = Parameter(Descriptor::kContext); |
2177 | 2177 |
2178 CSA_ASSERT(this, IsFastRegExpMap(context, LoadMap(regexp))); | 2178 CSA_ASSERT(this, IsFastRegExpMap(context, LoadMap(regexp))); |
2179 CSA_ASSERT(this, IsString(string)); | 2179 CSA_ASSERT(this, IsString(string)); |
2180 | 2180 |
2181 // TODO(jgruber): Even if map checks send us to the fast path, we still need | 2181 // TODO(jgruber): Even if map checks send us to the fast path, we still need |
2182 // to verify the constructor property and jump to the slow path if it has | 2182 // to verify the constructor property and jump to the slow path if it has |
2183 // been changed. | 2183 // been changed. |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2543 Goto(&out); | 2543 Goto(&out); |
2544 } | 2544 } |
2545 } | 2545 } |
2546 | 2546 |
2547 Bind(&out); | 2547 Bind(&out); |
2548 return var_result.value(); | 2548 return var_result.value(); |
2549 } | 2549 } |
2550 | 2550 |
2551 // Helper that skips a few initial checks. | 2551 // Helper that skips a few initial checks. |
2552 TF_BUILTIN(RegExpReplace, RegExpBuiltinsAssembler) { | 2552 TF_BUILTIN(RegExpReplace, RegExpBuiltinsAssembler) { |
2553 Node* const regexp = Parameter(Descriptor::kReceiver); | 2553 Node* const regexp = Parameter(Descriptor::kRegExp); |
2554 Node* const string = Parameter(Descriptor::kString); | 2554 Node* const string = Parameter(Descriptor::kString); |
2555 Node* const replace_value = Parameter(Descriptor::kReplaceValue); | 2555 Node* const replace_value = Parameter(Descriptor::kReplaceValue); |
2556 Node* const context = Parameter(Descriptor::kContext); | 2556 Node* const context = Parameter(Descriptor::kContext); |
2557 | 2557 |
2558 CSA_ASSERT(this, IsFastRegExpMap(context, LoadMap(regexp))); | 2558 CSA_ASSERT(this, IsFastRegExpMap(context, LoadMap(regexp))); |
2559 CSA_ASSERT(this, IsString(string)); | 2559 CSA_ASSERT(this, IsString(string)); |
2560 | 2560 |
2561 Label checkreplacestring(this), if_iscallable(this), | 2561 Label checkreplacestring(this), if_iscallable(this), |
2562 runtime(this, Label::kDeferred); | 2562 runtime(this, Label::kDeferred); |
2563 | 2563 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2681 Bind(&if_matched); | 2681 Bind(&if_matched); |
2682 { | 2682 { |
2683 Node* result = | 2683 Node* result = |
2684 ConstructNewResultFromMatchInfo(context, regexp, match_indices, string); | 2684 ConstructNewResultFromMatchInfo(context, regexp, match_indices, string); |
2685 Return(result); | 2685 Return(result); |
2686 } | 2686 } |
2687 } | 2687 } |
2688 | 2688 |
2689 } // namespace internal | 2689 } // namespace internal |
2690 } // namespace v8 | 2690 } // namespace v8 |
OLD | NEW |