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

Side by Side Diff: src/runtime/runtime-array.cc

Issue 2497243002: [stubs] Port builtin for Array.push fast-case from Crankshaft to TF (Closed)
Patch Set: Cleanup Created 4 years, 1 month 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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/conversions-inl.h" 9 #include "src/conversions-inl.h"
10 #include "src/elements.h" 10 #include "src/elements.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 id); 58 id);
59 } 59 }
60 60
61 RUNTIME_FUNCTION(Runtime_SpecialArrayFunctions) { 61 RUNTIME_FUNCTION(Runtime_SpecialArrayFunctions) {
62 HandleScope scope(isolate); 62 HandleScope scope(isolate);
63 DCHECK(args.length() == 0); 63 DCHECK(args.length() == 0);
64 Handle<JSObject> holder = 64 Handle<JSObject> holder =
65 isolate->factory()->NewJSObject(isolate->object_function()); 65 isolate->factory()->NewJSObject(isolate->object_function());
66 66
67 InstallBuiltin(isolate, holder, "pop", Builtins::kArrayPop); 67 InstallBuiltin(isolate, holder, "pop", Builtins::kArrayPop);
68 if (FLAG_minimal) { 68 InstallBuiltin(isolate, holder, "push", Builtins::kArrayPush);
69 InstallBuiltin(isolate, holder, "push", Builtins::kArrayPush);
70 } else {
71 FastArrayPushStub stub(isolate);
72 InstallCode(isolate, holder, "push", stub.GetCode());
73 }
74 InstallBuiltin(isolate, holder, "shift", Builtins::kArrayShift); 69 InstallBuiltin(isolate, holder, "shift", Builtins::kArrayShift);
75 InstallBuiltin(isolate, holder, "unshift", Builtins::kArrayUnshift); 70 InstallBuiltin(isolate, holder, "unshift", Builtins::kArrayUnshift);
76 InstallBuiltin(isolate, holder, "slice", Builtins::kArraySlice); 71 InstallBuiltin(isolate, holder, "slice", Builtins::kArraySlice);
77 InstallBuiltin(isolate, holder, "splice", Builtins::kArraySplice); 72 InstallBuiltin(isolate, holder, "splice", Builtins::kArraySplice);
78 InstallBuiltin(isolate, holder, "includes", Builtins::kArrayIncludes, 2); 73 InstallBuiltin(isolate, holder, "includes", Builtins::kArrayIncludes, 2);
79 InstallBuiltin(isolate, holder, "indexOf", Builtins::kArrayIndexOf, 2); 74 InstallBuiltin(isolate, holder, "indexOf", Builtins::kArrayIndexOf, 2);
80 InstallBuiltin(isolate, holder, "keys", Builtins::kArrayPrototypeKeys, 0, 75 InstallBuiltin(isolate, holder, "keys", Builtins::kArrayPrototypeKeys, 0,
81 kArrayKeys); 76 kArrayKeys);
82 InstallBuiltin(isolate, holder, "values", Builtins::kArrayPrototypeValues, 0, 77 InstallBuiltin(isolate, holder, "values", Builtins::kArrayPrototypeValues, 0,
83 kArrayValues); 78 kArrayValues);
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 669 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
675 isolate, spreaded, 670 isolate, spreaded,
676 Execution::Call(isolate, spread_iterable_function, 671 Execution::Call(isolate, spread_iterable_function,
677 isolate->factory()->undefined_value(), 1, &spread)); 672 isolate->factory()->undefined_value(), 1, &spread));
678 673
679 return *spreaded; 674 return *spreaded;
680 } 675 }
681 676
682 } // namespace internal 677 } // namespace internal
683 } // namespace v8 678 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698