Changeset 156376 in webkit
- Timestamp:
- Sep 24, 2013 5:37:57 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r156375 r156376 1 2013-09-24 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 op_get_callee shouldn't use value profiling 4 https://bugs.webkit.org/show_bug.cgi?id=121821 5 6 Reviewed by Filip Pizlo. 7 8 Added two tests to make sure we didn't regress the performance of op_get_callee. 9 10 * js/regress/get_callee_monomorphic-expected.txt: Added. 11 * js/regress/get_callee_monomorphic.html: Added. 12 * js/regress/get_callee_polymorphic-expected.txt: Added. 13 * js/regress/get_callee_polymorphic.html: Added. 14 * js/regress/script-tests/get_callee_monomorphic.js: Added. 15 * js/regress/script-tests/get_callee_polymorphic.js: Added. 16 1 17 2013-09-24 Bear Travis <betravis@adobe.com> 2 18 -
trunk/Source/JavaScriptCore/ChangeLog
r156374 r156376 1 2013-09-24 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 op_get_callee shouldn't use value profiling 4 https://bugs.webkit.org/show_bug.cgi?id=121821 5 6 Reviewed by Filip Pizlo. 7 8 Currently it's one of the two opcodes that uses m_singletonValue, which is unnecessary. 9 Our current plan is to remove m_singletonValue so that GenGC can have a simpler story 10 for handling CodeBlocks/FunctionExecutables during nursery collections. 11 12 Instead of using a ValueProfile op_get_callee now has a simple inline cache of the most 13 recent JSFunction that we saw. 14 15 * bytecode/CodeBlock.cpp: 16 (JSC::CodeBlock::CodeBlock): 17 (JSC::CodeBlock::finalizeUnconditionally): 18 * bytecompiler/BytecodeGenerator.cpp: 19 (JSC::BytecodeGenerator::emitCreateThis): 20 * dfg/DFGByteCodeParser.cpp: 21 (JSC::DFG::ByteCodeParser::parseBlock): 22 * jit/JIT.cpp: 23 (JSC::JIT::privateCompileSlowCases): 24 * jit/JIT.h: 25 * jit/JITOpcodes.cpp: 26 (JSC::JIT::emit_op_get_callee): 27 (JSC::JIT::emitSlow_op_get_callee): 28 * jit/JITOpcodes32_64.cpp: 29 (JSC::JIT::emit_op_get_callee): 30 (JSC::JIT::emitSlow_op_get_callee): 31 * llint/LowLevelInterpreter32_64.asm: 32 * llint/LowLevelInterpreter64.asm: 33 * runtime/CommonSlowPaths.cpp: 34 (JSC::SLOW_PATH_DECL): 35 * runtime/CommonSlowPaths.h: 36 1 37 2013-09-24 Mark Lam <mark.lam@apple.com> 2 38 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r156374 r156376 1737 1737 case op_to_this: 1738 1738 case op_get_by_id: 1739 case op_call_varargs: 1740 case op_get_callee: { 1739 case op_call_varargs: { 1741 1740 ValueProfile* profile = &m_valueProfiles[pc[i + opLength - 1].u.operand]; 1742 1741 ASSERT(profile->m_bytecodeOffset == -1); … … 2239 2238 break; 2240 2239 case op_get_array_length: 2240 break; 2241 case op_get_callee: 2242 if (!curInstruction[2].u.jsCell || Heap::isMarked(curInstruction[2].u.jsCell.get())) 2243 break; 2244 if (Options::verboseOSR()) 2245 dataLogF("Clearing LLInt get callee with function %p.\n", curInstruction[2].u.jsCell.get()); 2246 curInstruction[2].u.jsCell.clear(); 2241 2247 break; 2242 2248 case op_get_from_scope: -
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r156374 r156376 1405 1405 RefPtr<RegisterID> func = newTemporary(); 1406 1406 1407 UnlinkedValueProfile profile = emitProfiledOpcode(op_get_callee);1407 emitOpcode(op_get_callee); 1408 1408 instructions().append(func->index()); 1409 instructions().append( profile);1409 instructions().append(0); 1410 1410 1411 1411 size_t begin = instructions().size(); -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r156300 r156376 2008 2008 2009 2009 case op_get_callee: { 2010 ConcurrentJITLocker locker(m_inlineStackTop->m_profiledBlock->m_lock); 2011 ValueProfile* profile = currentInstruction[2].u.profile; 2012 profile->computeUpdatedPrediction(locker); 2013 if (profile->m_singletonValueIsTop 2014 || !profile->m_singletonValue 2015 || !profile->m_singletonValue.isCell()) 2010 JSCell* cachedFunction = currentInstruction[2].u.jsCell.get(); 2011 if (!cachedFunction 2012 || m_inlineStackTop->m_profiledBlock->couldTakeSlowCase(m_currentIndex) 2013 || m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadFunction)) { 2016 2014 set(currentInstruction[1].u.operand, get(JSStack::Callee)); 2017 else {2018 ASSERT( profile->m_singletonValue.asCell()->inherits(JSFunction::info()));2015 } else { 2016 ASSERT(cachedFunction->inherits(JSFunction::info())); 2019 2017 Node* actualCallee = get(JSStack::Callee); 2020 addToGraph(CheckFunction, OpInfo( profile->m_singletonValue.asCell()), actualCallee);2021 set(currentInstruction[1].u.operand, addToGraph(WeakJSConstant, OpInfo( profile->m_singletonValue.asCell())));2018 addToGraph(CheckFunction, OpInfo(cachedFunction), actualCallee); 2019 set(currentInstruction[1].u.operand, addToGraph(WeakJSConstant, OpInfo(cachedFunction))); 2022 2020 } 2023 2021 NEXT_OPCODE(op_get_callee); -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r156247 r156376 408 408 DEFINE_SLOWCASE_OP(op_div) 409 409 DEFINE_SLOWCASE_OP(op_eq) 410 DEFINE_SLOWCASE_OP(op_get_callee) 410 411 case op_get_by_id_out_of_line: 411 412 case op_get_array_length: -
trunk/Source/JavaScriptCore/jit/JIT.h
r156184 r156376 747 747 void emitSlow_op_div(Instruction*, Vector<SlowCaseEntry>::iterator&); 748 748 void emitSlow_op_eq(Instruction*, Vector<SlowCaseEntry>::iterator&); 749 void emitSlow_op_get_callee(Instruction*, Vector<SlowCaseEntry>::iterator&); 749 750 void emitSlow_op_get_by_id(Instruction*, Vector<SlowCaseEntry>::iterator&); 750 751 void emitSlow_op_get_arguments_length(Instruction*, Vector<SlowCaseEntry>::iterator&); -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r156374 r156376 879 879 { 880 880 int result = currentInstruction[1].u.operand; 881 WriteBarrierBase<JSCell>* cachedFunction = ¤tInstruction[2].u.jsCell; 881 882 emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0); 882 emitValueProfilingSite(regT4); 883 884 loadPtr(cachedFunction, regT2); 885 addSlowCase(branchPtr(NotEqual, regT0, regT2)); 886 883 887 emitPutVirtualRegister(result); 888 } 889 890 void JIT::emitSlow_op_get_callee(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 891 { 892 linkSlowCase(iter); 893 894 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_get_callee); 895 slowPathCall.call(); 896 emitGetVirtualRegister(currentInstruction[1].u.operand, regT0); 884 897 } 885 898 -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r156374 r156376 1130 1130 void JIT::emit_op_get_callee(Instruction* currentInstruction) 1131 1131 { 1132 int dst = currentInstruction[1].u.operand; 1132 int result = currentInstruction[1].u.operand; 1133 WriteBarrierBase<JSCell>* cachedFunction = ¤tInstruction[2].u.jsCell; 1133 1134 emitGetFromCallFrameHeaderPtr(JSStack::Callee, regT0); 1135 1136 loadPtr(cachedFunction, regT2); 1137 addSlowCase(branchPtr(NotEqual, regT0, regT2)); 1138 1134 1139 move(TrustedImm32(JSValue::CellTag), regT1); 1135 emitValueProfilingSite(regT4); 1136 emitStore(dst, regT1, regT0); 1140 emitStore(result, regT1, regT0); 1141 } 1142 1143 void JIT::emitSlow_op_get_callee(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1144 { 1145 linkSlowCase(iter); 1146 1147 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_get_callee); 1148 slowPathCall.call(); 1149 emitLoad(currentInstruction[1].u.operand, regT1, regT0); 1137 1150 } 1138 1151 -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm
r155711 r156376 415 415 loadi 4[PC], t0 416 416 loadp PayloadOffset + Callee[cfr], t1 417 valueProfile(CellTag, t1, 8, t2) 417 loadpFromInstruction(2, t2) 418 bpneq t1, t2, .opGetCalleeSlow 418 419 storei CellTag, TagOffset[cfr, t0, 8] 419 420 storei t1, PayloadOffset[cfr, t0, 8] 420 421 dispatch(3) 421 422 423 .opGetCalleeSlow: 424 callSlowPath(_slow_path_get_callee) 425 dispatch(3) 422 426 423 427 _llint_op_to_this: -
trunk/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm
r155711 r156376 296 296 loadisFromInstruction(1, t0) 297 297 loadp Callee[cfr], t1 298 valueProfile(t1, 2, t2) 298 loadpFromInstruction(2, t2) 299 bpneq t1, t2, .opGetCalleeSlow 299 300 storep t1, [cfr, t0, 8] 300 301 dispatch(3) 301 302 303 .opGetCalleeSlow: 304 callSlowPath(_slow_path_get_callee) 305 dispatch(3) 302 306 303 307 _llint_op_to_this: -
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.cpp
r156242 r156376 194 194 } 195 195 196 SLOW_PATH_DECL(slow_path_get_callee) 197 { 198 BEGIN(); 199 JSFunction* callee = jsCast<JSFunction*>(exec->callee()); 200 pc[2].u.jsCell.set(exec->vm(), exec->codeBlock()->ownerExecutable(), callee); 201 RETURN(callee); 202 } 203 196 204 SLOW_PATH_DECL(slow_path_create_arguments) 197 205 { -
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h
r156046 r156376 154 154 SLOW_PATH_HIDDEN_DECL(slow_path_create_arguments); 155 155 SLOW_PATH_HIDDEN_DECL(slow_path_create_this); 156 SLOW_PATH_HIDDEN_DECL(slow_path_get_callee); 156 157 SLOW_PATH_HIDDEN_DECL(slow_path_to_this); 157 158 SLOW_PATH_HIDDEN_DECL(slow_path_not);
Note: See TracChangeset
for help on using the changeset viewer.