Unreviewed, rolling out r250002.
https://bugs.webkit.org/show_bug.cgi?id=201943

Patching of the callee and call is not atomic (Requested by
tadeuzagallo on #webkit).

Reverted changeset:

"Change WebAssembly calling conventions"
https://bugs.webkit.org/show_bug.cgi?id=201799
https://trac.webkit.org/changeset/250002

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@250052 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/wasm/WasmBinding.cpp b/Source/JavaScriptCore/wasm/WasmBinding.cpp
index eefb972..ce61076 100644
--- a/Source/JavaScriptCore/wasm/WasmBinding.cpp
+++ b/Source/JavaScriptCore/wasm/WasmBinding.cpp
@@ -47,7 +47,6 @@
     JIT jit;
 
     GPRReg scratch = wasmCallingConventionAir().prologueScratch(0);
-    GPRReg callee = wasmCallingConventionAir().prologueScratch(1);
     GPRReg baseMemory = pinnedRegs.baseMemoryPointer;
     ASSERT(baseMemory != scratch);
     ASSERT(pinnedRegs.sizeRegister != baseMemory);
@@ -58,20 +57,13 @@
     jit.loadWasmContextInstance(sizeRegAsScratch); // Old Instance*
     // Get the callee's Wasm::Instance and set it as WasmContext's instance. The caller will take care of restoring its own Instance.
     jit.loadPtr(JIT::Address(sizeRegAsScratch, Instance::offsetOfTargetInstance(importIndex)), baseMemory); // Instance*.
-    // While we're accessing that cacheline, also get the wasm entrypoint and callee so we can tail call to it below.
+    // While we're accessing that cacheline, also get the wasm entrypoint so we can tail call to it below.
     jit.loadPtr(JIT::Address(sizeRegAsScratch, Instance::offsetOfWasmEntrypointLoadLocation(importIndex)), scratch);
-    jit.loadPtr(JIT::Address(sizeRegAsScratch, Instance::offsetOfBoxedCalleeLoadLocation(importIndex)), callee);
     jit.storeWasmContextInstance(baseMemory);
 
     jit.loadPtr(JIT::Address(sizeRegAsScratch, Instance::offsetOfCachedStackLimit()), sizeRegAsScratch);
     jit.storePtr(sizeRegAsScratch, JIT::Address(baseMemory, Instance::offsetOfCachedStackLimit()));
 
-    // Set the callee slot in the call frame
-    jit.loadPtr(callee, callee);
-    // At this point, we have been called, so ReturnPC is on the stack, but we have not yet pushed the frame pointer,
-    // so we have to subtract the space for CallerFrame from the callee slot
-    jit.storePtr(callee, JIT::Address(JIT::stackPointerRegister, CallFrameSlot::callee * sizeof(Register) - sizeof(CPURegister)));
-
     // FIXME the following code assumes that all Wasm::Instance have the same pinned registers. https://bugs.webkit.org/show_bug.cgi?id=162952
     // Set up the callee's baseMemory register as well as the memory size registers.
     {