Changeset 251903 in webkit
- Timestamp:
- Oct 31, 2019 8:22:18 PM (4 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r251894 r251903 1 2019-10-31 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Remove metadata(CallFrame*) accessor 4 https://bugs.webkit.org/show_bug.cgi?id=203712 5 6 Reviewed by Tadeu Zagallo. 7 8 We should pass CodeBlock* explicitly to remove unnecessary use of CallFrame*, which is very error-prone. 9 10 * dfg/DFGOSREntry.cpp: 11 (JSC::DFG::prepareCatchOSREntry): 12 * dfg/DFGOSREntry.h: 13 * generator/Metadata.rb: 14 * jit/JITOperations.cpp: 15 1 16 2019-10-31 Tadeu Zagallo <tzagallo@apple.com> 2 17 -
trunk/Source/JavaScriptCore/dfg/DFGOSREntry.cpp
r251468 r251903 330 330 } 331 331 332 MacroAssemblerCodePtr<ExceptionHandlerPtrTag> prepareCatchOSREntry(VM& vm, CallFrame* callFrame, CodeBlock* codeBlock, BytecodeIndex bytecodeIndex)332 MacroAssemblerCodePtr<ExceptionHandlerPtrTag> prepareCatchOSREntry(VM& vm, CallFrame* callFrame, CodeBlock* baselineCodeBlock, CodeBlock* optimizedCodeBlock, BytecodeIndex bytecodeIndex) 333 333 { 334 ASSERT( codeBlock->jitType() == JITType::DFGJIT || codeBlock->jitType() == JITType::FTLJIT);335 ASSERT( codeBlock->jitCode()->dfgCommon()->isStillValid);336 337 if (!Options::useOSREntryToDFG() && codeBlock->jitCode()->jitType() == JITType::DFGJIT)338 return nullptr; 339 if (!Options::useOSREntryToFTL() && codeBlock->jitCode()->jitType() == JITType::FTLJIT)340 return nullptr; 341 342 CommonData* dfgCommon = codeBlock->jitCode()->dfgCommon();334 ASSERT(optimizedCodeBlock->jitType() == JITType::DFGJIT || optimizedCodeBlock->jitType() == JITType::FTLJIT); 335 ASSERT(optimizedCodeBlock->jitCode()->dfgCommon()->isStillValid); 336 337 if (!Options::useOSREntryToDFG() && optimizedCodeBlock->jitCode()->jitType() == JITType::DFGJIT) 338 return nullptr; 339 if (!Options::useOSREntryToFTL() && optimizedCodeBlock->jitCode()->jitType() == JITType::FTLJIT) 340 return nullptr; 341 342 CommonData* dfgCommon = optimizedCodeBlock->jitCode()->dfgCommon(); 343 343 RELEASE_ASSERT(dfgCommon); 344 344 DFG::CatchEntrypointData* catchEntrypoint = dfgCommon->catchOSREntryDataForBytecodeIndex(bytecodeIndex); … … 381 381 return nullptr; 382 382 383 auto instruction = callFrame->codeBlock()->instructions().at(callFrame->bytecodeIndex());383 auto instruction = baselineCodeBlock->instructions().at(callFrame->bytecodeIndex()); 384 384 ASSERT(instruction->is<OpCatch>()); 385 ValueProfileAndOperandBuffer* buffer = instruction->as<OpCatch>().metadata( callFrame).m_buffer;385 ValueProfileAndOperandBuffer* buffer = instruction->as<OpCatch>().metadata(baselineCodeBlock).m_buffer; 386 386 JSValue* dataBuffer = reinterpret_cast<JSValue*>(dfgCommon->catchOSREntryBuffer->dataBuffer()); 387 387 unsigned index = 0; -
trunk/Source/JavaScriptCore/dfg/DFGOSREntry.h
r251468 r251903 85 85 86 86 // If null is returned, we can't OSR enter. If it's not null, it's the PC to jump to. 87 MacroAssemblerCodePtr<ExceptionHandlerPtrTag> prepareCatchOSREntry(VM&, CallFrame*, CodeBlock* , BytecodeIndex);87 MacroAssemblerCodePtr<ExceptionHandlerPtrTag> prepareCatchOSREntry(VM&, CallFrame*, CodeBlock* baselineCodeBlock, CodeBlock* optimizedCodeBlock, BytecodeIndex); 88 88 #else 89 89 inline MacroAssemblerCodePtr<ExceptionHandlerPtrTag> prepareOSREntry(VM&, CallFrame*, CodeBlock*, BytecodeIndex) { return nullptr; } -
trunk/Source/JavaScriptCore/generator/Metadata.rb
r251425 r251903 84 84 return codeBlock->metadata<Metadata>(opcodeID, #{Metadata.field_name}); 85 85 } 86 87 Metadata& metadata(CallFrame* callFrame) const88 {89 return metadata(callFrame->codeBlock());90 }91 86 EOF 92 87 end -
trunk/Source/JavaScriptCore/jit/JITOperations.cpp
r251518 r251903 1733 1733 BytecodeIndex bytecodeIndex = BytecodeIndex::fromBits(bytecodeIndexBits); 1734 1734 1735 CodeBlock* optimizedReplacement = callFrame->codeBlock()->replacement();1736 if (UNLIKELY(!optimizedReplacement))1737 return nullptr;1738 1739 switch (optimizedReplacement->jitType()) {1740 case JITType::DFGJIT:1741 case JITType::FTLJIT: {1742 MacroAssemblerCodePtr<ExceptionHandlerPtrTag> entry = DFG::prepareCatchOSREntry(vm, callFrame, optimizedReplacement, bytecodeIndex);1743 return entry.executableAddress<char*>();1744 }1745 default:1746 break;1747 }1748 return nullptr;1749 }1750 1751 char* JIT_OPERATION operationTryOSREnterAtCatchAndValueProfile(VM* vmPointer, uint32_t bytecodeIndexBits)1752 {1753 VM& vm = *vmPointer;1754 CallFrame* callFrame = DECLARE_CALL_FRAME(vm);1755 JITOperationPrologueCallFrameTracer tracer(vm, callFrame);1756 BytecodeIndex bytecodeIndex = BytecodeIndex::fromBits(bytecodeIndexBits);1757 1758 1735 CodeBlock* codeBlock = callFrame->codeBlock(); 1759 1736 CodeBlock* optimizedReplacement = codeBlock->replacement(); … … 1764 1741 case JITType::DFGJIT: 1765 1742 case JITType::FTLJIT: { 1766 MacroAssemblerCodePtr<ExceptionHandlerPtrTag> entry = DFG::prepareCatchOSREntry(vm, callFrame, optimizedReplacement, bytecodeIndex); 1743 MacroAssemblerCodePtr<ExceptionHandlerPtrTag> entry = DFG::prepareCatchOSREntry(vm, callFrame, codeBlock, optimizedReplacement, bytecodeIndex); 1744 return entry.executableAddress<char*>(); 1745 } 1746 default: 1747 break; 1748 } 1749 return nullptr; 1750 } 1751 1752 char* JIT_OPERATION operationTryOSREnterAtCatchAndValueProfile(VM* vmPointer, uint32_t bytecodeIndexBits) 1753 { 1754 VM& vm = *vmPointer; 1755 CallFrame* callFrame = DECLARE_CALL_FRAME(vm); 1756 JITOperationPrologueCallFrameTracer tracer(vm, callFrame); 1757 BytecodeIndex bytecodeIndex = BytecodeIndex::fromBits(bytecodeIndexBits); 1758 1759 CodeBlock* codeBlock = callFrame->codeBlock(); 1760 CodeBlock* optimizedReplacement = codeBlock->replacement(); 1761 if (UNLIKELY(!optimizedReplacement)) 1762 return nullptr; 1763 1764 switch (optimizedReplacement->jitType()) { 1765 case JITType::DFGJIT: 1766 case JITType::FTLJIT: { 1767 MacroAssemblerCodePtr<ExceptionHandlerPtrTag> entry = DFG::prepareCatchOSREntry(vm, callFrame, codeBlock, optimizedReplacement, bytecodeIndex); 1767 1768 return entry.executableAddress<char*>(); 1768 1769 }
Note: See TracChangeset
for help on using the changeset viewer.