Lines Matching refs:isolate
15 #include "src/execution/isolate-inl.h"
32 HandleScope scope(isolate);
35 isolate, NewReferenceError(MessageTemplate::kUnsupportedSuper));
40 HandleScope scope(isolate);
43 Handle<String> name(constructor->shared().Name(), isolate);
45 Handle<Context> context = handle(constructor->native_context(), isolate);
49 isolate);
52 isolate, NewError(realm_type_error_function,
56 isolate, NewError(realm_type_error_function,
62 HandleScope scope(isolate);
65 isolate, NewTypeError(MessageTemplate::kStaticPrototype));
69 HandleScope scope(isolate);
72 isolate, NewReferenceError(MessageTemplate::kSuperAlreadyCalled));
76 HandleScope scope(isolate);
79 isolate, NewReferenceError(MessageTemplate::kSuperNotCalled));
84 Object ThrowNotSuperConstructor(Isolate* isolate, Handle<Object> constructor,
89 handle(Handle<JSFunction>::cast(constructor)->shared().Name(), isolate);
91 DCHECK(constructor->IsNull(isolate));
92 super_name = isolate->factory()->null_string();
94 super_name = Object::NoSideEffectsToString(isolate, constructor);
98 super_name = isolate->factory()->null_string();
100 Handle<String> function_name(function->shared().Name(), isolate);
104 isolate,
109 isolate, NewTypeError(MessageTemplate::kNotSuperConstructor, super_name,
116 HandleScope scope(isolate);
120 return ThrowNotSuperConstructor(isolate, constructor, function);
126 Handle<Name> KeyToName(Isolate* isolate, Handle<Object> key) {
134 Handle<Name> KeyToName<NumberDictionary>(Isolate* isolate, Handle<Object> key) {
136 return isolate->factory()->NumberToString(key);
146 MaybeHandle<Object> GetMethodAndSetName(Isolate* isolate,
165 Handle<Name> name = KeyToName<Dictionary>(isolate, key);
178 Object GetMethodWithSharedName(Isolate* isolate, RuntimeArguments& args,
195 Isolate* isolate, Handle<Dictionary> dictionary_template) {
197 Dictionary::ShallowCopy(isolate, dictionary_template);
202 Handle<AccessorPair> pair(AccessorPair::cast(value), isolate);
203 pair = AccessorPair::Copy(isolate, pair);
211 bool SubstituteValues(Isolate* isolate, Handle<Dictionary> dictionary,
214 ReadOnlyRoots roots(isolate);
218 Handle<Object> key(maybe_key, isolate);
219 Handle<Object> value(dictionary->ValueAt(i), isolate);
226 isolate, result,
227 GetMethodAndSetName<Dictionary>(isolate, args, Smi::cast(tmp),
228 isolate->factory()->get_string(),
237 isolate, result,
238 GetMethodAndSetName<Dictionary>(isolate, args, Smi::cast(tmp),
239 isolate->factory()->set_string(),
247 isolate, result,
248 GetMethodAndSetName<Dictionary>(isolate, args, Smi::cast(*value),
249 isolate->factory()->empty_string(),
259 void UpdateProtectors(Isolate* isolate, Handle<JSObject> receiver,
261 ReadOnlyRoots roots(isolate);
265 Handle<Name> name(Name::cast(maybe_key), isolate);
266 LookupIterator::UpdateProtector(isolate, receiver, name);
270 void UpdateProtectors(Isolate* isolate, Handle<JSObject> receiver,
274 Handle<Name> name(properties_template->GetKey(i), isolate);
275 LookupIterator::UpdateProtector(isolate, receiver, name);
280 Isolate* isolate, Handle<Map> map,
287 DescriptorArray::Allocate(isolate, nof_descriptors, 0);
291 ReadOnlyRoots(isolate).empty_slow_element_dictionary()
293 : ShallowCopyDictionaryTemplate(isolate,
307 isolate->factory()->NewPropertyArray(count);
316 isolate, handle(AccessorPair::cast(value), isolate));
326 value = GetMethodWithSharedName(isolate, args, value);
329 value.OptimalRepresentation(isolate));
336 pair.set_getter(GetMethodWithSharedName(isolate, args, tmp));
340 pair.set_setter(GetMethodWithSharedName(isolate, args, tmp));
365 UpdateProtectors(isolate, receiver, descriptors_template);
367 map->InitializeDescriptors(isolate, *descriptors);
369 if (!SubstituteValues<NumberDictionary>(isolate, elements_dictionary,
402 Isolate* isolate, Handle<Map> map,
411 ShallowCopyDictionaryTemplate(isolate, properties_dictionary_template);
413 ShallowCopyDictionaryTemplate(isolate, elements_dictionary_template);
434 isolate, elements_dictionary, element, key_index, value_kind, value);
437 name = isolate->factory()->InternalizeName(name);
439 isolate, properties_dictionary, name, key_index, value_kind, value);
444 if (!SubstituteValues<Dictionary>(isolate, properties_dictionary, args)) {
448 UpdateProtectors(isolate, receiver, properties_dictionary);
451 if (!SubstituteValues<NumberDictionary>(isolate, elements_dictionary,
467 Handle<JSObject> CreateClassPrototype(Isolate* isolate) {
474 Handle<Map> map = Map::Create(isolate, 0);
475 return isolate->factory()->NewJSObjectFromMap(map);
478 bool InitClassPrototype(Isolate* isolate,
484 Handle<Map> map(prototype->map(), isolate);
485 map = Map::CopyDropDescriptors(isolate, map);
487 Map::SetPrototype(isolate, map, prototype_parent);
491 class_boilerplate->instance_computed_properties(), isolate);
494 isolate);
497 class_boilerplate->instance_properties_template(), isolate);
506 return AddDescriptorsByTemplate(isolate, map, descriptors_template,
519 isolate, map, properties_dictionary_template,
525 isolate, map, properties_dictionary_template,
531 bool InitClassConstructor(Isolate* isolate,
536 Handle<Map> map(constructor->map(), isolate);
537 map = Map::CopyDropDescriptors(isolate, map);
543 Map::SetPrototype(isolate, map, constructor_parent, false);
545 JSObject::MakePrototypesFast(constructor_parent, kStartAtReceiver, isolate);
550 isolate);
552 class_boilerplate->static_computed_properties(), isolate);
555 class_boilerplate->static_properties_template(), isolate);
561 return AddDescriptorsByTemplate(isolate, map, descriptors_template,
566 map->InitializeDescriptors(isolate,
567 ReadOnlyRoots(isolate).empty_descriptor_array());
577 isolate, map, properties_dictionary_template,
583 isolate, map, properties_dictionary_template,
589 MaybeHandle<Object> DefineClass(Isolate* isolate,
597 if (super_class->IsTheHole(isolate)) {
598 prototype_parent = isolate->initial_object_prototype();
600 if (super_class->IsNull(isolate)) {
601 prototype_parent = isolate->factory()->null_value();
607 isolate, prototype_parent,
608 Runtime::GetObjectProperty(isolate, super_class,
609 isolate->factory()->prototype_string()),
611 if (!prototype_parent->IsNull(isolate) &&
614 isolate, NewTypeError(MessageTemplate::kPrototypeParentNotAnObject,
621 constructor_parent = handle(HeapObject::cast(*super_class), isolate);
623 THROW_NEW_ERROR(isolate,
630 Handle<JSObject> prototype = CreateClassPrototype(isolate);
637 isolate, &args, ClassBoilerplate::kPrototypeArgumentIndex, *prototype);
639 if (!InitClassConstructor(isolate, class_boilerplate, constructor_parent,
641 !InitClassPrototype(isolate, class_boilerplate, prototype,
644 DCHECK(isolate->has_pending_exception());
649 LOG(isolate,
650 MapEvent("InitialMap", empty_map, handle(constructor->map(), isolate),
653 handle(constructor->shared(), isolate))));
654 LOG(isolate,
655 MapEvent("InitialMap", empty_map, handle(prototype->map(), isolate),
665 HandleScope scope(isolate);
673 isolate,
674 DefineClass(isolate, class_boilerplate, super_class, constructor, args));
681 MaybeHandle<JSReceiver> GetSuperHolder(Isolate* isolate,
685 !isolate->MayAccess(handle(isolate->context(), isolate), home_object)) {
686 isolate->ReportFailedAccessCheck(home_object);
687 RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, JSReceiver);
690 PrototypeIterator iter(isolate, home_object);
697 Handle<Name> name = key->GetName(isolate);
698 THROW_NEW_ERROR(isolate, NewTypeError(message, proto, name), JSReceiver);
703 MaybeHandle<Object> LoadFromSuper(Isolate* isolate, Handle<Object> receiver,
708 isolate, holder,
709 GetSuperHolder(isolate, home_object, SuperMode::kLoad, key), Object);
710 LookupIterator it(isolate, receiver, *key, holder);
712 ASSIGN_RETURN_ON_EXCEPTION(isolate, result, Object::GetProperty(&it), Object);
719 HandleScope scope(isolate);
725 PropertyKey key(isolate, name);
727 RETURN_RESULT_OR_FAILURE(isolate,
728 LoadFromSuper(isolate, receiver, home_object, &key));
733 HandleScope scope(isolate);
742 PropertyKey lookup_key(isolate, key, &success);
743 if (!success) return ReadOnlyRoots(isolate).exception();
746 isolate, LoadFromSuper(isolate, receiver, home_object, &lookup_key));
751 MaybeHandle<Object> StoreToSuper(Isolate* isolate, Handle<JSObject> home_object,
757 isolate, holder,
758 GetSuperHolder(isolate, home_object, SuperMode::kStore, key), Object);
759 LookupIterator it(isolate, receiver, *key, holder);
768 HandleScope scope(isolate);
775 PropertyKey key(isolate, name);
778 isolate, StoreToSuper(isolate, home_object, receiver, &key, value,
783 HandleScope scope(isolate);
793 PropertyKey lookup_key(isolate, key, &success);
794 if (!success) return ReadOnlyRoots(isolate).exception();
797 isolate, StoreToSuper(isolate, home_object, receiver, &lookup_key, value,