5#ifndef V8_CODEGEN_CODE_STUB_ASSEMBLER_INL_H_
6#define V8_CODEGEN_CODE_STUB_ASSEMBLER_INL_H_
22template <
typename TCallable,
class... TArgs>
29 "Use CallFunction() when the callable is a JSFunction.");
40template <
typename TCallable,
class... TArgs>
49template <
typename TCallable,
class... TArgs>
56template <
class... TArgs>
72template <
class... TArgs>
82template <
class... TArgs>
91template <
typename Function>
94 const Function& materialize_target,
bool target_is_new) {
95 Label done_copy_properties(
this), done_copy_elements(
this);
109 EmptyFixedArrayConstant());
114 Comment(
"FastCloneJSObject: cloning properties");
119 GotoIf(IsEmptyFixedArray(source_properties), &done_copy_properties);
131 var_properties = property_array;
134 Goto(&done_copy_properties);
135 BIND(&done_copy_properties);
137 Comment(
"FastCloneJSObject: cloning elements");
140 &done_copy_elements);
144 Goto(&done_copy_elements);
145 BIND(&done_copy_elements);
147 Comment(
"FastCloneJSObject: initialize the target object");
149 target_map, var_properties.value(), var_elements.value());
163 target_inobject_properties_start),
165 source_inobject_properties_start)));
170 Comment(
"FastCloneJSObject: initializing unused in-object properties");
176 RootIndex::kUndefinedValue);
179 Comment(
"FastCloneJSObject: copying used in-object properties");
185 IntPtrSub(source_payload_start, target_payload_start);
187 Label done_copy_used(
this);
188 auto EmitCopyLoop = [&](
bool write_barrier) {
191 "FastCloneJSObject: copying used in-object properties with write "
195 "FastCloneJSObject: copying used in-object properties without write "
199 target_payload_start, target_used_payload_end,
202 IntPtrSub(result_offset, field_offset_difference);
215 if (!target_is_new) {
216 Label if_no_write_barrier(
this),
220 Goto(&if_no_write_barrier);
222 BIND(&if_needs_write_barrier);
225 Goto(&done_copy_used);
226 BIND(&if_no_write_barrier);
230 Goto(&done_copy_used);
232 BIND(&done_copy_used);
239 Comment(
"FastCloneJSObject: cloning heap numbers");
241 target, target_payload_start, target_used_payload_end);
#define CSA_DCHECK(csa,...)
static constexpr Builtin CallFunction(ConvertReceiverMode=ConvertReceiverMode::kAny)
static constexpr Builtin Call(ConvertReceiverMode=ConvertReceiverMode::kAny)
TNode< WordT > TimesTaggedSize(TNode< WordT > value)
@ kAllFixedArraysDontCopyCOW
void FillPropertyArrayWithUndefined(TNode< PropertyArray > array, TNode< IntPtrT > from_index, TNode< IntPtrT > to_index)
TNode< BoolT > IsStrong(TNode< MaybeObject > value)
void CopyPropertyArrayValues(TNode< HeapObject > from_array, TNode< PropertyArray > to_array, TNode< IntPtrT > length, WriteBarrierMode barrier_mode, DestroySource destroy_source)
TNode< IntPtrT > LoadMapInobjectPropertiesStartInWords(TNode< Map > map)
TNode< BoolT > InstanceTypeEqual(TNode< Int32T > instance_type, int type)
void InitializeFieldsWithRoot(TNode< HeapObject > object, TNode< IntPtrT > start_offset, TNode< IntPtrT > end_offset, RootIndex root)
void TrySkipWriteBarrier(TNode< Object > object, Label *if_needs_write_barrier)
void DCheckReceiver(ConvertReceiverMode mode, TNode< JSAny > receiver)
TNode< BoolT > TaggedEqual(TNode< AnyTaggedT > a, TNode< AnyTaggedT > b)
TNode< FixedArrayBase > LoadElements(TNode< JSObject > object)
TNode< T > LoadObjectField(TNode< HeapObject > object, int offset)
TNode< BoolT > IsNotSetWord32(TNode< Word32T > word32)
TNode< Uint32T > LoadMapBitField3(TNode< Map > map)
TNode< IntPtrT > LoadPropertyArrayLength(TNode< PropertyArray > object)
void BuildFastLoop(const VariableList &vars, TVariable< TIndex > &var_index, TNode< TIndex > start_index, TNode< TIndex > end_index, const FastLoopBody< TIndex > &body, TNode< TIndex > increment, LoopUnrollingMode unrolling_mode, IndexAdvanceMode advance_mode, IndexAdvanceDirection advance_direction)
void StoreObjectFieldNoWriteBarrier(TNode< HeapObject > object, TNode< IntPtrT > offset, TNode< T > value)
TNode< JSAny > Call(TNode< Context > context, TNode< TCallable > callable, ConvertReceiverMode mode, TNode< JSAny > receiver, TArgs... args)
TNode< Uint16T > LoadMapInstanceType(TNode< Map > map)
TNode< Uint16T > LoadInstanceType(TNode< HeapObject > object)
TNode< BoolT > TaggedIsSmi(TNode< MaybeObject > a)
TNode< PropertyArray > AllocatePropertyArray(TNode< IntPtrT > capacity)
TNode< IntPtrT > MapUsedInstanceSizeInWords(TNode< Map > map)
TNode< Object > FastCloneJSObject(TNode< HeapObject > source, TNode< Map > source_map, TNode< Map > target_map, const Function &materialize_target, bool target_is_new)
TNode< JSAny > CallFunction(TNode< Context > context, TNode< JSFunction > callable, ConvertReceiverMode mode, TNode< JSAny > receiver, TArgs... args)
void StoreObjectField(TNode< HeapObject > object, int offset, TNode< Smi > value)
TNode< IntPtrT > LoadMapInstanceSizeInWords(TNode< Map > map)
TNode< FixedArrayBase > CloneFixedArray(TNode< FixedArrayBase > source, ExtractFixedArrayFlags flags=ExtractFixedArrayFlag::kAllFixedArraysDontCopyCOW)
void CopyMutableHeapNumbersInObject(TNode< HeapObject > copy, TNode< IntPtrT > start_offset, TNode< IntPtrT > instance_size)
CodeAssemblerState * state()
void Comment(MessageWithSourceLocation message, Args &&... args)
bool IsUndefinedConstant(TNode< Object > node)
TNode< IntPtrT > IntPtrConstant(intptr_t value)
bool IsNullConstant(TNode< Object > node)
void GotoIf(TNode< IntegralT > condition, Label *true_label, GotoHint goto_hint=GotoHint::kNone)
TNode< BoolT > IntPtrEqual(TNode< WordT > left, TNode< WordT > right)
TNode< IntPtrT > IntPtrSub(TNode< IntPtrT > left, TNode< IntPtrT > right)
TNode< JSAny > CallJS(Builtin builtin, TNode< Context > context, TNode< Object > function, TNode< JSAny > receiver, TArgs... args)
base::Vector< const DirectHandle< Object > > args
constexpr int kTaggedSize
static constexpr bool is_subtype_v
#define DCHECK_NE(v1, v2)