/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/v8/src/builtins/array-concat.tq
50 строк
2 KB
Michaël Zasso
deps: update V8 to 13.6.233.8
02 май 2025, 16:06
Не верифицирован
02 май 2025, 16:06
918fe04
Код
Авторство
О чём код?
// Copyright 2021 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. namespace array { // These are technically all js-implicit parameters, but we don't currently // support supplying these in tail calls (where we have to supply them). extern javascript builtin ArrayConcat( Context, JSFunction, JSAny, int32, DispatchHandle): JSAny; transitioning javascript builtin ArrayPrototypeConcat( js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny { // Fast path if we invoke as `x.concat()`. if (arguments.length == 0) { typeswitch (receiver) { case (a: FastJSArrayForConcat): { return CloneFastJSArray(context, a); } case (JSAny): { // Fallthrough. } } } // Fast path if we invoke as `[].concat(x)`. try { const receiverAsArray: FastJSArrayForConcat = Cast<FastJSArrayForConcat>(receiver) otherwise ReceiverIsNotFastJSArrayForConcat; if (receiverAsArray.IsEmpty() && arguments.length == 1) { typeswitch (arguments[0]) { case (a: FastJSArrayForCopy): { return CloneFastJSArray(context, a); } case (JSAny): { // Fallthrough. } } } } label ReceiverIsNotFastJSArrayForConcat { // Fallthrough. } // TODO(victorgomes): Implement slow path ArrayConcat in Torque. tail ArrayConcat( context, LoadTargetFromFrame(), Undefined, Convert<int32>(arguments.actual_count), kInvalidDispatchHandle); } } // namespace array