Changeset 190690 in webkit


Ignore:
Timestamp:
Oct 7, 2015 2:57:22 PM (8 years ago)
Author:
Sukolsak Sakshuwong
Message:

Add an LLVM IR generator for WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=149486

Reviewed by Mark Lam.

This patch adds initial support for an LLVM IR generator in WebAssembly
(polyfill-prototype-1 format). All the methods will be implemented in
subsequent patches.

(JSC::WASMFunctionLLVMIRGenerator::MemoryAddress::MemoryAddress):
(JSC::WASMFunctionLLVMIRGenerator::startFunction):
(JSC::WASMFunctionLLVMIRGenerator::endFunction):
(JSC::WASMFunctionLLVMIRGenerator::buildSetLocal):
(JSC::WASMFunctionLLVMIRGenerator::buildSetGlobal):
(JSC::WASMFunctionLLVMIRGenerator::buildReturn):
(JSC::WASMFunctionLLVMIRGenerator::buildImmediateI32):
(JSC::WASMFunctionLLVMIRGenerator::buildImmediateF32):
(JSC::WASMFunctionLLVMIRGenerator::buildImmediateF64):
(JSC::WASMFunctionLLVMIRGenerator::buildGetLocal):
(JSC::WASMFunctionLLVMIRGenerator::buildGetGlobal):
(JSC::WASMFunctionLLVMIRGenerator::buildConvertType):
(JSC::WASMFunctionLLVMIRGenerator::buildLoad):
(JSC::WASMFunctionLLVMIRGenerator::buildStore):
(JSC::WASMFunctionLLVMIRGenerator::buildUnaryI32):
(JSC::WASMFunctionLLVMIRGenerator::buildUnaryF32):
(JSC::WASMFunctionLLVMIRGenerator::buildUnaryF64):
(JSC::WASMFunctionLLVMIRGenerator::buildBinaryI32):
(JSC::WASMFunctionLLVMIRGenerator::buildBinaryF32):
(JSC::WASMFunctionLLVMIRGenerator::buildBinaryF64):
(JSC::WASMFunctionLLVMIRGenerator::buildRelationalI32):
(JSC::WASMFunctionLLVMIRGenerator::buildRelationalF32):
(JSC::WASMFunctionLLVMIRGenerator::buildRelationalF64):
(JSC::WASMFunctionLLVMIRGenerator::buildMinOrMaxI32):
(JSC::WASMFunctionLLVMIRGenerator::buildMinOrMaxF64):
(JSC::WASMFunctionLLVMIRGenerator::buildCallInternal):
(JSC::WASMFunctionLLVMIRGenerator::buildCallIndirect):
(JSC::WASMFunctionLLVMIRGenerator::buildCallImport):
(JSC::WASMFunctionLLVMIRGenerator::appendExpressionList):
(JSC::WASMFunctionLLVMIRGenerator::discard):
(JSC::WASMFunctionLLVMIRGenerator::linkTarget):
(JSC::WASMFunctionLLVMIRGenerator::jumpToTarget):
(JSC::WASMFunctionLLVMIRGenerator::jumpToTargetIf):
(JSC::WASMFunctionLLVMIRGenerator::startLoop):
(JSC::WASMFunctionLLVMIRGenerator::endLoop):
(JSC::WASMFunctionLLVMIRGenerator::startSwitch):
(JSC::WASMFunctionLLVMIRGenerator::endSwitch):
(JSC::WASMFunctionLLVMIRGenerator::startLabel):
(JSC::WASMFunctionLLVMIRGenerator::endLabel):
(JSC::WASMFunctionLLVMIRGenerator::breakTarget):
(JSC::WASMFunctionLLVMIRGenerator::continueTarget):
(JSC::WASMFunctionLLVMIRGenerator::breakLabelTarget):
(JSC::WASMFunctionLLVMIRGenerator::continueLabelTarget):
(JSC::WASMFunctionLLVMIRGenerator::buildSwitch):

  • wasm/WASMFunctionParser.cpp:
