Commit ede7df9c authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Move definition of FunctionSig to a common place

We were re-definining the FunctionSig typedef in several places. This
CL moves it to value-type.h, since it's a signature over ValueType.

R=titzer@chromium.org

Bug: v8:8238
Change-Id: Id5e8a55c7e0f98d61235e32a5e6cd12e04d26947
Reviewed-on: https://chromium-review.googlesource.com/c/1278387
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56597}
parent a2918ebd
......@@ -15,8 +15,6 @@ namespace internal {
namespace wasm {
using FunctionSig = Signature<ValueType>;
// A signature map canonicalizes signatures into a range of indices so that
// two different {FunctionSig} instances with the same contents map to the
// same index.
......
......@@ -10,6 +10,10 @@
namespace v8 {
namespace internal {
template <typename T>
class Signature;
namespace wasm {
enum ValueType : uint8_t {
......@@ -25,6 +29,8 @@ enum ValueType : uint8_t {
kWasmVar,
};
using FunctionSig = Signature<ValueType>;
inline size_t hash_value(ValueType type) { return static_cast<size_t>(type); }
// TODO(clemensh): Compute memtype and size from ValueType once we have c++14
......
......@@ -16,8 +16,6 @@ namespace v8 {
namespace internal {
namespace wasm {
using FunctionSig = Signature<ValueType>;
// Implements a cache for import wrappers.
class WasmImportWrapperCache {
public:
......
......@@ -29,7 +29,6 @@ struct WasmModule;
class SignatureMap;
class WireBytesRef;
class WasmInterpreter;
using FunctionSig = Signature<ValueType>;
struct WasmFeatures;
} // namespace wasm
......
......@@ -13,12 +13,8 @@
namespace v8 {
namespace internal {
template <typename T>
class Signature;
namespace wasm {
using FunctionSig = Signature<ValueType>;
std::ostream& operator<<(std::ostream& os, const FunctionSig& function);
bool IsJSCompatibleSignature(const FunctionSig* sig);
......
......@@ -6,14 +6,13 @@
#define TEST_SIGNATURES_H
#include "src/signature.h"
#include "src/wasm/value-type.h"
#include "src/wasm/wasm-opcodes.h"
namespace v8 {
namespace internal {
namespace wasm {
typedef Signature<ValueType> FunctionSig;
// A helper class with many useful signatures in order to simplify tests.
class TestSignatures {
public:
......
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