[wasm] Support anyref for external calls in interpreter.
This adds support for passing/returning reference type parameter/return values when the interpreter is calling extern functions. It expands the existing test coverage to the interpreter. R=clemensh@chromium.org TEST=mjsunit/wasm/anyref-interpreter,mjsunit/wasm/anyfunc-interpreter BUG=v8:8091,v8:7581 Change-Id: I377e9d28aa36866c0441683ffd6a48160b721ec1 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1559853 Reviewed-by: Clemens Hammacher <clemensh@chromium.org> Commit-Queue: Michael Starzinger <mstarzinger@chromium.org> Cr-Commit-Position: refs/heads/master@{#60715}
This commit is contained in:
parent
31b49aeeb0
commit
b077d88e12
@ -3517,6 +3517,12 @@ class ThreadImpl {
|
||||
case kWasmF64:
|
||||
WriteUnalignedValue(address, arg.to<double>());
|
||||
break;
|
||||
case kWasmAnyRef:
|
||||
case kWasmAnyFunc:
|
||||
case kWasmExceptRef:
|
||||
DCHECK_EQ(kSystemPointerSize, param_size);
|
||||
WriteUnalignedValue<Object>(address, *arg.to_anyref());
|
||||
break;
|
||||
default:
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
@ -3588,6 +3594,13 @@ class ThreadImpl {
|
||||
case kWasmF64:
|
||||
Push(WasmValue(ReadUnalignedValue<double>(address)));
|
||||
break;
|
||||
case kWasmAnyRef:
|
||||
case kWasmAnyFunc:
|
||||
case kWasmExceptRef: {
|
||||
Handle<Object> ref(ReadUnalignedValue<Object>(address), isolate);
|
||||
Push(WasmValue(ref));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
UNIMPLEMENTED();
|
||||
}
|
||||
|
12
test/mjsunit/wasm/anyfunc-interpreter.js
Normal file
12
test/mjsunit/wasm/anyfunc-interpreter.js
Normal file
@ -0,0 +1,12 @@
|
||||
// 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.
|
||||
|
||||
// Flags: --expose-wasm --experimental-wasm-anyref --expose-gc
|
||||
// Flags: --wasm-interpret-all
|
||||
|
||||
// This is just a wrapper for an existing reference types test case that runs
|
||||
// with the --wasm-interpret-all flag added. If we ever decide to add a test
|
||||
// variant for this, then we can remove this file.
|
||||
|
||||
load("test/mjsunit/wasm/anyfunc.js");
|
12
test/mjsunit/wasm/anyref-interpreter.js
Normal file
12
test/mjsunit/wasm/anyref-interpreter.js
Normal file
@ -0,0 +1,12 @@
|
||||
// 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.
|
||||
|
||||
// Flags: --expose-wasm --experimental-wasm-anyref --expose-gc
|
||||
// Flags: --wasm-interpret-all
|
||||
|
||||
// This is just a wrapper for an existing reference types test case that runs
|
||||
// with the --wasm-interpret-all flag added. If we ever decide to add a test
|
||||
// variant for this, then we can remove this file.
|
||||
|
||||
load("test/mjsunit/wasm/anyref.js");
|
Loading…
Reference in New Issue
Block a user