v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
builtins-typed-array-gen.h
Go to the documentation of this file.
1// Copyright 2018 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_BUILTINS_BUILTINS_TYPED_ARRAY_GEN_H_
6#define V8_BUILTINS_BUILTINS_TYPED_ARRAY_GEN_H_
7
9
10namespace v8 {
11namespace internal {
12
14 public:
15 using ElementsInfo = TorqueStructTypedArrayElementsInfo;
18
21 TNode<Map> map, TNode<Smi> length,
22 TNode<UintPtrT> byte_offset);
23
25
29 TNode<UintPtrT> byte_offset);
30
31 // Returns true if kind is either UINT8_ELEMENTS, UINT8_CLAMPED_ELEMENTS,
32 // RAB_GSAB_UINT8_ELEMENTS, or RAB_GSAB_UINT8_CLAMPED_ELEMENTS.
34
35 // Returns true if kind is either BIGINT64_ELEMENTS, BIGUINT64_ELEMENTS,
36 // RAB_GSAB_BIGINT64_ELEMENTS, or RAB_GSAB_BIGUINT64_ELEMENTS.
38
39 // Returns the byte size of an element for a TypedArray elements kind.
41
42 // Returns information (byte size and map) about a TypedArray's elements.
45
47 TNode<JSTypedArray> exemplar);
48
50 TNode<Object> obj,
51 const char* method_name);
52
54 TNode<Object> obj,
55 const char* method_name);
56
57 void CallCMemmove(TNode<RawPtrT> dest_ptr, TNode<RawPtrT> src_ptr,
58 TNode<UintPtrT> byte_length);
59
61 TNode<UintPtrT> byte_length);
62
63 void CallCMemcpy(TNode<RawPtrT> dest_ptr, TNode<RawPtrT> src_ptr,
64 TNode<UintPtrT> byte_length);
65
67 TNode<UintPtrT> byte_length);
68
69 void CallCMemset(TNode<RawPtrT> dest_ptr, TNode<IntPtrT> value,
70 TNode<UintPtrT> length);
71
75
78 TNode<UintPtrT> source_length,
80
85
86 using TypedArraySwitchCase = std::function<void(ElementsKind, int, int)>;
87
89 TNode<Word32T> elements_kind, const TypedArraySwitchCase& case_function);
90
95 TNode<RawPtrT> base,
98 TNode<JSTypedArray> typed_array,
99 TNode<UintPtrT> index_node,
100 TNode<Numeric> value,
101 ElementsKind elements_kind);
103 TNode<JSTypedArray> typed_array,
104 TNode<UintPtrT> index_node,
105 TNode<Object> value,
106 ElementsKind elements_kind,
107 Label* if_detached_or_out_of_bounds);
108 template <typename TValue>
110 TNode<Context> context, TNode<JSTypedArray> typed_array,
111 TNode<UintPtrT> index_node, TNode<TValue> value,
112 ElementsKind elements_kind, Label* if_detached_or_out_of_bounds);
113};
114
115} // namespace internal
116} // namespace v8
117
118#endif // V8_BUILTINS_BUILTINS_TYPED_ARRAY_GEN_H_
Builtins::Kind kind
Definition builtins.cc:40
TorqueStructTypedArrayElementsInfo ElementsInfo
void StoreJSTypedArrayElementFromPreparedValue(TNode< Context > context, TNode< JSTypedArray > typed_array, TNode< UintPtrT > index_node, TNode< TValue > value, ElementsKind elements_kind, Label *if_detached_or_out_of_bounds)
TNode< JSFunction > GetDefaultConstructor(TNode< Context > context, TNode< JSTypedArray > exemplar)
ElementsInfo GetTypedArrayElementsInfo(TNode< JSTypedArray > typed_array)
void SetJSTypedArrayOffHeapDataPtr(TNode< JSTypedArray > holder, TNode< RawPtrT > base, TNode< UintPtrT > offset)
void CallCMemset(TNode< RawPtrT > dest_ptr, TNode< IntPtrT > value, TNode< UintPtrT > length)
TNode< UintPtrT > ValidateTypedArrayAndGetLength(TNode< Context > context, TNode< Object > obj, const char *method_name)
void AttachBuffer(TNode< JSTypedArray > holder, TNode< JSArrayBuffer > buffer, TNode< Map > map, TNode< Smi > length, TNode< UintPtrT > byte_offset)
void CallCRelaxedMemcpy(TNode< RawPtrT > dest_ptr, TNode< RawPtrT > src_ptr, TNode< UintPtrT > byte_length)
std::function< void(ElementsKind, int, int)> TypedArraySwitchCase
void CallCCopyTypedArrayElementsSlice(TNode< JSTypedArray > source, TNode< JSTypedArray > dest, TNode< UintPtrT > start, TNode< UintPtrT > end)
void CallCCopyFastNumberJSArrayElementsToTypedArray(TNode< Context > context, TNode< JSArray > source, TNode< JSTypedArray > dest, TNode< UintPtrT > source_length, TNode< UintPtrT > offset)
void CallCRelaxedMemmove(TNode< RawPtrT > dest_ptr, TNode< RawPtrT > src_ptr, TNode< UintPtrT > byte_length)
void CallCMemcpy(TNode< RawPtrT > dest_ptr, TNode< RawPtrT > src_ptr, TNode< UintPtrT > byte_length)
void CallCCopyTypedArrayElementsToTypedArray(TNode< JSTypedArray > source, TNode< JSTypedArray > dest, TNode< UintPtrT > source_length, TNode< UintPtrT > offset)
TypedArrayBuiltinsAssembler(compiler::CodeAssemblerState *state)
void StoreJSTypedArrayElementFromTagged(TNode< Context > context, TNode< JSTypedArray > typed_array, TNode< UintPtrT > index_node, TNode< Object > value, ElementsKind elements_kind, Label *if_detached_or_out_of_bounds)
void DispatchTypedArrayByElementsKind(TNode< Word32T > elements_kind, const TypedArraySwitchCase &case_function)
void StoreJSTypedArrayElementFromNumeric(TNode< Context > context, TNode< JSTypedArray > typed_array, TNode< UintPtrT > index_node, TNode< Numeric > value, ElementsKind elements_kind)
TNode< JSArrayBuffer > AllocateEmptyOnHeapBuffer(TNode< Context > context)
void CallCMemmove(TNode< RawPtrT > dest_ptr, TNode< RawPtrT > src_ptr, TNode< UintPtrT > byte_length)
TNode< IntPtrT > GetTypedArrayElementSize(TNode< Int32T > elements_kind)
TNode< Map > LoadMapForType(TNode< JSTypedArray > array)
void SetJSTypedArrayOnHeapDataPtr(TNode< JSTypedArray > holder, TNode< ByteArray > base, TNode< UintPtrT > offset)
TNode< JSTypedArray > ValidateTypedArray(TNode< Context > context, TNode< Object > obj, const char *method_name)
TNode< BoolT > IsUint8ElementsKind(TNode< Int32T > kind)
TNode< BoolT > IsBigInt64ElementsKind(TNode< Int32T > kind)
TNode< UintPtrT > CalculateExternalPointer(TNode< UintPtrT > backing_store, TNode< UintPtrT > byte_offset)
void SetupTypedArrayEmbedderFields(TNode< JSTypedArray > holder)
int start
int end
int32_t offset