Commit 42130fd6 authored by Daniel Clifford's avatar Daniel Clifford Committed by Commit Bot

[builtins] Remove obsolete implementation of Array.prototype.slice

In the process, use the correct ArrayPrototype* naming convention for
the slice and splice builtins.

Change-Id: I1f85e5512dbde8f92e7c764aef9f137d0a6693e0
Reviewed-on: https://chromium-review.googlesource.com/c/1350869Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Commit-Queue: Daniel Clifford <danno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57840}
parent d1b2edbf
......@@ -1708,12 +1708,12 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Builtins::kArrayPrototypeShift, 0, false);
SimpleInstallFunction(isolate_, proto, "unshift",
Builtins::kArrayPrototypeUnshift, 1, false);
SimpleInstallFunction(isolate_, proto, "slice", Builtins::kArraySlice, 2,
false);
SimpleInstallFunction(isolate_, proto, "slice",
Builtins::kArrayPrototypeSlice, 2, false);
SimpleInstallFunction(isolate_, proto, "sort",
Builtins::kArrayPrototypeSort, 1, false);
SimpleInstallFunction(isolate_, proto, "splice", Builtins::kArraySplice, 2,
false);
SimpleInstallFunction(isolate_, proto, "splice",
Builtins::kArrayPrototypeSplice, 2, false);
SimpleInstallFunction(isolate_, proto, "includes", Builtins::kArrayIncludes,
1, false);
SimpleInstallFunction(isolate_, proto, "indexOf", Builtins::kArrayIndexOf,
......
......@@ -119,7 +119,8 @@ namespace array {
// https://tc39.github.io/ecma262/#sec-array.prototype.slice
transitioning javascript builtin
ArraySlice(context: Context, receiver: Object, ...arguments): Object {
ArrayPrototypeSlice(context: Context, receiver: Object, ...arguments):
Object {
// Handle array cloning case if the receiver is a fast array.
if (arguments.length == 0) {
typeswitch (receiver) {
......
......@@ -349,7 +349,8 @@ namespace array {
// https://tc39.github.io/ecma262/#sec-array.prototype.splice
transitioning javascript builtin
ArraySplice(context: Context, receiver: Object, ...arguments): Object {
ArrayPrototypeSplice(context: Context, receiver: Object, ...arguments):
Object {
// 1. Let O be ? ToObject(this value).
const o: JSReceiver = ToObject(context, receiver);
......
This diff is collapsed.
......@@ -334,8 +334,6 @@ namespace internal {
/* ES6 #sec-array.prototype.shift */ \
CPP(ArrayShift) \
TFJ(ArrayPrototypeShift, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
/* ES6 #sec-array.prototype.slice */ \
TFJ(ArrayPrototypeSlice, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
/* ES6 #sec-array.prototype.unshift */ \
CPP(ArrayUnshift) \
/* Support for Array.from and other array-copying idioms */ \
......
......@@ -3447,7 +3447,6 @@ Reduction JSCallReducer::ReduceJSCall(Node* node,
case Builtins::kArrayPrototypeShift:
return ReduceArrayPrototypeShift(node);
case Builtins::kArrayPrototypeSlice:
case Builtins::kArraySlice:
return ReduceArrayPrototypeSlice(node);
case Builtins::kArrayPrototypeEntries:
return ReduceArrayIterator(node, IterationKind::kEntries);
......
......@@ -384,8 +384,6 @@ bool BuiltinToIntrinsicHasNoSideEffect(Builtins::Name builtin_id,
/* Arrays */ \
V(Builtins::kArrayFilter, W(CreateDataProperty)) \
V(Builtins::kArrayMap, W(CreateDataProperty)) \
V(Builtins::kArraySlice, \
W(CreateDataProperty) W(SetKeyedProperty) W(SetNamedProperty)) \
V(Builtins::kArrayPrototypeSlice, \
W(CreateDataProperty) W(SetKeyedProperty) W(SetNamedProperty)) \
/* TypedArrays */ \
......@@ -558,7 +556,6 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) {
case Builtins::kArrayPrototypeKeys:
case Builtins::kArrayPrototypeLastIndexOf:
case Builtins::kArrayPrototypeSlice:
case Builtins::kArraySlice:
case Builtins::kArrayPrototypeSort:
case Builtins::kArrayPrototypeToLocaleString:
case Builtins::kArrayPrototypeToString:
......@@ -822,7 +819,7 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) {
case Builtins::kArrayPrototypeReverse:
case Builtins::kArrayPrototypeShift:
case Builtins::kArrayPrototypeUnshift:
case Builtins::kArraySplice:
case Builtins::kArrayPrototypeSplice:
case Builtins::kArrayUnshift:
// Map builtins.
case Builtins::kMapIteratorPrototypeNext:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment