• Manos Koukoutos's avatar
    [wasm] Implement EvaluateInitExpression · dc3f7f81
    Manos Koukoutos authored
    So far, initializer-expression evaluation was tied to setting global
    values. We now need it to operate independently of globals, so that we
    can implement new constant expressions like struct.new, which need their
    arguments to be computed before they can be initialized.
    
    Changes:
    - Move type computation of WasmInitExpr into WasmInitExpr::type.
    - Fix WasmInitExpr::type kRttSub case for rtts without depth.
    - Introduce InstanceBuilder::EvaluateInitExpression().
    - Rename InstanceBuilder::GetRawGlobalPointer() ->
      GetRawUntaggedGlobalPointer().
    - Simplify InstanceBuilder::InitGlobals using EvaluateInitExpression().
    - Introduce ValueType::is_numeric.
    - Add Simd128(byte*) constructor.
    - Introduce WasmValue::CopyTo() for numeric types.
    
    Change-Id: Ic502b611f3998187abd9fc6ec377c2954c27abdc
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2939982
    Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
    Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#74949}
    dc3f7f81
value-type.h 24.4 KB