Title: [244783] trunk/Source/_javascript_Core
Revision
244783
Author
[email protected]
Date
2019-04-30 10:57:48 -0700 (Tue, 30 Apr 2019)

Log Message

Fix failing ARM64E wasm tests
https://bugs.webkit.org/show_bug.cgi?id=197420

Reviewed by Saam Barati.

This patch fixes a bug in the slow path of our JS->Wasm IC bridge
where we wouldn't untag the link register before tail calling.

Additionally, this patch fixes a broken assert when using setting
Options::useTailCalls=false.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitCallForwardArgumentsInTailPosition):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (244782 => 244783)


--- trunk/Source/_javascript_Core/ChangeLog	2019-04-30 17:51:47 UTC (rev 244782)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-04-30 17:57:48 UTC (rev 244783)
@@ -1,3 +1,21 @@
+2019-04-30  Keith Miller  <[email protected]>
+
+        Fix failing ARM64E wasm tests
+        https://bugs.webkit.org/show_bug.cgi?id=197420
+
+        Reviewed by Saam Barati.
+
+        This patch fixes a bug in the slow path of our JS->Wasm IC bridge
+        where we wouldn't untag the link register before tail calling.
+
+        Additionally, this patch fixes a broken assert when using setting
+        Options::useTailCalls=false.
+
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::emitCallForwardArgumentsInTailPosition):
+        * wasm/js/WebAssemblyFunction.cpp:
+        (JSC::WebAssemblyFunction::jsCallEntrypointSlow):
+
 2019-04-29  Saam Barati  <[email protected]>
 
         Make JITType an enum class

Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp (244782 => 244783)


--- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp	2019-04-30 17:51:47 UTC (rev 244782)
+++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp	2019-04-30 17:57:48 UTC (rev 244783)
@@ -3285,7 +3285,8 @@
 
 RegisterID* BytecodeGenerator::emitCallForwardArgumentsInTailPosition(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition& divot, const JSTextPosition& divotStart, const JSTextPosition& divotEnd, DebuggableCall debuggableCall)
 {
-    ASSERT(m_inTailPosition);
+    // We must emit a tail call here because we did not allocate an arguments object thus we would otherwise have no way to correctly make this call.
+    ASSERT(m_inTailPosition || !Options::useTailCalls());
     return emitCallVarargs<OpTailCallForwardArguments>(dst, func, thisRegister, nullptr, firstFreeRegister, firstVarArgOffset, divot, divotStart, divotEnd, debuggableCall);
 }
     

Modified: trunk/Source/_javascript_Core/wasm/js/WebAssemblyFunction.cpp (244782 => 244783)


--- trunk/Source/_javascript_Core/wasm/js/WebAssemblyFunction.cpp	2019-04-30 17:51:47 UTC (rev 244782)
+++ trunk/Source/_javascript_Core/wasm/js/WebAssemblyFunction.cpp	2019-04-30 17:57:48 UTC (rev 244783)
@@ -470,6 +470,9 @@
     emitRestoreCalleeSaves();
     jit.move(CCallHelpers::TrustedImmPtr(this), GPRInfo::regT0);
     jit.emitFunctionEpilogue();
+#if CPU(ARM64E)
+    jit.untagPtr(MacroAssembler::linkRegister, MacroAssembler::stackPointerRegister);
+#endif
     auto jumpToHostCallThunk = jit.jump();
 
     LinkBuffer linkBuffer(jit, nullptr, JITCompilationCanFail);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to