[JSC] Allow poly proto for intrinsic getters
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Nov 2017 10:07:50 +0000 (10:07 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 21 Nov 2017 10:07:50 +0000 (10:07 +0000)
commite9bd43755ecacaa14fa3e09a0be7adff670ddc26
treef07edb3bcd782f0ed1a850c8812b19e370094ade
parent125dc928fbeecf6c6618b0363c86cdee84bd772e
[JSC] Allow poly proto for intrinsic getters
https://bugs.webkit.org/show_bug.cgi?id=179550

Reviewed by Saam Barati.

JSTests:

This change is also tested by existing tests.

    1. stress/intrinsic-getter-with-poly-proto.js
    2. stress/poly-proto-intrinsic-getter-correctness.js

* stress/intrinsic-getter-with-poly-proto-getter-change.js: Added.
(shouldBe):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(target):
* stress/intrinsic-getter-with-poly-proto-proto-change.js: Added.
(shouldBe):
(makePolyProtoObject.foo.C):
(makePolyProtoObject.foo):
(makePolyProtoObject):
(target):

Source/JavaScriptCore:

This patch allows intrinsic getters to accept poly proto.
We propagate PolyProtoAccessChain in IntrinsicGetterAccessCase to perform
poly proto checks. And we extend UnderscoreProtoIntrinsic to emit
code for poly proto case.

* bytecode/IntrinsicGetterAccessCase.cpp:
(JSC::IntrinsicGetterAccessCase::IntrinsicGetterAccessCase):
(JSC::IntrinsicGetterAccessCase::create):
* bytecode/IntrinsicGetterAccessCase.h:
* jit/IntrinsicEmitter.cpp:
(JSC::IntrinsicGetterAccessCase::canEmitIntrinsicGetter):
(JSC::IntrinsicGetterAccessCase::emitIntrinsicGetter):
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSTests/ChangeLog
JSTests/stress/intrinsic-getter-with-poly-proto-getter-change.js [new file with mode: 0644]
JSTests/stress/intrinsic-getter-with-poly-proto-proto-change.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/bytecode/IntrinsicGetterAccessCase.cpp
Source/JavaScriptCore/bytecode/IntrinsicGetterAccessCase.h
Source/JavaScriptCore/jit/IntrinsicEmitter.cpp
Source/JavaScriptCore/jit/Repatch.cpp