Commit 68ae81b
PPC/s390: [wasm] Fix return value of lazy compile runtime function
Port 22a16bd
Original Commit Message:
The Runtime_WasmCompileLazy function was returning a ptr-sized address,
wrapped in an Object. This worked because no GC is triggered between the
return from the runtime function and the point where we jump to the
returned address.
In a pointer-compressed world though, generated code assumes that all
objects live in the same 4GB heap, so comparisons only compare the lower
32 bit. On a 64-bit system, this can lead to collisions where a
comparison determines that the returned address equals a heap object,
even though the upper 32-bit differ.
This happens occasionally in the wild, where the returned function entry
pointer has the same lower half than the exception sentinel value. This
leads to triggering stack unwinding (by the CEntry stub), which then
fails (with a CHECK) because there is no pending exception.
This CL fixes that by returning a Smi instead which is the offset in the
jump table where the kWasmCompileLazy builtin should jump to. The
builtin then gets the jump table start address from the instance object,
adds the offset that the runtime function returned, and performs the
jump.
We do not include a regression test because this failure is very
spurious and hard to reproduce.
[email protected], [email protected], [email protected], [email protected]
BUG=
LOG=N
Change-Id: I92907b97a9d44d8cf42bb356ef350a22f7c5d5e1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3666249
Commit-Queue: Milad Farazmand <[email protected]>
Reviewed-by: Clemens Backes <[email protected]>
Reviewed-by: Junliang Yan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#80752}1 parent fe44d70 commit 68ae81b
2 files changed
Lines changed: 44 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2904 | 2904 | | |
2905 | 2905 | | |
2906 | 2906 | | |
2907 | | - | |
2908 | | - | |
| 2907 | + | |
| 2908 | + | |
2909 | 2909 | | |
2910 | 2910 | | |
2911 | 2911 | | |
| |||
2939 | 2939 | | |
2940 | 2940 | | |
2941 | 2941 | | |
2942 | | - | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
2943 | 2947 | | |
2944 | | - | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
2945 | 2951 | | |
2946 | 2952 | | |
2947 | 2953 | | |
2948 | 2954 | | |
2949 | | - | |
2950 | | - | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
2951 | 2966 | | |
2952 | 2967 | | |
2953 | 2968 | | |
2954 | 2969 | | |
2955 | 2970 | | |
2956 | | - | |
| 2971 | + | |
| 2972 | + | |
2957 | 2973 | | |
2958 | 2974 | | |
2959 | 2975 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2910 | 2910 | | |
2911 | 2911 | | |
2912 | 2912 | | |
2913 | | - | |
2914 | | - | |
| 2913 | + | |
| 2914 | + | |
2915 | 2915 | | |
2916 | 2916 | | |
2917 | 2917 | | |
| |||
2939 | 2939 | | |
2940 | 2940 | | |
2941 | 2941 | | |
2942 | | - | |
| 2942 | + | |
| 2943 | + | |
| 2944 | + | |
| 2945 | + | |
| 2946 | + | |
2943 | 2947 | | |
2944 | | - | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
2945 | 2951 | | |
2946 | 2952 | | |
2947 | 2953 | | |
2948 | 2954 | | |
2949 | | - | |
2950 | | - | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
2951 | 2964 | | |
2952 | 2965 | | |
2953 | 2966 | | |
2954 | 2967 | | |
2955 | 2968 | | |
2956 | | - | |
| 2969 | + | |
| 2970 | + | |
2957 | 2971 | | |
2958 | 2972 | | |
2959 | 2973 | | |
| |||
0 commit comments