Changeset 220556 in webkit
- Timestamp:
- Aug 10, 2017 4:00:06 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r220548 r220556 1 2017-08-10 Mark Lam <mark.lam@apple.com> 2 3 Apply the UNLIKELY macro to some unlikely things. 4 https://bugs.webkit.org/show_bug.cgi?id=175440 5 <rdar://problem/33834767> 6 7 Reviewed by Yusuke Suzuki. 8 9 * bytecode/CodeBlock.cpp: 10 (JSC::CodeBlock::~CodeBlock): 11 (JSC::CodeBlock::jettison): 12 * dfg/DFGByteCodeParser.cpp: 13 (JSC::DFG::ByteCodeParser::handleCall): 14 (JSC::DFG::ByteCodeParser::handleVarargsCall): 15 (JSC::DFG::ByteCodeParser::handleGetById): 16 (JSC::DFG::ByteCodeParser::handlePutById): 17 (JSC::DFG::ByteCodeParser::parseBlock): 18 (JSC::DFG::ByteCodeParser::parseCodeBlock): 19 * dfg/DFGJITCompiler.cpp: 20 (JSC::DFG::JITCompiler::JITCompiler): 21 (JSC::DFG::JITCompiler::linkOSRExits): 22 (JSC::DFG::JITCompiler::link): 23 (JSC::DFG::JITCompiler::disassemble): 24 * dfg/DFGJITFinalizer.cpp: 25 (JSC::DFG::JITFinalizer::finalizeCommon): 26 * dfg/DFGOSRExit.cpp: 27 (JSC::DFG::OSRExit::compileOSRExit): 28 * dfg/DFGPlan.cpp: 29 (JSC::DFG::Plan::Plan): 30 * ftl/FTLJITFinalizer.cpp: 31 (JSC::FTL::JITFinalizer::finalizeCommon): 32 * ftl/FTLLink.cpp: 33 (JSC::FTL::link): 34 * ftl/FTLOSRExitCompiler.cpp: 35 (JSC::FTL::compileStub): 36 * jit/JIT.cpp: 37 (JSC::JIT::privateCompileMainPass): 38 (JSC::JIT::compileWithoutLinking): 39 (JSC::JIT::link): 40 * runtime/ScriptExecutable.cpp: 41 (JSC::ScriptExecutable::installCode): 42 * runtime/VM.cpp: 43 (JSC::VM::VM): 44 1 45 2017-08-09 Yusuke Suzuki <utatane.tea@gmail.com> 2 46 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r220500 r220556 840 840 CodeBlock::~CodeBlock() 841 841 { 842 if ( m_vm->m_perBytecodeProfiler)842 if (UNLIKELY(m_vm->m_perBytecodeProfiler)) 843 843 m_vm->m_perBytecodeProfiler->notifyDestruction(this); 844 844 … … 1918 1918 #if ENABLE(DFG_JIT) 1919 1919 if (reason != Profiler::JettisonDueToOldAge) { 1920 if (Profiler::Compilation* compilation = jitCode()->dfgCommon()->compilation.get()) 1920 Profiler::Compilation* compilation = jitCode()->dfgCommon()->compilation.get(); 1921 if (UNLIKELY(compilation)) 1921 1922 compilation->setJettisonReason(reason, detail); 1922 1923 -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r219981 r220556 1317 1317 1318 1318 if (handleInlining(callTarget, result, callLinkStatus, registerOffset, virtualRegisterForArgument(0, registerOffset), VirtualRegister(), 0, argumentCountIncludingThis, nextOffset, op, kind, prediction)) { 1319 if ( m_graph.compilation())1319 if (UNLIKELY(m_graph.compilation())) 1320 1320 m_graph.compilation()->noticeInlinedCall(); 1321 1321 return NonTerminal; … … 1355 1355 if (callLinkStatus.canOptimize() 1356 1356 && handleInlining(callTarget, result, callLinkStatus, firstFreeReg, VirtualRegister(thisReg), VirtualRegister(arguments), firstVarArgOffset, 0, m_currentIndex + OPCODE_LENGTH(op_call_varargs), op, InlineCallFrame::varargsKindFor(callMode), prediction)) { 1357 if ( m_graph.compilation())1357 if (UNLIKELY(m_graph.compilation())) 1358 1358 m_graph.compilation()->noticeInlinedCall(); 1359 1359 return NonTerminal; … … 3718 3718 if (getById != TryGetById && getByIdStatus.isModuleNamespace()) { 3719 3719 if (handleModuleNamespaceLoad(destinationOperand, prediction, base, getByIdStatus)) { 3720 if ( m_graph.compilation())3720 if (UNLIKELY(m_graph.compilation())) 3721 3721 m_graph.compilation()->noticeInlinedGetById(); 3722 3722 return; … … 3732 3732 ASSERT(variant.domAttribute()); 3733 3733 if (handleDOMJITGetter(destinationOperand, variant, base, identifierNumber, prediction)) { 3734 if ( m_graph.compilation())3734 if (UNLIKELY(m_graph.compilation())) 3735 3735 m_graph.compilation()->noticeInlinedGetById(); 3736 3736 return; … … 3783 3783 } 3784 3784 3785 if ( m_graph.compilation())3785 if (UNLIKELY(m_graph.compilation())) 3786 3786 m_graph.compilation()->noticeInlinedGetById(); 3787 3787 … … 3805 3805 } 3806 3806 3807 if ( m_graph.compilation())3807 if (UNLIKELY(m_graph.compilation())) 3808 3808 m_graph.compilation()->noticeInlinedGetById(); 3809 3809 … … 3904 3904 } 3905 3905 3906 if ( m_graph.compilation())3906 if (UNLIKELY(m_graph.compilation())) 3907 3907 m_graph.compilation()->noticeInlinedPutById(); 3908 3908 … … 3928 3928 case PutByIdVariant::Replace: { 3929 3929 store(base, identifierNumber, variant, value); 3930 if ( m_graph.compilation())3930 if (UNLIKELY(m_graph.compilation())) 3931 3931 m_graph.compilation()->noticeInlinedPutById(); 3932 3932 return; … … 3995 3995 addToGraph(PutStructure, OpInfo(transition), base); 3996 3996 3997 if ( m_graph.compilation())3997 if (UNLIKELY(m_graph.compilation())) 3998 3998 m_graph.compilation()->noticeInlinedPutById(); 3999 3999 return; … … 4125 4125 dataLog(" parsing ", currentCodeOrigin(), ": ", opcodeID, "\n"); 4126 4126 4127 if ( m_graph.compilation()) {4127 if (UNLIKELY(m_graph.compilation())) { 4128 4128 addToGraph(CountExecution, OpInfo(m_graph.compilation()->executionCounterFor( 4129 4129 Profiler::OriginStack(*m_vm->m_perBytecodeProfiler, m_codeBlock, currentCodeOrigin())))); … … 6062 6062 CodeBlock* codeBlock = m_inlineStackTop->m_codeBlock; 6063 6063 6064 if ( m_graph.compilation()) {6064 if (UNLIKELY(m_graph.compilation())) { 6065 6065 m_graph.compilation()->addProfiledBytecodes( 6066 6066 *m_vm->m_perBytecodeProfiler, m_inlineStackTop->m_profiledBlock); -
trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
r220306 r220556 57 57 , m_pcToCodeOriginMapBuilder(dfg.m_vm) 58 58 { 59 if ( shouldDumpDisassembly() || m_graph.m_vm.m_perBytecodeProfiler)59 if (UNLIKELY(shouldDumpDisassembly() || m_graph.m_vm.m_perBytecodeProfiler)) 60 60 m_disassembler = std::make_unique<Disassembler>(dfg); 61 61 #if ENABLE(FTL_JIT) … … 73 73 { 74 74 ASSERT(m_jitCode->osrExit.size() == m_exitCompilationInfo.size()); 75 if ( m_graph.compilation()) {75 if (UNLIKELY(m_graph.compilation())) { 76 76 for (unsigned i = 0; i < m_jitCode->osrExit.size(); ++i) { 77 77 OSRExitCompilationInfo& info = m_exitCompilationInfo[i]; … … 318 318 } 319 319 320 if ( m_graph.compilation()) {320 if (UNLIKELY(m_graph.compilation())) { 321 321 ASSERT(m_exitSiteLabels.size() == m_jitCode->osrExit.size()); 322 322 for (unsigned i = 0; i < m_exitSiteLabels.size(); ++i) { … … 529 529 } 530 530 531 if ( m_graph.m_plan.compilation)531 if (UNLIKELY(m_graph.m_plan.compilation)) 532 532 m_disassembler->reportToProfiler(m_graph.m_plan.compilation.get(), linkBuffer); 533 533 } -
trunk/Source/JavaScriptCore/dfg/DFGJITFinalizer.cpp
r212365 r220556 91 91 #endif // ENABLE(FTL_JIT) 92 92 93 if ( m_plan.compilation)93 if (UNLIKELY(m_plan.compilation)) 94 94 m_plan.vm->m_perBytecodeProfiler->addCompilation(m_plan.codeBlock, *m_plan.compilation); 95 95 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp
r220318 r220556 197 197 jit.jitAssertHasValidCallFrame(); 198 198 199 if ( vm->m_perBytecodeProfiler && codeBlock->jitCode()->dfgCommon()->compilation) {199 if (UNLIKELY(vm->m_perBytecodeProfiler && codeBlock->jitCode()->dfgCommon()->compilation)) { 200 200 Profiler::Database& database = *vm->m_perBytecodeProfiler; 201 201 Profiler::Compilation* compilation = codeBlock->jitCode()->dfgCommon()->compilation.get(); -
trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp
r220118 r220556 145 145 , osrEntryBytecodeIndex(osrEntryBytecodeIndex) 146 146 , mustHandleValues(mustHandleValues) 147 , compilation( vm->m_perBytecodeProfiler ? adoptRef(new Profiler::Compilation(vm->m_perBytecodeProfiler->ensureBytecodesFor(codeBlock), profilerCompilationKindForMode(mode))) : 0)147 , compilation(UNLIKELY(vm->m_perBytecodeProfiler) ? adoptRef(new Profiler::Compilation(vm->m_perBytecodeProfiler->ensureBytecodesFor(codeBlock), profilerCompilationKindForMode(mode))) : nullptr) 148 148 , inlineCallFrames(adoptRef(new InlineCallFrameSet())) 149 149 , identifiers(codeBlock) -
trunk/Source/JavaScriptCore/ftl/FTLJITFinalizer.cpp
r214069 r220556 90 90 m_plan.codeBlock->setJITCode(*jitCode); 91 91 92 if ( m_plan.compilation)92 if (UNLIKELY(m_plan.compilation)) 93 93 m_plan.vm->m_perBytecodeProfiler->addCompilation(m_plan.codeBlock, *m_plan.compilation); 94 94 -
trunk/Source/JavaScriptCore/ftl/FTLLink.cpp
r218794 r220556 69 69 CCallHelpers::stackPointerRegister, -static_cast<int32_t>(AssemblyHelpers::prologueStackPointerDelta())); 70 70 71 if (Profiler::Compilation* compilation = graph.compilation()) { 71 Profiler::Compilation* compilation = graph.compilation(); 72 if (UNLIKELY(compilation)) { 72 73 compilation->addDescription( 73 74 Profiler::OriginStack(), -
trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp
r214645 r220556 249 249 jit.checkStackPointerAlignment(); 250 250 251 if ( vm->m_perBytecodeProfiler && jitCode->dfgCommon()->compilation) {251 if (UNLIKELY(vm->m_perBytecodeProfiler && jitCode->dfgCommon()->compilation)) { 252 252 Profiler::Database& database = *vm->m_perBytecodeProfiler; 253 253 Profiler::Compilation* compilation = jitCode->dfgCommon()->compilation.get(); -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r219043 r220556 244 244 OpcodeID opcodeID = Interpreter::getOpcodeID(currentInstruction->u.opcode); 245 245 246 if ( m_compilation) {246 if (UNLIKELY(m_compilation)) { 247 247 add64( 248 248 TrustedImm32(1), … … 612 612 } 613 613 614 if ( Options::dumpDisassembly() || (m_vm->m_perBytecodeProfiler && Options::disassembleBaselineForProfiler()))614 if (UNLIKELY(Options::dumpDisassembly() || (m_vm->m_perBytecodeProfiler && Options::disassembleBaselineForProfiler()))) 615 615 m_disassembler = std::make_unique<JITDisassembler>(m_codeBlock); 616 if ( m_vm->m_perBytecodeProfiler) {616 if (UNLIKELY(m_vm->m_perBytecodeProfiler)) { 617 617 m_compilation = adoptRef( 618 618 new Profiler::Compilation( … … 842 842 patchBuffer.didAlreadyDisassemble(); 843 843 } 844 if ( m_compilation) {844 if (UNLIKELY(m_compilation)) { 845 845 if (Options::disassembleBaselineForProfiler()) 846 846 m_disassembler->reportToProfiler(m_compilation.get(), patchBuffer); -
trunk/Source/JavaScriptCore/runtime/ScriptExecutable.cpp
r220432 r220556 152 152 RELEASE_ASSERT(JITCode::isExecutableScript(genericCodeBlock->jitType())); 153 153 154 if ( Options::verboseOSR())154 if (UNLIKELY(Options::verboseOSR())) 155 155 dataLog("Installing ", *genericCodeBlock, "\n"); 156 156 157 if ( vm.m_perBytecodeProfiler)157 if (UNLIKELY(vm.m_perBytecodeProfiler)) 158 158 vm.m_perBytecodeProfiler->ensureBytecodesFor(genericCodeBlock); 159 159 160 if (Debugger* debugger = genericCodeBlock->globalObject()->debugger()) 160 Debugger* debugger = genericCodeBlock->globalObject()->debugger(); 161 if (UNLIKELY(debugger)) 161 162 debugger->registerCodeBlock(genericCodeBlock); 162 163 } -
trunk/Source/JavaScriptCore/runtime/VM.cpp
r220352 r220556 301 301 LLInt::Data::performAssertions(*this); 302 302 303 if ( Options::useProfiler()) {303 if (UNLIKELY(Options::useProfiler())) { 304 304 m_perBytecodeProfiler = std::make_unique<Profiler::Database>(*this); 305 305 -
trunk/Source/WebKit/ChangeLog
r220553 r220556 1 2017-08-10 Mark Lam <mark.lam@apple.com> 2 3 Apply the UNLIKELY macro to some unlikely things. 4 https://bugs.webkit.org/show_bug.cgi?id=175440 5 <rdar://problem/33834767> 6 7 Reviewed by Yusuke Suzuki. 8 9 * WebProcess/WebPage/WebPage.cpp: 10 (WebKit::WebPage::getBytecodeProfile): 11 1 12 2017-08-10 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r220507 r220556 5710 5710 void WebPage::getBytecodeProfile(CallbackID callbackID) 5711 5711 { 5712 if ( !commonVM().m_perBytecodeProfiler) {5712 if (LIKELY(!commonVM().m_perBytecodeProfiler)) { 5713 5713 send(Messages::WebPageProxy::StringCallback(String(), callbackID)); 5714 5714 return;
Note: See TracChangeset
for help on using the changeset viewer.