15#include "torque-generated/exported-macros-assembler.h"
27 Label callable_target(
this), constructor_target(
this), none_target(
this),
34 BIND(&callable_target);
40 LoadContextElement(nativeContext, Context::PROXY_CALLABLE_MAP_INDEX));
43 BIND(&constructor_target);
45 map =
CAST(LoadContextElement(nativeContext,
46 Context::PROXY_CONSTRUCTOR_MAP_INDEX));
51 map =
CAST(LoadContextElement(nativeContext, Context::PROXY_MAP_INDEX));
59 ? RootIndex::kEmptySwissPropertyDictionary
60 : RootIndex::kEmptyPropertyDictionary;
87 auto argc = UncheckedParameter<Int32T>(Descriptor::kActualArgumentsCount);
89 auto proxy = Parameter<JSProxy>(Descriptor::kFunction);
90 auto context = Parameter<Context>(Descriptor::kContext);
94 PerformStackCheck(context);
96 Label throw_proxy_handler_revoked(
this, Label::kDeferred),
101 CAST(LoadObjectField(proxy, JSProxy::kHandlerOffset));
104 GotoIf(
IsNull(handler), &throw_proxy_handler_revoked);
110 TNode<Object> target = LoadObjectField(proxy, JSProxy::kTargetOffset);
130 BIND(&trap_undefined);
136 BIND(&throw_proxy_handler_revoked);
137 { ThrowTypeError(context, MessageTemplate::kProxyRevoked,
"apply"); }
141 auto argc = UncheckedParameter<Int32T>(Descriptor::kActualArgumentsCount);
143 auto proxy = Parameter<JSProxy>(Descriptor::kTarget);
144 auto new_target = Parameter<Object>(Descriptor::kNewTarget);
145 auto context = Parameter<Context>(Descriptor::kContext);
149 PerformStackCheck(context);
151 Label throw_proxy_handler_revoked(
this, Label::kDeferred),
152 trap_undefined(
this), not_an_object(
this, Label::kDeferred);
156 CAST(LoadObjectField(proxy, JSProxy::kHandlerOffset));
159 GotoIf(
IsNull(handler), &throw_proxy_handler_revoked);
165 TNode<Object> target = LoadObjectField(proxy, JSProxy::kTargetOffset);
185 GotoIf(TaggedIsSmi(new_obj), ¬_an_object);
186 GotoIfNot(JSAnyIsNotPrimitive(
CAST(new_obj)), ¬_an_object);
189 args.PopAndReturn(new_obj);
191 BIND(¬_an_object);
193 ThrowTypeError(context, MessageTemplate::kProxyConstructNonObject, new_obj);
196 BIND(&trap_undefined);
202 TailCallBuiltin(Builtin::kConstruct, context, target,
new_target, argc);
205 BIND(&throw_proxy_handler_revoked);
206 { ThrowTypeError(context, MessageTemplate::kProxyRevoked,
"construct"); }
225 &if_found_value, &var_value, &var_details, &var_raw_value,
228 BIND(&if_found_value);
232 check_accessor(
this), check_data(
this);
253 &throw_non_configurable_data);
256 BIND(&check_accessor);
272 BIND(&continue_check);
273 GotoIfNot(IsUndefined(trap_result), &throw_non_configurable_accessor);
278 GotoIf(IsUndefined(
setter), &throw_non_configurable_accessor);
284 BIND(&throw_non_configurable_data);
287 ThrowTypeError(context, MessageTemplate::kProxyGetNonConfigurableData,
288 name, var_value.value(), trap_result);
290 ThrowTypeError(context, MessageTemplate::kProxySetFrozenData, name);
294 BIND(&throw_non_configurable_accessor);
298 MessageTemplate::kProxyGetNonConfigurableAccessor, name,
301 ThrowTypeError(context, MessageTemplate::kProxySetFrozenAccessor, name);
305 BIND(&check_in_runtime);
307 CallRuntime(Runtime::kCheckProxyGetSetTrapResult, context, name, target,
334 &if_found_value, &var_value, &var_details, &var_raw_value,
338 BIND(&if_found_value);
344 GotoIf(non_configurable, &throw_non_configurable);
350 GotoIfNot(target_extensible, &throw_non_extensible);
354 BIND(&throw_non_configurable);
355 {
ThrowTypeError(context, MessageTemplate::kProxyHasNonConfigurable, name); }
357 BIND(&throw_non_extensible);
358 {
ThrowTypeError(context, MessageTemplate::kProxyHasNonExtensible, name); }
360 BIND(&check_in_runtime);
362 CallRuntime(Runtime::kCheckProxyHasTrapResult, context, name, target);
387 &if_found_value, &var_value, &var_details, &var_raw_value,
391 BIND(&if_found_value);
396 GotoIf(non_configurable, &throw_non_configurable);
402 GotoIfNot(target_extensible, &throw_non_extensible);
406 BIND(&throw_non_configurable);
409 MessageTemplate::kProxyDeletePropertyNonConfigurable, name);
412 BIND(&throw_non_extensible);
414 ThrowTypeError(context, MessageTemplate::kProxyDeletePropertyNonExtensible,
418 BIND(&check_in_runtime);
420 CallRuntime(Runtime::kCheckProxyDeleteTrapResult, context, name, target);
#define CSA_DCHECK(csa,...)
#define TF_BUILTIN(Name, AssemblerBase)
static constexpr Builtin Call(ConvertReceiverMode=ConvertReceiverMode::kAny)
TNode< BoolT > IsUniqueNameNoIndex(TNode< HeapObject > object)
void BranchIfSameValue(TNode< Object > lhs, TNode< Object > rhs, Label *if_true, Label *if_false, SameValueMode mode=SameValueMode::kFull)
TNode< BoolT > IsConstructor(TNode< HeapObject > object)
TNode< BoolT > IsExtensibleMap(TNode< Map > map)
void ThrowTypeError(TNode< Context > context, MessageTemplate message, char const *arg0=nullptr, char const *arg1=nullptr)
TNode< HeapObject > Allocate(TNode< IntPtrT > size, AllocationFlags flags=AllocationFlag::kNone)
void StoreObjectFieldRoot(TNode< HeapObject > object, int offset, RootIndex root)
TNode< JSFunction > AllocateRootFunctionWithContext(RootIndex function, TNode< Context > context, std::optional< TNode< NativeContext > > maybe_native_context)
void TryGetOwnProperty(TNode< Context > context, TNode< JSAny > receiver, TNode< JSReceiver > object, TNode< Map > map, TNode< Int32T > instance_type, TNode< Name > unique_name, Label *if_found_value, TVariable< Object > *var_value, Label *if_not_found, Label *if_bailout, ExpectedReceiverMode expected_receiver_mode=kExpectingAnyReceiver)
TNode< BoolT > IsSetWord32(TNode< Word32T > word32)
TNode< Object > LoadAccessorPairGetter(TNode< AccessorPair > accessor_pair)
void StoreObjectFieldNoWriteBarrier(TNode< HeapObject > object, TNode< IntPtrT > offset, TNode< T > value)
TNode< Uint16T > LoadInstanceType(TNode< HeapObject > object)
TNode< NativeContext > LoadNativeContext(TNode< Context > context)
void BranchIfAccessorPair(TNode< Object > value, Label *if_accessor_pair, Label *if_not_accessor_pair)
void StoreContextElementNoWriteBarrier(TNode< Context > context, int slot_index, TNode< Object > value)
TNode< Map > LoadMap(TNode< HeapObject > object)
TNode< Object > LoadAccessorPairSetter(TNode< AccessorPair > accessor_pair)
TNode< BoolT > IsCallable(TNode< HeapObject > object)
void StoreMapNoWriteBarrier(TNode< HeapObject > object, RootIndex map_root_index)
static const int kAttributesReadOnlyMask
static const int kAttributesDontDeleteMask
TNode< JSFunction > AllocateProxyRevokeFunction(TNode< Context > context, TNode< JSProxy > proxy)
TNode< JSProxy > AllocateProxy(TNode< Context > context, TNode< JSReceiver > target, TNode< JSReceiver > handler)
void CheckHasTrapResult(TNode< Context > context, TNode< JSReceiver > target, TNode< JSProxy > proxy, TNode< Name > name)
void CheckDeleteTrapResult(TNode< Context > context, TNode< JSReceiver > target, TNode< JSProxy > proxy, TNode< Name > name)
TNode< Context > CreateProxyRevokeFunctionContext(TNode< JSProxy > proxy, TNode< NativeContext > native_context)
void CheckGetSetTrapResult(TNode< Context > context, TNode< JSReceiver > target, TNode< JSProxy > proxy, TNode< Name > name, TNode< Object > trap_result, JSProxy::AccessKind access_kind)
void GotoIfNot(TNode< IntegralT > condition, Label *false_label, GotoHint goto_hint=GotoHint::kNone)
TNode< Smi > SmiConstant(Tagged< Smi > value)
void GotoIf(TNode< IntegralT > condition, Label *true_label, GotoHint goto_hint=GotoHint::kNone)
TNode< T > CallRuntime(Runtime::FunctionId function, TNode< Object > context, TArgs... args)
void Branch(TNode< IntegralT > condition, Label *true_label, Label *false_label, BranchHint branch_hint=BranchHint::kNone)
#define V8_ENABLE_SWISS_NAME_DICTIONARY_BOOL
base::Vector< const DirectHandle< Object > > args
DirectHandle< Object > new_target
ZoneVector< RpoNumber > & result
std::optional< OolTrapLabel > trap
Handle< To > UncheckedCast(Handle< From > value)
kInstanceDescriptorsOffset kTransitionsOrPrototypeInfoOffset IsNull(value)||IsJSProxy(value)||IsWasmObject(value)||(IsJSObject(value) &&(HeapLayout
!IsContextMap !IsContextMap native_context