Ignore:
Timestamp:
Apr 8, 2014, 12:39:55 PM (11 years ago)
Author:
[email protected]
Message:

Repatch should support setters and plant calls to them directly
https://bugs.webkit.org/show_bug.cgi?id=130750

Source/JavaScriptCore:

Reviewed by Geoffrey Garen.

All of the infrastructure was in place so this just enables setter optimization.

This is a 12x speed-up on setter microbenchmarks. This is a 1% speed-up on Octane.

  • bytecode/PolymorphicPutByIdList.cpp:

(JSC::PutByIdAccess::visitWeak):

  • bytecode/PolymorphicPutByIdList.h:

(JSC::PutByIdAccess::setter):
(JSC::PutByIdAccess::customSetter): Deleted.

  • bytecode/PutByIdStatus.cpp:

(JSC::PutByIdStatus::computeForStubInfo):

  • jit/Repatch.cpp:

(JSC::toString):
(JSC::kindFor):
(JSC::customFor):
(JSC::generateByIdStub):
(JSC::tryCachePutByID):
(JSC::tryBuildPutByIdList):

  • runtime/JSObject.cpp:

(JSC::JSObject::put):

  • runtime/Lookup.h:

(JSC::putEntry):

  • runtime/PutPropertySlot.h:

(JSC::PutPropertySlot::setCacheableSetter):
(JSC::PutPropertySlot::isCacheableSetter):
(JSC::PutPropertySlot::isCacheableCustom):
(JSC::PutPropertySlot::setCacheableCustomProperty): Deleted.
(JSC::PutPropertySlot::isCacheableCustomProperty): Deleted.

  • tests/stress/setter.js: Added.

(foo):

LayoutTests:

Reviewed by Geoffrey Garen.

  • js/regress/script-tests/setter.js: Added.
  • js/regress/setter-expected.txt: Added.
  • js/regress/setter.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r166292 r166945  
    385385            if (gs.isGetterSetter()) {
    386386                callSetter(exec, cell, gs, value, slot.isStrictMode() ? StrictMode : NotStrictMode);
     387                if (!thisObject->structure()->isDictionary())
     388                    slot.setCacheableSetter(obj, offset);
    387389                return;
    388390            } else
Note: See TracChangeset for help on using the changeset viewer.