Changeset 246210 in webkit


Ignore:
Timestamp:
Jun 7, 2019 11:54:31 AM (5 years ago)
Author:
Tadeu Zagallo
Message:

AI should get GetterSetter structure from the base's GlobalObject for GetGetterSetterByOffset
https://bugs.webkit.org/show_bug.cgi?id=198581
<rdar://problem/51099753>

Reviewed by Saam Barati.

JSTests:

  • stress/global-object-proto-getter.js: Added.

(f):
(test):

Source/JavaScriptCore:

For GetGetterSetterByOffset, when the abstract interpreter fails to read the property
from the object, it gets the GetterSetter structure from the CodeBlock's global object.
However, that's not correct, since the global object for the base object might differ
from the CodeBlock's. Instead, we try to get the global object from the base, when it's
a constant object. Otherwise, we can't infer the value and only set the type.

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r246139 r246210  
     12019-06-07  Tadeu Zagallo  <tzagallo@apple.com>
     2
     3        AI should get GetterSetter structure from the base's GlobalObject for GetGetterSetterByOffset
     4        https://bugs.webkit.org/show_bug.cgi?id=198581
     5        <rdar://problem/51099753>
     6
     7        Reviewed by Saam Barati.
     8
     9        * stress/global-object-proto-getter.js: Added.
     10        (f):
     11        (test):
     12
    1132019-06-05  Justin Michaud  <justin_michaud@apple.com>
    214
  • trunk/Source/JavaScriptCore/ChangeLog

    r246177 r246210  
     12019-06-07  Tadeu Zagallo  <tzagallo@apple.com>
     2
     3        AI should get GetterSetter structure from the base's GlobalObject for GetGetterSetterByOffset
     4        https://bugs.webkit.org/show_bug.cgi?id=198581
     5        <rdar://problem/51099753>
     6
     7        Reviewed by Saam Barati.
     8
     9        For GetGetterSetterByOffset, when the abstract interpreter fails to read the property
     10        from the object, it gets the GetterSetter structure from the CodeBlock's global object.
     11        However, that's not correct, since the global object for the base object might differ
     12        from the CodeBlock's. Instead, we try to get the global object from the base, when it's
     13        a constant object. Otherwise, we can't infer the value and only set the type.
     14
     15        * dfg/DFGAbstractInterpreterInlines.h:
     16        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
     17
    1182019-06-06  Devin Rousso  <drousso@apple.com>
    219
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h

    r246073 r246210  
    33173317    case GetGetterSetterByOffset: {
    33183318        StorageAccessData& data = node->storageAccessData();
    3319         JSValue result = m_graph.tryGetConstantProperty(forNode(node->child2()), data.offset);
     3319        AbstractValue base = forNode(node->child2());
     3320        JSValue result = m_graph.tryGetConstantProperty(base, data.offset);
    33203321        if (result && jsDynamicCast<GetterSetter*>(m_vm, result)) {
    33213322            setConstant(node, *m_graph.freeze(result));
     
    33233324        }
    33243325       
    3325         setForNode(node, m_graph.globalObjectFor(node->origin.semantic)->getterSetterStructure());
     3326        if (base.value() && base.value().isObject()) {
     3327            setForNode(node, asObject(base.value())->globalObject()->getterSetterStructure());
     3328            break;
     3329        }
     3330
     3331        setTypeForNode(node, SpecObjectOther);
    33263332        break;
    33273333    }
Note: See TracChangeset for help on using the changeset viewer.