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

Side by Side Diff: src/builtins/builtins-array-gen.cc

Issue 2803853005: Inline Array.prototype.forEach in TurboFan (Closed)
Patch Set: Review feedback Created 3 years, 7 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
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 #include "src/builtins/builtins-utils-gen.h" 5 #include "src/builtins/builtins-utils-gen.h"
6 #include "src/builtins/builtins.h" 6 #include "src/builtins/builtins.h"
7 #include "src/code-stub-assembler.h" 7 #include "src/code-stub-assembler.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 834
835 InitIteratingArrayBuiltinLoopContinuation(context, receiver, callbackfn, 835 InitIteratingArrayBuiltinLoopContinuation(context, receiver, callbackfn,
836 this_arg, array, object, initial_k, 836 this_arg, array, object, initial_k,
837 len, to); 837 len, to);
838 838
839 GenerateIteratingArrayBuiltinLoopContinuation( 839 GenerateIteratingArrayBuiltinLoopContinuation(
840 &ArrayBuiltinCodeStubAssembler::ForEachProcessor, 840 &ArrayBuiltinCodeStubAssembler::ForEachProcessor,
841 &ArrayBuiltinCodeStubAssembler::NullPostLoopAction); 841 &ArrayBuiltinCodeStubAssembler::NullPostLoopAction);
842 } 842 }
843 843
844 TF_BUILTIN(ArrayForEachLoopEagerDeoptContinuation,
845 ArrayBuiltinCodeStubAssembler) {
846 Node* context = Parameter(Descriptor::kContext);
847 Node* receiver = Parameter(Descriptor::kReceiver);
848 Node* callbackfn = Parameter(Descriptor::kCallbackFn);
849 Node* this_arg = Parameter(Descriptor::kThisArg);
850 Node* initial_k = Parameter(Descriptor::kInitialK);
851 Node* len = Parameter(Descriptor::kLength);
852
853 Callable stub(Builtins::CallableFor(isolate(),
854 Builtins::kArrayForEachLoopContinuation));
855 Return(CallStub(stub, context, receiver, callbackfn, this_arg,
856 UndefinedConstant(), receiver, initial_k, len,
857 UndefinedConstant()));
858 }
859
860 TF_BUILTIN(ArrayForEachLoopLazyDeoptContinuation,
861 ArrayBuiltinCodeStubAssembler) {
862 Node* context = Parameter(Descriptor::kContext);
863 Node* receiver = Parameter(Descriptor::kReceiver);
864 Node* callbackfn = Parameter(Descriptor::kCallbackFn);
865 Node* this_arg = Parameter(Descriptor::kThisArg);
866 Node* initial_k = Parameter(Descriptor::kInitialK);
867 Node* len = Parameter(Descriptor::kLength);
868
869 Callable stub(Builtins::CallableFor(isolate(),
870 Builtins::kArrayForEachLoopContinuation));
871 Return(CallStub(stub, context, receiver, callbackfn, this_arg,
872 UndefinedConstant(), receiver, initial_k, len,
873 UndefinedConstant()));
874 }
875
844 TF_BUILTIN(ArrayForEach, ArrayBuiltinCodeStubAssembler) { 876 TF_BUILTIN(ArrayForEach, ArrayBuiltinCodeStubAssembler) {
845 Node* argc = 877 Node* argc =
846 ChangeInt32ToIntPtr(Parameter(BuiltinDescriptor::kArgumentsCount)); 878 ChangeInt32ToIntPtr(Parameter(BuiltinDescriptor::kArgumentsCount));
847 CodeStubArguments args(this, argc); 879 CodeStubArguments args(this, argc);
848 Node* context = Parameter(BuiltinDescriptor::kContext); 880 Node* context = Parameter(BuiltinDescriptor::kContext);
849 Node* new_target = Parameter(BuiltinDescriptor::kNewTarget); 881 Node* new_target = Parameter(BuiltinDescriptor::kNewTarget);
850 Node* receiver = args.GetReceiver(); 882 Node* receiver = args.GetReceiver();
851 Node* callbackfn = args.GetOptionalArgumentValue(0, UndefinedConstant()); 883 Node* callbackfn = args.GetOptionalArgumentValue(0, UndefinedConstant());
852 Node* this_arg = args.GetOptionalArgumentValue(1, UndefinedConstant()); 884 Node* this_arg = args.GetOptionalArgumentValue(1, UndefinedConstant());
853 885
(...skipping 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 { 2278 {
2247 Node* message = SmiConstant(MessageTemplate::kDetachedOperation); 2279 Node* message = SmiConstant(MessageTemplate::kDetachedOperation);
2248 CallRuntime(Runtime::kThrowTypeError, context, message, 2280 CallRuntime(Runtime::kThrowTypeError, context, message,
2249 HeapConstant(operation)); 2281 HeapConstant(operation));
2250 Unreachable(); 2282 Unreachable();
2251 } 2283 }
2252 } 2284 }
2253 2285
2254 } // namespace internal 2286 } // namespace internal
2255 } // namespace v8 2287 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698