Location:
trunk/Source/JavaScriptCore
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r190684 r190690  
     12015-10-07  Sukolsak Sakshuwong  <sukolsak@gmail.com>
     2
     3        Add an LLVM IR generator for WebAssembly
     4        https://bugs.webkit.org/show_bug.cgi?id=149486
     5
     6        Reviewed by Mark Lam.
     7
     8        This patch adds initial support for an LLVM IR generator in WebAssembly
     9        (polyfill-prototype-1 format). All the methods will be implemented in
     10        subsequent patches.
     11
     12        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
     13        * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
     14        * JavaScriptCore.xcodeproj/project.pbxproj:
     15        * wasm/WASMFunctionLLVMIRGenerator.h: Added.
     16        (JSC::WASMFunctionLLVMIRGenerator::MemoryAddress::MemoryAddress):
     17        (JSC::WASMFunctionLLVMIRGenerator::startFunction):
     18        (JSC::WASMFunctionLLVMIRGenerator::endFunction):
     19        (JSC::WASMFunctionLLVMIRGenerator::buildSetLocal):
     20        (JSC::WASMFunctionLLVMIRGenerator::buildSetGlobal):
     21        (JSC::WASMFunctionLLVMIRGenerator::buildReturn):
     22        (JSC::WASMFunctionLLVMIRGenerator::buildImmediateI32):
     23        (JSC::WASMFunctionLLVMIRGenerator::buildImmediateF32):
     24        (JSC::WASMFunctionLLVMIRGenerator::buildImmediateF64):
     25        (JSC::WASMFunctionLLVMIRGenerator::buildGetLocal):
     26        (JSC::WASMFunctionLLVMIRGenerator::buildGetGlobal):
     27        (JSC::WASMFunctionLLVMIRGenerator::buildConvertType):
     28        (JSC::WASMFunctionLLVMIRGenerator::buildLoad):
     29        (JSC::WASMFunctionLLVMIRGenerator::buildStore):
     30        (JSC::WASMFunctionLLVMIRGenerator::buildUnaryI32):
     31        (JSC::WASMFunctionLLVMIRGenerator::buildUnaryF32):
     32        (JSC::WASMFunctionLLVMIRGenerator::buildUnaryF64):
     33        (JSC::WASMFunctionLLVMIRGenerator::buildBinaryI32):
     34        (JSC::WASMFunctionLLVMIRGenerator::buildBinaryF32):
     35        (JSC::WASMFunctionLLVMIRGenerator::buildBinaryF64):
     36        (JSC::WASMFunctionLLVMIRGenerator::buildRelationalI32):
     37        (JSC::WASMFunctionLLVMIRGenerator::buildRelationalF32):
     38        (JSC::WASMFunctionLLVMIRGenerator::buildRelationalF64):
     39        (JSC::WASMFunctionLLVMIRGenerator::buildMinOrMaxI32):
     40        (JSC::WASMFunctionLLVMIRGenerator::buildMinOrMaxF64):
     41        (JSC::WASMFunctionLLVMIRGenerator::buildCallInternal):
     42        (JSC::WASMFunctionLLVMIRGenerator::buildCallIndirect):
     43        (JSC::WASMFunctionLLVMIRGenerator::buildCallImport):
     44        (JSC::WASMFunctionLLVMIRGenerator::appendExpressionList):
     45        (JSC::WASMFunctionLLVMIRGenerator::discard):
     46        (JSC::WASMFunctionLLVMIRGenerator::linkTarget):
     47        (JSC::WASMFunctionLLVMIRGenerator::jumpToTarget):
     48        (JSC::WASMFunctionLLVMIRGenerator::jumpToTargetIf):
     49        (JSC::WASMFunctionLLVMIRGenerator::startLoop):
     50        (JSC::WASMFunctionLLVMIRGenerator::endLoop):
     51        (JSC::WASMFunctionLLVMIRGenerator::startSwitch):
     52        (JSC::WASMFunctionLLVMIRGenerator::endSwitch):
     53        (JSC::WASMFunctionLLVMIRGenerator::startLabel):
     54        (JSC::WASMFunctionLLVMIRGenerator::endLabel):
     55        (JSC::WASMFunctionLLVMIRGenerator::breakTarget):
     56        (JSC::WASMFunctionLLVMIRGenerator::continueTarget):
     57        (JSC::WASMFunctionLLVMIRGenerator::breakLabelTarget):
     58        (JSC::WASMFunctionLLVMIRGenerator::continueLabelTarget):
     59        (JSC::WASMFunctionLLVMIRGenerator::buildSwitch):
     60        * wasm/WASMFunctionParser.cpp:
     61
    1622015-10-07  Filip Pizlo  <fpizlo@apple.com>
    263
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj

    r190569 r190690  
    18311831    <ClInclude Include="..\wasm\WASMFormat.h" />
    18321832    <ClInclude Include="..\wasm\WASMFunctionCompiler.h" />
     1833    <ClInclude Include="..\wasm\WASMFunctionLLVMIRGenerator.h" />
    18331834    <ClInclude Include="..\wasm\WASMFunctionParser.h" />
    18341835    <ClInclude Include="..\wasm\WASMFunctionSyntaxChecker.h" />
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters

    r190569 r190690  
    45164516      <Filter>wasm</Filter>
    45174517    </ClInclude>
     4518    <ClInclude Include="..\wasm\WASMFunctionLLVMIRGenerator.h">
     4519      <Filter>wasm</Filter>
     4520    </ClInclude>
    45184521    <ClInclude Include="..\wasm\WASMFunctionParser.h">
    45194522      <Filter>wasm</Filter>
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r190649 r190690  
    10691069                7B39F7701B62DE3200360FB4 /* WASMReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B39F76C1B62DE2200360FB4 /* WASMReader.h */; settings = {ATTRIBUTES = (Private, ); }; };
    10701070                7B39F7721B63574D00360FB4 /* WASMReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B39F7711B63574B00360FB4 /* WASMReader.cpp */; };
     1071                7B8329BF1BB21FE300649A6E /* WASMFunctionLLVMIRGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B8329BE1BB21FD100649A6E /* WASMFunctionLLVMIRGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
    10711072                7B98D1361B60CD5F0023B1A4 /* JSWASMModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B98D1341B60CD5A0023B1A4 /* JSWASMModule.cpp */; };
    10721073                7B98D1371B60CD620023B1A4 /* JSWASMModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B98D1351B60CD5A0023B1A4 /* JSWASMModule.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    29232924                7B39F76C1B62DE2200360FB4 /* WASMReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WASMReader.h; sourceTree = "<group>"; };
    29242925                7B39F7711B63574B00360FB4 /* WASMReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WASMReader.cpp; sourceTree = "<group>"; };
     2926                7B8329BE1BB21FD100649A6E /* WASMFunctionLLVMIRGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WASMFunctionLLVMIRGenerator.h; sourceTree = "<group>"; };
    29252927                7B98D1341B60CD5A0023B1A4 /* JSWASMModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWASMModule.cpp; sourceTree = "<group>"; };
    29262928                7B98D1351B60CD5A0023B1A4 /* JSWASMModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWASMModule.h; sourceTree = "<group>"; };
     
    45394541                                7BC547D21B69599B00959B58 /* WASMFormat.h */,
    45404542                                7B2E010D1B97AA5800EF5D5C /* WASMFunctionCompiler.h */,
     4543                                7B8329BE1BB21FD100649A6E /* WASMFunctionLLVMIRGenerator.h */,
    45414544                                7B0247531B8682D500542440 /* WASMFunctionParser.cpp */,
    45424545                                7B0247541B8682D500542440 /* WASMFunctionParser.h */,
     
    61696172                                A7BFF3C0179868940002F462 /* DFGFiltrationResult.h in Headers */,
    61706173                                A78A9777179738B8009DF744 /* DFGFinalizer.h in Headers */,
     6174                                7B8329BF1BB21FE300649A6E /* WASMFunctionLLVMIRGenerator.h in Headers */,
    61716175                                0F2BDC16151C5D4F00CD8910 /* DFGFixupPhase.h in Headers */,
    61726176                                0F9D339717FFC4E60073C2BC /* DFGFlushedAt.h in Headers */,
  • trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.cpp

    r190130 r190690  
    3232#include "JSWASMModule.h"
    3333#include "WASMFunctionCompiler.h"
     34#include "WASMFunctionLLVMIRGenerator.h"
    3435#include "WASMFunctionSyntaxChecker.h"
    3536
Note: See TracChangeset for help on using the changeset viewer.