22BUILTIN(ObjectPrototypePropertyIsEnumerable) {
61template <AccessorComponent which_accessor>
63 DirectHandle<JSAny>
object,
64 DirectHandle<Object> name,
65 DirectHandle<Object> accessor) {
71 if (!IsCallable(*accessor)) {
74 ? MessageTemplate::kObjectGetterExpectingFunction
75 : MessageTemplate::kObjectSetterExpectingFunction;
80 PropertyDescriptor desc;
87 desc.set_enumerable(
true);
88 desc.set_configurable(
true);
97 MAYBE_RETURN(success, ReadOnlyRoots(isolate).exception());
98 if (!success.FromJust()) {
102 return ReadOnlyRoots(isolate).undefined_value();
106 DirectHandle<JSAny>
object,
107 DirectHandle<Object>
key,
116 PropertyKey lookup_key(isolate,
key);
117 LookupIterator it(isolate,
object, lookup_key,
121 switch (it.state()) {
127 if (it.HasAccess())
continue;
129 it.GetHolder<JSObject>()));
133 PropertyDescriptor desc;
135 isolate, it.GetHolder<JSProxy>(), it.GetName(), &desc);
136 MAYBE_RETURN(found, ReadOnlyRoots(isolate).exception());
137 if (found.FromJust()) {
144 return ReadOnlyRoots(isolate).undefined_value();
149 if (
IsNull(*prototype, isolate)) {
150 return ReadOnlyRoots(isolate).undefined_value();
152 return ObjectLookupAccessor(isolate, prototype,
key, component);
159 return ReadOnlyRoots(isolate).undefined_value();
162 DirectHandle<Object> maybe_pair = it.GetAccessors();
163 if (IsAccessorPair(*maybe_pair)) {
164 DirectHandle<NativeContext> holder_realm(
165 it.GetHolder<JSReceiver>()->GetCreationContext().value(),
186 return ObjectDefineAccessor<ACCESSOR_GETTER>(isolate,
object, name,
getter);
196 return ObjectDefineAccessor<ACCESSOR_SETTER>(isolate,
object, name,
setter);
221 if (IsJSReceiver(*
object)) {
249 isolate, NewTypeError(MessageTemplate::kCalledOnNullOrUndefined,
250 isolate->factory()->NewStringFromAsciiChecked(
251 "set Object.prototype.__proto__")));
256 if (!
IsNull(*proto, isolate) && !IsJSReceiver(*proto)) {
261 if (!IsJSReceiver(*
object))
return ReadOnlyRoots(isolate).undefined_value();
279 DirectHandle<Object>
object =
args.atOrUndefined(isolate, 1);
283 DirectHandle<FixedArray> keys;
288 return *isolate->factory()->NewJSArrayWithElements(keys);
307 return isolate->heap()->ToBoolean(
result.FromJust());
319 return isolate->heap()->ToBoolean(
result.FromJust());
338 isolate->factory()->NewJSObject(isolate->object_function());
340 for (
int i = 0;
i < keys->
length(); ++
i) {
347 if (!did_get_descriptor.
FromJust())
continue;
362 if (IsJSReceiver(*
object)) {
@ kDefineGetterOrSetterWouldThrow
V8_INLINE T FromJust() const &
V8_INLINE bool IsNothing() const
static Handle< JSAny > GetComponent(Isolate *isolate, DirectHandle< NativeContext > native_context, DirectHandle< AccessorPair > accessor_pair, AccessorComponent component)
static V8_WARN_UNUSED_RESULT Maybe< bool > GetOwnPropertyDescriptor(Isolate *isolate, DirectHandle< JSProxy > proxy, DirectHandle< Name > name, PropertyDescriptor *desc)
static MaybeDirectHandle< JSPrototype > GetPrototype(DirectHandle< JSProxy > receiver)
V8_EXPORT_PRIVATE static V8_WARN_UNUSED_RESULT Maybe< bool > GetOwnPropertyDescriptor(Isolate *isolate, DirectHandle< JSReceiver > object, DirectHandle< Object > key, PropertyDescriptor *desc)
V8_EXPORT_PRIVATE static V8_WARN_UNUSED_RESULT Maybe< bool > SetPrototype(Isolate *isolate, DirectHandle< JSReceiver > object, DirectHandle< Object > value, bool from_javascript, ShouldThrow should_throw)
static V8_WARN_UNUSED_RESULT Maybe< PropertyAttributes > GetOwnPropertyAttributes(Isolate *isolate, DirectHandle< JSReceiver > object, DirectHandle< Name > name)
static V8_WARN_UNUSED_RESULT Maybe< bool > TestIntegrityLevel(Isolate *isolate, DirectHandle< JSReceiver > object, IntegrityLevel lvl)
static V8_WARN_UNUSED_RESULT Maybe< bool > SetIntegrityLevel(Isolate *isolate, DirectHandle< JSReceiver > object, IntegrityLevel lvl, ShouldThrow should_throw)
static MaybeDirectHandle< JSPrototype > GetPrototype(Isolate *isolate, DirectHandle< JSReceiver > receiver)
static V8_WARN_UNUSED_RESULT Maybe< bool > CreateDataProperty(Isolate *isolate, DirectHandle< JSReceiver > object, DirectHandle< Name > key, DirectHandle< Object > value, Maybe< ShouldThrow > should_throw)
static V8_WARN_UNUSED_RESULT Tagged< Object > DefineProperty(Isolate *isolate, DirectHandle< Object > object, DirectHandle< Object > name, Handle< Object > attributes)
static V8_WARN_UNUSED_RESULT Maybe< bool > DefineOwnProperty(Isolate *isolate, DirectHandle< JSReceiver > object, DirectHandle< Object > key, PropertyDescriptor *desc, Maybe< ShouldThrow > should_throw)
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< Object > DefineProperties(Isolate *isolate, DirectHandle< Object > object, DirectHandle< Object > properties)
static MaybeHandle< FixedArray > GetKeys(Isolate *isolate, DirectHandle< JSReceiver > object, KeyCollectionMode mode, PropertyFilter filter, GetKeysConversion keys_conversion=GetKeysConversion::kKeepNumbers, bool is_for_in=false, bool skip_indices=false)
@ TYPED_ARRAY_INDEX_NOT_FOUND
@ PROTOTYPE_CHAIN_SKIP_INTERCEPTOR
static V8_WARN_UNUSED_RESULT HandleType< JSReceiver >::MaybeType ToObject(Isolate *isolate, HandleType< T > object, const char *method_name=nullptr)
static V8_WARN_UNUSED_RESULT HandleType< Object >::MaybeType ToPropertyKey(Isolate *isolate, HandleType< T > value)
static V8_WARN_UNUSED_RESULT HandleType< Name >::MaybeType ToName(Isolate *isolate, HandleType< Object > input)
DirectHandle< JSObject > ToObject(Isolate *isolate)
#define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call)
#define THROW_NEW_ERROR_RETURN_FAILURE(isolate, call)
#define RETURN_FAILURE_ON_EXCEPTION(isolate, call)
#define MAYBE_RETURN(call, value)
#define RETURN_RESULT_OR_FAILURE(isolate, call)
base::Vector< const DirectHandle< Object > > args
ZoneVector< RpoNumber > & result
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in name
bool IsNullOrUndefined(Tagged< Object > obj, Isolate *isolate)
kInstanceDescriptorsOffset kTransitionsOrPrototypeInfoOffset IsNull(value)||IsJSProxy(value)||IsWasmObject(value)||(IsJSObject(value) &&(HeapLayout
kInstanceDescriptorsOffset kTransitionsOrPrototypeInfoOffset prototype
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
Maybe< T > Just(const T &t)
#define DCHECK_LE(v1, v2)
#define DCHECK(condition)