Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (230864 => 230865)
--- trunk/Source/_javascript_Core/ChangeLog 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/ChangeLog 2018-04-20 23:30:05 UTC (rev 230865)
@@ -1,3 +1,65 @@
+2018-04-20 Mark Lam <mark....@apple.com>
+
+ Some JSEntryPtrTags should actually be JSInternalPtrTags.
+ https://bugs.webkit.org/show_bug.cgi?id=184712
+ <rdar://problem/39507381>
+
+ Reviewed by Michael Saboff.
+
+ 1. Convert some uses of JSEntryPtrTag into JSInternalPtrTags.
+ 2. Tag all LLInt bytecodes consistently with BytecodePtrTag now and retag them
+ only when needed.
+
+ * bytecode/AccessCase.cpp:
+ (JSC::AccessCase::generateImpl):
+ * bytecode/ByValInfo.h:
+ (JSC::ByValInfo::ByValInfo):
+ * bytecode/CallLinkInfo.cpp:
+ (JSC::CallLinkInfo::callReturnLocation):
+ (JSC::CallLinkInfo::patchableJump):
+ (JSC::CallLinkInfo::hotPathBegin):
+ (JSC::CallLinkInfo::slowPathStart):
+ * bytecode/CallLinkInfo.h:
+ (JSC::CallLinkInfo::setCallLocations):
+ (JSC::CallLinkInfo::hotPathOther):
+ * bytecode/PolymorphicAccess.cpp:
+ (JSC::PolymorphicAccess::regenerate):
+ * bytecode/StructureStubInfo.h:
+ (JSC::StructureStubInfo::doneLocation):
+ * dfg/DFGJITCompiler.cpp:
+ (JSC::DFG::JITCompiler::link):
+ * dfg/DFGOSRExit.cpp:
+ (JSC::DFG::reifyInlinedCallFrames):
+ * ftl/FTLLazySlowPath.cpp:
+ (JSC::FTL::LazySlowPath::initialize):
+ * ftl/FTLLazySlowPath.h:
+ (JSC::FTL::LazySlowPath::done const):
+ * ftl/FTLLowerDFGToB3.cpp:
+ (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
+ (JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
+ (JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
+ (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
+ (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
+ (JSC::FTL::DFG::LowerDFGToB3::compileIn):
+ (JSC::FTL::DFG::LowerDFGToB3::lazySlowPath):
+ * jit/JIT.cpp:
+ (JSC::JIT::link):
+ * jit/JITExceptions.cpp:
+ (JSC::genericUnwind):
+ * jit/JITMathIC.h:
+ (JSC::isProfileEmpty):
+ * llint/LLIntData.cpp:
+ (JSC::LLInt::initialize):
+ * llint/LLIntData.h:
+ (JSC::LLInt::getCodePtr):
+ (JSC::LLInt::getExecutableAddress): Deleted.
+ * llint/LLIntExceptions.cpp:
+ (JSC::LLInt::callToThrow):
+ * llint/LLIntSlowPaths.cpp:
+ (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+ * wasm/js/WasmToJS.cpp:
+ (JSC::Wasm::wasmToJS):
+
2018-04-18 Jer Noble <jer.no...@apple.com>
Don't put build products into WK_ALTERNATE_WEBKIT_SDK_PATH for engineering builds
Modified: trunk/Source/_javascript_Core/bytecode/AccessCase.cpp (230864 => 230865)
--- trunk/Source/_javascript_Core/bytecode/AccessCase.cpp 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/bytecode/AccessCase.cpp 2018-04-20 23:30:05 UTC (rev 230865)
@@ -818,9 +818,9 @@
jit.addLinkTask([=, &vm] (LinkBuffer& linkBuffer) {
this->as<GetterSetterAccessCase>().callLinkInfo()->setCallLocations(
- CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowPathCall)),
- CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(addressOfLinkFunctionCheck)),
- linkBuffer.locationOfNearCall<JSEntryPtrTag>(fastPathCall));
+ CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowPathCall)),
+ CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(addressOfLinkFunctionCheck)),
+ linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastPathCall));
linkBuffer.link(
slowPathCall,
Modified: trunk/Source/_javascript_Core/bytecode/ByValInfo.h (230864 => 230865)
--- trunk/Source/_javascript_Core/bytecode/ByValInfo.h 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/bytecode/ByValInfo.h 2018-04-20 23:30:05 UTC (rev 230865)
@@ -226,7 +226,7 @@
struct ByValInfo {
ByValInfo() { }
- ByValInfo(unsigned bytecodeIndex, CodeLocationJump<JSEntryPtrTag> notIndexJump, CodeLocationJump<JSEntryPtrTag> badTypeJump, CodeLocationLabel<ExceptionHandlerPtrTag> exceptionHandler, JITArrayMode arrayMode, ArrayProfile* arrayProfile, int16_t badTypeJumpToDone, int16_t badTypeJumpToNextHotPath, int16_t returnAddressToSlowPath)
+ 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)
: bytecodeIndex(bytecodeIndex)
, notIndexJump(notIndexJump)
, badTypeJump(badTypeJump)
@@ -244,8 +244,8 @@
}
unsigned bytecodeIndex;
- CodeLocationJump<JSEntryPtrTag> notIndexJump;
- CodeLocationJump<JSEntryPtrTag> badTypeJump;
+ CodeLocationJump<JSInternalPtrTag> notIndexJump;
+ CodeLocationJump<JSInternalPtrTag> badTypeJump;
CodeLocationLabel<ExceptionHandlerPtrTag> exceptionHandler;
JITArrayMode arrayMode; // The array mode that was baked into the inline JIT code.
ArrayProfile* arrayProfile;
Modified: trunk/Source/_javascript_Core/bytecode/CallLinkInfo.cpp (230864 => 230865)
--- trunk/Source/_javascript_Core/bytecode/CallLinkInfo.cpp 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/bytecode/CallLinkInfo.cpp 2018-04-20 23:30:05 UTC (rev 230865)
@@ -97,25 +97,25 @@
RELEASE_ASSERT(!isOnList());
}
-CodeLocationNearCall<JSEntryPtrTag> CallLinkInfo::callReturnLocation()
+CodeLocationNearCall<JSInternalPtrTag> CallLinkInfo::callReturnLocation()
{
RELEASE_ASSERT(!isDirect());
- return CodeLocationNearCall<JSEntryPtrTag>(m_callReturnLocationOrPatchableJump, Regular);
+ return CodeLocationNearCall<JSInternalPtrTag>(m_callReturnLocationOrPatchableJump, Regular);
}
-CodeLocationJump<JSEntryPtrTag> CallLinkInfo::patchableJump()
+CodeLocationJump<JSInternalPtrTag> CallLinkInfo::patchableJump()
{
RELEASE_ASSERT(callType() == DirectTailCall);
- return CodeLocationJump<JSEntryPtrTag>(m_callReturnLocationOrPatchableJump);
+ return CodeLocationJump<JSInternalPtrTag>(m_callReturnLocationOrPatchableJump);
}
-CodeLocationDataLabelPtr<JSEntryPtrTag> CallLinkInfo::hotPathBegin()
+CodeLocationDataLabelPtr<JSInternalPtrTag> CallLinkInfo::hotPathBegin()
{
RELEASE_ASSERT(!isDirect());
- return CodeLocationDataLabelPtr<JSEntryPtrTag>(m_hotPathBeginOrSlowPathStart);
+ return CodeLocationDataLabelPtr<JSInternalPtrTag>(m_hotPathBeginOrSlowPathStart);
}
-CodeLocationLabel<JSEntryPtrTag> CallLinkInfo::slowPathStart()
+CodeLocationLabel<JSInternalPtrTag> CallLinkInfo::slowPathStart()
{
RELEASE_ASSERT(isDirect());
return m_hotPathBeginOrSlowPathStart;
Modified: trunk/Source/_javascript_Core/bytecode/CallLinkInfo.h (230864 => 230865)
--- trunk/Source/_javascript_Core/bytecode/CallLinkInfo.h 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/bytecode/CallLinkInfo.h 2018-04-20 23:30:05 UTC (rev 230865)
@@ -165,9 +165,9 @@
}
void setCallLocations(
- CodeLocationLabel<JSEntryPtrTag> callReturnLocationOrPatchableJump,
- CodeLocationLabel<JSEntryPtrTag> hotPathBeginOrSlowPathStart,
- CodeLocationNearCall<JSEntryPtrTag> hotPathOther)
+ CodeLocationLabel<JSInternalPtrTag> callReturnLocationOrPatchableJump,
+ CodeLocationLabel<JSInternalPtrTag> hotPathBeginOrSlowPathStart,
+ CodeLocationNearCall<JSInternalPtrTag> hotPathOther)
{
m_callReturnLocationOrPatchableJump = callReturnLocationOrPatchableJump;
m_hotPathBeginOrSlowPathStart = hotPathBeginOrSlowPathStart;
@@ -181,12 +181,12 @@
m_allowStubs = false;
}
- CodeLocationNearCall<JSEntryPtrTag> callReturnLocation();
- CodeLocationJump<JSEntryPtrTag> patchableJump();
- CodeLocationDataLabelPtr<JSEntryPtrTag> hotPathBegin();
- CodeLocationLabel<JSEntryPtrTag> slowPathStart();
+ CodeLocationNearCall<JSInternalPtrTag> callReturnLocation();
+ CodeLocationJump<JSInternalPtrTag> patchableJump();
+ CodeLocationDataLabelPtr<JSInternalPtrTag> hotPathBegin();
+ CodeLocationLabel<JSInternalPtrTag> slowPathStart();
- CodeLocationNearCall<JSEntryPtrTag> hotPathOther()
+ CodeLocationNearCall<JSInternalPtrTag> hotPathOther()
{
return m_hotPathOther;
}
@@ -327,11 +327,9 @@
}
private:
- // FIXME: These should be tagged with JSInternalPtrTag instead of JSEntryTag.
- // https://bugs.webkit.org/show_bug.cgi?id=184712
- CodeLocationLabel<JSEntryPtrTag> m_callReturnLocationOrPatchableJump;
- CodeLocationLabel<JSEntryPtrTag> m_hotPathBeginOrSlowPathStart;
- CodeLocationNearCall<JSEntryPtrTag> m_hotPathOther;
+ CodeLocationLabel<JSInternalPtrTag> m_callReturnLocationOrPatchableJump;
+ CodeLocationLabel<JSInternalPtrTag> m_hotPathBeginOrSlowPathStart;
+ CodeLocationNearCall<JSInternalPtrTag> m_hotPathOther;
WriteBarrier<JSCell> m_calleeOrCodeBlock;
WriteBarrier<JSCell> m_lastSeenCalleeOrExecutable;
RefPtr<PolymorphicCallStubRoutine> m_stub;
Modified: trunk/Source/_javascript_Core/bytecode/PolymorphicAccess.cpp (230864 => 230865)
--- trunk/Source/_javascript_Core/bytecode/PolymorphicAccess.cpp 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/bytecode/PolymorphicAccess.cpp 2018-04-20 23:30:05 UTC (rev 230865)
@@ -558,7 +558,7 @@
return AccessGenerationResult::GaveUp;
}
- CodeLocationLabel<JSEntryPtrTag> successLabel = stubInfo.doneLocation();
+ CodeLocationLabel<JSInternalPtrTag> successLabel = stubInfo.doneLocation();
linkBuffer.link(state.success, successLabel);
Modified: trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h (230864 => 230865)
--- trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h 2018-04-20 23:30:05 UTC (rev 230865)
@@ -186,7 +186,7 @@
} patch;
CodeLocationCall<JSInternalPtrTag> slowPathCallLocation() { return patch.start.callAtOffset<JSInternalPtrTag>(patch.deltaFromStartToSlowPathCallLocation); }
- CodeLocationLabel<JSEntryPtrTag> doneLocation() { return patch.start.labelAtOffset<JSEntryPtrTag>(patch.inlineSize); }
+ CodeLocationLabel<JSInternalPtrTag> doneLocation() { return patch.start.labelAtOffset<JSInternalPtrTag>(patch.inlineSize); }
CodeLocationLabel<JITStubRoutinePtrTag> slowPathStartLocation() { return patch.start.labelAtOffset(patch.deltaFromStartToSlowPathStart); }
CodeLocationJump<JSInternalPtrTag> patchableJumpForIn()
{
Modified: trunk/Source/_javascript_Core/dfg/DFGJITCompiler.cpp (230864 => 230865)
--- trunk/Source/_javascript_Core/dfg/DFGJITCompiler.cpp 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/dfg/DFGJITCompiler.cpp 2018-04-20 23:30:05 UTC (rev 230865)
@@ -292,9 +292,9 @@
CallLinkInfo& info = *record.info;
linkBuffer.link(record.slowCall, linkCallThunk);
info.setCallLocations(
- CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(record.slowCall)),
- CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(record.targetToCheck)),
- linkBuffer.locationOfNearCall<JSEntryPtrTag>(record.fastCall));
+ CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(record.slowCall)),
+ CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(record.targetToCheck)),
+ linkBuffer.locationOfNearCall<JSInternalPtrTag>(record.fastCall));
}
for (JSDirectCallRecord& record : m_jsDirectCalls) {
@@ -301,17 +301,17 @@
CallLinkInfo& info = *record.info;
linkBuffer.link(record.call, linkBuffer.locationOf<NoPtrTag>(record.slowPath));
info.setCallLocations(
- CodeLocationLabel<JSEntryPtrTag>(),
- linkBuffer.locationOf<JSEntryPtrTag>(record.slowPath),
- linkBuffer.locationOfNearCall<JSEntryPtrTag>(record.call));
+ CodeLocationLabel<JSInternalPtrTag>(),
+ linkBuffer.locationOf<JSInternalPtrTag>(record.slowPath),
+ linkBuffer.locationOfNearCall<JSInternalPtrTag>(record.call));
}
for (JSDirectTailCallRecord& record : m_jsDirectTailCalls) {
CallLinkInfo& info = *record.info;
info.setCallLocations(
- linkBuffer.locationOf<JSEntryPtrTag>(record.patchableJump),
- linkBuffer.locationOf<JSEntryPtrTag>(record.slowPath),
- linkBuffer.locationOfNearCall<JSEntryPtrTag>(record.call));
+ linkBuffer.locationOf<JSInternalPtrTag>(record.patchableJump),
+ linkBuffer.locationOf<JSInternalPtrTag>(record.slowPath),
+ linkBuffer.locationOfNearCall<JSInternalPtrTag>(record.call));
}
MacroAssemblerCodeRef<JITThunkPtrTag> osrExitThunk = vm()->getCTIStub(osrExitGenerationThunkGenerator);
Modified: trunk/Source/_javascript_Core/dfg/DFGOSRExit.cpp (230864 => 230865)
--- trunk/Source/_javascript_Core/dfg/DFGOSRExit.cpp 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/dfg/DFGOSRExit.cpp 2018-04-20 23:30:05 UTC (rev 230865)
@@ -754,7 +754,7 @@
} else {
CodeBlock* baselineCodeBlockForCaller = baselineCodeBlockForOriginAndBaselineCodeBlock(*trueCaller, outermostBaselineCodeBlock);
unsigned callBytecodeIndex = trueCaller->bytecodeIndex;
- void* jumpTarget = nullptr;
+ MacroAssemblerCodePtr<JSInternalPtrTag> jumpTarget;
switch (trueCallerCallKind) {
case InlineCallFrame::Call:
@@ -767,7 +767,7 @@
baselineCodeBlockForCaller->getCallLinkInfoForBytecodeIndex(callBytecodeIndex);
RELEASE_ASSERT(callLinkInfo);
- jumpTarget = callLinkInfo->callReturnLocation().executableAddress();
+ jumpTarget = callLinkInfo->callReturnLocation();
break;
}
@@ -777,7 +777,7 @@
baselineCodeBlockForCaller->findStubInfo(CodeOrigin(callBytecodeIndex));
RELEASE_ASSERT(stubInfo);
- jumpTarget = stubInfo->doneLocation().executableAddress();
+ jumpTarget = stubInfo->doneLocation();
break;
}
@@ -788,11 +788,12 @@
if (trueCaller->inlineCallFrame)
callerFrame = cpu.fp<uint8_t*>() + trueCaller->inlineCallFrame->stackOffset * sizeof(EncodedJSValue);
+ void* targetAddress = jumpTarget.executableAddress();
#if USE(POINTER_PROFILING)
void* newEntrySP = cpu.fp<uint8_t*>() + inlineCallFrame->returnPCOffset() + sizeof(void*);
- jumpTarget = retagCodePtr(jumpTarget, JSEntryPtrTag, bitwise_cast<PtrTag>(newEntrySP));
+ targetAddress = retagCodePtr(targetAddress, JSInternalPtrTag, bitwise_cast<PtrTag>(newEntrySP));
#endif
- frame.set<void*>(inlineCallFrame->returnPCOffset(), jumpTarget);
+ frame.set<void*>(inlineCallFrame->returnPCOffset(), targetAddress);
}
frame.setOperand<void*>(inlineCallFrame->stackOffset + CallFrameSlot::codeBlock, baselineCodeBlock);
Modified: trunk/Source/_javascript_Core/ftl/FTLLazySlowPath.cpp (230864 => 230865)
--- trunk/Source/_javascript_Core/ftl/FTLLazySlowPath.cpp 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/ftl/FTLLazySlowPath.cpp 2018-04-20 23:30:05 UTC (rev 230865)
@@ -38,7 +38,7 @@
}
void LazySlowPath::initialize(
- CodeLocationJump<JSInternalPtrTag> patchableJump, CodeLocationLabel<JSEntryPtrTag> done,
+ CodeLocationJump<JSInternalPtrTag> patchableJump, CodeLocationLabel<JSInternalPtrTag> done,
CodeLocationLabel<ExceptionHandlerPtrTag> exceptionTarget,
const RegisterSet& usedRegisters, CallSiteIndex callSiteIndex, RefPtr<Generator> generator
)
Modified: trunk/Source/_javascript_Core/ftl/FTLLazySlowPath.h (230864 => 230865)
--- trunk/Source/_javascript_Core/ftl/FTLLazySlowPath.h 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/ftl/FTLLazySlowPath.h 2018-04-20 23:30:05 UTC (rev 230865)
@@ -69,13 +69,13 @@
~LazySlowPath();
void initialize(
- CodeLocationJump<JSInternalPtrTag> patchableJump, CodeLocationLabel<JSEntryPtrTag> done,
+ CodeLocationJump<JSInternalPtrTag> patchableJump, CodeLocationLabel<JSInternalPtrTag> done,
CodeLocationLabel<ExceptionHandlerPtrTag> exceptionTarget, const RegisterSet& usedRegisters,
CallSiteIndex, RefPtr<Generator>
);
CodeLocationJump<JSInternalPtrTag> patchableJump() const { return m_patchableJump; }
- CodeLocationLabel<JSEntryPtrTag> done() const { return m_done; }
+ CodeLocationLabel<JSInternalPtrTag> done() const { return m_done; }
const RegisterSet& usedRegisters() const { return m_usedRegisters; }
CallSiteIndex callSiteIndex() const { return m_callSiteIndex; }
@@ -85,9 +85,7 @@
private:
CodeLocationJump<JSInternalPtrTag> m_patchableJump;
- // FIXME: This should be tagged with JSInternalPtrTag instead of JSEntryTag.
- // https://bugs.webkit.org/show_bug.cgi?id=184712
- CodeLocationLabel<JSEntryPtrTag> m_done;
+ CodeLocationLabel<JSInternalPtrTag> m_done;
CodeLocationLabel<ExceptionHandlerPtrTag> m_exceptionTarget;
RegisterSet m_usedRegisters;
CallSiteIndex m_callSiteIndex;
Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp (230864 => 230865)
--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToB3.cpp 2018-04-20 23:30:05 UTC (rev 230865)
@@ -7172,9 +7172,9 @@
linkBuffer.link(slowCall, FunctionPtr<JITThunkPtrTag>(linkCall));
callLinkInfo->setCallLocations(
- CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall)),
- CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(targetToCheck)),
- linkBuffer.locationOfNearCall<JSEntryPtrTag>(fastCall));
+ CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall)),
+ CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(targetToCheck)),
+ linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall));
});
});
@@ -7314,10 +7314,10 @@
jit.addLinkTask(
[=] (LinkBuffer& linkBuffer) {
- CodeLocationLabel<JSEntryPtrTag> patchableJumpLocation = linkBuffer.locationOf<JSEntryPtrTag>(patchableJump);
- CodeLocationNearCall<JSEntryPtrTag> callLocation = linkBuffer.locationOfNearCall<JSEntryPtrTag>(call);
- CodeLocationLabel<JSEntryPtrTag> slowPathLocation = linkBuffer.locationOf<JSEntryPtrTag>(slowPath);
-
+ CodeLocationLabel<JSInternalPtrTag> patchableJumpLocation = linkBuffer.locationOf<JSInternalPtrTag>(patchableJump);
+ CodeLocationNearCall<JSInternalPtrTag> callLocation = linkBuffer.locationOfNearCall<JSInternalPtrTag>(call);
+ CodeLocationLabel<JSInternalPtrTag> slowPathLocation = linkBuffer.locationOf<JSInternalPtrTag>(slowPath);
+
callLinkInfo->setCallLocations(
patchableJumpLocation,
slowPathLocation,
@@ -7363,13 +7363,13 @@
jit.addLinkTask(
[=] (LinkBuffer& linkBuffer) {
- CodeLocationNearCall<JSEntryPtrTag> callLocation = linkBuffer.locationOfNearCall<JSEntryPtrTag>(call);
- CodeLocationLabel<JSEntryPtrTag> slowPathLocation = linkBuffer.locationOf<JSEntryPtrTag>(slowPath);
-
+ CodeLocationNearCall<JSInternalPtrTag> callLocation = linkBuffer.locationOfNearCall<JSInternalPtrTag>(call);
+ CodeLocationLabel<JSInternalPtrTag> slowPathLocation = linkBuffer.locationOf<JSInternalPtrTag>(slowPath);
+
linkBuffer.link(call, slowPathLocation);
-
+
callLinkInfo->setCallLocations(
- CodeLocationLabel<JSEntryPtrTag>(),
+ CodeLocationLabel<JSInternalPtrTag>(),
slowPathLocation,
callLocation);
});
@@ -7492,9 +7492,9 @@
linkBuffer.link(slowCall, FunctionPtr<JITThunkPtrTag>(linkCall));
callLinkInfo->setCallLocations(
- CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall)),
- CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(targetToCheck)),
- linkBuffer.locationOfNearCall<JSEntryPtrTag>(fastCall));
+ CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall)),
+ CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(targetToCheck)),
+ linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall));
});
});
}
@@ -7790,9 +7790,9 @@
linkBuffer.link(slowCall, FunctionPtr<JITThunkPtrTag>(linkCall));
callLinkInfo->setCallLocations(
- CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall)),
- CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(targetToCheck)),
- linkBuffer.locationOfNearCall<JSEntryPtrTag>(fastCall));
+ CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall)),
+ CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(targetToCheck)),
+ linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall));
});
});
@@ -8072,9 +8072,9 @@
linkBuffer.link(slowCall, FunctionPtr<JITThunkPtrTag>(linkCall));
callLinkInfo->setCallLocations(
- CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall)),
- CodeLocationLabel<JSEntryPtrTag>(linkBuffer.locationOf<JSEntryPtrTag>(targetToCheck)),
- linkBuffer.locationOfNearCall<JSEntryPtrTag>(fastCall));
+ CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall)),
+ CodeLocationLabel<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(targetToCheck)),
+ linkBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall));
});
});
@@ -9687,15 +9687,15 @@
CodeLocationLabel<JITStubRoutinePtrTag> start = linkBuffer.locationOf<JITStubRoutinePtrTag>(jump);
stubInfo->patch.start = start;
ptrdiff_t inlineSize = MacroAssembler::differenceBetweenCodePtr(
- start, linkBuffer.locationOf<JSEntryPtrTag>(done));
+ start, linkBuffer.locationOf<NoPtrTag>(done));
RELEASE_ASSERT(inlineSize >= 0);
stubInfo->patch.inlineSize = inlineSize;
stubInfo->patch.deltaFromStartToSlowPathCallLocation = MacroAssembler::differenceBetweenCodePtr(
- start, linkBuffer.locationOf<JSEntryPtrTag>(slowPathCall));
+ start, linkBuffer.locationOf<NoPtrTag>(slowPathCall));
stubInfo->patch.deltaFromStartToSlowPathStart = MacroAssembler::differenceBetweenCodePtr(
- start, linkBuffer.locationOf<JSEntryPtrTag>(slowPathBegin));
+ start, linkBuffer.locationOf<NoPtrTag>(slowPathBegin));
});
});
@@ -13984,7 +13984,7 @@
auto linkedPatchableJump = CodeLocationJump<JSInternalPtrTag>(linkBuffer.locationOf<JSInternalPtrTag>(patchableJump));
- CodeLocationLabel<JSEntryPtrTag> linkedDone = linkBuffer.locationOf<JSEntryPtrTag>(done);
+ CodeLocationLabel<JSInternalPtrTag> linkedDone = linkBuffer.locationOf<JSInternalPtrTag>(done);
CallSiteIndex callSiteIndex =
jitCode->common.addUniqueCallSiteIndex(origin);
Modified: trunk/Source/_javascript_Core/jit/JIT.cpp (230864 => 230865)
--- trunk/Source/_javascript_Core/jit/JIT.cpp 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/jit/JIT.cpp 2018-04-20 23:30:05 UTC (rev 230865)
@@ -835,10 +835,10 @@
for (const auto& byValCompilationInfo : m_byValCompilationInfo) {
PatchableJump patchableNotIndexJump = byValCompilationInfo.notIndexJump;
- auto notIndexJump = CodeLocationJump<JSEntryPtrTag>();
+ auto notIndexJump = CodeLocationJump<JSInternalPtrTag>();
if (Jump(patchableNotIndexJump).isSet())
- notIndexJump = CodeLocationJump<JSEntryPtrTag>(patchBuffer.locationOf<JSEntryPtrTag>(patchableNotIndexJump));
- auto badTypeJump = CodeLocationJump<JSEntryPtrTag>(patchBuffer.locationOf<JSEntryPtrTag>(byValCompilationInfo.badTypeJump));
+ notIndexJump = CodeLocationJump<JSInternalPtrTag>(patchBuffer.locationOf<JSInternalPtrTag>(patchableNotIndexJump));
+ auto badTypeJump = CodeLocationJump<JSInternalPtrTag>(patchBuffer.locationOf<JSInternalPtrTag>(byValCompilationInfo.badTypeJump));
CodeLocationLabel<NoPtrTag> doneTarget = patchBuffer.locationOf<NoPtrTag>(byValCompilationInfo.doneTarget);
CodeLocationLabel<NoPtrTag> nextHotPathTarget = patchBuffer.locationOf<NoPtrTag>(byValCompilationInfo.nextHotPathTarget);
CodeLocationLabel<NoPtrTag> slowPathTarget = patchBuffer.locationOf<NoPtrTag>(byValCompilationInfo.slowPathTarget);
@@ -860,9 +860,9 @@
for (auto& compilationInfo : m_callCompilationInfo) {
CallLinkInfo& info = *compilationInfo.callLinkInfo;
info.setCallLocations(
- CodeLocationLabel<JSEntryPtrTag>(patchBuffer.locationOfNearCall<JSEntryPtrTag>(compilationInfo.callReturnLocation)),
- CodeLocationLabel<JSEntryPtrTag>(patchBuffer.locationOf<JSEntryPtrTag>(compilationInfo.hotPathBegin)),
- patchBuffer.locationOfNearCall<JSEntryPtrTag>(compilationInfo.hotPathOther));
+ CodeLocationLabel<JSInternalPtrTag>(patchBuffer.locationOfNearCall<JSInternalPtrTag>(compilationInfo.callReturnLocation)),
+ CodeLocationLabel<JSInternalPtrTag>(patchBuffer.locationOf<JSInternalPtrTag>(compilationInfo.hotPathBegin)),
+ patchBuffer.locationOfNearCall<JSInternalPtrTag>(compilationInfo.hotPathOther));
}
JITCodeMap jitCodeMap;
Modified: trunk/Source/_javascript_Core/jit/JITExceptions.cpp (230864 => 230865)
--- trunk/Source/_javascript_Core/jit/JITExceptions.cpp 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/jit/JITExceptions.cpp 2018-04-20 23:30:05 UTC (rev 230865)
@@ -82,7 +82,7 @@
catchRoutine = catchPCForInterpreter->u.pointer;
#endif
} else
- catchRoutine = LLInt::getExecutableAddress(handleUncaughtException);
+ catchRoutine = LLInt::getCodePtr<ExceptionHandlerPtrTag>(handleUncaughtException).executableAddress();
ASSERT(bitwise_cast<uintptr_t>(callFrame) < bitwise_cast<uintptr_t>(vm->topEntryFrame));
Modified: trunk/Source/_javascript_Core/jit/JITMathIC.h (230864 => 230865)
--- trunk/Source/_javascript_Core/jit/JITMathIC.h 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/jit/JITMathIC.h 2018-04-20 23:30:05 UTC (rev 230865)
@@ -62,11 +62,9 @@
{
}
- // FIXME: These should be tagged with JSInternalPtrTag instead of JSEntryTag.
- // https://bugs.webkit.org/show_bug.cgi?id=184712
- CodeLocationLabel<JSEntryPtrTag> doneLocation() { return m_inlineStart.labelAtOffset(m_inlineSize); }
- CodeLocationLabel<JSEntryPtrTag> slowPathStartLocation() { return m_inlineStart.labelAtOffset(m_deltaFromStartToSlowPathStart); }
- CodeLocationCall<JSEntryPtrTag> slowPathCallLocation() { return m_inlineStart.callAtOffset(m_deltaFromStartToSlowPathCallLocation); }
+ CodeLocationLabel<JSInternalPtrTag> doneLocation() { return m_inlineStart.labelAtOffset(m_inlineSize); }
+ CodeLocationLabel<JSInternalPtrTag> slowPathStartLocation() { return m_inlineStart.labelAtOffset(m_deltaFromStartToSlowPathStart); }
+ CodeLocationCall<JSInternalPtrTag> slowPathCallLocation() { return m_inlineStart.callAtOffset(m_deltaFromStartToSlowPathCallLocation); }
bool generateInline(CCallHelpers& jit, MathICGenerationState& state, bool shouldEmitProfiling = true)
{
@@ -223,7 +221,7 @@
void finalizeInlineCode(const MathICGenerationState& state, LinkBuffer& linkBuffer)
{
- CodeLocationLabel<JSEntryPtrTag> start = linkBuffer.locationOf<JSEntryPtrTag>(state.fastPathStart);
+ CodeLocationLabel<JSInternalPtrTag> start = linkBuffer.locationOf<JSInternalPtrTag>(state.fastPathStart);
m_inlineStart = start;
m_inlineSize = MacroAssembler::differenceBetweenCodePtr(
@@ -253,9 +251,7 @@
ArithProfile* m_arithProfile;
Instruction* m_instruction;
MacroAssemblerCodeRef<JITStubRoutinePtrTag> m_code;
- // FIXME: These should be tagged with JSInternalPtrTag instead of JSEntryTag.
- // https://bugs.webkit.org/show_bug.cgi?id=184712
- CodeLocationLabel<JSEntryPtrTag> m_inlineStart;
+ CodeLocationLabel<JSInternalPtrTag> m_inlineStart;
int32_t m_inlineSize;
int32_t m_deltaFromStartToSlowPathCallLocation;
int32_t m_deltaFromStartToSlowPathStart;
Modified: trunk/Source/_javascript_Core/llint/LLIntData.cpp (230864 => 230865)
--- trunk/Source/_javascript_Core/llint/LLIntData.cpp 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/llint/LLIntData.cpp 2018-04-20 23:30:05 UTC (rev 230865)
@@ -58,41 +58,12 @@
#else // ENABLE(JIT)
llint_entry(&Data::s_opcodeMap);
- for (int i = 0; i < NUMBER_OF_BYTECODE_IDS; ++i)
+ for (int i = 0; i < numOpcodeIDs; ++i)
Data::s_opcodeMap[i] = tagCodePtr(Data::s_opcodeMap[i], BytecodePtrTag);
- static const PtrTag tagsForOpcode[] = {
- // FIXME: These should be tagged with JSInternalPtrTag instead of JSEntryTag.
- // https://bugs.webkit.org/show_bug.cgi?id=184712
- JSEntryPtrTag, // llint_program_prologue
- JSEntryPtrTag, // llint_eval_prologue
- JSEntryPtrTag, // llint_module_program_prologue
- JSEntryPtrTag, // llint_function_for_call_prologue
- JSEntryPtrTag, // llint_function_for_construct_prologue
- JSEntryPtrTag, // llint_function_for_call_arity_check
- JSEntryPtrTag, // llint_function_for_construct_arity_check
- JSEntryPtrTag, // llint_generic_return_point
- BytecodePtrTag, // llint_throw_from_slow_path_trampoline
- ExceptionHandlerPtrTag, // llint_throw_during_call_trampoline
- JSEntryPtrTag, // llint_native_call_trampoline
- JSEntryPtrTag, // llint_native_construct_trampoline
- JSEntryPtrTag, // llint_internal_function_call_trampoline
- JSEntryPtrTag, // llint_internal_function_construct_trampoline
- ExceptionHandlerPtrTag, // handleUncaughtException
- };
-
- static_assert(sizeof(tagsForOpcode) / sizeof(tagsForOpcode[0]) == NUMBER_OF_BYTECODE_HELPER_IDS, "");
- static_assert(static_cast<uintptr_t>(llint_program_prologue) == NUMBER_OF_BYTECODE_IDS, "");
-
- for (int i = 0; i < NUMBER_OF_BYTECODE_HELPER_IDS; ++i) {
- int opcodeID = i + NUMBER_OF_BYTECODE_IDS;
- Data::s_opcodeMap[opcodeID] = tagCodePtr(Data::s_opcodeMap[opcodeID], tagsForOpcode[i]);
- }
-
- void* handler = LLInt::getExecutableAddress(llint_throw_from_slow_path_trampoline);
+ void* handler = Data::s_opcodeMap[llint_throw_from_slow_path_trampoline];
for (int i = 0; i < maxOpcodeLength + 1; ++i)
Data::s_exceptionInstructions[i].u.pointer = handler;
-
#endif // ENABLE(JIT)
}
Modified: trunk/Source/_javascript_Core/llint/LLIntData.h (230864 => 230865)
--- trunk/Source/_javascript_Core/llint/LLIntData.h 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/llint/LLIntData.h 2018-04-20 23:30:05 UTC (rev 230865)
@@ -80,16 +80,12 @@
#endif
}
-ALWAYS_INLINE void* getExecutableAddress(OpcodeID opcodeID)
-{
- ASSERT(opcodeID >= NUMBER_OF_BYTECODE_IDS);
- return reinterpret_cast<void*>(getOpcode(opcodeID));
-}
-
template<PtrTag tag>
ALWAYS_INLINE MacroAssemblerCodePtr<tag> getCodePtr(OpcodeID opcodeID)
{
- return MacroAssemblerCodePtr<tag>::createFromExecutableAddress(getOpcode(opcodeID));
+ void* address = getOpcode(opcodeID);
+ address = retagCodePtr<BytecodePtrTag, tag>(address);
+ return MacroAssemblerCodePtr<tag>::createFromExecutableAddress(address);
}
template<PtrTag tag>
Modified: trunk/Source/_javascript_Core/llint/LLIntExceptions.cpp (230864 => 230865)
--- trunk/Source/_javascript_Core/llint/LLIntExceptions.cpp 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/llint/LLIntExceptions.cpp 2018-04-20 23:30:05 UTC (rev 230865)
@@ -58,7 +58,7 @@
auto scope = DECLARE_THROW_SCOPE(*vm);
dataLog("Throwing exception ", JSValue(scope.exception()), " (callToThrow).\n");
#endif
- return LLInt::getExecutableAddress(llint_throw_during_call_trampoline);
+ return LLInt::getCodePtr<ExceptionHandlerPtrTag>(llint_throw_during_call_trampoline).executableAddress();
}
} } // namespace JSC::LLInt
Modified: trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp (230864 => 230865)
--- trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp 2018-04-20 23:30:05 UTC (rev 230865)
@@ -1636,7 +1636,7 @@
execCallee->setArgumentCountIncludingThis(pc[3].u.operand);
execCallee->setCallerFrame(exec);
execCallee->uncheckedR(CallFrameSlot::callee) = calleeAsValue;
- execCallee->setReturnPC(LLInt::getExecutableAddress(llint_generic_return_point));
+ execCallee->setReturnPC(LLInt::getCodePtr<JSEntryPtrTag>(llint_generic_return_point).executableAddress());
execCallee->setCodeBlock(0);
exec->setCurrentVPC(pc);
Modified: trunk/Source/_javascript_Core/wasm/js/WasmToJS.cpp (230864 => 230865)
--- trunk/Source/_javascript_Core/wasm/js/WasmToJS.cpp 2018-04-20 23:24:48 UTC (rev 230864)
+++ trunk/Source/_javascript_Core/wasm/js/WasmToJS.cpp 2018-04-20 23:30:05 UTC (rev 230865)
@@ -654,9 +654,9 @@
return makeUnexpected(BindingFailure::OutOfMemory);
patchBuffer.link(slowCall, FunctionPtr<JITThunkPtrTag>(vm->getCTIStub(linkCallThunkGenerator).code()));
- CodeLocationLabel<JSEntryPtrTag> callReturnLocation(patchBuffer.locationOfNearCall<JSEntryPtrTag>(slowCall));
- CodeLocationLabel<JSEntryPtrTag> hotPathBegin(patchBuffer.locationOf<JSEntryPtrTag>(targetToCheck));
- CodeLocationNearCall<JSEntryPtrTag> hotPathOther = patchBuffer.locationOfNearCall<JSEntryPtrTag>(fastCall);
+ CodeLocationLabel<JSInternalPtrTag> callReturnLocation(patchBuffer.locationOfNearCall<JSInternalPtrTag>(slowCall));
+ CodeLocationLabel<JSInternalPtrTag> hotPathBegin(patchBuffer.locationOf<JSInternalPtrTag>(targetToCheck));
+ CodeLocationNearCall<JSInternalPtrTag> hotPathOther = patchBuffer.locationOfNearCall<JSInternalPtrTag>(fastCall);
callLinkInfo->setCallLocations(callReturnLocation, hotPathBegin, hotPathOther);
return FINALIZE_CODE(patchBuffer, WasmEntryPtrTag, "WebAssembly->_javascript_ import[%i] %s", importIndex, signature.toString().ascii().data());