⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283451 in webkit


Ignore:
Timestamp:
Oct 2, 2021, 3:51:04 PM (5 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r283444. rdar://problem/83784764

Remove JSC hack after r283410
https://bugs.webkit.org/show_bug.cgi?id=230261

Reviewed by Mark Lam.

Source/JavaScriptCore:

  • runtime/JSObject.cpp: (JSC::JSObject::getOwnPropertyDescriptor):
  • runtime/PropertySlot.h:

Source/WebCore:

We revert a hack for accessors in JSC since this is not necessary.

  • bindings/scripts/CodeGeneratorJS.pm: (GetJSCAttributesForAttribute):
  • bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjDOMConstructor::construct): (WebCore::jsTestObj_searchGetter): (WebCore::JSC_DEFINE_CUSTOM_GETTER): (WebCore::setJSTestObj_searchSetter): (WebCore::JSC_DEFINE_CUSTOM_SETTER):
  • bindings/scripts/test/TestObj.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283444 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-612.2.9.1-branch/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612.2.9.1-branch/Source/JavaScriptCore/ChangeLog

    r283420 r283451  
     12021-10-02  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r283444. rdar://problem/83784764
     4
     5    Remove JSC hack after r283410
     6    https://bugs.webkit.org/show_bug.cgi?id=230261
     7   
     8    Reviewed by Mark Lam.
     9   
     10    Source/JavaScriptCore:
     11   
     12    * runtime/JSObject.cpp:
     13    (JSC::JSObject::getOwnPropertyDescriptor):
     14    * runtime/PropertySlot.h:
     15   
     16    Source/WebCore:
     17   
     18    We revert a hack for accessors in JSC since this is not necessary.
     19   
     20    * bindings/scripts/CodeGeneratorJS.pm:
     21    (GetJSCAttributesForAttribute):
     22    * bindings/scripts/test/JS/JSTestObj.cpp:
     23    (WebCore::JSTestObjDOMConstructor::construct):
     24    (WebCore::jsTestObj_searchGetter):
     25    (WebCore::JSC_DEFINE_CUSTOM_GETTER):
     26    (WebCore::setJSTestObj_searchSetter):
     27    (WebCore::JSC_DEFINE_CUSTOM_SETTER):
     28    * bindings/scripts/test/TestObj.idl:
     29   
     30    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     31
     32    2021-10-02  Yusuke Suzuki  <ysuzuki@apple.com>
     33
     34            Remove JSC hack after r283410
     35            https://bugs.webkit.org/show_bug.cgi?id=230261
     36
     37            Reviewed by Mark Lam.
     38
     39            * runtime/JSObject.cpp:
     40            (JSC::JSObject::getOwnPropertyDescriptor):
     41            * runtime/PropertySlot.h:
     42
    1432021-10-01  Russell Epstein  <repstein@apple.com>
    244
  • branches/safari-612.2.9.1-branch/Source/JavaScriptCore/runtime/JSObject.cpp

    r283420 r283451  
    36783678        descriptor.setAccessorDescriptor((slot.attributes() | PropertyAttribute::Accessor) & ~PropertyAttribute::CustomAccessor);
    36793679        JSGlobalObject* slotBaseGlobalObject = slot.slotBase()->globalObject(vm);
    3680         if (slot.attributes() & PropertyAttribute::DOMLegacyAccessor)
    3681             slotBaseGlobalObject = globalObject;
    36823680        if (slot.customGetter())
    36833681            descriptor.setGetter(createCustomGetterFunction(slotBaseGlobalObject, vm, propertyName, slot.customGetter(), slot.domAttribute()));
  • branches/safari-612.2.9.1-branch/Source/JavaScriptCore/runtime/PropertySlot.h

    r283420 r283451  
    4646    CustomAccessor    = 1 << 5,
    4747    CustomValue       = 1 << 6,
    48     DOMLegacyAccessor = 1 << 7, // property is a DOM legacy accessor, which holds caller's global object when it is materialized.
    4948    CustomAccessorOrValue = CustomAccessor | CustomValue,
    5049    AccessorOrCustomAccessorOrValue = Accessor | CustomAccessor | CustomValue,
  • branches/safari-612.2.9.1-branch/Source/WebCore/ChangeLog

    r283420 r283451  
     12021-10-02  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r283444. rdar://problem/83784764
     4
     5    Remove JSC hack after r283410
     6    https://bugs.webkit.org/show_bug.cgi?id=230261
     7   
     8    Reviewed by Mark Lam.
     9   
     10    Source/JavaScriptCore:
     11   
     12    * runtime/JSObject.cpp:
     13    (JSC::JSObject::getOwnPropertyDescriptor):
     14    * runtime/PropertySlot.h:
     15   
     16    Source/WebCore:
     17   
     18    We revert a hack for accessors in JSC since this is not necessary.
     19   
     20    * bindings/scripts/CodeGeneratorJS.pm:
     21    (GetJSCAttributesForAttribute):
     22    * bindings/scripts/test/JS/JSTestObj.cpp:
     23    (WebCore::JSTestObjDOMConstructor::construct):
     24    (WebCore::jsTestObj_searchGetter):
     25    (WebCore::JSC_DEFINE_CUSTOM_GETTER):
     26    (WebCore::setJSTestObj_searchSetter):
     27    (WebCore::JSC_DEFINE_CUSTOM_SETTER):
     28    * bindings/scripts/test/TestObj.idl:
     29   
     30    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     31
     32    2021-10-02  Yusuke Suzuki  <ysuzuki@apple.com>
     33
     34            Remove JSC hack after r283410
     35            https://bugs.webkit.org/show_bug.cgi?id=230261
     36
     37            Reviewed by Mark Lam.
     38
     39            We revert a hack for accessors in JSC since this is not necessary.
     40
     41            * bindings/scripts/CodeGeneratorJS.pm:
     42            (GetJSCAttributesForAttribute):
     43            * bindings/scripts/test/JS/JSTestObj.cpp:
     44            (WebCore::JSTestObjDOMConstructor::construct):
     45            (WebCore::jsTestObj_searchGetter):
     46            (WebCore::JSC_DEFINE_CUSTOM_GETTER):
     47            (WebCore::setJSTestObj_searchSetter):
     48            (WebCore::JSC_DEFINE_CUSTOM_SETTER):
     49            * bindings/scripts/test/TestObj.idl:
     50
    1512021-10-01  Russell Epstein  <repstein@apple.com>
    252
  • branches/safari-612.2.9.1-branch/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r283450 r283451  
    20562056    push(@specials, "JSC::PropertyAttribute::ReadOnly") if IsReadonly($attribute);
    20572057    push(@specials, "JSC::PropertyAttribute::CustomAccessor") unless $isGlobalConstructor or IsJSBuiltin($interface, $attribute);
    2058     push(@specials, "JSC::PropertyAttribute::DOMLegacyAccessor") if $attribute->extendedAttributes->{LegacyActiveWindowForAccessor};
    20592058    push(@specials, "JSC::PropertyAttribute::DOMAttribute") if IsAcceleratedDOMAttribute($interface, $attribute);
    20602059    push(@specials, "JSC::PropertyAttribute::DOMJITAttribute") if $attribute->extendedAttributes->{DOMJIT};
  • branches/safari-612.2.9.1-branch/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r283450 r283451  
    18481848static JSC_DECLARE_CUSTOM_GETTER(jsTestObj_trailing_underscore_attribute_);
    18491849static JSC_DECLARE_CUSTOM_SETTER(setJSTestObj_trailing_underscore_attribute_);
     1850static JSC_DECLARE_CUSTOM_GETTER(jsTestObj_search);
     1851static JSC_DECLARE_CUSTOM_SETTER(setJSTestObj_search);
    18501852
    18511853class JSTestObjPrototype final : public JSC::JSNonFinalObject {
     
    21822184    { "_double_leading_underscore_attribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObj_double_leading_underscore_attribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObj_double_leading_underscore_attribute) } },
    21832185    { "trailing_underscore_attribute_", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObj_trailing_underscore_attribute_), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObj_trailing_underscore_attribute_) } },
     2186    { "search", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObj_search), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObj_search) } },
    21842187#if ENABLE(TEST_FEATURE)
    21852188    { "enabledAtRuntimeOperation", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestObjPrototypeFunction_enabledAtRuntimeOperation), (intptr_t) (1) } },
     
    53275330}
    53285331
     5332static inline JSValue jsTestObj_searchGetter(JSGlobalObject& lexicalGlobalObject, JSTestObj& thisObject)
     5333{
     5334    auto& vm = JSC::getVM(&lexicalGlobalObject);
     5335    auto throwScope = DECLARE_THROW_SCOPE(vm);
     5336    auto& impl = thisObject.wrapped();
     5337    RELEASE_AND_RETURN(throwScope, (toJS<IDLUSVString>(lexicalGlobalObject, throwScope, impl.search())));
     5338}
     5339
     5340JSC_DEFINE_CUSTOM_GETTER(jsTestObj_search, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
     5341{
     5342    return IDLAttribute<JSTestObj>::get<jsTestObj_searchGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName);
     5343}
     5344
     5345static inline bool setJSTestObj_searchSetter(JSGlobalObject& lexicalGlobalObject, JSTestObj& thisObject, JSValue value)
     5346{
     5347    auto& vm = JSC::getVM(&lexicalGlobalObject);
     5348    auto throwScope = DECLARE_THROW_SCOPE(vm);
     5349    auto& impl = thisObject.wrapped();
     5350    auto nativeValue = convert<IDLUSVString>(lexicalGlobalObject, value);
     5351    RETURN_IF_EXCEPTION(throwScope, false);
     5352    invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] {
     5353        return impl.setSearch(legacyActiveDOMWindowForAccessor(*jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject)), firstDOMWindow(*jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject)), WTFMove(nativeValue));
     5354    });
     5355    return true;
     5356}
     5357
     5358JSC_DEFINE_CUSTOM_SETTER(setJSTestObj_search, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName))
     5359{
     5360    return IDLAttribute<JSTestObj>::set<setJSTestObj_searchSetter>(*lexicalGlobalObject, thisValue, encodedValue, attributeName);
     5361}
     5362
    53295363#if ENABLE(TEST_FEATURE)
    53305364static inline JSC::EncodedJSValue jsTestObjPrototypeFunction_enabledAtRuntimeOperation1Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestObj>::ClassParameter castedThis)
  • branches/safari-612.2.9.1-branch/Source/WebCore/bindings/scripts/test/TestObj.idl

    r283450 r283451  
    456456    boolean bigInt64AllowShared([AllowShared] BigInt64Array destination);
    457457    boolean bigUint64AllowShared([AllowShared] BigUint64Array destination);
     458
     459    [SetterCallWith=LegacyActiveWindowForAccessor&FirstWindow] attribute USVString search;
    458460};
    459461
Note: See TracChangeset for help on using the changeset viewer.