Ignore:
Timestamp:
Nov 3, 2019, 8:11:43 PM (6 years ago)
Author:
Tadeu Zagallo
Message:

LLIntGenerator should not allocate temporaries in between variables
https://bugs.webkit.org/show_bug.cgi?id=203787

Reviewed by Yusuke Suzuki.

JSTests:

  • wasm/stress/local-ref.js: Added.

Source/JavaScriptCore:

The BytecodeGenerator requires that all variables must be allocated contiguously, before any
temporaries are allocated. Currently, we might end up allocating a temporary to materialize
the null constant to initialize locals of type Anyref/Funcref. Fix it by keeping track of the
locals that need to be initialized and adding a new callback to notify when we have finished
parsing locals. Only then we perform the delayed initialization of local refs.

  • wasm/WasmAirIRGenerator.cpp:

(JSC::Wasm::AirIRGenerator::didFinishParsingLocals):

  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::B3IRGenerator::didFinishParsingLocals):

  • wasm/WasmFunctionParser.h:

(JSC::Wasm::FunctionParser<Context>::parse):

  • wasm/WasmLLIntGenerator.cpp:

(JSC::Wasm::LLIntGenerator::addLocal):
(JSC::Wasm::LLIntGenerator::didFinishParsingLocals):

  • wasm/WasmValidate.cpp:

(JSC::Wasm::Validate::didFinishParsingLocals):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r251967 r251978  
     12019-11-03  Tadeu Zagallo  <[email protected]>
     2
     3        LLIntGenerator should not allocate temporaries in between variables
     4        https://bugs.webkit.org/show_bug.cgi?id=203787
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        The BytecodeGenerator requires that all variables must be allocated contiguously, before any
     9        temporaries are allocated. Currently, we might end up allocating a temporary to materialize
     10        the null constant to initialize locals of type Anyref/Funcref. Fix it by keeping track of the
     11        locals that need to be initialized and adding a new callback to notify when we have finished
     12        parsing locals. Only then we perform the delayed initialization of local refs.
     13
     14        * wasm/WasmAirIRGenerator.cpp:
     15        (JSC::Wasm::AirIRGenerator::didFinishParsingLocals):
     16        * wasm/WasmB3IRGenerator.cpp:
     17        (JSC::Wasm::B3IRGenerator::didFinishParsingLocals):
     18        * wasm/WasmFunctionParser.h:
     19        (JSC::Wasm::FunctionParser<Context>::parse):
     20        * wasm/WasmLLIntGenerator.cpp:
     21        (JSC::Wasm::LLIntGenerator::addLocal):
     22        (JSC::Wasm::LLIntGenerator::didFinishParsingLocals):
     23        * wasm/WasmValidate.cpp:
     24        (JSC::Wasm::Validate::didFinishParsingLocals):
     25
    1262019-11-02  Alexey Proskuryakov  <[email protected]>
    227
Note: See TracChangeset for help on using the changeset viewer.