Ignore:
Timestamp:
Dec 13, 2016, 5:31:43 PM (9 years ago)
Author:
[email protected]
Message:

WebAssembly: implement the elements section
https://bugs.webkit.org/show_bug.cgi?id=165715

Reviewed by Keith Miller.

JSTests:

  • wasm/Builder.js:

(export.default.Builder.prototype._registerSectionBuilders.switch.case.string_appeared_here.this.section):
(export.default.Builder.prototype._registerSectionBuilders.switch):

  • wasm/Builder_WebAssemblyBinary.js:

(const.emitters.Element):

  • wasm/function-tests/basic-element.js: Added.
  • wasm/js-api/element.js: Added.

(assertBadBinary):
(assertBadBinary.badInstantiation):

Source/JavaScriptCore:

This is a straight forward implementation of the Element
section in the Wasm spec:
https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md#element-section

There are a few ambiguities I encountered when implementing this, so I've
filed bugs against the Wasm design repo, and corresponding bugzilla bugs
for us to address after they've been discussed by the various Wasm folks:

  • wasm/WasmFormat.h:
  • wasm/WasmModuleParser.cpp:

(JSC::Wasm::ModuleParser::parseElement):
(JSC::Wasm::ModuleParser::parseInitExpr):
(JSC::Wasm::ModuleParser::parseData):

  • wasm/WasmModuleParser.h:
  • wasm/js/WebAssemblyModuleRecord.cpp:

(JSC::WebAssemblyModuleRecord::evaluate):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/wasm/WasmModuleParser.h

    r209771 r209785  
    8282    bool WARN_UNUSED_RETURN parseTableHelper(bool isImport);
    8383    bool WARN_UNUSED_RETURN parseResizableLimits(uint32_t& initial, std::optional<uint32_t>& maximum);
     84    bool WARN_UNUSED_RETURN parseInitExpr(uint32_t&);
    8485
    8586    VM* m_vm;
Note: See TracChangeset for help on using the changeset viewer.