Ignore:
Timestamp:
Jul 28, 2015, 5:55:17 PM (10 years ago)
Author:
[email protected]
Message:

Implement WebAssembly module parser
https://bugs.webkit.org/show_bug.cgi?id=147293

Patch by Sukolsak Sakshuwong <Sukolsak Sakshuwong> on 2015-07-28
Reviewed by Geoffrey Garen.

Implement WebAssembly module parser for WebAssembly files produced by pack-asmjs
<https://github.com/WebAssembly/polyfill-prototype-1>. This patch only checks
the magic number at the beginning of the files. Parsing of the rest will be
implemented in a subsequent patch.

(GlobalObject::finishCreation):
(functionLoadWebAssembly):

  • parser/SourceProvider.h:

(JSC::WebAssemblySourceProvider::create):
(JSC::WebAssemblySourceProvider::data):
(JSC::WebAssemblySourceProvider::WebAssemblySourceProvider):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::wasmModuleStructure):

  • wasm/WASMMagicNumber.h: Added.
  • wasm/WASMModuleParser.cpp: Added.

(JSC::WASMModuleParser::WASMModuleParser):
(JSC::WASMModuleParser::parse):
(JSC::WASMModuleParser::parseModule):
(JSC::parseWebAssembly):

  • wasm/WASMModuleParser.h: Added.
  • wasm/WASMReader.cpp: Added.

(JSC::WASMReader::readUnsignedInt32):
(JSC::WASMReader::readFloat):
(JSC::WASMReader::readDouble):

  • wasm/WASMReader.h: Added.

(JSC::WASMReader::WASMReader):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r187515 r187531  
    244244    WriteBarrier<Structure> m_regExpMatchesArrayStructure;
    245245    WriteBarrier<Structure> m_promiseStructure;
     246#if ENABLE(WEBASSEMBLY)
     247    WriteBarrier<Structure> m_wasmModuleStructure;
     248#endif
    246249
    247250#define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
     
    476479    Structure* regExpMatchesArrayStructure() const { return m_regExpMatchesArrayStructure.get(); }
    477480    Structure* promiseStructure() const { return m_promiseStructure.get(); }
     481#if ENABLE(WEBASSEMBLY)
     482    Structure* wasmModuleStructure() const { return m_wasmModuleStructure.get(); }
     483#endif
    478484
    479485    JS_EXPORT_PRIVATE void setRemoteDebuggingEnabled(bool);
Note: See TracChangeset for help on using the changeset viewer.