[ES6] Add DFG/FTL support for accessor put operations
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Oct 2015 18:05:57 +0000 (18:05 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Oct 2015 18:05:57 +0000 (18:05 +0000)
commit0aae2237d667614eb166f8797514af1e211365de
treefba70e22d3e81c6b35bd4dec9d2a7f26fdbd70e2
parent020e23cd150fcbe927f75b78a1c1a9c9b9423361
[ES6] Add DFG/FTL support for accessor put operations
https://bugs.webkit.org/show_bug.cgi?id=148860

Reviewed by Geoffrey Garen.

This patch introduces accessor defining ops into DFG and FTL.
The following DFG nodes are introduced.

    op_put_getter_by_id  => PutGetterById
    op_put_setter_by_id  => PutSetterById
    op_put_getter_setter => PutGetterSetterById
    op_put_getter_by_val => PutGetterByVal
    op_put_setter_by_val => PutSetterByVal

These DFG nodes just call operations. But it does not prevent compiling in DFG/FTL.

To use operations defined for baseline JIT, we clean up existing operations.
And reuse these operations in DFG and FTL.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasIdentifier):
(JSC::DFG::Node::hasAccessorAttributes):
(JSC::DFG::Node::accessorAttributes):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compilePutAccessorById):
(JSC::DFG::SpeculativeJIT::compilePutGetterSetterById):
(JSC::DFG::SpeculativeJIT::compilePutAccessorByVal):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
(JSC::FTL::DFG::LowerDFGToLLVM::compilePutAccessorById):
(JSC::FTL::DFG::LowerDFGToLLVM::compilePutGetterSetterById):
(JSC::FTL::DFG::LowerDFGToLLVM::compilePutAccessorByVal):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_put_getter_by_id):
(JSC::JIT::emit_op_put_setter_by_id):
(JSC::JIT::emit_op_put_getter_setter):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_put_getter_by_id):
(JSC::JIT::emit_op_put_setter_by_id):
(JSC::JIT::emit_op_put_getter_setter):
* tests/stress/dfg-put-accessors-by-id-class.js: Added.
(shouldBe):
(testAttribute):
(getter.Cocoa.prototype.get hello):
(getter.Cocoa):
(getter):
(setter.Cocoa):
(setter.Cocoa.prototype.set hello):
(setter):
(accessors.Cocoa):
(accessors.Cocoa.prototype.get hello):
(accessors.Cocoa.prototype.set hello):
(accessors):
* tests/stress/dfg-put-accessors-by-id.js: Added.
(shouldBe):
(testAttribute):
(getter.object.get hello):
(getter):
(setter.object.set hello):
(setter):
(accessors.object.get hello):
(accessors.object.set hello):
(accessors):
* tests/stress/dfg-put-getter-by-id-class.js: Added.
(shouldBe):
(testAttribute):
(getter.Cocoa):
(getter.Cocoa.prototype.get hello):
(getter.Cocoa.prototype.get name):
(getter):
* tests/stress/dfg-put-getter-by-id.js: Added.
(shouldBe):
(testAttribute):
(getter.object.get hello):
(getter):
* tests/stress/dfg-put-getter-by-val-class.js: Added.
(shouldBe):
(testAttribute):
(getter.Cocoa):
(getter.Cocoa.prototype.get name):
(getter):
* tests/stress/dfg-put-getter-by-val.js: Added.
(shouldBe):
(testAttribute):
(getter.object.get name):
(getter):
* tests/stress/dfg-put-setter-by-id-class.js: Added.
(shouldBe):
(testAttribute):
(getter.Cocoa):
(getter.Cocoa.prototype.set hello):
(getter.Cocoa.prototype.get name):
(getter):
* tests/stress/dfg-put-setter-by-id.js: Added.
(shouldBe):
(testAttribute):
(setter.object.set hello):
(setter):
* tests/stress/dfg-put-setter-by-val-class.js: Added.
(shouldBe):
(testAttribute):
(setter.Cocoa):
(setter.Cocoa.prototype.set name):
(setter):
* tests/stress/dfg-put-setter-by-val.js: Added.
(shouldBe):
(testAttribute):
(setter.object.set name):
(setter):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191500 268f45cc-cd09-0410-ab3c-d52691b4dbfc
34 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/dfg/DFGCapabilities.cpp
Source/JavaScriptCore/dfg/DFGClobberize.h
Source/JavaScriptCore/dfg/DFGDoesGC.cpp
Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
Source/JavaScriptCore/dfg/DFGNode.h
Source/JavaScriptCore/dfg/DFGNodeType.h
Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp
Source/JavaScriptCore/dfg/DFGSafeToExecute.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
Source/JavaScriptCore/ftl/FTLCapabilities.cpp
Source/JavaScriptCore/ftl/FTLIntrinsicRepository.h
Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp
Source/JavaScriptCore/jit/JIT.h
Source/JavaScriptCore/jit/JITInlines.h
Source/JavaScriptCore/jit/JITOperations.cpp
Source/JavaScriptCore/jit/JITOperations.h
Source/JavaScriptCore/jit/JITPropertyAccess.cpp
Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
Source/JavaScriptCore/tests/stress/dfg-put-accessors-by-id-class.js [new file with mode: 0644]
Source/JavaScriptCore/tests/stress/dfg-put-accessors-by-id.js [new file with mode: 0644]
Source/JavaScriptCore/tests/stress/dfg-put-getter-by-id-class.js [new file with mode: 0644]
Source/JavaScriptCore/tests/stress/dfg-put-getter-by-id.js [new file with mode: 0644]
Source/JavaScriptCore/tests/stress/dfg-put-getter-by-val-class.js [new file with mode: 0644]
Source/JavaScriptCore/tests/stress/dfg-put-getter-by-val.js [new file with mode: 0644]
Source/JavaScriptCore/tests/stress/dfg-put-setter-by-id-class.js [new file with mode: 0644]
Source/JavaScriptCore/tests/stress/dfg-put-setter-by-id.js [new file with mode: 0644]
Source/JavaScriptCore/tests/stress/dfg-put-setter-by-val-class.js [new file with mode: 0644]
Source/JavaScriptCore/tests/stress/dfg-put-setter-by-val.js [new file with mode: 0644]