Changeset 85372 in webkit
- Timestamp:
- Apr 29, 2011 5:11:22 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r85361 r85372 1 2011-04-29 Gavin Barraclough <barraclough@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 https://bugs.webkit.org/show_bug.cgi?id=59847 6 Remove linkOffset from LinkBuffer 7 8 This is redundant since removal of recompilation for exception info. 9 10 * assembler/LinkBuffer.h: 11 (JSC::LinkBuffer::LinkBuffer): 12 (JSC::LinkBuffer::linkCode): 13 * dfg/DFGJITCompiler.cpp: 14 (JSC::DFG::JITCompiler::compileFunction): 15 * jit/JIT.cpp: 16 (JSC::JIT::JIT): 17 (JSC::JIT::privateCompile): 18 * jit/JIT.h: 19 (JSC::JIT::compile): 20 (JSC::JIT::compileCTIMachineTrampolines): 21 (JSC::JIT::compileCTINativeCall): 22 * jit/JITOpcodes.cpp: 23 (JSC::JIT::privateCompileCTIMachineTrampolines): 24 * jit/JITOpcodes32_64.cpp: 25 (JSC::JIT::privateCompileCTIMachineTrampolines): 26 (JSC::JIT::privateCompileCTINativeCall): 27 * jit/JITPropertyAccess.cpp: 28 (JSC::JIT::stringGetByValStubGenerator): 29 (JSC::JIT::privateCompilePutByIdTransition): 30 (JSC::JIT::privateCompilePatchGetArrayLength): 31 (JSC::JIT::privateCompileGetByIdProto): 32 (JSC::JIT::privateCompileGetByIdSelfList): 33 (JSC::JIT::privateCompileGetByIdProtoList): 34 (JSC::JIT::privateCompileGetByIdChainList): 35 (JSC::JIT::privateCompileGetByIdChain): 36 * jit/JITPropertyAccess32_64.cpp: 37 (JSC::JIT::stringGetByValStubGenerator): 38 (JSC::JIT::privateCompilePutByIdTransition): 39 (JSC::JIT::privateCompilePatchGetArrayLength): 40 (JSC::JIT::privateCompileGetByIdProto): 41 (JSC::JIT::privateCompileGetByIdSelfList): 42 (JSC::JIT::privateCompileGetByIdProtoList): 43 (JSC::JIT::privateCompileGetByIdChainList): 44 (JSC::JIT::privateCompileGetByIdChain): 45 * jit/SpecializedThunkJIT.h: 46 (JSC::SpecializedThunkJIT::finalize): 47 * yarr/YarrJIT.cpp: 48 (JSC::Yarr::YarrGenerator::compile): 49 1 50 2011-04-29 Gavin Barraclough <barraclough@apple.com> 2 51 -
trunk/Source/JavaScriptCore/assembler/LinkBuffer.h
r83916 r85372 71 71 // First, executablePool is copied into m_executablePool, then the initialization of 72 72 // m_code uses m_executablePool, *not* executablePool, since this is no longer valid. 73 // The linkOffset parameter should only be non-null when recompiling for exception info 74 LinkBuffer(MacroAssembler* masm, PassRefPtr<ExecutablePool> executablePool, void* linkOffset) 73 LinkBuffer(MacroAssembler* masm, PassRefPtr<ExecutablePool> executablePool) 75 74 : m_executablePool(executablePool) 76 75 , m_size(0) … … 81 80 #endif 82 81 { 83 linkCode( linkOffset);82 linkCode(); 84 83 } 85 84 … … 207 206 } 208 207 209 void linkCode(void* linkOffset) 210 { 211 UNUSED_PARAM(linkOffset); 208 void linkCode() 209 { 212 210 ASSERT(!m_code); 213 211 #if !ENABLE(BRANCH_COMPACTION) … … 222 220 uint8_t* inData = (uint8_t*)m_assembler->unlinkedCode(); 223 221 uint8_t* outData = reinterpret_cast<uint8_t*>(m_code); 224 const uint8_t* linkBase = linkOffset ? reinterpret_cast<uint8_t*>(linkOffset) : outData;225 222 int readPtr = 0; 226 223 int writePtr = 0; … … 242 239 const uint8_t* target; 243 240 if (jumpsToLink[i].to() >= jumpsToLink[i].from()) 244 target = linkBase+ jumpsToLink[i].to() - offset; // Compensate for what we have collapsed so far241 target = outData + jumpsToLink[i].to() - offset; // Compensate for what we have collapsed so far 245 242 else 246 target = linkBase+ jumpsToLink[i].to() - m_assembler->executableOffsetFor(jumpsToLink[i].to());243 target = outData + jumpsToLink[i].to() - m_assembler->executableOffsetFor(jumpsToLink[i].to()); 247 244 248 JumpLinkType jumpLinkType = m_assembler->computeJumpType(jumpsToLink[i], linkBase+ writePtr, target);245 JumpLinkType jumpLinkType = m_assembler->computeJumpType(jumpsToLink[i], outData + writePtr, target); 249 246 // Compact branch if we can... 250 247 if (m_assembler->canCompact(jumpsToLink[i].type())) { … … 262 259 m_assembler->recordLinkOffsets(readPtr, m_assembler->size(), readPtr - writePtr); 263 260 264 // Actually link everything (don't link if we've be given a linkoffset as it's a 265 // waste of time: linkOffset is used for recompiling to get exception info) 266 if (!linkOffset) { 267 for (unsigned i = 0; i < jumpCount; ++i) { 268 uint8_t* location = outData + jumpsToLink[i].from(); 269 uint8_t* target = outData + jumpsToLink[i].to() - m_assembler->executableOffsetFor(jumpsToLink[i].to()); 270 m_assembler->link(jumpsToLink[i], location, target); 271 } 261 for (unsigned i = 0; i < jumpCount; ++i) { 262 uint8_t* location = outData + jumpsToLink[i].from(); 263 uint8_t* target = outData + jumpsToLink[i].to() - m_assembler->executableOffsetFor(jumpsToLink[i].to()); 264 m_assembler->link(jumpsToLink[i], location, target); 272 265 } 273 266 -
trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
r85271 r85372 351 351 // Link the code, populate data in CodeBlock data structures. 352 352 353 LinkBuffer linkBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()) , 0);353 LinkBuffer linkBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size())); 354 354 355 355 #if DFG_DEBUG_VERBOSE -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r84063 r85372 69 69 } 70 70 71 JIT::JIT(JSGlobalData* globalData, CodeBlock* codeBlock , void* linkerOffset)71 JIT::JIT(JSGlobalData* globalData, CodeBlock* codeBlock) 72 72 : m_interpreter(globalData->interpreter) 73 73 , m_globalData(globalData) … … 87 87 , m_jumpTargetsPosition(0) 88 88 #endif 89 , m_linkerOffset(linkerOffset)90 89 { 91 90 } … … 514 513 ASSERT(m_jmpTable.isEmpty()); 515 514 516 LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()) , m_linkerOffset);515 LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size())); 517 516 518 517 // Translate vPC offsets into addresses in JIT generated code, for switch tables. -
trunk/Source/JavaScriptCore/jit/JIT.h
r84052 r85372 179 179 180 180 public: 181 static JITCode compile(JSGlobalData* globalData, CodeBlock* codeBlock, CodePtr* functionEntryArityCheck = 0 , void* offsetBase = 0)182 { 183 return JIT(globalData, codeBlock , offsetBase).privateCompile(functionEntryArityCheck);181 static JITCode compile(JSGlobalData* globalData, CodeBlock* codeBlock, CodePtr* functionEntryArityCheck = 0) 182 { 183 return JIT(globalData, codeBlock).privateCompile(functionEntryArityCheck); 184 184 } 185 185 … … 222 222 if (!globalData->canUseJIT()) 223 223 return; 224 JIT jit(globalData, 0 , 0);224 JIT jit(globalData, 0); 225 225 jit.privateCompileCTIMachineTrampolines(executablePool, globalData, trampolines); 226 226 } … … 230 230 if (!globalData->canUseJIT()) 231 231 return CodePtr(); 232 JIT jit(globalData, 0 , 0);232 JIT jit(globalData, 0); 233 233 return jit.privateCompileCTINativeCall(executablePool, globalData, func); 234 234 } … … 259 259 }; 260 260 261 JIT(JSGlobalData*, CodeBlock* = 0 , void* = 0);261 JIT(JSGlobalData*, CodeBlock* = 0); 262 262 263 263 void privateCompileMainPass(); … … 994 994 #endif 995 995 #endif 996 void* m_linkerOffset;997 996 static CodePtr stringGetByValStubGenerator(JSGlobalData* globalData, ExecutablePool* pool); 998 997 } JIT_CLASS_ALIGNMENT; -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r84399 r85372 159 159 160 160 // All trampolines constructed! copy the code, link up calls, and set the pointers on the Machine object. 161 LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()) , 0);161 LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size())); 162 162 163 163 #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r84402 r85372 160 160 161 161 // All trampolines constructed! copy the code, link up calls, and set the pointers on the Machine object. 162 LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size()) , 0);162 LinkBuffer patchBuffer(this, m_globalData->executableAllocator.poolForSize(m_assembler.size())); 163 163 164 164 #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) … … 465 465 466 466 // All trampolines constructed! copy the code, link up calls, and set the pointers on the Machine object. 467 LinkBuffer patchBuffer(this, executablePool , 0);467 LinkBuffer patchBuffer(this, executablePool); 468 468 469 469 patchBuffer.link(nativeCall, FunctionPtr(func)); -
trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
r85240 r85372 78 78 jit.ret(); 79 79 80 LinkBuffer patchBuffer(&jit, pool , 0);80 LinkBuffer patchBuffer(&jit, pool); 81 81 return patchBuffer.finalizeCode().m_code; 82 82 } … … 602 602 Call failureCall = tailRecursiveCall(); 603 603 604 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);604 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 605 605 606 606 patchBuffer.link(failureCall, FunctionPtr(direct ? cti_op_put_by_id_direct_fail : cti_op_put_by_id_fail)); … … 680 680 Jump success = jump(); 681 681 682 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);682 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 683 683 684 684 // Use the patch information to link the failure cases back to the original slow case routine. … … 738 738 compileGetDirectOffset(protoObject, regT0, cachedOffset); 739 739 Jump success = jump(); 740 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);740 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 741 741 742 742 // Use the patch information to link the failure cases back to the original slow case routine. … … 791 791 Jump success = jump(); 792 792 793 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);793 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 794 794 795 795 if (needsStubLink) { … … 856 856 Jump success = jump(); 857 857 858 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);858 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 859 859 860 860 if (needsStubLink) { … … 922 922 Jump success = jump(); 923 923 924 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);924 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 925 925 926 926 if (needsStubLink) { … … 990 990 Jump success = jump(); 991 991 992 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);992 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 993 993 994 994 if (needsStubLink) { -
trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
r85240 r85372 296 296 jit.ret(); 297 297 298 LinkBuffer patchBuffer(&jit, pool , 0);298 LinkBuffer patchBuffer(&jit, pool); 299 299 return patchBuffer.finalizeCode().m_code; 300 300 } … … 625 625 Call failureCall = tailRecursiveCall(); 626 626 627 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);627 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 628 628 629 629 patchBuffer.link(failureCall, FunctionPtr(direct ? cti_op_put_by_id_direct_fail : cti_op_put_by_id_fail)); … … 707 707 Jump success = jump(); 708 708 709 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);709 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 710 710 711 711 // Use the patch information to link the failure cases back to the original slow case routine. … … 767 767 Jump success = jump(); 768 768 769 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);769 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 770 770 771 771 // Use the patch information to link the failure cases back to the original slow case routine. … … 824 824 Jump success = jump(); 825 825 826 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);826 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 827 827 if (needsStubLink) { 828 828 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { … … 888 888 Jump success = jump(); 889 889 890 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);890 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 891 891 if (needsStubLink) { 892 892 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { … … 955 955 Jump success = jump(); 956 956 957 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);957 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 958 958 if (needsStubLink) { 959 959 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { … … 1022 1022 Jump success = jump(); 1023 1023 1024 LinkBuffer patchBuffer(this, m_codeBlock->executablePool() , 0);1024 LinkBuffer patchBuffer(this, m_codeBlock->executablePool()); 1025 1025 if (needsStubLink) { 1026 1026 for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) { -
trunk/Source/JavaScriptCore/jit/SpecializedThunkJIT.h
r82130 r85372 126 126 MacroAssemblerCodePtr finalize(MacroAssemblerCodePtr fallback) 127 127 { 128 LinkBuffer patchBuffer(this, m_pool.get() , 0);128 LinkBuffer patchBuffer(this, m_pool.get()); 129 129 patchBuffer.link(m_failures, CodeLocationLabel(fallback)); 130 130 return patchBuffer.finalizeCode().m_code; -
trunk/Source/JavaScriptCore/yarr/YarrJIT.cpp
r84846 r85372 2250 2250 generate(); 2251 2251 2252 LinkBuffer patchBuffer(this, globalData->regexAllocator.poolForSize(size()) , 0);2252 LinkBuffer patchBuffer(this, globalData->regexAllocator.poolForSize(size())); 2253 2253 2254 2254 for (unsigned i = 0; i < m_expressionState.m_backtrackRecords.size(); ++i)
Note: See TracChangeset
for help on using the changeset viewer.