#include "src/base/logging.h"
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/codegen/code-factory.h"
#include "src/common/assert-scope.h"
#include "src/debug/debug.h"
#include "src/execution/isolate.h"
#include "src/execution/protectors-inl.h"
#include "src/handles/global-handles-inl.h"
#include "src/logging/counters.h"
#include "src/objects/contexts.h"
#include "src/objects/elements-inl.h"
#include "src/objects/hash-table-inl.h"
#include "src/objects/js-array-buffer-inl.h"
#include "src/objects/js-array-inl.h"
#include "src/objects/js-collection-inl.h"
#include "src/objects/js-shared-array-inl.h"
#include "src/objects/lookup.h"
#include "src/objects/objects-inl.h"
#include "src/objects/prototype.h"
#include "src/objects/smi.h"
namespace v8 {
namespace internal {
namespace {
inline bool IsJSArrayFastElementMovingAllowed(Isolate* isolate,
Tagged<JSArray> receiver) { … }
inline bool HasSimpleElements(Tagged<JSObject> current) { … }
inline bool HasOnlySimpleReceiverElements(Isolate* isolate,
Tagged<JSObject> receiver) { … }
inline bool HasOnlySimpleElements(Isolate* isolate,
Tagged<JSReceiver> receiver) { … }
void MatchArrayElementsKindToArguments(Isolate* isolate, Handle<JSArray> array,
BuiltinArguments* args,
int first_arg_index, int num_arguments) { … }
V8_WARN_UNUSED_RESULT
inline bool EnsureJSArrayWithWritableFastElements(Isolate* isolate,
Handle<Object> receiver,
BuiltinArguments* args,
int first_arg_index,
int num_arguments) { … }
V8_WARN_UNUSED_RESULT Maybe<double> GetRelativeIndex(Isolate* isolate,
double length,
Handle<Object> index,
double init_if_undefined) { … }
V8_WARN_UNUSED_RESULT Maybe<double> GetLengthProperty(
Isolate* isolate, Handle<JSReceiver> receiver) { … }
V8_WARN_UNUSED_RESULT MaybeHandle<Object> SetLengthProperty(
Isolate* isolate, Handle<JSReceiver> receiver, double length) { … }
V8_WARN_UNUSED_RESULT Tagged<Object> GenericArrayFill(
Isolate* isolate, Handle<JSReceiver> receiver, Handle<Object> value,
double start, double end) { … }
V8_WARN_UNUSED_RESULT Maybe<bool> TryFastArrayFill(
Isolate* isolate, BuiltinArguments* args, Handle<JSReceiver> receiver,
Handle<Object> value, double start_index, double end_index) { … }
}
BUILTIN(ArrayPrototypeFill) { … }
namespace {
V8_WARN_UNUSED_RESULT Tagged<Object> GenericArrayPush(Isolate* isolate,
BuiltinArguments* args) { … }
}
BUILTIN(ArrayPush) { … }
namespace {
V8_WARN_UNUSED_RESULT Tagged<Object> GenericArrayPop(Isolate* isolate,
BuiltinArguments* args) { … }
}
BUILTIN(ArrayPop) { … }
namespace {
V8_WARN_UNUSED_RESULT bool CanUseFastArrayShift(Isolate* isolate,
Handle<JSReceiver> receiver) { … }
V8_WARN_UNUSED_RESULT Tagged<Object> GenericArrayShift(
Isolate* isolate, Handle<JSReceiver> receiver, double length) { … }
}
BUILTIN(ArrayShift) { … }
BUILTIN(ArrayUnshift) { … }
namespace {
class ArrayConcatVisitor { … };
uint32_t EstimateElementCount(Isolate* isolate, DirectHandle<JSArray> array) { … }
void CollectElementIndices(Isolate* isolate, Handle<JSObject> object,
uint32_t range, std::vector<uint32_t>* indices) { … }
bool IterateElementsSlow(Isolate* isolate, Handle<JSReceiver> receiver,
uint32_t length, ArrayConcatVisitor* visitor) { … }
bool IterateElements(Isolate* isolate, Handle<JSReceiver> receiver,
ArrayConcatVisitor* visitor) { … }
static Maybe<bool> IsConcatSpreadable(Isolate* isolate, Handle<Object> obj) { … }
Tagged<Object> Slow_ArrayConcat(BuiltinArguments* args, Handle<Object> species,
Isolate* isolate) { … }
bool IsSimpleArray(Isolate* isolate, DirectHandle<JSArray> obj) { … }
MaybeHandle<JSArray> Fast_ArrayConcat(Isolate* isolate,
BuiltinArguments* args) { … }
}
BUILTIN(ArrayConcat) { … }
}
}