[prev in list] [next in list] [prev in thread] [next in thread]
List: webkit-changes
Subject: [webkit-changes] [230106] trunk/Source/JavaScriptCore
From: mark.lam () apple ! com
Date: 2018-03-30 16:31:06
Message-ID: 20180330163106.BB07110051CC () svn ! webkit ! org
[Download RAW message or body]
[Attachment #2 (text/html)]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[230106] trunk/Source/JavaScriptCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: \
verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: \
bold} #msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: \
bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: \
6px; } #logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em \
0; } #logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg \
h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; } \
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; \
} #logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: \
-1.5em; padding-left: 1.5em; } #logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em \
1em 0 1em; background: white;} #logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid \
#fa0; border-bottom: 1px solid #fa0; background: #fff; } #logmsg table th { \
text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted \
#fa0; } #logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: \
0.2em 0.5em; } #logmsg table thead th { text-align: center; border-bottom: 1px solid \
#fa0; } #logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: \
6px; } #patch { width: 100%; }
#patch h4 {font-family: \
verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins \
{background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del \
{background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, \
.info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a \
href="http://trac.webkit.org/projects/webkit/changeset/230106">230106</a></dd> \
<dt>Author</dt> <dd>mark.lam@apple.com</dd> <dt>Date</dt> <dd>2018-03-30 09:31:06 \
-0700 (Fri, 30 Mar 2018)</dd> </dl>
<h3>Log Message</h3>
<pre>Add pointer profiling support to Wasm.
https://bugs.webkit.org/show_bug.cgi?id=184175
<rdar://problem/39027923>
Reviewed by JF Bastien.
* runtime/PtrTag.h:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addGrowMemory):
(JSC::Wasm::B3IRGenerator::addCall):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
(JSC::Wasm::B3IRGenerator::addOp<OpType::I32Popcnt>):
(JSC::Wasm::B3IRGenerator::addOp<OpType::I64Popcnt>):
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::prepare):
(JSC::Wasm::BBQPlan::complete):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/WasmBinding.h:
* wasm/WasmFaultSignalHandler.cpp:
(JSC::Wasm::trapHandler):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::work):
* wasm/WasmThunks.cpp:
(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
(JSC::Wasm::throwStackOverflowFromWasmThunkGenerator):
(JSC::Wasm::triggerOMGTierUpThunkGenerator):
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::handleBadI64Use):
(JSC::Wasm::wasmToJS):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
* wasm/js/WebAssemblyFunction.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimePtrTagh">trunk/Source/JavaScriptCore/runtime/PtrTag.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmB3IRGeneratorcpp">trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmBBQPlancpp">trunk/Source/JavaScriptCore/wasm/WasmBBQPlan.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmBindingcpp">trunk/Source/JavaScriptCore/wasm/WasmBinding.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmBindingh">trunk/Source/JavaScriptCore/wasm/WasmBinding.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmFaultSignalHandlercpp">trunk/Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmOMGPlancpp">trunk/Source/JavaScriptCore/wasm/WasmOMGPlan.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWasmThunkscpp">trunk/Source/JavaScriptCore/wasm/WasmThunks.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWasmToJScpp">trunk/Source/JavaScriptCore/wasm/js/WasmToJS.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyFunctioncpp">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmjsWebAssemblyFunctionh">trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (230105 => \
230106)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog 2018-03-30 16:05:22 UTC \
(rev 230105)
+++ trunk/Source/JavaScriptCore/ChangeLog 2018-03-30 16:31:06 UTC (rev 230106)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2018-03-30 Mark Lam <mark.lam@apple.com>
+
+ Add pointer profiling support to Wasm.
+ https://bugs.webkit.org/show_bug.cgi?id=184175
+ <rdar://problem/39027923>
+
+ Reviewed by JF Bastien.
+
+ * runtime/PtrTag.h:
+ * wasm/WasmB3IRGenerator.cpp:
+ (JSC::Wasm::B3IRGenerator::addGrowMemory):
+ (JSC::Wasm::B3IRGenerator::addCall):
+ (JSC::Wasm::B3IRGenerator::addCallIndirect):
+ (JSC::Wasm::B3IRGenerator::addOp<OpType::I32Popcnt>):
+ (JSC::Wasm::B3IRGenerator::addOp<OpType::I64Popcnt>):
+ * wasm/WasmBBQPlan.cpp:
+ (JSC::Wasm::BBQPlan::prepare):
+ (JSC::Wasm::BBQPlan::complete):
+ * wasm/WasmBinding.cpp:
+ (JSC::Wasm::wasmToWasm):
+ * wasm/WasmBinding.h:
+ * wasm/WasmFaultSignalHandler.cpp:
+ (JSC::Wasm::trapHandler):
+ * wasm/WasmOMGPlan.cpp:
+ (JSC::Wasm::OMGPlan::work):
+ * wasm/WasmThunks.cpp:
+ (JSC::Wasm::throwExceptionFromWasmThunkGenerator):
+ (JSC::Wasm::throwStackOverflowFromWasmThunkGenerator):
+ (JSC::Wasm::triggerOMGTierUpThunkGenerator):
+ * wasm/js/WasmToJS.cpp:
+ (JSC::Wasm::handleBadI64Use):
+ (JSC::Wasm::wasmToJS):
+ * wasm/js/WebAssemblyFunction.cpp:
+ (JSC::callWebAssemblyFunction):
+ * wasm/js/WebAssemblyFunction.h:
+
</ins><span class="cx"> 2018-03-30 Ryan Haddad <ryanhaddad@apple.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r230102.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimePtrTagh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/PtrTag.h \
(230105 => 230106)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/PtrTag.h 2018-03-30 \
16:05:22 UTC (rev 230105)
+++ trunk/Source/JavaScriptCore/runtime/PtrTag.h 2018-03-30 16:31:06 UTC (rev 230106)
</span><span class="lines">@@ -53,6 +53,9 @@
</span><span class="cx"> v(YarrMatchOnly8BitPtrTag) \
</span><span class="cx"> v(YarrMatchOnly16BitPtrTag) \
</span><span class="cx"> v(YarrBacktrackPtrTag) \
</span><ins>+ \
+ v(WasmCallPtrTag) \
+ v(WasmHelperPtrTag) \
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> enum PtrTag : uintptr_t {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmB3IRGeneratorcpp"></a>
<div class="modfile"><h4>Modified: \
trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp (230105 => 230106)</h4> <pre \
class="diff"><span> <span class="info">--- \
trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp 2018-03-30 16:05:22 UTC (rev \
230105)
+++ trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp 2018-03-30 16:31:06 UTC \
(rev 230106) </span><span class="lines">@@ -594,7 +594,7 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> result = \
m_currentBlock->appendNew<CCallValue>(m_proc, Int32, origin(), </span><del>- \
m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), \
bitwise_cast<void*>(growMemory)), </del><ins>+ \
m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), \
tagCFunctionPtr<void*>(growMemory, B3CCallPtrTag)), </ins><span class="cx"> \
m_currentBlock->appendNew<B3::Value>(m_proc, B3::FramePointer, origin()), \
instanceValue(), delta); </span><span class="cx">
</span><span class="cx"> \
restoreWebAssemblyGlobalState(RestoreCachedStackLimit::No, m_info.memory, \
instanceValue(), m_proc, m_currentBlock); </span><span class="lines">@@ -1135,8 \
+1135,9 @@ </span><span class="cx"> if (Options::usePoisoning())
</span><span class="cx"> jumpDestination = \
isEmbedderBlock->appendNew<Value>(m_proc, BitXor, origin(), jumpDestination, \
isEmbedderBlock->appendNew<Const64Value>(m_proc, origin(), \
g_JITCodePoison)); </span><span class="cx">
</span><ins>+ PtrTag callTag = ptrTag(WasmCallPtrTag, signature.hash());
</ins><span class="cx"> Value* embedderCallResult = \
wasmCallingConvention().setupCall(m_proc, isEmbedderBlock, origin(), args, \
toB3Type(returnType), </span><del>- [&] (PatchpointValue* patchpoint) \
{ </del><ins>+ [=] (PatchpointValue* patchpoint) {
</ins><span class="cx"> patchpoint->effects.writesPinned = true;
</span><span class="cx"> patchpoint->effects.readsPinned = true;
</span><span class="cx"> patchpoint->append(jumpDestination, \
ValueRep::SomeRegister); </span><span class="lines">@@ -1144,9 +1145,9 @@
</span><span class="cx"> // We pessimistically assume we could be \
calling to something that is bounds checking. </span><span class="cx"> \
// FIXME: We shouldn't have to do this: \
https://bugs.webkit.org/show_bug.cgi?id=172181 </span><span class="cx"> \
patchpoint->clobberLate(PinnedRegisterInfo::get().toSave(MemoryMode::BoundsChecking));
</span><del>- patchpoint->setGenerator([returnType] \
(CCallHelpers& jit, const B3::StackmapGenerationParams& params) { \
</del><ins>+ patchpoint->setGenerator([returnType, callTag] \
(CCallHelpers& jit, const B3::StackmapGenerationParams& params) { </ins><span \
class="cx"> AllowMacroScratchRegisterUsage allowScratch(jit); \
</span><del>- jit.call(params[returnType == Void ? 0 : 1].gpr(), \
NoPtrTag); </del><ins>+ jit.call(params[returnType == Void ? 0 : \
1].gpr(), callTag); </ins><span class="cx"> });
</span><span class="cx"> });
</span><span class="cx"> UpsilonValue* embedderCallResultUpsilon = returnType \
== Void ? nullptr : isEmbedderBlock->appendNew<UpsilonValue>(m_proc, \
origin(), embedderCallResult); </span><span class="lines">@@ -1317,6 +1318,7 @@
</span><span class="cx"> calleeCode = \
m_currentBlock->appendNew<Value>(m_proc, BitXor, origin(), calleeCode, \
m_currentBlock->appendNew<Const64Value>(m_proc, origin(), g_JITCodePoison)); \
</span><span class="cx"> </span><span class="cx"> Type returnType = \
signature.returnType(); </span><ins>+ PtrTag callTag = ptrTag(WasmCallPtrTag, \
signature.hash()); </ins><span class="cx"> result = \
wasmCallingConvention().setupCall(m_proc, m_currentBlock, origin(), args, \
toB3Type(returnType), </span><span class="cx"> [=] (PatchpointValue* \
patchpoint) { </span><span class="cx"> \
patchpoint->effects.writesPinned = true; </span><span class="lines">@@ -1331,7 \
+1333,7 @@ </span><span class="cx"> patchpoint->append(calleeCode, \
ValueRep::SomeRegister); </span><span class="cx"> \
patchpoint->setGenerator([=] (CCallHelpers& jit, const \
B3::StackmapGenerationParams& params) { </span><span class="cx"> \
AllowMacroScratchRegisterUsage allowScratch(jit); </span><del>- \
jit.call(params[returnType == Void ? 0 : 1].gpr(), NoPtrTag); </del><ins>+ \
jit.call(params[returnType == Void ? 0 : 1].gpr(), callTag); </ins><span class="cx"> \
}); </span><span class="cx"> });
</span><span class="cx">
</span><span class="lines">@@ -1582,7 +1584,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> uint32_t (*popcount)(int32_t) = [] (int32_t value) -> \
uint32_t { return __builtin_popcount(value); }; </span><del>- Value* funcAddress = \
m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), \
bitwise_cast<void*>(popcount)); </del><ins>+ Value* funcAddress = \
m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), \
tagCFunctionPtr<void*>(popcount, B3CCallPtrTag)); </ins><span class="cx"> \
result = m_currentBlock->appendNew<CCallValue>(m_proc, Int32, origin(), \
Effects::none(), funcAddress, arg); </span><span class="cx"> return { };
</span><span class="cx"> }
</span><span class="lines">@@ -1604,7 +1606,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> uint64_t (*popcount)(int64_t) = [] (int64_t value) -> \
uint64_t { return __builtin_popcountll(value); }; </span><del>- Value* funcAddress \
= m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), \
bitwise_cast<void*>(popcount)); </del><ins>+ Value* funcAddress = \
m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), \
tagCFunctionPtr<void*>(popcount, B3CCallPtrTag)); </ins><span class="cx"> \
result = m_currentBlock->appendNew<CCallValue>(m_proc, Int64, origin(), \
Effects::none(), funcAddress, arg); </span><span class="cx"> return { };
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmBBQPlancpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmBBQPlan.cpp \
(230105 => 230106)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmBBQPlan.cpp 2018-03-30 \
16:05:22 UTC (rev 230105)
+++ trunk/Source/JavaScriptCore/wasm/WasmBBQPlan.cpp 2018-03-30 16:31:06 UTC (rev \
230106) </span><span class="lines">@@ -174,8 +174,10 @@
</span><span class="cx"> if (import->kind != ExternalKind::Function)
</span><span class="cx"> continue;
</span><span class="cx"> unsigned importFunctionIndex = \
m_wasmToWasmExitStubs.size(); </span><ins>+ SignatureIndex signatureIndex = \
m_moduleInformation->importFunctionSignatureIndices[importFunctionIndex]; + \
const Signature& signature = SignatureInformation::get(signatureIndex); \
</ins><span class="cx"> dataLogLnIf(WasmBBQPlanInternal::verbose, \
"Processing import function number ", importFunctionIndex, ": ", \
makeString(import->module), ": ", makeString(import->field)); \
</span><del>- auto binding = wasmToWasm(importFunctionIndex); </del><ins>+ \
auto binding = wasmToWasm(signature, importFunctionIndex); </ins><span class="cx"> \
if (UNLIKELY(!binding)) { </span><span class="cx"> switch \
(binding.error()) { </span><span class="cx"> case \
BindingFailure::OutOfMemory: </span><span class="lines">@@ -300,6 +302,8 @@
</span><span class="cx"> for (uint32_t functionIndex = 0; functionIndex < \
m_moduleInformation->functionLocationInBinary.size(); functionIndex++) { \
</span><span class="cx"> CompilationContext& context = \
m_compilationContexts[functionIndex]; </span><span class="cx"> \
SignatureIndex signatureIndex = \
m_moduleInformation->internalFunctionSignatureIndices[functionIndex]; \
</span><ins>+ const Signature& signature = \
SignatureInformation::get(signatureIndex); + PtrTag callTag = \
ptrTag(WasmCallPtrTag, signature.hash()); </ins><span class="cx"> {
</span><span class="cx"> LinkBuffer \
linkBuffer(*context.wasmEntrypointJIT, nullptr, JITCompilationCanFail); </span><span \
class="cx"> if (UNLIKELY(linkBuffer.didFailToAllocate())) { \
</span><span class="lines">@@ -308,7 +312,7 @@ </span><span class="cx"> \
} </span><span class="cx">
</span><span class="cx"> \
m_wasmInternalFunctions[functionIndex]->entrypoint.compilation = \
std::make_unique<B3::Compilation>( </span><del>- \
FINALIZE_CODE(linkBuffer, NoPtrTag, "WebAssembly function[%i] %s", \
functionIndex, SignatureInformation::get(signatureIndex).toString().ascii().data()), \
</del><ins>+ FINALIZE_CODE(linkBuffer, callTag, "WebAssembly \
function[%i] %s", functionIndex, signature.toString().ascii().data()), \
</ins><span class="cx"> \
WTFMove(context.wasmEntrypointByproducts)); </span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -320,7 +324,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> \
embedderToWasmInternalFunction->entrypoint.compilation = \
std::make_unique<B3::Compilation>( </span><del>- \
FINALIZE_CODE(linkBuffer, NoPtrTag, "Embedder->WebAssembly entrypoint[%i] \
%s", functionIndex, \
SignatureInformation::get(signatureIndex).toString().ascii().data()), </del><ins>+ \
FINALIZE_CODE(linkBuffer, CodeEntryPtrTag, "Embedder->WebAssembly \
entrypoint[%i] %s", functionIndex, signature.toString().ascii().data()), \
</ins><span class="cx"> \
WTFMove(context.embedderEntrypointByproducts)); </span><span class="cx"> \
} </span><span class="cx"> }
</span><span class="lines">@@ -333,7 +337,10 @@
</span><span class="cx"> executableAddress = \
m_wasmToWasmExitStubs.at(call.functionIndexSpace).code(); </span><span class="cx"> \
} else </span><span class="cx"> executableAddress = \
m_wasmInternalFunctions.at(call.functionIndexSpace - \
m_moduleInformation->importFunctionCount())->entrypoint.compilation->code(); \
</span><del>- MacroAssembler::repatchNearCall(call.callLocation, \
CodeLocationLabel(executableAddress)); </del><ins>+ SignatureIndex \
signatureIndex = m_moduleInformation->signatureIndexFromFunctionIndexSpace(call.functionIndexSpace);
+ const Signature& signature = \
SignatureInformation::get(signatureIndex); + PtrTag oldTag = \
ptrTag(WasmCallPtrTag, signature.hash()); + \
MacroAssembler::repatchNearCall(call.callLocation, \
CodeLocationLabel(executableAddress.retagged(oldTag, NearCallPtrTag))); </ins><span \
class="cx"> } </span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmBindingcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmBinding.cpp \
(230105 => 230106)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmBinding.cpp 2018-03-30 \
16:05:22 UTC (rev 230105)
+++ trunk/Source/JavaScriptCore/wasm/WasmBinding.cpp 2018-03-30 16:31:06 UTC (rev \
230106) </span><span class="lines">@@ -37,8 +37,11 @@
</span><span class="cx">
</span><span class="cx"> using JIT = CCallHelpers;
</span><span class="cx">
</span><del>-Expected<MacroAssemblerCodeRef, BindingFailure> \
wasmToWasm(unsigned importIndex) </del><ins>+Expected<MacroAssemblerCodeRef, \
BindingFailure> wasmToWasm(const Signature& signature, unsigned importIndex) \
</ins><span class="cx"> { </span><ins>+ // FIXME: Consider uniquify the stubs \
based on signature + index to see if this saves memory. + // \
https://bugs.webkit.org/show_bug.cgi?id=184157 +
</ins><span class="cx"> const PinnedRegisterInfo& pinnedRegs = \
PinnedRegisterInfo::get(); </span><span class="cx"> JIT jit;
</span><span class="cx">
</span><span class="lines">@@ -78,13 +81,14 @@
</span><span class="cx"> jit.loadPtr(scratch, scratch);
</span><span class="cx"> if (Options::usePoisoning())
</span><span class="cx"> jit.xorPtr(JIT::TrustedImmPtr(g_JITCodePoison), \
scratch); </span><del>- jit.jump(scratch, NoPtrTag);
</del><ins>+ PtrTag tag = ptrTag(WasmCallPtrTag, signature.hash());
+ jit.jump(scratch, tag);
</ins><span class="cx">
</span><span class="cx"> LinkBuffer patchBuffer(jit, GLOBAL_THUNK_ID, \
JITCompilationCanFail); </span><span class="cx"> if \
(UNLIKELY(patchBuffer.didFailToAllocate())) </span><span class="cx"> return \
makeUnexpected(BindingFailure::OutOfMemory); </span><span class="cx">
</span><del>- return FINALIZE_CODE(patchBuffer, NoPtrTag, \
"WebAssembly->WebAssembly import[%i]", importIndex); </del><ins>+ \
return FINALIZE_CODE(patchBuffer, tag, "WebAssembly->WebAssembly \
import[%i]", importIndex); </ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } } // namespace JSC::Wasm
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmBinding.h \
(230105 => 230106)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmBinding.h 2018-03-30 \
16:05:22 UTC (rev 230105)
+++ trunk/Source/JavaScriptCore/wasm/WasmBinding.h 2018-03-30 16:31:06 UTC (rev \
230106) </span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with \
or without </span><span class="cx"> * modification, are permitted provided that the \
following conditions </span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> OutOfMemory,
</span><span class="cx"> };
</span><span class="cx">
</span><del>-Expected<MacroAssemblerCodeRef, BindingFailure> \
wasmToWasm(unsigned importIndex); </del><ins>+Expected<MacroAssemblerCodeRef, \
BindingFailure> wasmToWasm(const Signature&, unsigned importIndex); \
</ins><span class="cx"> </span><span class="cx"> } } // namespace JSC::Wasm
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmFaultSignalHandlercpp"></a>
<div class="modfile"><h4>Modified: \
trunk/Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp (230105 => 230106)</h4> \
<pre class="diff"><span> <span class="info">--- \
trunk/Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp 2018-03-30 16:05:22 UTC \
(rev 230105)
+++ trunk/Source/JavaScriptCore/wasm/WasmFaultSignalHandler.cpp 2018-03-30 16:31:06 \
UTC (rev 230106) </span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2017 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with \
or without </span><span class="cx"> * modification, are permitted provided that the \
following conditions </span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx"> dataLogLnIf(WasmFaultSignalHandlerInternal::verbose, \
"JIT memory start: ", \
RawPointer(reinterpret_cast<void*>(startOfFixedExecutableMemoryPool)), " \
end: ", RawPointer(reinterpret_cast<void*>(endOfFixedExecutableMemoryPool)));
</span><span class="cx"> // First we need to make sure we are in JIT code before \
we can aquire any locks. Otherwise, </span><span class="cx"> // we might have \
crashed in code that is already holding one of the locks we want to aquire. \
</span><ins>+ assertIsNotTagged(faultingInstruction); </ins><span class="cx"> \
if (isJITPC(faultingInstruction)) { </span><span class="cx"> bool \
faultedInActiveFastMemory = false; </span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmOMGPlancpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmOMGPlan.cpp \
(230105 => 230106)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmOMGPlan.cpp 2018-03-30 \
16:05:22 UTC (rev 230105)
+++ trunk/Source/JavaScriptCore/wasm/WasmOMGPlan.cpp 2018-03-30 16:31:06 UTC (rev \
230106) </span><span class="lines">@@ -97,8 +97,9 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ PtrTag callTag = ptrTag(WasmCallPtrTag, signature.hash());
</ins><span class="cx"> omgEntrypoint.compilation = \
std::make_unique<B3::Compilation>( </span><del>- \
FINALIZE_CODE(linkBuffer, NoPtrTag, "WebAssembly OMG function[%i] %s", \
m_functionIndex, SignatureInformation::get(signatureIndex).toString().ascii().data()),
</del><ins>+ FINALIZE_CODE(linkBuffer, callTag, "WebAssembly OMG \
function[%i] %s", m_functionIndex, signature.toString().ascii().data()), \
</ins><span class="cx"> WTFMove(context.wasmEntrypointByproducts)); \
</span><span class="cx"> </span><span class="cx"> \
omgEntrypoint.calleeSaveRegisters = \
WTFMove(parseAndCompileResult.value()->entrypoint.calleeSaveRegisters); \
</span><span class="lines">@@ -125,7 +126,10 @@ </span><span class="cx"> \
else </span><span class="cx"> entrypoint = \
m_codeBlock->wasmEntrypointCalleeFromFunctionIndexSpace(call.functionIndexSpace).entrypoint();
</span><span class="cx">
</span><del>- MacroAssembler::repatchNearCall(call.callLocation, \
CodeLocationLabel(entrypoint)); </del><ins>+ SignatureIndex signatureIndex \
= m_moduleInformation->signatureIndexFromFunctionIndexSpace(call.functionIndexSpace);
+ const Signature& signature = \
SignatureInformation::get(signatureIndex); + PtrTag oldTag = \
ptrTag(WasmCallPtrTag, signature.hash()); + \
MacroAssembler::repatchNearCall(call.callLocation, \
CodeLocationLabel(entrypoint.retagged(oldTag, NearCallPtrTag))); </ins><span \
class="cx"> } </span><span class="cx"> unlinkedCalls = \
std::exchange(m_codeBlock->m_wasmToWasmCallsites[m_functionIndex], unlinkedCalls); \
</span><span class="cx"> } </span><span class="lines">@@ -145,7 +149,10 @@
</span><span class="cx"> dataLogLnIf(WasmOMGPlanInternal::verbose, \
"Considering repatching call at: ", \
RawPointer(call.callLocation.dataLocation()), " that targets ", \
call.functionIndexSpace); </span><span class="cx"> if \
(call.functionIndexSpace == functionIndexSpace) { </span><span class="cx"> \
dataLogLnIf(WasmOMGPlanInternal::verbose, "Repatching call at: ", \
RawPointer(call.callLocation.dataLocation()), " to ", \
RawPointer(entrypoint.executableAddress())); </span><del>- \
MacroAssembler::repatchNearCall(call.callLocation, CodeLocationLabel(entrypoint)); \
</del><ins>+ SignatureIndex signatureIndex = \
m_moduleInformation->signatureIndexFromFunctionIndexSpace(call.functionIndexSpace);
+ const Signature& signature = \
SignatureInformation::get(signatureIndex); + PtrTag oldTag = \
ptrTag(WasmCallPtrTag, signature.hash()); + \
MacroAssembler::repatchNearCall(call.callLocation, \
CodeLocationLabel(entrypoint.retagged(oldTag, NearCallPtrTag))); </ins><span \
class="cx"> } </span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWasmThunkscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/WasmThunks.cpp \
(230105 => 230106)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WasmThunks.cpp 2018-03-30 \
16:05:22 UTC (rev 230105)
+++ trunk/Source/JavaScriptCore/wasm/WasmThunks.cpp 2018-03-30 16:31:06 UTC (rev \
230106) </span><span class="lines">@@ -51,15 +51,17 @@
</span><span class="cx"> \
jit.loadPtr(CCallHelpers::Address(GPRInfo::argumentGPR0), GPRInfo::argumentGPR0); \
</span><span class="cx"> \
jit.copyCalleeSavesToEntryFrameCalleeSavesBuffer(GPRInfo::argumentGPR0); </span><span \
class="cx"> jit.move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0); \
</span><del>- CCallHelpers::Call call = jit.call(NoPtrTag);
- jit.jump(GPRInfo::returnValueGPR, NoPtrTag);
</del><ins>+
+ PtrTag tag = ptrTag(WasmHelperPtrTag, nextPtrTagID());
+ CCallHelpers::Call call = jit.call(tag);
+ jit.jump(GPRInfo::returnValueGPR, ExceptionHandlerPtrTag);
</ins><span class="cx"> jit.breakpoint(); // We should not reach this.
</span><span class="cx">
</span><span class="cx"> ThrowWasmException throwWasmException = \
Thunks::singleton().throwWasmException(); </span><span class="cx"> \
RELEASE_ASSERT(throwWasmException); </span><span class="cx"> LinkBuffer \
linkBuffer(jit, GLOBAL_THUNK_ID); </span><del>- linkBuffer.link(call, \
FunctionPtr(throwWasmException));
- return FINALIZE_CODE(linkBuffer, NoPtrTag, "Throw exception from \
Wasm"); </del><ins>+ linkBuffer.link(call, FunctionPtr(throwWasmException, \
tag)); + return FINALIZE_CODE(linkBuffer, NearCallPtrTag, "Throw exception \
from Wasm"); </ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MacroAssemblerCodeRef \
throwStackOverflowFromWasmThunkGenerator(const AbstractLocker& locker) \
</span><span class="lines">@@ -73,7 +75,7 @@ </span><span class="cx"> auto \
jumpToExceptionHandler = jit.jump(); </span><span class="cx"> LinkBuffer \
linkBuffer(jit, GLOBAL_THUNK_ID); </span><span class="cx"> \
linkBuffer.link(jumpToExceptionHandler, \
CodeLocationLabel(Thunks::singleton().stub(locker, \
throwExceptionFromWasmThunkGenerator).code())); </span><del>- return \
FINALIZE_CODE(linkBuffer, NoPtrTag, "Throw stack overflow from Wasm"); \
</del><ins>+ return FINALIZE_CODE(linkBuffer, NearJumpPtrTag, "Throw stack \
overflow from Wasm"); </ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MacroAssemblerCodeRef triggerOMGTierUpThunkGenerator(const \
AbstractLocker&) </span><span class="lines">@@ -91,8 +93,9 @@
</span><span class="cx"> jit.loadWasmContextInstance(GPRInfo::argumentGPR0);
</span><span class="cx"> typedef void (*Run)(Instance*, uint32_t);
</span><span class="cx"> Run run = OMGPlan::runForIndex;
</span><del>- jit.move(MacroAssembler::TrustedImmPtr(reinterpret_cast<void*>(run)), \
GPRInfo::argumentGPR2);
- jit.call(GPRInfo::argumentGPR2, NoPtrTag);
</del><ins>+ PtrTag tag = ptrTag(WasmHelperPtrTag, nextPtrTagID());
+ jit.move(MacroAssembler::TrustedImmPtr(tagCFunctionPtr(run, tag)), \
GPRInfo::argumentGPR2); + jit.call(GPRInfo::argumentGPR2, tag);
</ins><span class="cx">
</span><span class="cx"> \
ScratchRegisterAllocator::restoreRegistersFromStackForCall(jit, registersToSpill, \
RegisterSet(), numberOfStackBytesUsedForRegisterPreservation, extraPaddingBytes); \
</span><span class="cx"> </span><span class="lines">@@ -99,7 +102,7 @@
</span><span class="cx"> jit.emitFunctionEpilogue();
</span><span class="cx"> jit.ret();
</span><span class="cx"> LinkBuffer linkBuffer(jit, GLOBAL_THUNK_ID);
</span><del>- return FINALIZE_CODE(linkBuffer, NoPtrTag, "Trigger OMG tier \
up"); </del><ins>+ return FINALIZE_CODE(linkBuffer, NearCallPtrTag, \
"Trigger OMG tier up"); </ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static Thunks* thunks;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWasmToJScpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/wasm/js/WasmToJS.cpp \
(230105 => 230106)</h4> <pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/js/WasmToJS.cpp 2018-03-30 \
16:05:22 UTC (rev 230105)
+++ trunk/Source/JavaScriptCore/wasm/js/WasmToJS.cpp 2018-03-30 16:31:06 UTC (rev \
230106) </span><span class="lines">@@ -93,7 +93,8 @@
</span><span class="cx"> // Let's be paranoid on the exception path and zero \
out the poison instead of leaving it in an argument GPR. </span><span class="cx"> \
jit.move(CCallHelpers::TrustedImm32(0), GPRInfo::argumentGPR3); </span><span \
class="cx"> </span><del>- auto call = jit.call(NoPtrTag);
</del><ins>+ PtrTag callTag = ptrTag(WasmHelperPtrTag, nextPtrTagID());
+ auto call = jit.call(callTag);
</ins><span class="cx"> jit.jumpToExceptionHandler(*vm);
</span><span class="cx">
</span><span class="cx"> void (*throwBadI64)(ExecState*, \
JSWebAssemblyInstance*) = [] (ExecState* exec, JSWebAssemblyInstance* instance) -> \
void { </span><span class="lines">@@ -115,8 +116,9 @@
</span><span class="cx"> if (UNLIKELY(linkBuffer.didFailToAllocate()))
</span><span class="cx"> return \
makeUnexpected(BindingFailure::OutOfMemory); </span><span class="cx">
</span><del>- linkBuffer.link(call, throwBadI64);
- return FINALIZE_CODE(linkBuffer, NoPtrTag, "WebAssembly->JavaScript \
invalid i64 use in import[%i]", importIndex); </del><ins>+ \
linkBuffer.link(call, FunctionPtr(throwBadI64, callTag)); + PtrTag tag = \
ptrTag(WasmCallPtrTag, signature.hash()); + return FINALIZE_CODE(linkBuffer, \
tag, "WebAssembly->JavaScript invalid i64 use in import[%i]", \
importIndex); </ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return MacroAssemblerCodeRef();
</span><span class="lines">@@ -300,9 +302,12 @@
</span><span class="cx"> // Let's be paranoid before the call and zero out \
the poison instead of leaving it in an argument GPR. </span><span class="cx"> \
jit.move(CCallHelpers::TrustedImm32(0), GPRInfo::argumentGPR3); </span><span \
class="cx"> </span><ins>+ PtrTag callTag = ptrTag(WasmHelperPtrTag, \
nextPtrTagID()); + PtrTag doUnwindingTag = ptrTag(WasmHelperPtrTag, \
nextPtrTagID()); +
</ins><span class="cx"> static_assert(GPRInfo::numberOfArgumentRegisters \
>= 4, "We rely on this with the call below."); </span><span class="cx"> \
jit.setupArguments<decltype(callFunc)>(GPRInfo::argumentGPR1, \
CCallHelpers::TrustedImm32(signatureIndex), CCallHelpers::TrustedImmPtr(buffer)); \
</span><del>- auto call = jit.call(NoPtrTag); </del><ins>+ auto call = \
jit.call(callTag); </ins><span class="cx"> auto noException = \
jit.emitExceptionCheck(*vm, AssemblyHelpers::InvertedExceptionCheck); </span><span \
class="cx"> </span><span class="cx"> // Exception here.
</span><span class="lines">@@ -314,7 +319,7 @@
</span><span class="cx"> genericUnwind(vm, exec);
</span><span class="cx"> ASSERT(!!vm->callFrameForCatch);
</span><span class="cx"> };
</span><del>- auto exceptionCall = jit.call(NoPtrTag);
</del><ins>+ auto exceptionCall = jit.call(doUnwindingTag);
</ins><span class="cx"> jit.jumpToExceptionHandler(*vm);
</span><span class="cx">
</span><span class="cx"> noException.link(&jit);
</span><span class="lines">@@ -339,10 +344,11 @@
</span><span class="cx"> if (UNLIKELY(linkBuffer.didFailToAllocate()))
</span><span class="cx"> return \
makeUnexpected(BindingFailure::OutOfMemory); </span><span class="cx">
</span><del>- linkBuffer.link(call, callFunc);
- linkBuffer.link(exceptionCall, doUnwinding);
</del><ins>+ linkBuffer.link(call, FunctionPtr(callFunc, callTag));
+ linkBuffer.link(exceptionCall, FunctionPtr(doUnwinding, doUnwindingTag));
</ins><span class="cx">
</span><del>- return FINALIZE_CODE(linkBuffer, NoPtrTag, \
"WebAssembly->JavaScript import[%i] %s", importIndex, \
signature.toString().ascii().data()); </del><ins>+ PtrTag tag = \
ptrTag(WasmCallPtrTag, signature.hash()); + return FINALIZE_CODE(linkBuffer, \
tag, "WebAssembly->JavaScript import[%i] %s", importIndex, \
signature.toString().ascii().data()); </ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Note: We don't need to perform a stack check here \
since WasmB3IRGenerator </span><span class="lines">@@ -544,13 +550,14 @@
</span><span class="cx"> jit.zeroExtend32ToPtr(GPRInfo::returnValueGPR, \
GPRInfo::returnValueGPR); </span><span class="cx"> done.append(jit.jump());
</span><span class="cx">
</span><ins>+ PtrTag tag = ptrTag(WasmHelperPtrTag, nextPtrTagID());
</ins><span class="cx"> slowPath.link(&jit);
</span><span class="cx"> \
jit.setupArguments<decltype(convertToI32)>(GPRInfo::returnValueGPR); \
</span><del>- auto call = jit.call(NoPtrTag); </del><ins>+ auto call = \
jit.call(tag); </ins><span class="cx"> \
exceptionChecks.append(jit.emitJumpIfException(*vm)); </span><span class="cx">
</span><span class="cx"> jit.addLinkTask([=] (LinkBuffer& linkBuffer) {
</span><del>- linkBuffer.link(call, convertToI32);
</del><ins>+ linkBuffer.link(call, FunctionPtr(convertToI32, tag));
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> done.link(&jit);
</span><span class="lines">@@ -579,13 +586,14 @@
</span><span class="cx"> jit.convertDoubleToFloat(FPRInfo::returnValueFPR, \
FPRInfo::returnValueFPR); </span><span class="cx"> done.append(jit.jump());
</span><span class="cx">
</span><ins>+ PtrTag tag = ptrTag(WasmHelperPtrTag, nextPtrTagID());
</ins><span class="cx"> notANumber.link(&jit);
</span><span class="cx"> \
jit.setupArguments<decltype(convertToF32)>(GPRInfo::returnValueGPR); \
</span><del>- auto call = jit.call(NoPtrTag); </del><ins>+ auto call = \
jit.call(tag); </ins><span class="cx"> \
exceptionChecks.append(jit.emitJumpIfException(*vm)); </span><span class="cx">
</span><span class="cx"> jit.addLinkTask([=] (LinkBuffer& linkBuffer) {
</span><del>- linkBuffer.link(call, convertToF32);
</del><ins>+ linkBuffer.link(call, FunctionPtr(convertToF32, tag));
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> done.link(&jit);
</span><span class="lines">@@ -613,13 +621,14 @@
</span><span class="cx"> jit.move64ToDouble(GPRInfo::returnValueGPR, \
FPRInfo::returnValueFPR); </span><span class="cx"> done.append(jit.jump());
</span><span class="cx">
</span><ins>+ PtrTag tag = ptrTag(WasmHelperPtrTag, nextPtrTagID());
</ins><span class="cx"> notANumber.link(&jit);
</span><span class="cx"> \
jit.setupArguments<decltype(convertToF64)>(GPRInfo::returnValueGPR); \
</span><del>- auto call = jit.call(NoPtrTag); </del><ins>+ auto call = \
jit.call(tag); </ins><span class="cx"> \
exceptionChecks.append(jit.emitJumpIfException(*vm)); </span><span class="cx">
</span><span class="cx"> jit.addLinkTask([=] (LinkBuffer& linkBuffer) {
</span><del>- linkBuffer.link(call, convertToF64);
</del><ins>+ linkBuffer.link(call, FunctionPtr(convertToF64, tag));
</ins><span class="cx"> });
</span><span class="cx">
</span><span class="cx"> done.link(&jit);
</span><span class="lines">@@ -631,10 +640,11 @@
</span><span class="cx"> jit.ret();
</span><span class="cx">
</span><span class="cx"> if (!exceptionChecks.empty()) {
</span><ins>+ PtrTag tag = ptrTag(WasmHelperPtrTag, nextPtrTagID());
</ins><span class="cx"> exceptionChecks.link(&jit);
</span><span class="cx"> \
jit.copyCalleeSavesToEntryFrameCalleeSavesBuffer(vm->topEntryFrame); </span><span \
class="cx"> jit.move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0); \
</span><del>- auto call = jit.call(NoPtrTag); </del><ins>+ auto call = \
jit.call(tag); </ins><span class="cx"> jit.jumpToExceptionHandler(*vm);
</span><span class="cx">
</span><span class="cx"> void (*doUnwinding)(ExecState*) = [] (ExecState* \
exec) -> void { </span><span class="lines">@@ -645,7 +655,7 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> jit.addLinkTask([=] (LinkBuffer& linkBuffer) {
</span><del>- linkBuffer.link(call, doUnwinding);
</del><ins>+ linkBuffer.link(call, FunctionPtr(doUnwinding, tag));
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -659,7 +669,8 @@
</span><span class="cx"> CodeLocationNearCall hotPathOther = \
patchBuffer.locationOfNearCall(fastCall); </span><span class="cx"> \
callLinkInfo->setCallLocations(callReturnLocation, hotPathBegin, hotPathOther); \
</span><span class="cx"> </span><del>- return FINALIZE_CODE(patchBuffer, \
NoPtrTag, "WebAssembly->JavaScript import[%i] %s", importIndex, \
signature.toString().ascii().data()); </del><ins>+ PtrTag tag = \
ptrTag(WasmCallPtrTag, signature.hash()); + return FINALIZE_CODE(patchBuffer, tag, \
"WebAssembly->JavaScript import[%i] %s", importIndex, \
signature.toString().ascii().data()); </ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void* wasmToJSException(ExecState* exec, Wasm::ExceptionType \
type, Instance* wasmInstance) </span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyFunctioncpp"></a>
<div class="modfile"><h4>Modified: \
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp (230105 => 230106)</h4> \
<pre class="diff"><span> <span class="info">--- \
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp 2018-03-30 16:05:22 UTC \
(rev 230105)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp 2018-03-30 16:31:06 \
UTC (rev 230106) </span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx"> vm.wasmContext.store(wasmInstance, vm.softStackLimit());
</span><span class="cx"> ASSERT(wasmFunction->instance());
</span><span class="cx"> ASSERT(&wasmFunction->instance()->instance() \
== vm.wasmContext.load()); </span><del>- EncodedJSValue rawResult = \
vmEntryToWasm(wasmFunction->jsEntrypoint().executableAddress(), &vm, \
&protoCallFrame); </del><ins>+ EncodedJSValue rawResult = \
vmEntryToWasm(wasmFunction->jsEntrypoint(MustCheckArity).executableAddress(), \
&vm, &protoCallFrame); </ins><span class="cx"> // We need to make sure \
this is in a register or on the stack since it's stored in Vector<JSValue>. \
</span><span class="cx"> // This probably isn't strictly necessary, since the \
WebAssemblyFunction* should keep the instance </span><span class="cx"> // alive. \
But it's good hygiene. </span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmjsWebAssemblyFunctionh"></a>
<div class="modfile"><h4>Modified: \
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.h (230105 => 230106)</h4> \
<pre class="diff"><span> <span class="info">--- \
trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.h 2018-03-30 16:05:22 UTC \
(rev 230105)
+++ trunk/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.h 2018-03-30 16:31:06 UTC \
(rev 230106) </span><span class="lines">@@ -64,7 +64,13 @@
</span><span class="cx"> WasmToWasmImportableFunction::LoadLocation \
entrypointLoadLocation() const { return m_importableFunction.entrypointLoadLocation; \
} </span><span class="cx"> WasmToWasmImportableFunction importableFunction() \
const { return m_importableFunction; } </span><span class="cx">
</span><del>- MacroAssemblerCodePtr jsEntrypoint() { return m_jsEntrypoint; }
</del><ins>+ MacroAssemblerCodePtr jsEntrypoint(ArityCheckMode arity)
+ {
+ if (arity == ArityCheckNotRequired)
+ return m_jsEntrypoint;
+ ASSERT(arity == MustCheckArity);
+ return m_jsEntrypoint.retagged(CodeEntryPtrTag, \
CodeEntryWithArityCheckPtrTag); + }
</ins><span class="cx">
</span><span class="cx"> static ptrdiff_t offsetOfEntrypointLoadLocation() { \
return OBJECT_OFFSETOF(WebAssemblyFunction, m_importableFunction) + \
WasmToWasmImportableFunction::offsetOfEntrypointLoadLocation(); } </span><span \
class="cx"> </span></span></pre>
</div>
</div>
</body>
</html>
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic