[DFG] InById should be converted to MatchStructure
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jun 2018 18:39:57 +0000 (18:39 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jun 2018 18:39:57 +0000 (18:39 +0000)
commit2296c9f712101ae13241303750163c5efc73c12d
tree54f9347425f62e28b60c222b1a4b6a6ef1905a7c
parent7666101ce51e55ef90a88ac0f8fa6b8b4fb359d1
[DFG] InById should be converted to MatchStructure
https://bugs.webkit.org/show_bug.cgi?id=185803

Reviewed by Keith Miller.

JSTests:

* microbenchmarks/in-by-id-match.js: Added.
(test):
* microbenchmarks/in-by-id-removed.js: Added.
(test):
* stress/in-by-id-constant.js: Added.
(shouldBe):
(test1):
* stress/in-by-id-match-invalid.js: Added.
(shouldBe):
(test1):
* stress/in-by-id-match.js: Added.
(shouldBe):
(test1):

Source/JavaScriptCore:

MatchStructure is introduced for instanceof optimization. But this node
is also useful for InById node. This patch converts InById to MatchStructure
node with CheckStructures if possible by using InByIdStatus.

Added microbenchmarks show improvements.

                           baseline                  patched

in-by-id-removed       18.1196+-0.8108     ^     16.1702+-0.9773        ^ definitely 1.1206x faster
in-by-id-match         16.3912+-0.2608     ^     15.2736+-0.8173        ^ definitely 1.0732x faster

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/InByIdStatus.cpp: Added.
(JSC::InByIdStatus::appendVariant):
(JSC::InByIdStatus::computeFor):
(JSC::InByIdStatus::hasExitSite):
(JSC::InByIdStatus::computeForStubInfo):
(JSC::InByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
(JSC::InByIdStatus::filter):
(JSC::InByIdStatus::dump const):
* bytecode/InByIdStatus.h: Added.
(JSC::InByIdStatus::InByIdStatus):
(JSC::InByIdStatus::state const):
(JSC::InByIdStatus::isSet const):
(JSC::InByIdStatus::operator bool const):
(JSC::InByIdStatus::isSimple const):
(JSC::InByIdStatus::numVariants const):
(JSC::InByIdStatus::variants const):
(JSC::InByIdStatus::at const):
(JSC::InByIdStatus::operator[] const):
(JSC::InByIdStatus::takesSlowPath const):
* bytecode/InByIdVariant.cpp: Added.
(JSC::InByIdVariant::InByIdVariant):
(JSC::InByIdVariant::attemptToMerge):
(JSC::InByIdVariant::dump const):
(JSC::InByIdVariant::dumpInContext const):
* bytecode/InByIdVariant.h: Added.
(JSC::InByIdVariant::isSet const):
(JSC::InByIdVariant::operator bool const):
(JSC::InByIdVariant::structureSet const):
(JSC::InByIdVariant::structureSet):
(JSC::InByIdVariant::conditionSet const):
(JSC::InByIdVariant::offset const):
(JSC::InByIdVariant::isHit const):
* bytecode/PolyProtoAccessChain.h:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232400 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
JSTests/ChangeLog
JSTests/microbenchmarks/in-by-id-match.js [new file with mode: 0644]
JSTests/microbenchmarks/in-by-id-removed.js [new file with mode: 0644]
JSTests/stress/in-by-id-constant.js [new file with mode: 0644]
JSTests/stress/in-by-id-match-invalid.js [new file with mode: 0644]
JSTests/stress/in-by-id-match.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/Sources.txt
Source/JavaScriptCore/bytecode/InByIdStatus.cpp [new file with mode: 0644]
Source/JavaScriptCore/bytecode/InByIdStatus.h [new file with mode: 0644]
Source/JavaScriptCore/bytecode/InByIdVariant.cpp [new file with mode: 0644]
Source/JavaScriptCore/bytecode/InByIdVariant.h [new file with mode: 0644]
Source/JavaScriptCore/bytecode/PolyProtoAccessChain.h
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp