Skip to content


Browse files Browse the repository at this point in the history
[JSC] Disable wasm tail-call because of several necessary things

Reviewed by Mark Lam.

This change disables wasm tail-calls since we still need several things to make it work correctly.

1. All wasm function calls need to adjust stack-pointer after the call. This is necessary thing for the support of tail-call,
   but currently it is not done yet. Since tail-call can adjust the stack-pointer of the caller, the stack-pointer value can become
   different after the tail-call happens from the caller's view. Since B3 etc. are freely accessing to stack slots via stack-pointer,
   and since stack-pointer needs to be the same during the procedure, the adjustment is required to make things work.
   In JS world, we are doing this adjustment: BaselineJIT's resetSP for example. Previously, since wasm does not have tail-calls,
   wasm call is not doing this adjustment. Now, we should do that.
2. We should not change offset of StackSlots. This is not a supported operation by B3 / Air.

For now, we disable wasm tail-call.

* Source/JavaScriptCore/runtime/OptionsList.h:

Canonical link:
  • Loading branch information
Constellation committed Feb 3, 2023
1 parent 14d3cca commit 3eb123c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions JSTests/wasm/v8/indirect-call-non-zero-table.js
@@ -1,4 +1,5 @@
//@ requireOptions("--useBBQJIT=1", "--useWasmLLInt=1", "--wasmLLIntTiersUpToBBQ=1")
//@ skip
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
Expand Down
2 changes: 1 addition & 1 deletion Source/JavaScriptCore/runtime/OptionsList.h
Expand Up @@ -560,7 +560,7 @@ bool canUseWebAssemblyFastMemory();
v(Bool, useWebAssemblyGC, false, Normal, "Allow gc types from the wasm gc proposal.") \
v(Bool, forceAllFunctionsToUseSIMD, false, Normal, "Force all functions to act conservatively w.r.t fp/vector registers for testing.") \
v(Bool, useWebAssemblySIMD, true, Normal, "Allow the new simd instructions and types from the wasm simd spec.") \
v(Bool, useWebAssemblyTailCalls, true, Normal, "Allow the new instructions from the wasm tail calls spec.") \
v(Bool, useWebAssemblyTailCalls, false, Normal, "Allow the new instructions from the wasm tail calls spec.") \

enum OptionEquivalence {
Expand Down

0 comments on commit 3eb123c

Please sign in to comment.