Commit 768093f4 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] Handle simple opcodes specially

Avoid the indirection via the signature, instead specialize per
signature. On a microbenchmark run locally, this speeds up Liftoff by
~5% and validation by ~15%.

R=titzer@chromium.org

Bug: v8:8423
Change-Id: Ia0e9ab0dcaa759e4ed4dcd46d2e6f16e65790915
Reviewed-on: https://chromium-review.googlesource.com/c/1373778Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58241}
parent 0091fbe8
This diff is collapsed.
......@@ -475,20 +475,8 @@ constexpr std::array<WasmOpcodeSig, 256> kAtomicExprSigTable =
constexpr std::array<WasmOpcodeSig, 256> kNumericExprSigTable =
base::make_array<256>(GetNumericOpcodeSigIndex{});
// Computes a direct pointer to a cached signature for a simple opcode.
struct GetSimpleOpcodeSig {
constexpr const FunctionSig* operator()(byte opcode) const {
#define CASE(name, opc, sig) opcode == opc ? &kSig_##sig:
return FOREACH_SIMPLE_OPCODE(CASE) nullptr;
#undef CASE
}
};
} // namespace
const std::array<const FunctionSig*, 256> kSimpleOpcodeSigs =
base::make_array<256>(GetSimpleOpcodeSig{});
FunctionSig* WasmOpcodes::Signature(WasmOpcode opcode) {
switch (opcode >> 8) {
case 0:
......
......@@ -576,8 +576,6 @@ enum TrapReason {
#undef DECLARE_ENUM
};
extern const std::array<const FunctionSig*, 256> kSimpleOpcodeSigs;
// A collection of opcode-related static methods.
class V8_EXPORT_PRIVATE WasmOpcodes {
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