Ignore:
Timestamp:
Nov 3, 2017, 12:57:01 PM (8 years ago)
Author:
[email protected]
Message:

PutProperytSlot should inform the IC about the property before effects.
https://bugs.webkit.org/show_bug.cgi?id=179262

Reviewed by Mark Lam.

This patch fixes an issue where we choose to cache setters based on
incorrect information. If we did so we might end up OSR exiting
more than we would otherwise need to. The new model is that the
PutPropertySlot should inform the IC of what the property looked
like before any potential side effects might have occurred.

  • runtime/JSObject.cpp:

(JSC::JSObject::putInlineSlow):

  • runtime/Lookup.h:

(JSC::putEntry):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/Lookup.h

    r222473 r224416  
    290290        bool isAccessor = entry->attributes() & PropertyAttribute::CustomAccessor;
    291291        JSValue updateThisValue = entry->attributes() & PropertyAttribute::CustomAccessor ? slot.thisValue() : JSValue(base);
    292         bool result = callCustomSetter(exec, entry->propertyPutter(), isAccessor, updateThisValue, value);
    293         RETURN_IF_EXCEPTION(scope, false);
     292        // We need to make sure that we decide to cache this property before we potentially execute aribitrary JS.
    294293        if (isAccessor)
    295294            slot.setCustomAccessor(base, entry->propertyPutter());
    296295        else
    297296            slot.setCustomValue(base, entry->propertyPutter());
     297
     298        bool result = callCustomSetter(exec, entry->propertyPutter(), isAccessor, updateThisValue, value);
     299        RETURN_IF_EXCEPTION(scope, false);
    298300        return result;
    299301    }
Note: See TracChangeset for help on using the changeset viewer.