• Clemens Hammacher's avatar
    [wasm] [interpreter] Implement indirect function calls · b8f88601
    Clemens Hammacher authored
    This CL adds support for indirect function calls to the interpreter. It
    can indirectly call other wasm function in the same instance, which are
    then executed in the interpreter, or call imported functions.
    
    Implementing this required some refactoring:
    - The wasm interpreter now unwraps import wrappers on demand, instead
      of unwrapping all of them on instantiation and storing a vector of
      handles. This also avoids the DeferredHandleScope completely, instead
      we just store two global handles in the code map.
    - The interpreter gets the code table, function tables and signature
      tables directly from the attached wasm instance object. This ensures
      that the interpreter sees all updates to tables that might have been
      performed by external code.
    - There is now common functionality for calling a code object. This is
      used for direct calls to imported functions and for all indirect
      calls. As these code objects can also be wasm functions which should
      be executed in the interpreter itself, I introduce a struct to hold
      the outcome of calling the code object, or a pointer to
      InterpreterCode to be called in the interpreter.
    
    R=ahaas@chromium.org
    BUG=v8:5822
    
    Change-Id: I20fb2ea007e79e5fcff9afb4b1ca31739ebcb83f
    Reviewed-on: https://chromium-review.googlesource.com/458417
    Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
    Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#44059}
    b8f88601
wasm-debug.cc 20.9 KB