Ignore:
Timestamp:
Aug 12, 2020, 9:50:12 PM (5 years ago)
Author:
[email protected]
Message:

Inline cache Replace and Setters on PureForwardingProxy
https://bugs.webkit.org/show_bug.cgi?id=215250

Reviewed by Yusuke Suzuki.

JSTests:

  • microbenchmarks/property-replace-and-setter-on-js-proxy.js: Added.

(assert):
(foo):

Source/JavaScriptCore:

We didn't used to cache any Puts on PureForwardingProxy. This patch
implements Replace and JS/Custom Setters on PureForwardingProxy. We don't support
Transition puts because in our current implementation different global objects
will never share the same structure.

This patch also aligns how our runtime and the ICs invoke Customs when the
passed in |this| value is a JSProxy. For custom accessors, our runtime passes
in the JSProxy, where our ICs used to pass in the target of the JSProxy, for
the receiver value. For custom values, the IC behavior and the runtime were
already aligned in passing in the property owner, which is the JSProxy's
target. This patch aligns our IC behavior to match our runtime behavior.

This patch also renames some of the registers in the IC code to clear
up what they're used for.

This is a 2.5x speedup on the microbenchmark I've added, and a 15-20% speedup
on JetStream2's 3d-cube-SP.

  • bytecode/AccessCase.cpp:

(JSC::AccessCase::generateWithGuard):
(JSC::AccessCase::generateImpl):

  • bytecode/GetterSetterAccessCase.cpp:

(JSC::GetterSetterAccessCase::create):

  • bytecode/GetterSetterAccessCase.h:
  • jit/JITOperations.cpp:
  • jit/Repatch.cpp:

(JSC::tryCachePutByID):

  • runtime/CommonSlowPaths.h:

(JSC::CommonSlowPaths::originalStructureBeforePut):
(JSC::CommonSlowPaths::putDirectWithReify):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITOperations.cpp

    r265000 r265600  
    590590    PutPropertySlot slot(baseValue, true, codeBlock->putByIdContext());
    591591
    592     Structure* structure = baseValue.isCell() ? baseValue.asCell()->structure(vm) : nullptr;
     592    Structure* structure = CommonSlowPaths::originalStructureBeforePut(vm, baseValue);
    593593    baseValue.putInline(globalObject, ident, value, slot);
    594594
     
    622622    PutPropertySlot slot(baseValue, false, codeBlock->putByIdContext());
    623623
    624     Structure* structure = baseValue.isCell() ? baseValue.asCell()->structure(vm) : nullptr;
     624    Structure* structure = CommonSlowPaths::originalStructureBeforePut(vm, baseValue);
    625625    baseValue.putInline(globalObject, ident, value, slot);
    626626
Note: See TracChangeset for help on using the changeset viewer.