Ignore:
Timestamp:
Nov 16, 2016, 3:34:39 PM (9 years ago)
Author:
[email protected]
Message:

Wasm function parser should use template functions for each binary and unary opcode
https://bugs.webkit.org/show_bug.cgi?id=164835

Reviewed by Mark Lam.

This patch changes the wasm function parser to call into a template specialization
for each binary/unary opcode. This change makes it easier to have custom implementations
of various opcodes. It is also, in theory a speedup since it does not require switching
on the opcode twice.

  • CMakeLists.txt:
  • DerivedSources.make:
  • wasm/WasmB3IRGenerator.cpp:

(): Deleted.

  • wasm/WasmFunctionParser.h:

(JSC::Wasm::FunctionParser<Context>::binaryCase):
(JSC::Wasm::FunctionParser<Context>::unaryCase):
(JSC::Wasm::FunctionParser<Context>::parseExpression):

  • wasm/WasmValidate.cpp:
  • wasm/generateWasm.py:

(isBinary):
(isSimple):

  • wasm/generateWasmB3IRGeneratorInlinesHeader.py: Added.

(generateSimpleCode):

  • wasm/generateWasmOpsHeader.py:

(opcodeMacroizer):

  • wasm/generateWasmValidateInlinesHeader.py:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/wasm/WasmValidate.cpp

    r208719 r208821  
    9292
    9393    // Basic operators
    94     bool WARN_UNUSED_RETURN binaryOp(BinaryOpType, ExpressionType left, ExpressionType right, ExpressionType& result);
    95     bool WARN_UNUSED_RETURN unaryOp(UnaryOpType, ExpressionType arg, ExpressionType& result);
     94    template<OpType>
     95    bool WARN_UNUSED_RETURN addOp(ExpressionType arg, ExpressionType& result);
     96    template<OpType>
     97    bool WARN_UNUSED_RETURN addOp(ExpressionType left, ExpressionType right, ExpressionType& result);
    9698    bool WARN_UNUSED_RETURN addSelect(ExpressionType condition, ExpressionType nonZero, ExpressionType zero, ExpressionType& result);
    9799
Note: See TracChangeset for help on using the changeset viewer.