Commit 839f5a64 authored by Thibaud Michaud's avatar Thibaud Michaud Committed by Commit Bot

[wasm][liftoff][eh] Encode f32 values in exceptions

R=clemensb@chromium.org

Bug: v8:11453
Change-Id: I8a29f1359b9f77401bba1f6abb8d11221b742176
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2763876
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73443}
parent 21a23587
......@@ -3883,12 +3883,24 @@ class LiftoffCompiler {
int* index_in_array, LiftoffRegList pinned) {
// TODO(clemensb): Handle more types.
LiftoffRegister value = pinned.set(__ PopToRegister(pinned));
if (type == kWasmI32) {
Store32BitExceptionValue(values_array, index_in_array, value.gp(),
pinned);
} else {
DCHECK_EQ(type, kWasmI64);
Store64BitExceptionValue(values_array, index_in_array, value, pinned);
switch (type.kind()) {
case kI32:
Store32BitExceptionValue(values_array, index_in_array, value.gp(),
pinned);
break;
case kF32: {
LiftoffRegister gp_reg =
pinned.set(__ GetUnusedRegister(kGpReg, pinned));
__ emit_type_conversion(kExprI32ReinterpretF32, gp_reg, value, nullptr);
Store32BitExceptionValue(values_array, index_in_array, gp_reg.gp(),
pinned);
break;
}
case kI64:
Store64BitExceptionValue(values_array, index_in_array, value, pinned);
break;
default:
UNREACHABLE();
}
}
......@@ -3986,7 +3998,7 @@ class LiftoffCompiler {
for (size_t param_idx = sig->parameter_count(); param_idx > 0;
--param_idx) {
ValueType type = sig->GetParam(param_idx - 1);
if (type != kWasmI32 && type != kWasmI64) {
if (type != kWasmI32 && type != kWasmI64 && type != kWasmF32) {
unsupported(decoder, kExceptionHandling,
"unsupported type in exception payload");
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment