| 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 2287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2298 Node* const length = smi_zero; | 2298 Node* const length = smi_zero; |
| 2299 Node* const capacity = int_zero; | 2299 Node* const capacity = int_zero; |
| 2300 Node* const result = AllocateJSArray(kind, array_map, capacity, length, | 2300 Node* const result = AllocateJSArray(kind, array_map, capacity, length, |
| 2301 allocation_site, mode); | 2301 allocation_site, mode); |
| 2302 Return(result); | 2302 Return(result); |
| 2303 } | 2303 } |
| 2304 } | 2304 } |
| 2305 | 2305 |
| 2306 // Helper that skips a few initial checks. | 2306 // Helper that skips a few initial checks. |
| 2307 TF_BUILTIN(RegExpSplit, RegExpBuiltinsAssembler) { | 2307 TF_BUILTIN(RegExpSplit, RegExpBuiltinsAssembler) { |
| 2308 Node* const regexp = Parameter(Descriptor::kReceiver); | 2308 Node* const regexp = Parameter(Descriptor::kRegExp); |
| 2309 Node* const string = Parameter(Descriptor::kString); | 2309 Node* const string = Parameter(Descriptor::kString); |
| 2310 Node* const maybe_limit = Parameter(Descriptor::kLimit); | 2310 Node* const maybe_limit = Parameter(Descriptor::kLimit); |
| 2311 Node* const context = Parameter(Descriptor::kContext); | 2311 Node* const context = Parameter(Descriptor::kContext); |
| 2312 | 2312 |
| 2313 CSA_ASSERT(this, IsFastRegExp(context, regexp)); | 2313 CSA_ASSERT(this, IsFastRegExp(context, regexp)); |
| 2314 CSA_ASSERT(this, IsString(string)); | 2314 CSA_ASSERT(this, IsString(string)); |
| 2315 | 2315 |
| 2316 // TODO(jgruber): Even if map checks send us to the fast path, we still need | 2316 // TODO(jgruber): Even if map checks send us to the fast path, we still need |
| 2317 // to verify the constructor property and jump to the slow path if it has | 2317 // to verify the constructor property and jump to the slow path if it has |
| 2318 // been changed. | 2318 // been changed. |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2704 Goto(&out); | 2704 Goto(&out); |
| 2705 } | 2705 } |
| 2706 } | 2706 } |
| 2707 | 2707 |
| 2708 BIND(&out); | 2708 BIND(&out); |
| 2709 return var_result.value(); | 2709 return var_result.value(); |
| 2710 } | 2710 } |
| 2711 | 2711 |
| 2712 // Helper that skips a few initial checks. | 2712 // Helper that skips a few initial checks. |
| 2713 TF_BUILTIN(RegExpReplace, RegExpBuiltinsAssembler) { | 2713 TF_BUILTIN(RegExpReplace, RegExpBuiltinsAssembler) { |
| 2714 Node* const regexp = Parameter(Descriptor::kReceiver); | 2714 Node* const regexp = Parameter(Descriptor::kRegExp); |
| 2715 Node* const string = Parameter(Descriptor::kString); | 2715 Node* const string = Parameter(Descriptor::kString); |
| 2716 Node* const replace_value = Parameter(Descriptor::kReplaceValue); | 2716 Node* const replace_value = Parameter(Descriptor::kReplaceValue); |
| 2717 Node* const context = Parameter(Descriptor::kContext); | 2717 Node* const context = Parameter(Descriptor::kContext); |
| 2718 | 2718 |
| 2719 CSA_ASSERT(this, IsFastRegExp(context, regexp)); | 2719 CSA_ASSERT(this, IsFastRegExp(context, regexp)); |
| 2720 CSA_ASSERT(this, IsString(string)); | 2720 CSA_ASSERT(this, IsString(string)); |
| 2721 | 2721 |
| 2722 Label checkreplacestring(this), if_iscallable(this), | 2722 Label checkreplacestring(this), if_iscallable(this), |
| 2723 runtime(this, Label::kDeferred); | 2723 runtime(this, Label::kDeferred); |
| 2724 | 2724 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2854 BIND(&if_matched); | 2854 BIND(&if_matched); |
| 2855 { | 2855 { |
| 2856 Node* result = | 2856 Node* result = |
| 2857 ConstructNewResultFromMatchInfo(context, regexp, match_indices, string); | 2857 ConstructNewResultFromMatchInfo(context, regexp, match_indices, string); |
| 2858 Return(result); | 2858 Return(result); |
| 2859 } | 2859 } |
| 2860 } | 2860 } |
| 2861 | 2861 |
| 2862 } // namespace internal | 2862 } // namespace internal |
| 2863 } // namespace v8 | 2863 } // namespace v8 |
| OLD | NEW |