Changeset 232400 in webkit
- Timestamp:
- Jun 1, 2018 11:39:57 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r232386 r232400 1 2018-05-30 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 [DFG] InById should be converted to MatchStructure 4 https://bugs.webkit.org/show_bug.cgi?id=185803 5 6 Reviewed by Keith Miller. 7 8 * microbenchmarks/in-by-id-match.js: Added. 9 (test): 10 * microbenchmarks/in-by-id-removed.js: Added. 11 (test): 12 * stress/in-by-id-constant.js: Added. 13 (shouldBe): 14 (test1): 15 * stress/in-by-id-match-invalid.js: Added. 16 (shouldBe): 17 (test1): 18 * stress/in-by-id-match.js: Added. 19 (shouldBe): 20 (test1): 21 1 22 2018-05-31 Caio Lima <ticaiolima@gmail.com> 2 23 -
trunk/Source/JavaScriptCore/ChangeLog
r232399 r232400 1 2018-05-30 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 [DFG] InById should be converted to MatchStructure 4 https://bugs.webkit.org/show_bug.cgi?id=185803 5 6 Reviewed by Keith Miller. 7 8 MatchStructure is introduced for instanceof optimization. But this node 9 is also useful for InById node. This patch converts InById to MatchStructure 10 node with CheckStructures if possible by using InByIdStatus. 11 12 Added microbenchmarks show improvements. 13 14 baseline patched 15 16 in-by-id-removed 18.1196+-0.8108 ^ 16.1702+-0.9773 ^ definitely 1.1206x faster 17 in-by-id-match 16.3912+-0.2608 ^ 15.2736+-0.8173 ^ definitely 1.0732x faster 18 19 * JavaScriptCore.xcodeproj/project.pbxproj: 20 * Sources.txt: 21 * bytecode/InByIdStatus.cpp: Added. 22 (JSC::InByIdStatus::appendVariant): 23 (JSC::InByIdStatus::computeFor): 24 (JSC::InByIdStatus::hasExitSite): 25 (JSC::InByIdStatus::computeForStubInfo): 26 (JSC::InByIdStatus::computeForStubInfoWithoutExitSiteFeedback): 27 (JSC::InByIdStatus::filter): 28 (JSC::InByIdStatus::dump const): 29 * bytecode/InByIdStatus.h: Added. 30 (JSC::InByIdStatus::InByIdStatus): 31 (JSC::InByIdStatus::state const): 32 (JSC::InByIdStatus::isSet const): 33 (JSC::InByIdStatus::operator bool const): 34 (JSC::InByIdStatus::isSimple const): 35 (JSC::InByIdStatus::numVariants const): 36 (JSC::InByIdStatus::variants const): 37 (JSC::InByIdStatus::at const): 38 (JSC::InByIdStatus::operator[] const): 39 (JSC::InByIdStatus::takesSlowPath const): 40 * bytecode/InByIdVariant.cpp: Added. 41 (JSC::InByIdVariant::InByIdVariant): 42 (JSC::InByIdVariant::attemptToMerge): 43 (JSC::InByIdVariant::dump const): 44 (JSC::InByIdVariant::dumpInContext const): 45 * bytecode/InByIdVariant.h: Added. 46 (JSC::InByIdVariant::isSet const): 47 (JSC::InByIdVariant::operator bool const): 48 (JSC::InByIdVariant::structureSet const): 49 (JSC::InByIdVariant::structureSet): 50 (JSC::InByIdVariant::conditionSet const): 51 (JSC::InByIdVariant::offset const): 52 (JSC::InByIdVariant::isHit const): 53 * bytecode/PolyProtoAccessChain.h: 54 * dfg/DFGByteCodeParser.cpp: 55 (JSC::DFG::ByteCodeParser::parseBlock): 56 1 57 2018-06-01 Keith Miller <keith_miller@apple.com> 2 58 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r232193 r232400 1703 1703 E328DAEB1D38D005001A2529 /* BytecodeRewriter.h in Headers */ = {isa = PBXBuildFile; fileRef = E3D2642A1D38C042000BE174 /* BytecodeRewriter.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1704 1704 E32AB2441DCD75F400D7533A /* MacroAssemblerHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = E380A76B1DCD7195000F89E6 /* MacroAssemblerHelpers.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1705 E3305FB320B0F78800CEB82B /* InByIdStatus.h in Headers */ = {isa = PBXBuildFile; fileRef = E3305FAF20B0F78700CEB82B /* InByIdStatus.h */; }; 1706 E3305FB520B0F78800CEB82B /* InByIdVariant.h in Headers */ = {isa = PBXBuildFile; fileRef = E3305FB120B0F78800CEB82B /* InByIdVariant.h */; }; 1705 1707 E33637A61B63220200EE0840 /* ReflectObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E33637A41B63220200EE0840 /* ReflectObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1706 1708 E33B3E261B7ABD750048DB2E /* InspectorInstrumentationObject.lut.h in Headers */ = {isa = PBXBuildFile; fileRef = E33B3E251B7ABD750048DB2E /* InspectorInstrumentationObject.lut.h */; }; … … 4569 4571 E3282BB91FE930A300EDAF71 /* YarrErrorCode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = YarrErrorCode.cpp; path = yarr/YarrErrorCode.cpp; sourceTree = "<group>"; }; 4570 4572 E3282BBA1FE930A400EDAF71 /* YarrErrorCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YarrErrorCode.h; path = yarr/YarrErrorCode.h; sourceTree = "<group>"; }; 4573 E3305FAF20B0F78700CEB82B /* InByIdStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InByIdStatus.h; sourceTree = "<group>"; }; 4574 E3305FB020B0F78700CEB82B /* InByIdVariant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InByIdVariant.cpp; sourceTree = "<group>"; }; 4575 E3305FB120B0F78800CEB82B /* InByIdVariant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InByIdVariant.h; sourceTree = "<group>"; }; 4576 E3305FB220B0F78800CEB82B /* InByIdStatus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InByIdStatus.cpp; sourceTree = "<group>"; }; 4571 4577 E33637A31B63220200EE0840 /* ReflectObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReflectObject.cpp; sourceTree = "<group>"; }; 4572 4578 E33637A41B63220200EE0840 /* ReflectObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReflectObject.h; sourceTree = "<group>"; }; … … 4913 4919 0FEC85AD1BDB5CF10080FF74 /* testb3 */, 4914 4920 FE533CAC1F217DB40016A1FE /* testmasm */, 4921 79281BDC20B62B3E002E2A60 /* testmem */, 4915 4922 6511230514046A4C002B101D /* testRegExp */, 4916 4923 932F5BD90822A1C700736975 /* JavaScriptCore.framework */, 4917 79281BDC20B62B3E002E2A60 /* testmem */,4918 4924 ); 4919 4925 name = Products; … … 6287 6293 isa = PBXGroup; 6288 6294 children = ( 6295 79ABCC5820B7812600323D5F /* testmem2.1 */, 6289 6296 79ABCC5620B7812600323D5F /* testmem2.m */, 6290 79ABCC5820B7812600323D5F /* testmem2.1 */,6291 6297 ); 6292 6298 path = testmem2; … … 7676 7682 0F0B83A814BCF55E00885B4F /* HandlerInfo.h */, 7677 7683 0FB399BD20AF6B380017E213 /* ICStatusUtils.h */, 7684 E3305FB220B0F78800CEB82B /* InByIdStatus.cpp */, 7685 E3305FAF20B0F78700CEB82B /* InByIdStatus.h */, 7686 E3305FB020B0F78700CEB82B /* InByIdVariant.cpp */, 7687 E3305FB120B0F78800CEB82B /* InByIdVariant.h */, 7678 7688 7905BB661D12050E0019FE57 /* InlineAccess.cpp */, 7679 7689 7905BB671D12050E0019FE57 /* InlineAccess.h */, … … 8366 8376 0FEC85261BDACDAC0080FF74 /* B3PatchpointSpecial.h in Headers */, 8367 8377 0FEC85281BDACDAC0080FF74 /* B3PatchpointValue.h in Headers */, 8368 0FD2FD9520B52BE200F09441 /* IsoSubspaceInlines.h in Headers */,8369 8378 799EF7C41C56ED96002B0534 /* B3PCToOriginMap.h in Headers */, 8370 8379 0FEC852A1BDACDAC0080FF74 /* B3PhaseScope.h in Headers */, … … 8494 8503 0F4F11E8209BCDAB00709654 /* CompilerTimingScope.h in Headers */, 8495 8504 0FDCE12A1FAFA85F006F3901 /* CompleteSubspace.h in Headers */, 8505 0FD2FD9420B52BDE00F09441 /* CompleteSubspaceInlines.h in Headers */, 8496 8506 BC18C3F40E16F5CD00B34460 /* Completion.h in Headers */, 8497 8507 0F6FC751196110A800E1D02D /* ComplexGetStatus.h in Headers */, … … 8991 9001 0FB467811FDDA6F7003FCB09 /* IsoCellSetInlines.h in Headers */, 8992 9002 0FDCE12D1FAFB4E5006F3901 /* IsoSubspace.h in Headers */, 9003 0FD2FD9520B52BE200F09441 /* IsoSubspaceInlines.h in Headers */, 8993 9004 0F5E0FE72086AD480097F0DE /* IsoSubspacePerVM.h in Headers */, 8994 9005 8B9F6D561D5912FA001C739F /* IterationKind.h in Headers */, … … 9001 9012 BC18C4150E16F5CD00B34460 /* JavaScriptCorePrefix.h in Headers */, 9002 9013 1429D9300ED22D7000B89619 /* JIT.h in Headers */, 9003 0FD2FD9420B52BDE00F09441 /* CompleteSubspaceInlines.h in Headers */,9004 9014 FE1220271BE7F58C0039E6F2 /* JITAddGenerator.h in Headers */, 9005 9015 0F75A0662013E4F10038E2CF /* JITAllocator.h in Headers */, -
trunk/Source/JavaScriptCore/Sources.txt
r232074 r232400 220 220 bytecode/GetByIdVariant.cpp 221 221 bytecode/GetterSetterAccessCase.cpp 222 bytecode/InByIdStatus.cpp 223 bytecode/InByIdVariant.cpp 222 224 bytecode/InlineAccess.cpp 223 225 bytecode/InlineCallFrame.cpp -
trunk/Source/JavaScriptCore/bytecode/PolyProtoAccessChain.h
r222827 r232400 30 30 namespace JSC { 31 31 32 class JSCell; 32 33 class JSGlobalObject; 33 34 class JSObject; -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r232376 r232400 49 49 #include "GetByIdStatus.h" 50 50 #include "Heap.h" 51 #include "InByIdStatus.h" 51 52 #include "InstanceOfStatus.h" 52 53 #include "JSCInlines.h" … … 4806 4807 addToGraph(CheckCell, OpInfo(m_graph.freeze(commonPrototype)), prototype); 4807 4808 4809 bool allOK = true; 4808 4810 MatchStructureData* data = m_graph.m_matchStructureData.add(); 4809 4811 for (const InstanceOfVariant& variant : status.variants()) { 4810 check(variant.conditionSet()); 4812 if (!check(variant.conditionSet())) { 4813 allOK = false; 4814 break; 4815 } 4811 4816 for (Structure* structure : variant.structureSet()) { 4812 4817 MatchStructureVariant matchVariant; … … 4814 4819 matchVariant.result = variant.isHit(); 4815 4820 4816 data->variants.append( matchVariant);4821 data->variants.append(WTFMove(matchVariant)); 4817 4822 } 4818 4823 } 4819 4824 4820 Node* match = addToGraph(MatchStructure, OpInfo(data), value); 4821 set(VirtualRegister(bytecode.dst()), match); 4822 NEXT_OPCODE(op_instanceof); 4825 if (allOK) { 4826 Node* match = addToGraph(MatchStructure, OpInfo(data), value); 4827 set(VirtualRegister(bytecode.dst()), match); 4828 NEXT_OPCODE(op_instanceof); 4829 } 4823 4830 } 4824 4831 … … 6424 6431 Node* base = get(VirtualRegister(currentInstruction[2].u.operand)); 6425 6432 unsigned identifierNumber = m_inlineStackTop->m_identifierRemap[currentInstruction[3].u.operand]; 6426 set(VirtualRegister(currentInstruction[1].u.operand), 6427 addToGraph(InById, OpInfo(identifierNumber), base)); 6433 UniquedStringImpl* uid = m_graph.identifiers()[identifierNumber]; 6434 6435 InByIdStatus status = InByIdStatus::computeFor( 6436 m_inlineStackTop->m_profiledBlock, m_dfgCodeBlock, 6437 m_inlineStackTop->m_stubInfos, m_dfgStubInfos, 6438 currentCodeOrigin(), uid); 6439 6440 if (status.isSimple()) { 6441 bool allOK = true; 6442 MatchStructureData* data = m_graph.m_matchStructureData.add(); 6443 for (const InByIdVariant& variant : status.variants()) { 6444 if (!check(variant.conditionSet())) { 6445 allOK = false; 6446 break; 6447 } 6448 for (Structure* structure : variant.structureSet()) { 6449 MatchStructureVariant matchVariant; 6450 matchVariant.structure = m_graph.registerStructure(structure); 6451 matchVariant.result = variant.isHit(); 6452 6453 data->variants.append(WTFMove(matchVariant)); 6454 } 6455 } 6456 6457 if (allOK) { 6458 Node* match = addToGraph(MatchStructure, OpInfo(data), base); 6459 set(VirtualRegister(currentInstruction[1].u.operand), match); 6460 NEXT_OPCODE(op_in_by_id); 6461 } 6462 } 6463 6464 set(VirtualRegister(currentInstruction[1].u.operand), addToGraph(InById, OpInfo(identifierNumber), base)); 6428 6465 NEXT_OPCODE(op_in_by_id); 6429 break;6430 6466 } 6431 6467
Note: See TracChangeset
for help on using the changeset viewer.