Changeset 230865 in webkit
- Timestamp:
- Apr 20, 2018 4:30:05 PM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r230858 r230865 1 2018-04-20 Mark Lam <mark.lam@apple.com> 2 3 Some JSEntryPtrTags should actually be JSInternalPtrTags. 4 https://bugs.webkit.org/show_bug.cgi?id=184712 5 <rdar://problem/39507381> 6 7 Reviewed by Michael Saboff. 8 9 1. Convert some uses of JSEntryPtrTag into JSInternalPtrTags. 10 2. Tag all LLInt bytecodes consistently with BytecodePtrTag now and retag them 11 only when needed. 12 13 * bytecode/AccessCase.cpp: 14 (JSC::AccessCase::generateImpl): 15 * bytecode/ByValInfo.h: 16 (JSC::ByValInfo::ByValInfo): 17 * bytecode/CallLinkInfo.cpp: 18 (JSC::CallLinkInfo::callReturnLocation): 19 (JSC::CallLinkInfo::patchableJump): 20 (JSC::CallLinkInfo::hotPathBegin): 21 (JSC::CallLinkInfo::slowPathStart): 22 * bytecode/CallLinkInfo.h: 23 (JSC::CallLinkInfo::setCallLocations): 24 (JSC::CallLinkInfo::hotPathOther): 25 * bytecode/PolymorphicAccess.cpp: 26 (JSC::PolymorphicAccess::regenerate): 27 * bytecode/StructureStubInfo.h: 28 (JSC::StructureStubInfo::doneLocation): 29 * dfg/DFGJITCompiler.cpp: 30 (JSC::DFG::JITCompiler::link): 31 * dfg/DFGOSRExit.cpp: 32 (JSC::DFG::reifyInlinedCallFrames): 33 * ftl/FTLLazySlowPath.cpp: 34 (JSC::FTL::LazySlowPath::initialize): 35 * ftl/FTLLazySlowPath.h: 36 (JSC::FTL::LazySlowPath::done const): 37 * ftl/FTLLowerDFGToB3.cpp: 38 (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct): 39 (JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct): 40 (JSC::FTL::DFG::LowerDFGToB3::compileTailCall): 41 (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread): 42 (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs): 43 (JSC::FTL::DFG::LowerDFGToB3::compileIn): 44 (JSC::FTL::DFG::LowerDFGToB3::lazySlowPath): 45 * jit/JIT.cpp: 46 (JSC::JIT::link): 47 * jit/JITExceptions.cpp: 48 (JSC::genericUnwind): 49 * jit/JITMathIC.h: 50 (JSC::isProfileEmpty): 51 * llint/LLIntData.cpp: 52 (JSC::LLInt::initialize): 53 * llint/LLIntData.h: 54 (JSC::LLInt::getCodePtr): 55 (JSC::LLInt::getExecutableAddress): Deleted. 56 * llint/LLIntExceptions.cpp: 57 (JSC::LLInt::callToThrow): 58 * llint/LLIntSlowPaths.cpp: 59 (JSC::LLInt::LLINT_SLOW_PATH_DECL): 60 * wasm/js/WasmToJS.cpp: 61 (JSC::Wasm::wasmToJS): 62 1 63 2018-04-18 Jer Noble <jer.noble@apple.com> 2 64 -
trunk/Source/JavaScriptCore/bytecode/AccessCase.cpp
r230748 r230865 819 819 jit.addLinkTask([=, &vm] (LinkBuffer& linkBuffer) { 820 820 this->as<GetterSetterAccessCase>().callLinkInfo()->setCallLocations( 821 CodeLocationLabel<JS EntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowPathCall)),822 CodeLocationLabel<JS EntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(addressOfLinkFunctionCheck)),823 linkBuffer.locationOfNearCall<JS EntryPtrTag>(fastPathCall));821 CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowPathCall)), 822 CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(addressOfLinkFunctionCheck)), 823 linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastPathCall)); 824 824 825 825 linkBuffer.link( -
trunk/Source/JavaScriptCore/bytecode/ByValInfo.h
r230748 r230865 227 227 ByValInfo() { } 228 228 229 ByValInfo(unsigned bytecodeIndex, CodeLocationJump<JS EntryPtrTag> notIndexJump, CodeLocationJump<JSEntryPtrTag> badTypeJump, CodeLocationLabel<ExceptionHandlerPtrTag> exceptionHandler, JITArrayMode arrayMode, ArrayProfile* arrayProfile, int16_t badTypeJumpToDone, int16_t badTypeJumpToNextHotPath, int16_t returnAddressToSlowPath)229 ByValInfo(unsigned bytecodeIndex, CodeLocationJump<JSInternalPtrTag> notIndexJump, CodeLocationJump<JSInternalPtrTag> badTypeJump, CodeLocationLabel<ExceptionHandlerPtrTag> exceptionHandler, JITArrayMode arrayMode, ArrayProfile* arrayProfile, int16_t badTypeJumpToDone, int16_t badTypeJumpToNextHotPath, int16_t returnAddressToSlowPath) 230 230 : bytecodeIndex(bytecodeIndex) 231 231 , notIndexJump(notIndexJump) … … 245 245 246 246 unsigned bytecodeIndex; 247 CodeLocationJump<JS EntryPtrTag> notIndexJump;248 CodeLocationJump<JS EntryPtrTag> badTypeJump;247 CodeLocationJump<JSInternalPtrTag> notIndexJump; 248 CodeLocationJump<JSInternalPtrTag> badTypeJump; 249 249 CodeLocationLabel<ExceptionHandlerPtrTag> exceptionHandler; 250 250 JITArrayMode arrayMode; // The array mode that was baked into the inline JIT code. -
trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp
r230748 r230865 98 98 } 99 99 100 CodeLocationNearCall<JS EntryPtrTag> CallLinkInfo::callReturnLocation()101 { 102 RELEASE_ASSERT(!isDirect()); 103 return CodeLocationNearCall<JS EntryPtrTag>(m_callReturnLocationOrPatchableJump, Regular);104 } 105 106 CodeLocationJump<JS EntryPtrTag> CallLinkInfo::patchableJump()100 CodeLocationNearCall<JSInternalPtrTag> CallLinkInfo::callReturnLocation() 101 { 102 RELEASE_ASSERT(!isDirect()); 103 return CodeLocationNearCall<JSInternalPtrTag>(m_callReturnLocationOrPatchableJump, Regular); 104 } 105 106 CodeLocationJump<JSInternalPtrTag> CallLinkInfo::patchableJump() 107 107 { 108 108 RELEASE_ASSERT(callType() == DirectTailCall); 109 return CodeLocationJump<JS EntryPtrTag>(m_callReturnLocationOrPatchableJump);110 } 111 112 CodeLocationDataLabelPtr<JS EntryPtrTag> CallLinkInfo::hotPathBegin()113 { 114 RELEASE_ASSERT(!isDirect()); 115 return CodeLocationDataLabelPtr<JS EntryPtrTag>(m_hotPathBeginOrSlowPathStart);116 } 117 118 CodeLocationLabel<JS EntryPtrTag> CallLinkInfo::slowPathStart()109 return CodeLocationJump<JSInternalPtrTag>(m_callReturnLocationOrPatchableJump); 110 } 111 112 CodeLocationDataLabelPtr<JSInternalPtrTag> CallLinkInfo::hotPathBegin() 113 { 114 RELEASE_ASSERT(!isDirect()); 115 return CodeLocationDataLabelPtr<JSInternalPtrTag>(m_hotPathBeginOrSlowPathStart); 116 } 117 118 CodeLocationLabel<JSInternalPtrTag> CallLinkInfo::slowPathStart() 119 119 { 120 120 RELEASE_ASSERT(isDirect()); -
trunk/Source/JavaScriptCore/bytecode/CallLinkInfo.h
r230748 r230865 166 166 167 167 void setCallLocations( 168 CodeLocationLabel<JS EntryPtrTag> callReturnLocationOrPatchableJump,169 CodeLocationLabel<JS EntryPtrTag> hotPathBeginOrSlowPathStart,170 CodeLocationNearCall<JS EntryPtrTag> hotPathOther)168 CodeLocationLabel<JSInternalPtrTag> callReturnLocationOrPatchableJump, 169 CodeLocationLabel<JSInternalPtrTag> hotPathBeginOrSlowPathStart, 170 CodeLocationNearCall<JSInternalPtrTag> hotPathOther) 171 171 { 172 172 m_callReturnLocationOrPatchableJump = callReturnLocationOrPatchableJump; … … 182 182 } 183 183 184 CodeLocationNearCall<JS EntryPtrTag> callReturnLocation();185 CodeLocationJump<JS EntryPtrTag> patchableJump();186 CodeLocationDataLabelPtr<JS EntryPtrTag> hotPathBegin();187 CodeLocationLabel<JS EntryPtrTag> slowPathStart();188 189 CodeLocationNearCall<JS EntryPtrTag> hotPathOther()184 CodeLocationNearCall<JSInternalPtrTag> callReturnLocation(); 185 CodeLocationJump<JSInternalPtrTag> patchableJump(); 186 CodeLocationDataLabelPtr<JSInternalPtrTag> hotPathBegin(); 187 CodeLocationLabel<JSInternalPtrTag> slowPathStart(); 188 189 CodeLocationNearCall<JSInternalPtrTag> hotPathOther() 190 190 { 191 191 return m_hotPathOther; … … 328 328 329 329 private: 330 // FIXME: These should be tagged with JSInternalPtrTag instead of JSEntryTag. 331 // https://bugs.webkit.org/show_bug.cgi?id=184712 332 CodeLocationLabel<JSEntryPtrTag> m_callReturnLocationOrPatchableJump; 333 CodeLocationLabel<JSEntryPtrTag> m_hotPathBeginOrSlowPathStart; 334 CodeLocationNearCall<JSEntryPtrTag> m_hotPathOther; 330 CodeLocationLabel<JSInternalPtrTag> m_callReturnLocationOrPatchableJump; 331 CodeLocationLabel<JSInternalPtrTag> m_hotPathBeginOrSlowPathStart; 332 CodeLocationNearCall<JSInternalPtrTag> m_hotPathOther; 335 333 WriteBarrier<JSCell> m_calleeOrCodeBlock; 336 334 WriteBarrier<JSCell> m_lastSeenCalleeOrExecutable; -
trunk/Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp
r230748 r230865 559 559 } 560 560 561 CodeLocationLabel<JS EntryPtrTag> successLabel = stubInfo.doneLocation();561 CodeLocationLabel<JSInternalPtrTag> successLabel = stubInfo.doneLocation(); 562 562 563 563 linkBuffer.link(state.success, successLabel); -
trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h
r230748 r230865 187 187 188 188 CodeLocationCall<JSInternalPtrTag> slowPathCallLocation() { return patch.start.callAtOffset<JSInternalPtrTag>(patch.deltaFromStartToSlowPathCallLocation); } 189 CodeLocationLabel<JS EntryPtrTag> doneLocation() { return patch.start.labelAtOffset<JSEntryPtrTag>(patch.inlineSize); }189 CodeLocationLabel<JSInternalPtrTag> doneLocation() { return patch.start.labelAtOffset<JSInternalPtrTag>(patch.inlineSize); } 190 190 CodeLocationLabel<JITStubRoutinePtrTag> slowPathStartLocation() { return patch.start.labelAtOffset(patch.deltaFromStartToSlowPathStart); } 191 191 CodeLocationJump<JSInternalPtrTag> patchableJumpForIn() -
trunk/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
r230748 r230865 293 293 linkBuffer.link(record.slowCall, linkCallThunk); 294 294 info.setCallLocations( 295 CodeLocationLabel<JS EntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(record.slowCall)),296 CodeLocationLabel<JS EntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(record.targetToCheck)),297 linkBuffer.locationOfNearCall<JS EntryPtrTag>(record.fastCall));295 CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(record.slowCall)), 296 CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(record.targetToCheck)), 297 linkBuffer.locationOfNearCall<JSInternalPtrTag>(record.fastCall)); 298 298 } 299 299 … … 302 302 linkBuffer.link(record.call, linkBuffer.locationOf<NoPtrTag>(record.slowPath)); 303 303 info.setCallLocations( 304 CodeLocationLabel<JS EntryPtrTag>(),305 linkBuffer.locationOf<JS EntryPtrTag>(record.slowPath),306 linkBuffer.locationOfNearCall<JS EntryPtrTag>(record.call));304 CodeLocationLabel<JSInternalPtrTag>(), 305 linkBuffer.locationOf<JSInternalPtrTag>(record.slowPath), 306 linkBuffer.locationOfNearCall<JSInternalPtrTag>(record.call)); 307 307 } 308 308 … … 310 310 CallLinkInfo& info = *record.info; 311 311 info.setCallLocations( 312 linkBuffer.locationOf<JS EntryPtrTag>(record.patchableJump),313 linkBuffer.locationOf<JS EntryPtrTag>(record.slowPath),314 linkBuffer.locationOfNearCall<JS EntryPtrTag>(record.call));312 linkBuffer.locationOf<JSInternalPtrTag>(record.patchableJump), 313 linkBuffer.locationOf<JSInternalPtrTag>(record.slowPath), 314 linkBuffer.locationOfNearCall<JSInternalPtrTag>(record.call)); 315 315 } 316 316 -
trunk/Source/JavaScriptCore/dfg/DFGOSRExit.cpp
r230748 r230865 755 755 CodeBlock* baselineCodeBlockForCaller = baselineCodeBlockForOriginAndBaselineCodeBlock(*trueCaller, outermostBaselineCodeBlock); 756 756 unsigned callBytecodeIndex = trueCaller->bytecodeIndex; 757 void* jumpTarget = nullptr;757 MacroAssemblerCodePtr<JSInternalPtrTag> jumpTarget; 758 758 759 759 switch (trueCallerCallKind) { … … 768 768 RELEASE_ASSERT(callLinkInfo); 769 769 770 jumpTarget = callLinkInfo->callReturnLocation() .executableAddress();770 jumpTarget = callLinkInfo->callReturnLocation(); 771 771 break; 772 772 } … … 778 778 RELEASE_ASSERT(stubInfo); 779 779 780 jumpTarget = stubInfo->doneLocation() .executableAddress();780 jumpTarget = stubInfo->doneLocation(); 781 781 break; 782 782 } … … 789 789 callerFrame = cpu.fp<uint8_t*>() + trueCaller->inlineCallFrame->stackOffset * sizeof(EncodedJSValue); 790 790 791 void* targetAddress = jumpTarget.executableAddress(); 791 792 #if USE(POINTER_PROFILING) 792 793 void* newEntrySP = cpu.fp<uint8_t*>() + inlineCallFrame->returnPCOffset() + sizeof(void*); 793 jumpTarget = retagCodePtr(jumpTarget, JSEntryPtrTag, bitwise_cast<PtrTag>(newEntrySP));794 #endif 795 frame.set<void*>(inlineCallFrame->returnPCOffset(), jumpTarget);794 targetAddress = retagCodePtr(targetAddress, JSInternalPtrTag, bitwise_cast<PtrTag>(newEntrySP)); 795 #endif 796 frame.set<void*>(inlineCallFrame->returnPCOffset(), targetAddress); 796 797 } 797 798 -
trunk/Source/JavaScriptCore/ftl/FTLLazySlowPath.cpp
r230748 r230865 39 39 40 40 void LazySlowPath::initialize( 41 CodeLocationJump<JSInternalPtrTag> patchableJump, CodeLocationLabel<JS EntryPtrTag> done,41 CodeLocationJump<JSInternalPtrTag> patchableJump, CodeLocationLabel<JSInternalPtrTag> done, 42 42 CodeLocationLabel<ExceptionHandlerPtrTag> exceptionTarget, 43 43 const RegisterSet& usedRegisters, CallSiteIndex callSiteIndex, RefPtr<Generator> generator -
trunk/Source/JavaScriptCore/ftl/FTLLazySlowPath.h
r230748 r230865 70 70 71 71 void initialize( 72 CodeLocationJump<JSInternalPtrTag> patchableJump, CodeLocationLabel<JS EntryPtrTag> done,72 CodeLocationJump<JSInternalPtrTag> patchableJump, CodeLocationLabel<JSInternalPtrTag> done, 73 73 CodeLocationLabel<ExceptionHandlerPtrTag> exceptionTarget, const RegisterSet& usedRegisters, 74 74 CallSiteIndex, RefPtr<Generator> … … 76 76 77 77 CodeLocationJump<JSInternalPtrTag> patchableJump() const { return m_patchableJump; } 78 CodeLocationLabel<JS EntryPtrTag> done() const { return m_done; }78 CodeLocationLabel<JSInternalPtrTag> done() const { return m_done; } 79 79 const RegisterSet& usedRegisters() const { return m_usedRegisters; } 80 80 CallSiteIndex callSiteIndex() const { return m_callSiteIndex; } … … 86 86 private: 87 87 CodeLocationJump<JSInternalPtrTag> m_patchableJump; 88 // FIXME: This should be tagged with JSInternalPtrTag instead of JSEntryTag. 89 // https://bugs.webkit.org/show_bug.cgi?id=184712 90 CodeLocationLabel<JSEntryPtrTag> m_done; 88 CodeLocationLabel<JSInternalPtrTag> m_done; 91 89 CodeLocationLabel<ExceptionHandlerPtrTag> m_exceptionTarget; 92 90 RegisterSet m_usedRegisters; -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r230748 r230865 7173 7173 7174 7174 callLinkInfo->setCallLocations( 7175 CodeLocationLabel<JS EntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall)),7176 CodeLocationLabel<JS EntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(targetToCheck)),7177 linkBuffer.locationOfNearCall<JS EntryPtrTag>(fastCall));7175 CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall)), 7176 CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(targetToCheck)), 7177 linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall)); 7178 7178 }); 7179 7179 }); … … 7315 7315 jit.addLinkTask( 7316 7316 [=] (LinkBuffer& linkBuffer) { 7317 CodeLocationLabel<JS EntryPtrTag> patchableJumpLocation = linkBuffer.locationOf<JSEntryPtrTag>(patchableJump);7318 CodeLocationNearCall<JS EntryPtrTag> callLocation = linkBuffer.locationOfNearCall<JSEntryPtrTag>(call);7319 CodeLocationLabel<JS EntryPtrTag> slowPathLocation = linkBuffer.locationOf<JSEntryPtrTag>(slowPath);7320 7317 CodeLocationLabel<JSInternalPtrTag> patchableJumpLocation = linkBuffer.locationOf<JSInternalPtrTag>(patchableJump); 7318 CodeLocationNearCall<JSInternalPtrTag> callLocation = linkBuffer.locationOfNearCall<JSInternalPtrTag>(call); 7319 CodeLocationLabel<JSInternalPtrTag> slowPathLocation = linkBuffer.locationOf<JSInternalPtrTag>(slowPath); 7320 7321 7321 callLinkInfo->setCallLocations( 7322 7322 patchableJumpLocation, … … 7364 7364 jit.addLinkTask( 7365 7365 [=] (LinkBuffer& linkBuffer) { 7366 CodeLocationNearCall<JS EntryPtrTag> callLocation = linkBuffer.locationOfNearCall<JSEntryPtrTag>(call);7367 CodeLocationLabel<JS EntryPtrTag> slowPathLocation = linkBuffer.locationOf<JSEntryPtrTag>(slowPath);7368 7366 CodeLocationNearCall<JSInternalPtrTag> callLocation = linkBuffer.locationOfNearCall<JSInternalPtrTag>(call); 7367 CodeLocationLabel<JSInternalPtrTag> slowPathLocation = linkBuffer.locationOf<JSInternalPtrTag>(slowPath); 7368 7369 7369 linkBuffer.link(call, slowPathLocation); 7370 7370 7371 7371 callLinkInfo->setCallLocations( 7372 CodeLocationLabel<JS EntryPtrTag>(),7372 CodeLocationLabel<JSInternalPtrTag>(), 7373 7373 slowPathLocation, 7374 7374 callLocation); … … 7493 7493 7494 7494 callLinkInfo->setCallLocations( 7495 CodeLocationLabel<JS EntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall)),7496 CodeLocationLabel<JS EntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(targetToCheck)),7497 linkBuffer.locationOfNearCall<JS EntryPtrTag>(fastCall));7495 CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall)), 7496 CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(targetToCheck)), 7497 linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall)); 7498 7498 }); 7499 7499 }); … … 7791 7791 7792 7792 callLinkInfo->setCallLocations( 7793 CodeLocationLabel<JS EntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall)),7794 CodeLocationLabel<JS EntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(targetToCheck)),7795 linkBuffer.locationOfNearCall<JS EntryPtrTag>(fastCall));7793 CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall)), 7794 CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(targetToCheck)), 7795 linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall)); 7796 7796 }); 7797 7797 }); … … 8073 8073 8074 8074 callLinkInfo->setCallLocations( 8075 CodeLocationLabel<JS EntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall)),8076 CodeLocationLabel<JS EntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(targetToCheck)),8077 linkBuffer.locationOfNearCall<JS EntryPtrTag>(fastCall));8075 CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall)), 8076 CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(targetToCheck)), 8077 linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall)); 8078 8078 }); 8079 8079 }); … … 9688 9688 stubInfo->patch.start = start; 9689 9689 ptrdiff_t inlineSize = MacroAssembler::differenceBetweenCodePtr( 9690 start, linkBuffer.locationOf< JSEntryPtrTag>(done));9690 start, linkBuffer.locationOf<NoPtrTag>(done)); 9691 9691 RELEASE_ASSERT(inlineSize >= 0); 9692 9692 stubInfo->patch.inlineSize = inlineSize; 9693 9693 9694 9694 stubInfo->patch.deltaFromStartToSlowPathCallLocation = MacroAssembler::differenceBetweenCodePtr( 9695 start, linkBuffer.locationOf< JSEntryPtrTag>(slowPathCall));9695 start, linkBuffer.locationOf<NoPtrTag>(slowPathCall)); 9696 9696 9697 9697 stubInfo->patch.deltaFromStartToSlowPathStart = MacroAssembler::differenceBetweenCodePtr( 9698 start, linkBuffer.locationOf< JSEntryPtrTag>(slowPathBegin));9698 start, linkBuffer.locationOf<NoPtrTag>(slowPathBegin)); 9699 9699 9700 9700 }); … … 13985 13985 auto linkedPatchableJump = CodeLocationJump<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(patchableJump)); 13986 13986 13987 CodeLocationLabel<JS EntryPtrTag> linkedDone = linkBuffer.locationOf<JSEntryPtrTag>(done);13987 CodeLocationLabel<JSInternalPtrTag> linkedDone = linkBuffer.locationOf<JSInternalPtrTag>(done); 13988 13988 13989 13989 CallSiteIndex callSiteIndex = -
trunk/Source/JavaScriptCore/jit/JIT.cpp
r230748 r230865 836 836 for (const auto& byValCompilationInfo : m_byValCompilationInfo) { 837 837 PatchableJump patchableNotIndexJump = byValCompilationInfo.notIndexJump; 838 auto notIndexJump = CodeLocationJump<JS EntryPtrTag>();838 auto notIndexJump = CodeLocationJump<JSInternalPtrTag>(); 839 839 if (Jump(patchableNotIndexJump).isSet()) 840 notIndexJump = CodeLocationJump<JS EntryPtrTag>(patchBuffer.locationOf<JSEntryPtrTag>(patchableNotIndexJump));841 auto badTypeJump = CodeLocationJump<JS EntryPtrTag>(patchBuffer.locationOf<JSEntryPtrTag>(byValCompilationInfo.badTypeJump));840 notIndexJump = CodeLocationJump<JSInternalPtrTag>(patchBuffer.locationOf<JSInternalPtrTag>(patchableNotIndexJump)); 841 auto badTypeJump = CodeLocationJump<JSInternalPtrTag>(patchBuffer.locationOf<JSInternalPtrTag>(byValCompilationInfo.badTypeJump)); 842 842 CodeLocationLabel<NoPtrTag> doneTarget = patchBuffer.locationOf<NoPtrTag>(byValCompilationInfo.doneTarget); 843 843 CodeLocationLabel<NoPtrTag> nextHotPathTarget = patchBuffer.locationOf<NoPtrTag>(byValCompilationInfo.nextHotPathTarget); … … 861 861 CallLinkInfo& info = *compilationInfo.callLinkInfo; 862 862 info.setCallLocations( 863 CodeLocationLabel<JS EntryPtrTag>(patchBuffer.locationOfNearCall<JSEntryPtrTag>(compilationInfo.callReturnLocation)),864 CodeLocationLabel<JS EntryPtrTag>(patchBuffer.locationOf<JSEntryPtrTag>(compilationInfo.hotPathBegin)),865 patchBuffer.locationOfNearCall<JS EntryPtrTag>(compilationInfo.hotPathOther));863 CodeLocationLabel<JSInternalPtrTag>(patchBuffer.locationOfNearCall<JSInternalPtrTag>(compilationInfo.callReturnLocation)), 864 CodeLocationLabel<JSInternalPtrTag>(patchBuffer.locationOf<JSInternalPtrTag>(compilationInfo.hotPathBegin)), 865 patchBuffer.locationOfNearCall<JSInternalPtrTag>(compilationInfo.hotPathOther)); 866 866 } 867 867 -
trunk/Source/JavaScriptCore/jit/JITExceptions.cpp
r230748 r230865 83 83 #endif 84 84 } else 85 catchRoutine = LLInt::get ExecutableAddress(handleUncaughtException);85 catchRoutine = LLInt::getCodePtr<ExceptionHandlerPtrTag>(handleUncaughtException).executableAddress(); 86 86 87 87 ASSERT(bitwise_cast<uintptr_t>(callFrame) < bitwise_cast<uintptr_t>(vm->topEntryFrame)); -
trunk/Source/JavaScriptCore/jit/JITMathIC.h
r230748 r230865 63 63 } 64 64 65 // FIXME: These should be tagged with JSInternalPtrTag instead of JSEntryTag. 66 // https://bugs.webkit.org/show_bug.cgi?id=184712 67 CodeLocationLabel<JSEntryPtrTag> doneLocation() { return m_inlineStart.labelAtOffset(m_inlineSize); } 68 CodeLocationLabel<JSEntryPtrTag> slowPathStartLocation() { return m_inlineStart.labelAtOffset(m_deltaFromStartToSlowPathStart); } 69 CodeLocationCall<JSEntryPtrTag> slowPathCallLocation() { return m_inlineStart.callAtOffset(m_deltaFromStartToSlowPathCallLocation); } 65 CodeLocationLabel<JSInternalPtrTag> doneLocation() { return m_inlineStart.labelAtOffset(m_inlineSize); } 66 CodeLocationLabel<JSInternalPtrTag> slowPathStartLocation() { return m_inlineStart.labelAtOffset(m_deltaFromStartToSlowPathStart); } 67 CodeLocationCall<JSInternalPtrTag> slowPathCallLocation() { return m_inlineStart.callAtOffset(m_deltaFromStartToSlowPathCallLocation); } 70 68 71 69 bool generateInline(CCallHelpers& jit, MathICGenerationState& state, bool shouldEmitProfiling = true) … … 224 222 void finalizeInlineCode(const MathICGenerationState& state, LinkBuffer& linkBuffer) 225 223 { 226 CodeLocationLabel<JS EntryPtrTag> start = linkBuffer.locationOf<JSEntryPtrTag>(state.fastPathStart);224 CodeLocationLabel<JSInternalPtrTag> start = linkBuffer.locationOf<JSInternalPtrTag>(state.fastPathStart); 227 225 m_inlineStart = start; 228 226 … … 254 252 Instruction* m_instruction; 255 253 MacroAssemblerCodeRef<JITStubRoutinePtrTag> m_code; 256 // FIXME: These should be tagged with JSInternalPtrTag instead of JSEntryTag. 257 // https://bugs.webkit.org/show_bug.cgi?id=184712 258 CodeLocationLabel<JSEntryPtrTag> m_inlineStart; 254 CodeLocationLabel<JSInternalPtrTag> m_inlineStart; 259 255 int32_t m_inlineSize; 260 256 int32_t m_deltaFromStartToSlowPathCallLocation; -
trunk/Source/JavaScriptCore/llint/LLIntData.cpp
r230748 r230865 59 59 llint_entry(&Data::s_opcodeMap); 60 60 61 for (int i = 0; i < NUMBER_OF_BYTECODE_IDS; ++i)61 for (int i = 0; i < numOpcodeIDs; ++i) 62 62 Data::s_opcodeMap[i] = tagCodePtr(Data::s_opcodeMap[i], BytecodePtrTag); 63 63 64 static const PtrTag tagsForOpcode[] = { 65 // FIXME: These should be tagged with JSInternalPtrTag instead of JSEntryTag. 66 // https://bugs.webkit.org/show_bug.cgi?id=184712 67 JSEntryPtrTag, // llint_program_prologue 68 JSEntryPtrTag, // llint_eval_prologue 69 JSEntryPtrTag, // llint_module_program_prologue 70 JSEntryPtrTag, // llint_function_for_call_prologue 71 JSEntryPtrTag, // llint_function_for_construct_prologue 72 JSEntryPtrTag, // llint_function_for_call_arity_check 73 JSEntryPtrTag, // llint_function_for_construct_arity_check 74 JSEntryPtrTag, // llint_generic_return_point 75 BytecodePtrTag, // llint_throw_from_slow_path_trampoline 76 ExceptionHandlerPtrTag, // llint_throw_during_call_trampoline 77 JSEntryPtrTag, // llint_native_call_trampoline 78 JSEntryPtrTag, // llint_native_construct_trampoline 79 JSEntryPtrTag, // llint_internal_function_call_trampoline 80 JSEntryPtrTag, // llint_internal_function_construct_trampoline 81 ExceptionHandlerPtrTag, // handleUncaughtException 82 }; 83 84 static_assert(sizeof(tagsForOpcode) / sizeof(tagsForOpcode[0]) == NUMBER_OF_BYTECODE_HELPER_IDS, ""); 85 static_assert(static_cast<uintptr_t>(llint_program_prologue) == NUMBER_OF_BYTECODE_IDS, ""); 86 87 for (int i = 0; i < NUMBER_OF_BYTECODE_HELPER_IDS; ++i) { 88 int opcodeID = i + NUMBER_OF_BYTECODE_IDS; 89 Data::s_opcodeMap[opcodeID] = tagCodePtr(Data::s_opcodeMap[opcodeID], tagsForOpcode[i]); 90 } 91 92 void* handler = LLInt::getExecutableAddress(llint_throw_from_slow_path_trampoline); 64 void* handler = Data::s_opcodeMap[llint_throw_from_slow_path_trampoline]; 93 65 for (int i = 0; i < maxOpcodeLength + 1; ++i) 94 66 Data::s_exceptionInstructions[i].u.pointer = handler; 95 96 67 #endif // ENABLE(JIT) 97 68 } -
trunk/Source/JavaScriptCore/llint/LLIntData.h
r230748 r230865 81 81 } 82 82 83 ALWAYS_INLINE void* getExecutableAddress(OpcodeID opcodeID)84 {85 ASSERT(opcodeID >= NUMBER_OF_BYTECODE_IDS);86 return reinterpret_cast<void*>(getOpcode(opcodeID));87 }88 89 83 template<PtrTag tag> 90 84 ALWAYS_INLINE MacroAssemblerCodePtr<tag> getCodePtr(OpcodeID opcodeID) 91 85 { 92 return MacroAssemblerCodePtr<tag>::createFromExecutableAddress(getOpcode(opcodeID)); 86 void* address = getOpcode(opcodeID); 87 address = retagCodePtr<BytecodePtrTag, tag>(address); 88 return MacroAssemblerCodePtr<tag>::createFromExecutableAddress(address); 93 89 } 94 90 -
trunk/Source/JavaScriptCore/llint/LLIntExceptions.cpp
r230748 r230865 59 59 dataLog("Throwing exception ", JSValue(scope.exception()), " (callToThrow).\n"); 60 60 #endif 61 return LLInt::get ExecutableAddress(llint_throw_during_call_trampoline);61 return LLInt::getCodePtr<ExceptionHandlerPtrTag>(llint_throw_during_call_trampoline).executableAddress(); 62 62 } 63 63 -
trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
r230748 r230865 1637 1637 execCallee->setCallerFrame(exec); 1638 1638 execCallee->uncheckedR(CallFrameSlot::callee) = calleeAsValue; 1639 execCallee->setReturnPC(LLInt::get ExecutableAddress(llint_generic_return_point));1639 execCallee->setReturnPC(LLInt::getCodePtr<JSEntryPtrTag>(llint_generic_return_point).executableAddress()); 1640 1640 execCallee->setCodeBlock(0); 1641 1641 exec->setCurrentVPC(pc); -
trunk/Source/JavaScriptCore/wasm/js/WasmToJS.cpp
r230748 r230865 655 655 656 656 patchBuffer.link(slowCall, FunctionPtr<JITThunkPtrTag>(vm->getCTIStub(linkCallThunkGenerator).code())); 657 CodeLocationLabel<JS EntryPtrTag> callReturnLocation(patchBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall));658 CodeLocationLabel<JS EntryPtrTag> hotPathBegin(patchBuffer.locationOf<JSEntryPtrTag>(targetToCheck));659 CodeLocationNearCall<JS EntryPtrTag> hotPathOther = patchBuffer.locationOfNearCall<JSEntryPtrTag>(fastCall);657 CodeLocationLabel<JSInternalPtrTag> callReturnLocation(patchBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall)); 658 CodeLocationLabel<JSInternalPtrTag> hotPathBegin(patchBuffer.locationOf<JSInternalPtrTag>(targetToCheck)); 659 CodeLocationNearCall<JSInternalPtrTag> hotPathOther = patchBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall); 660 660 callLinkInfo->setCallLocations(callReturnLocation, hotPathBegin, hotPathOther); 661 661
Note: See TracChangeset
for help on using the changeset viewer.