[runtime] Dehandlify MakeAccessor

Change-Id: Ifa0b6419484aea82f575db6ef8863c318cfabfe6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3865152
Reviewed-by: Igor Sheludko <ishell@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82821}
This commit is contained in:
Camillo Bruni 2022-08-30 13:50:50 +02:00 committed by V8 LUCI CQ
parent fa6928544b
commit 2698ad44cf

View File

@ -28,19 +28,23 @@ Handle<AccessorInfo> Accessors::MakeAccessor(
Isolate* isolate, Handle<Name> name, AccessorNameGetterCallback getter,
AccessorNameBooleanSetterCallback setter) {
Factory* factory = isolate->factory();
Handle<AccessorInfo> info = factory->NewAccessorInfo();
info->set_all_can_read(false);
info->set_all_can_write(false);
info->set_is_special_data_property(true);
info->set_is_sloppy(false);
info->set_replace_on_access(false);
info->set_getter_side_effect_type(SideEffectType::kHasSideEffect);
info->set_setter_side_effect_type(SideEffectType::kHasSideEffect);
name = factory->InternalizeName(name);
info->set_name(*name);
info->set_getter(isolate, reinterpret_cast<Address>(getter));
if (setter == nullptr) setter = &ReconfigureToDataProperty;
info->set_setter(isolate, reinterpret_cast<Address>(setter));
Handle<AccessorInfo> info = factory->NewAccessorInfo();
{
DisallowGarbageCollection no_gc;
auto raw = *info;
raw.set_all_can_read(false);
raw.set_all_can_write(false);
raw.set_is_special_data_property(true);
raw.set_is_sloppy(false);
raw.set_replace_on_access(false);
raw.set_getter_side_effect_type(SideEffectType::kHasSideEffect);
raw.set_setter_side_effect_type(SideEffectType::kHasSideEffect);
raw.set_name(*name);
raw.set_getter(isolate, reinterpret_cast<Address>(getter));
if (setter == nullptr) setter = &ReconfigureToDataProperty;
raw.set_setter(isolate, reinterpret_cast<Address>(setter));
}
return info;
}