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, ...@@ -1708,12 +1708,12 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Builtins::kArrayPrototypeShift, 0, false); Builtins::kArrayPrototypeShift, 0, false);
SimpleInstallFunction(isolate_, proto, "unshift", SimpleInstallFunction(isolate_, proto, "unshift",
Builtins::kArrayPrototypeUnshift, 1, false); Builtins::kArrayPrototypeUnshift, 1, false);
SimpleInstallFunction(isolate_, proto, "slice", Builtins::kArraySlice, 2, SimpleInstallFunction(isolate_, proto, "slice",
false); Builtins::kArrayPrototypeSlice, 2, false);
SimpleInstallFunction(isolate_, proto, "sort", SimpleInstallFunction(isolate_, proto, "sort",
Builtins::kArrayPrototypeSort, 1, false); Builtins::kArrayPrototypeSort, 1, false);
SimpleInstallFunction(isolate_, proto, "splice", Builtins::kArraySplice, 2, SimpleInstallFunction(isolate_, proto, "splice",
false); Builtins::kArrayPrototypeSplice, 2, false);
SimpleInstallFunction(isolate_, proto, "includes", Builtins::kArrayIncludes, SimpleInstallFunction(isolate_, proto, "includes", Builtins::kArrayIncludes,
1, false); 1, false);
SimpleInstallFunction(isolate_, proto, "indexOf", Builtins::kArrayIndexOf, SimpleInstallFunction(isolate_, proto, "indexOf", Builtins::kArrayIndexOf,
......
...@@ -119,7 +119,8 @@ namespace array { ...@@ -119,7 +119,8 @@ namespace array {
// https://tc39.github.io/ecma262/#sec-array.prototype.slice // https://tc39.github.io/ecma262/#sec-array.prototype.slice
transitioning javascript builtin 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. // Handle array cloning case if the receiver is a fast array.
if (arguments.length == 0) { if (arguments.length == 0) {
typeswitch (receiver) { typeswitch (receiver) {
......
...@@ -349,7 +349,8 @@ namespace array { ...@@ -349,7 +349,8 @@ namespace array {
// https://tc39.github.io/ecma262/#sec-array.prototype.splice // https://tc39.github.io/ecma262/#sec-array.prototype.splice
transitioning javascript builtin transitioning javascript builtin
ArraySplice(context: Context, receiver: Object, ...arguments): Object { ArrayPrototypeSplice(context: Context, receiver: Object, ...arguments):
Object {
// 1. Let O be ? ToObject(this value). // 1. Let O be ? ToObject(this value).
const o: JSReceiver = ToObject(context, receiver); const o: JSReceiver = ToObject(context, receiver);
......
This diff is collapsed.
...@@ -334,8 +334,6 @@ namespace internal { ...@@ -334,8 +334,6 @@ namespace internal {
/* ES6 #sec-array.prototype.shift */ \ /* ES6 #sec-array.prototype.shift */ \
CPP(ArrayShift) \ CPP(ArrayShift) \
TFJ(ArrayPrototypeShift, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \ TFJ(ArrayPrototypeShift, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
/* ES6 #sec-array.prototype.slice */ \
TFJ(ArrayPrototypeSlice, SharedFunctionInfo::kDontAdaptArgumentsSentinel) \
/* ES6 #sec-array.prototype.unshift */ \ /* ES6 #sec-array.prototype.unshift */ \
CPP(ArrayUnshift) \ CPP(ArrayUnshift) \
/* Support for Array.from and other array-copying idioms */ \ /* Support for Array.from and other array-copying idioms */ \
......
...@@ -3447,7 +3447,6 @@ Reduction JSCallReducer::ReduceJSCall(Node* node, ...@@ -3447,7 +3447,6 @@ Reduction JSCallReducer::ReduceJSCall(Node* node,
case Builtins::kArrayPrototypeShift: case Builtins::kArrayPrototypeShift:
return ReduceArrayPrototypeShift(node); return ReduceArrayPrototypeShift(node);
case Builtins::kArrayPrototypeSlice: case Builtins::kArrayPrototypeSlice:
case Builtins::kArraySlice:
return ReduceArrayPrototypeSlice(node); return ReduceArrayPrototypeSlice(node);
case Builtins::kArrayPrototypeEntries: case Builtins::kArrayPrototypeEntries:
return ReduceArrayIterator(node, IterationKind::kEntries); return ReduceArrayIterator(node, IterationKind::kEntries);
......
...@@ -384,8 +384,6 @@ bool BuiltinToIntrinsicHasNoSideEffect(Builtins::Name builtin_id, ...@@ -384,8 +384,6 @@ bool BuiltinToIntrinsicHasNoSideEffect(Builtins::Name builtin_id,
/* Arrays */ \ /* Arrays */ \
V(Builtins::kArrayFilter, W(CreateDataProperty)) \ V(Builtins::kArrayFilter, W(CreateDataProperty)) \
V(Builtins::kArrayMap, W(CreateDataProperty)) \ V(Builtins::kArrayMap, W(CreateDataProperty)) \
V(Builtins::kArraySlice, \
W(CreateDataProperty) W(SetKeyedProperty) W(SetNamedProperty)) \
V(Builtins::kArrayPrototypeSlice, \ V(Builtins::kArrayPrototypeSlice, \
W(CreateDataProperty) W(SetKeyedProperty) W(SetNamedProperty)) \ W(CreateDataProperty) W(SetKeyedProperty) W(SetNamedProperty)) \
/* TypedArrays */ \ /* TypedArrays */ \
...@@ -558,7 +556,6 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) { ...@@ -558,7 +556,6 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) {
case Builtins::kArrayPrototypeKeys: case Builtins::kArrayPrototypeKeys:
case Builtins::kArrayPrototypeLastIndexOf: case Builtins::kArrayPrototypeLastIndexOf:
case Builtins::kArrayPrototypeSlice: case Builtins::kArrayPrototypeSlice:
case Builtins::kArraySlice:
case Builtins::kArrayPrototypeSort: case Builtins::kArrayPrototypeSort:
case Builtins::kArrayPrototypeToLocaleString: case Builtins::kArrayPrototypeToLocaleString:
case Builtins::kArrayPrototypeToString: case Builtins::kArrayPrototypeToString:
...@@ -822,7 +819,7 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) { ...@@ -822,7 +819,7 @@ DebugInfo::SideEffectState BuiltinGetSideEffectState(Builtins::Name id) {
case Builtins::kArrayPrototypeReverse: case Builtins::kArrayPrototypeReverse:
case Builtins::kArrayPrototypeShift: case Builtins::kArrayPrototypeShift:
case Builtins::kArrayPrototypeUnshift: case Builtins::kArrayPrototypeUnshift:
case Builtins::kArraySplice: case Builtins::kArrayPrototypeSplice:
case Builtins::kArrayUnshift: case Builtins::kArrayUnshift:
// Map builtins. // Map builtins.
case Builtins::kMapIteratorPrototypeNext: 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