<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[204180] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/204180">204180</a></dd>
<dt>Author</dt> <dd>keith_miller@apple.com</dd>
<dt>Date</dt> <dd>2016-08-05 11:53:49 -0700 (Fri, 05 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Delete out of date WASM code.
https://bugs.webkit.org/show_bug.cgi?id=160603

Reviewed by Saam Barati.

Source/JavaScriptCore:

This patch removes a bunch of the wasm files that we are unlikey to use
with the newer wasm spec. If we end up needing any of the deleted code
later we can restore it at that time.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* jit/JITOperations.cpp:
* jsc.cpp:
(GlobalObject::finishCreation): Deleted.
(functionLoadWebAssembly): Deleted.
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::setUpCall): Deleted.
* runtime/Executable.cpp:
(JSC::WebAssemblyExecutable::prepareForExecution): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init): Deleted.
(JSC::JSGlobalObject::visitChildren): Deleted.
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::wasmModuleStructure): Deleted.
* wasm/WASMConstants.h: Removed.
* wasm/WASMFunctionB3IRGenerator.h: Removed.
(JSC::WASMFunctionB3IRGenerator::MemoryAddress::MemoryAddress): Deleted.
(JSC::WASMFunctionB3IRGenerator::startFunction): Deleted.
(JSC::WASMFunctionB3IRGenerator::endFunction): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildSetLocal): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildSetGlobal): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildReturn): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildImmediateI32): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildImmediateF32): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildImmediateF64): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildGetLocal): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildGetGlobal): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildConvertType): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildLoad): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildStore): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildUnaryI32): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildUnaryF32): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildUnaryF64): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildBinaryI32): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildBinaryF32): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildBinaryF64): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildRelationalI32): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildRelationalF32): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildRelationalF64): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildMinOrMaxI32): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildMinOrMaxF64): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildCallInternal): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildCallIndirect): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildCallImport): Deleted.
(JSC::WASMFunctionB3IRGenerator::appendExpressionList): Deleted.
(JSC::WASMFunctionB3IRGenerator::discard): Deleted.
(JSC::WASMFunctionB3IRGenerator::linkTarget): Deleted.
(JSC::WASMFunctionB3IRGenerator::jumpToTarget): Deleted.
(JSC::WASMFunctionB3IRGenerator::jumpToTargetIf): Deleted.
(JSC::WASMFunctionB3IRGenerator::startLoop): Deleted.
(JSC::WASMFunctionB3IRGenerator::endLoop): Deleted.
(JSC::WASMFunctionB3IRGenerator::startSwitch): Deleted.
(JSC::WASMFunctionB3IRGenerator::endSwitch): Deleted.
(JSC::WASMFunctionB3IRGenerator::startLabel): Deleted.
(JSC::WASMFunctionB3IRGenerator::endLabel): Deleted.
(JSC::WASMFunctionB3IRGenerator::breakTarget): Deleted.
(JSC::WASMFunctionB3IRGenerator::continueTarget): Deleted.
(JSC::WASMFunctionB3IRGenerator::breakLabelTarget): Deleted.
(JSC::WASMFunctionB3IRGenerator::continueLabelTarget): Deleted.
(JSC::WASMFunctionB3IRGenerator::buildSwitch): Deleted.
* wasm/WASMFunctionCompiler.h: Removed.
(JSC::operationConvertJSValueToInt32): Deleted.
(JSC::operationConvertJSValueToDouble): Deleted.
(JSC::operationDiv): Deleted.
(JSC::operationMod): Deleted.
(JSC::operationUnsignedDiv): Deleted.
(JSC::operationUnsignedMod): Deleted.
(JSC::operationConvertUnsignedInt32ToDouble): Deleted.
(JSC::sizeOfMemoryType): Deleted.
(JSC::WASMFunctionCompiler::MemoryAddress::MemoryAddress): Deleted.
(JSC::WASMFunctionCompiler::WASMFunctionCompiler): Deleted.
(JSC::WASMFunctionCompiler::startFunction): Deleted.
(JSC::WASMFunctionCompiler::endFunction): Deleted.
(JSC::WASMFunctionCompiler::buildSetLocal): Deleted.
(JSC::WASMFunctionCompiler::buildSetGlobal): Deleted.
(JSC::WASMFunctionCompiler::buildReturn): Deleted.
(JSC::WASMFunctionCompiler::buildImmediateI32): Deleted.
(JSC::WASMFunctionCompiler::buildImmediateF32): Deleted.
(JSC::WASMFunctionCompiler::buildImmediateF64): Deleted.
(JSC::WASMFunctionCompiler::buildGetLocal): Deleted.
(JSC::WASMFunctionCompiler::buildGetGlobal): Deleted.
(JSC::WASMFunctionCompiler::buildConvertType): Deleted.
(JSC::WASMFunctionCompiler::buildLoad): Deleted.
(JSC::WASMFunctionCompiler::buildStore): Deleted.
(JSC::WASMFunctionCompiler::buildUnaryI32): Deleted.
(JSC::WASMFunctionCompiler::buildUnaryF32): Deleted.
(JSC::WASMFunctionCompiler::buildUnaryF64): Deleted.
(JSC::WASMFunctionCompiler::buildBinaryI32): Deleted.
(JSC::WASMFunctionCompiler::buildBinaryF32): Deleted.
(JSC::WASMFunctionCompiler::buildBinaryF64): Deleted.
(JSC::WASMFunctionCompiler::buildRelationalI32): Deleted.
(JSC::WASMFunctionCompiler::buildRelationalF32): Deleted.
(JSC::WASMFunctionCompiler::buildRelationalF64): Deleted.
(JSC::WASMFunctionCompiler::buildMinOrMaxI32): Deleted.
(JSC::WASMFunctionCompiler::buildMinOrMaxF64): Deleted.
(JSC::WASMFunctionCompiler::buildCallInternal): Deleted.
(JSC::WASMFunctionCompiler::buildCallIndirect): Deleted.
(JSC::WASMFunctionCompiler::buildCallImport): Deleted.
(JSC::WASMFunctionCompiler::appendExpressionList): Deleted.
(JSC::WASMFunctionCompiler::discard): Deleted.
(JSC::WASMFunctionCompiler::linkTarget): Deleted.
(JSC::WASMFunctionCompiler::jumpToTarget): Deleted.
(JSC::WASMFunctionCompiler::jumpToTargetIf): Deleted.
(JSC::WASMFunctionCompiler::startLoop): Deleted.
(JSC::WASMFunctionCompiler::endLoop): Deleted.
(JSC::WASMFunctionCompiler::startSwitch): Deleted.
(JSC::WASMFunctionCompiler::endSwitch): Deleted.
(JSC::WASMFunctionCompiler::startLabel): Deleted.
(JSC::WASMFunctionCompiler::endLabel): Deleted.
(JSC::WASMFunctionCompiler::breakTarget): Deleted.
(JSC::WASMFunctionCompiler::continueTarget): Deleted.
(JSC::WASMFunctionCompiler::breakLabelTarget): Deleted.
(JSC::WASMFunctionCompiler::continueLabelTarget): Deleted.
(JSC::WASMFunctionCompiler::buildSwitch): Deleted.
(JSC::WASMFunctionCompiler::localAddress): Deleted.
(JSC::WASMFunctionCompiler::temporaryAddress): Deleted.
(JSC::WASMFunctionCompiler::appendCall): Deleted.
(JSC::WASMFunctionCompiler::appendCallWithExceptionCheck): Deleted.
(JSC::WASMFunctionCompiler::emitNakedCall): Deleted.
(JSC::WASMFunctionCompiler::appendCallSetResult): Deleted.
(JSC::WASMFunctionCompiler::callOperation): Deleted.
(JSC::WASMFunctionCompiler::boxArgumentsAndAdjustStackPointer): Deleted.
(JSC::WASMFunctionCompiler::callAndUnboxResult): Deleted.
(JSC::WASMFunctionCompiler::convertValueToInt32): Deleted.
(JSC::WASMFunctionCompiler::convertValueToDouble): Deleted.
(JSC::WASMFunctionCompiler::convertDoubleToValue): Deleted.
* wasm/WASMFunctionParser.cpp: Removed.
(JSC::nameOfType): Deleted.
(JSC::WASMFunctionParser::checkSyntax): Deleted.
(JSC::WASMFunctionParser::compile): Deleted.
(JSC::WASMFunctionParser::parseFunction): Deleted.
(JSC::WASMFunctionParser::parseLocalVariables): Deleted.
(JSC::WASMFunctionParser::parseStatement): Deleted.
(JSC::WASMFunctionParser::parseReturnStatement): Deleted.
(JSC::WASMFunctionParser::parseBlockStatement): Deleted.
(JSC::WASMFunctionParser::parseIfStatement): Deleted.
(JSC::WASMFunctionParser::parseIfElseStatement): Deleted.
(JSC::WASMFunctionParser::parseWhileStatement): Deleted.
(JSC::WASMFunctionParser::parseDoStatement): Deleted.
(JSC::WASMFunctionParser::parseLabelStatement): Deleted.
(JSC::WASMFunctionParser::parseBreakStatement): Deleted.
(JSC::WASMFunctionParser::parseBreakLabelStatement): Deleted.
(JSC::WASMFunctionParser::parseContinueStatement): Deleted.
(JSC::WASMFunctionParser::parseContinueLabelStatement): Deleted.
(JSC::WASMFunctionParser::parseSwitchStatement): Deleted.
(JSC::WASMFunctionParser::parseExpression): Deleted.
(JSC::WASMFunctionParser::parseExpressionI32): Deleted.
(JSC::WASMFunctionParser::parseConstantPoolIndexExpressionI32): Deleted.
(JSC::WASMFunctionParser::parseImmediateExpressionI32): Deleted.
(JSC::WASMFunctionParser::parseUnaryExpressionI32): Deleted.
(JSC::WASMFunctionParser::parseBinaryExpressionI32): Deleted.
(JSC::WASMFunctionParser::parseRelationalI32ExpressionI32): Deleted.
(JSC::WASMFunctionParser::parseRelationalF32ExpressionI32): Deleted.
(JSC::WASMFunctionParser::parseRelationalF64ExpressionI32): Deleted.
(JSC::WASMFunctionParser::parseMinOrMaxExpressionI32): Deleted.
(JSC::WASMFunctionParser::parseExpressionF32): Deleted.
(JSC::WASMFunctionParser::parseConstantPoolIndexExpressionF32): Deleted.
(JSC::WASMFunctionParser::parseImmediateExpressionF32): Deleted.
(JSC::WASMFunctionParser::parseUnaryExpressionF32): Deleted.
(JSC::WASMFunctionParser::parseBinaryExpressionF32): Deleted.
(JSC::WASMFunctionParser::parseExpressionF64): Deleted.
(JSC::WASMFunctionParser::parseConstantPoolIndexExpressionF64): Deleted.
(JSC::WASMFunctionParser::parseImmediateExpressionF64): Deleted.
(JSC::WASMFunctionParser::parseUnaryExpressionF64): Deleted.
(JSC::WASMFunctionParser::parseBinaryExpressionF64): Deleted.
(JSC::WASMFunctionParser::parseMinOrMaxExpressionF64): Deleted.
(JSC::WASMFunctionParser::parseExpressionVoid): Deleted.
(JSC::WASMFunctionParser::parseGetLocalExpression): Deleted.
(JSC::WASMFunctionParser::parseGetGlobalExpression): Deleted.
(JSC::WASMFunctionParser::parseSetLocal): Deleted.
(JSC::WASMFunctionParser::parseSetGlobal): Deleted.
(JSC::WASMFunctionParser::parseMemoryAddress): Deleted.
(JSC::WASMFunctionParser::parseLoad): Deleted.
(JSC::WASMFunctionParser::parseStore): Deleted.
(JSC::WASMFunctionParser::parseCallArguments): Deleted.
(JSC::WASMFunctionParser::parseCallInternal): Deleted.
(JSC::WASMFunctionParser::parseCallIndirect): Deleted.
(JSC::WASMFunctionParser::parseCallImport): Deleted.
(JSC::WASMFunctionParser::parseConditional): Deleted.
(JSC::WASMFunctionParser::parseComma): Deleted.
(JSC::WASMFunctionParser::parseConvertType): Deleted.
* wasm/WASMFunctionParser.h: Removed.
(JSC::WASMFunctionParser::WASMFunctionParser): Deleted.
* wasm/WASMFunctionSyntaxChecker.h: Removed.
(JSC::WASMFunctionSyntaxChecker::MemoryAddress::MemoryAddress): Deleted.
(JSC::WASMFunctionSyntaxChecker::startFunction): Deleted.
(JSC::WASMFunctionSyntaxChecker::endFunction): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildSetLocal): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildSetGlobal): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildReturn): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildImmediateI32): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildImmediateF32): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildImmediateF64): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildGetLocal): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildGetGlobal): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildConvertType): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildLoad): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildStore): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildUnaryI32): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildUnaryF32): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildUnaryF64): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildBinaryI32): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildBinaryF32): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildBinaryF64): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildRelationalI32): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildRelationalF32): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildRelationalF64): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildMinOrMaxI32): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildMinOrMaxF64): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildCallInternal): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildCallImport): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildCallIndirect): Deleted.
(JSC::WASMFunctionSyntaxChecker::appendExpressionList): Deleted.
(JSC::WASMFunctionSyntaxChecker::discard): Deleted.
(JSC::WASMFunctionSyntaxChecker::linkTarget): Deleted.
(JSC::WASMFunctionSyntaxChecker::jumpToTarget): Deleted.
(JSC::WASMFunctionSyntaxChecker::jumpToTargetIf): Deleted.
(JSC::WASMFunctionSyntaxChecker::startLoop): Deleted.
(JSC::WASMFunctionSyntaxChecker::endLoop): Deleted.
(JSC::WASMFunctionSyntaxChecker::startSwitch): Deleted.
(JSC::WASMFunctionSyntaxChecker::endSwitch): Deleted.
(JSC::WASMFunctionSyntaxChecker::startLabel): Deleted.
(JSC::WASMFunctionSyntaxChecker::endLabel): Deleted.
(JSC::WASMFunctionSyntaxChecker::breakTarget): Deleted.
(JSC::WASMFunctionSyntaxChecker::continueTarget): Deleted.
(JSC::WASMFunctionSyntaxChecker::breakLabelTarget): Deleted.
(JSC::WASMFunctionSyntaxChecker::continueLabelTarget): Deleted.
(JSC::WASMFunctionSyntaxChecker::buildSwitch): Deleted.
(JSC::WASMFunctionSyntaxChecker::stackHeight): Deleted.
(JSC::WASMFunctionSyntaxChecker::updateTempStackHeight): Deleted.
(JSC::WASMFunctionSyntaxChecker::updateTempStackHeightForCall): Deleted.
* wasm/WASMModuleParser.cpp: Removed.
(JSC::WASMModuleParser::WASMModuleParser): Deleted.
(JSC::WASMModuleParser::parse): Deleted.
(JSC::WASMModuleParser::parseModule): Deleted.
(JSC::WASMModuleParser::parseConstantPoolSection): Deleted.
(JSC::WASMModuleParser::parseSignatureSection): Deleted.
(JSC::WASMModuleParser::parseFunctionImportSection): Deleted.
(JSC::WASMModuleParser::parseGlobalSection): Deleted.
(JSC::WASMModuleParser::parseFunctionDeclarationSection): Deleted.
(JSC::WASMModuleParser::parseFunctionPointerTableSection): Deleted.
(JSC::WASMModuleParser::parseFunctionDefinitionSection): Deleted.
(JSC::WASMModuleParser::parseFunctionDefinition): Deleted.
(JSC::WASMModuleParser::parseExportSection): Deleted.
(JSC::WASMModuleParser::getImportedValue): Deleted.
(JSC::parseWebAssembly): Deleted.
* wasm/WASMModuleParser.h: Removed.
* wasm/WASMReader.cpp: Removed.
(JSC::WASMReader::readUInt32): Deleted.
(JSC::WASMReader::readFloat): Deleted.
(JSC::WASMReader::readDouble): Deleted.
(JSC::WASMReader::readCompactInt32): Deleted.
(JSC::WASMReader::readCompactUInt32): Deleted.
(JSC::WASMReader::readString): Deleted.
(JSC::WASMReader::readType): Deleted.
(JSC::WASMReader::readExpressionType): Deleted.
(JSC::WASMReader::readExportFormat): Deleted.
(JSC::WASMReader::readByte): Deleted.
(JSC::WASMReader::readOpStatement): Deleted.
(JSC::WASMReader::readOpExpressionI32): Deleted.
(JSC::WASMReader::readOpExpressionF32): Deleted.
(JSC::WASMReader::readOpExpressionF64): Deleted.
(JSC::WASMReader::readOpExpressionVoid): Deleted.
(JSC::WASMReader::readVariableTypes): Deleted.
(JSC::WASMReader::readOp): Deleted.
(JSC::WASMReader::readSwitchCase): Deleted.
* wasm/WASMReader.h: Removed.
(JSC::WASMReader::WASMReader): Deleted.
(JSC::WASMReader::offset): Deleted.
(JSC::WASMReader::setOffset): Deleted.

Source/WTF:

Add Feature define for WebAssembly on mac.

* wtf/FeatureDefines.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejsccpp">trunk/Source/JavaScriptCore/jsc.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExecutablecpp">trunk/Source/JavaScriptCore/runtime/Executable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjecth">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfFeatureDefinesh">trunk/Source/WTF/wtf/FeatureDefines.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCorewasmWASMConstantsh">trunk/Source/JavaScriptCore/wasm/WASMConstants.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMFunctionB3IRGeneratorh">trunk/Source/JavaScriptCore/wasm/WASMFunctionB3IRGenerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMFunctionCompilerh">trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMFunctionParsercpp">trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMFunctionParserh">trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMFunctionSyntaxCheckerh">trunk/Source/JavaScriptCore/wasm/WASMFunctionSyntaxChecker.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMModuleParsercpp">trunk/Source/JavaScriptCore/wasm/WASMModuleParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMModuleParserh">trunk/Source/JavaScriptCore/wasm/WASMModuleParser.h</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMReadercpp">trunk/Source/JavaScriptCore/wasm/WASMReader.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorewasmWASMReaderh">trunk/Source/JavaScriptCore/wasm/WASMReader.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -839,9 +839,6 @@
</span><span class="cx">     tools/JSDollarVMPrototype.cpp
</span><span class="cx"> 
</span><span class="cx">     wasm/JSWASMModule.cpp
</span><del>-    wasm/WASMFunctionParser.cpp
-    wasm/WASMModuleParser.cpp
-    wasm/WASMReader.cpp
</del><span class="cx"> 
</span><span class="cx">     yarr/RegularExpression.cpp
</span><span class="cx">     yarr/YarrCanonicalizeUCS2.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1,5 +1,288 @@
</span><span class="cx"> 2016-08-05  Keith Miller  &lt;keith_miller@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Delete out of date WASM code.
+        https://bugs.webkit.org/show_bug.cgi?id=160603
+
+        Reviewed by Saam Barati.
+
+        This patch removes a bunch of the wasm files that we are unlikey to use
+        with the newer wasm spec. If we end up needing any of the deleted code
+        later we can restore it at that time.
+
+        * CMakeLists.txt:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * jit/JITOperations.cpp:
+        * jsc.cpp:
+        (GlobalObject::finishCreation): Deleted.
+        (functionLoadWebAssembly): Deleted.
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::setUpCall): Deleted.
+        * runtime/Executable.cpp:
+        (JSC::WebAssemblyExecutable::prepareForExecution): Deleted.
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init): Deleted.
+        (JSC::JSGlobalObject::visitChildren): Deleted.
+        * runtime/JSGlobalObject.h:
+        (JSC::JSGlobalObject::wasmModuleStructure): Deleted.
+        * wasm/WASMConstants.h: Removed.
+        * wasm/WASMFunctionB3IRGenerator.h: Removed.
+        (JSC::WASMFunctionB3IRGenerator::MemoryAddress::MemoryAddress): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::startFunction): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::endFunction): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildSetLocal): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildSetGlobal): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildReturn): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildImmediateI32): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildImmediateF32): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildImmediateF64): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildGetLocal): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildGetGlobal): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildConvertType): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildLoad): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildStore): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildUnaryI32): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildUnaryF32): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildUnaryF64): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildBinaryI32): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildBinaryF32): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildBinaryF64): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildRelationalI32): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildRelationalF32): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildRelationalF64): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildMinOrMaxI32): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildMinOrMaxF64): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildCallInternal): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildCallIndirect): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildCallImport): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::appendExpressionList): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::discard): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::linkTarget): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::jumpToTarget): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::jumpToTargetIf): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::startLoop): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::endLoop): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::startSwitch): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::endSwitch): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::startLabel): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::endLabel): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::breakTarget): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::continueTarget): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::breakLabelTarget): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::continueLabelTarget): Deleted.
+        (JSC::WASMFunctionB3IRGenerator::buildSwitch): Deleted.
+        * wasm/WASMFunctionCompiler.h: Removed.
+        (JSC::operationConvertJSValueToInt32): Deleted.
+        (JSC::operationConvertJSValueToDouble): Deleted.
+        (JSC::operationDiv): Deleted.
+        (JSC::operationMod): Deleted.
+        (JSC::operationUnsignedDiv): Deleted.
+        (JSC::operationUnsignedMod): Deleted.
+        (JSC::operationConvertUnsignedInt32ToDouble): Deleted.
+        (JSC::sizeOfMemoryType): Deleted.
+        (JSC::WASMFunctionCompiler::MemoryAddress::MemoryAddress): Deleted.
+        (JSC::WASMFunctionCompiler::WASMFunctionCompiler): Deleted.
+        (JSC::WASMFunctionCompiler::startFunction): Deleted.
+        (JSC::WASMFunctionCompiler::endFunction): Deleted.
+        (JSC::WASMFunctionCompiler::buildSetLocal): Deleted.
+        (JSC::WASMFunctionCompiler::buildSetGlobal): Deleted.
+        (JSC::WASMFunctionCompiler::buildReturn): Deleted.
+        (JSC::WASMFunctionCompiler::buildImmediateI32): Deleted.
+        (JSC::WASMFunctionCompiler::buildImmediateF32): Deleted.
+        (JSC::WASMFunctionCompiler::buildImmediateF64): Deleted.
+        (JSC::WASMFunctionCompiler::buildGetLocal): Deleted.
+        (JSC::WASMFunctionCompiler::buildGetGlobal): Deleted.
+        (JSC::WASMFunctionCompiler::buildConvertType): Deleted.
+        (JSC::WASMFunctionCompiler::buildLoad): Deleted.
+        (JSC::WASMFunctionCompiler::buildStore): Deleted.
+        (JSC::WASMFunctionCompiler::buildUnaryI32): Deleted.
+        (JSC::WASMFunctionCompiler::buildUnaryF32): Deleted.
+        (JSC::WASMFunctionCompiler::buildUnaryF64): Deleted.
+        (JSC::WASMFunctionCompiler::buildBinaryI32): Deleted.
+        (JSC::WASMFunctionCompiler::buildBinaryF32): Deleted.
+        (JSC::WASMFunctionCompiler::buildBinaryF64): Deleted.
+        (JSC::WASMFunctionCompiler::buildRelationalI32): Deleted.
+        (JSC::WASMFunctionCompiler::buildRelationalF32): Deleted.
+        (JSC::WASMFunctionCompiler::buildRelationalF64): Deleted.
+        (JSC::WASMFunctionCompiler::buildMinOrMaxI32): Deleted.
+        (JSC::WASMFunctionCompiler::buildMinOrMaxF64): Deleted.
+        (JSC::WASMFunctionCompiler::buildCallInternal): Deleted.
+        (JSC::WASMFunctionCompiler::buildCallIndirect): Deleted.
+        (JSC::WASMFunctionCompiler::buildCallImport): Deleted.
+        (JSC::WASMFunctionCompiler::appendExpressionList): Deleted.
+        (JSC::WASMFunctionCompiler::discard): Deleted.
+        (JSC::WASMFunctionCompiler::linkTarget): Deleted.
+        (JSC::WASMFunctionCompiler::jumpToTarget): Deleted.
+        (JSC::WASMFunctionCompiler::jumpToTargetIf): Deleted.
+        (JSC::WASMFunctionCompiler::startLoop): Deleted.
+        (JSC::WASMFunctionCompiler::endLoop): Deleted.
+        (JSC::WASMFunctionCompiler::startSwitch): Deleted.
+        (JSC::WASMFunctionCompiler::endSwitch): Deleted.
+        (JSC::WASMFunctionCompiler::startLabel): Deleted.
+        (JSC::WASMFunctionCompiler::endLabel): Deleted.
+        (JSC::WASMFunctionCompiler::breakTarget): Deleted.
+        (JSC::WASMFunctionCompiler::continueTarget): Deleted.
+        (JSC::WASMFunctionCompiler::breakLabelTarget): Deleted.
+        (JSC::WASMFunctionCompiler::continueLabelTarget): Deleted.
+        (JSC::WASMFunctionCompiler::buildSwitch): Deleted.
+        (JSC::WASMFunctionCompiler::localAddress): Deleted.
+        (JSC::WASMFunctionCompiler::temporaryAddress): Deleted.
+        (JSC::WASMFunctionCompiler::appendCall): Deleted.
+        (JSC::WASMFunctionCompiler::appendCallWithExceptionCheck): Deleted.
+        (JSC::WASMFunctionCompiler::emitNakedCall): Deleted.
+        (JSC::WASMFunctionCompiler::appendCallSetResult): Deleted.
+        (JSC::WASMFunctionCompiler::callOperation): Deleted.
+        (JSC::WASMFunctionCompiler::boxArgumentsAndAdjustStackPointer): Deleted.
+        (JSC::WASMFunctionCompiler::callAndUnboxResult): Deleted.
+        (JSC::WASMFunctionCompiler::convertValueToInt32): Deleted.
+        (JSC::WASMFunctionCompiler::convertValueToDouble): Deleted.
+        (JSC::WASMFunctionCompiler::convertDoubleToValue): Deleted.
+        * wasm/WASMFunctionParser.cpp: Removed.
+        (JSC::nameOfType): Deleted.
+        (JSC::WASMFunctionParser::checkSyntax): Deleted.
+        (JSC::WASMFunctionParser::compile): Deleted.
+        (JSC::WASMFunctionParser::parseFunction): Deleted.
+        (JSC::WASMFunctionParser::parseLocalVariables): Deleted.
+        (JSC::WASMFunctionParser::parseStatement): Deleted.
+        (JSC::WASMFunctionParser::parseReturnStatement): Deleted.
+        (JSC::WASMFunctionParser::parseBlockStatement): Deleted.
+        (JSC::WASMFunctionParser::parseIfStatement): Deleted.
+        (JSC::WASMFunctionParser::parseIfElseStatement): Deleted.
+        (JSC::WASMFunctionParser::parseWhileStatement): Deleted.
+        (JSC::WASMFunctionParser::parseDoStatement): Deleted.
+        (JSC::WASMFunctionParser::parseLabelStatement): Deleted.
+        (JSC::WASMFunctionParser::parseBreakStatement): Deleted.
+        (JSC::WASMFunctionParser::parseBreakLabelStatement): Deleted.
+        (JSC::WASMFunctionParser::parseContinueStatement): Deleted.
+        (JSC::WASMFunctionParser::parseContinueLabelStatement): Deleted.
+        (JSC::WASMFunctionParser::parseSwitchStatement): Deleted.
+        (JSC::WASMFunctionParser::parseExpression): Deleted.
+        (JSC::WASMFunctionParser::parseExpressionI32): Deleted.
+        (JSC::WASMFunctionParser::parseConstantPoolIndexExpressionI32): Deleted.
+        (JSC::WASMFunctionParser::parseImmediateExpressionI32): Deleted.
+        (JSC::WASMFunctionParser::parseUnaryExpressionI32): Deleted.
+        (JSC::WASMFunctionParser::parseBinaryExpressionI32): Deleted.
+        (JSC::WASMFunctionParser::parseRelationalI32ExpressionI32): Deleted.
+        (JSC::WASMFunctionParser::parseRelationalF32ExpressionI32): Deleted.
+        (JSC::WASMFunctionParser::parseRelationalF64ExpressionI32): Deleted.
+        (JSC::WASMFunctionParser::parseMinOrMaxExpressionI32): Deleted.
+        (JSC::WASMFunctionParser::parseExpressionF32): Deleted.
+        (JSC::WASMFunctionParser::parseConstantPoolIndexExpressionF32): Deleted.
+        (JSC::WASMFunctionParser::parseImmediateExpressionF32): Deleted.
+        (JSC::WASMFunctionParser::parseUnaryExpressionF32): Deleted.
+        (JSC::WASMFunctionParser::parseBinaryExpressionF32): Deleted.
+        (JSC::WASMFunctionParser::parseExpressionF64): Deleted.
+        (JSC::WASMFunctionParser::parseConstantPoolIndexExpressionF64): Deleted.
+        (JSC::WASMFunctionParser::parseImmediateExpressionF64): Deleted.
+        (JSC::WASMFunctionParser::parseUnaryExpressionF64): Deleted.
+        (JSC::WASMFunctionParser::parseBinaryExpressionF64): Deleted.
+        (JSC::WASMFunctionParser::parseMinOrMaxExpressionF64): Deleted.
+        (JSC::WASMFunctionParser::parseExpressionVoid): Deleted.
+        (JSC::WASMFunctionParser::parseGetLocalExpression): Deleted.
+        (JSC::WASMFunctionParser::parseGetGlobalExpression): Deleted.
+        (JSC::WASMFunctionParser::parseSetLocal): Deleted.
+        (JSC::WASMFunctionParser::parseSetGlobal): Deleted.
+        (JSC::WASMFunctionParser::parseMemoryAddress): Deleted.
+        (JSC::WASMFunctionParser::parseLoad): Deleted.
+        (JSC::WASMFunctionParser::parseStore): Deleted.
+        (JSC::WASMFunctionParser::parseCallArguments): Deleted.
+        (JSC::WASMFunctionParser::parseCallInternal): Deleted.
+        (JSC::WASMFunctionParser::parseCallIndirect): Deleted.
+        (JSC::WASMFunctionParser::parseCallImport): Deleted.
+        (JSC::WASMFunctionParser::parseConditional): Deleted.
+        (JSC::WASMFunctionParser::parseComma): Deleted.
+        (JSC::WASMFunctionParser::parseConvertType): Deleted.
+        * wasm/WASMFunctionParser.h: Removed.
+        (JSC::WASMFunctionParser::WASMFunctionParser): Deleted.
+        * wasm/WASMFunctionSyntaxChecker.h: Removed.
+        (JSC::WASMFunctionSyntaxChecker::MemoryAddress::MemoryAddress): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::startFunction): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::endFunction): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildSetLocal): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildSetGlobal): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildReturn): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildImmediateI32): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildImmediateF32): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildImmediateF64): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildGetLocal): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildGetGlobal): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildConvertType): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildLoad): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildStore): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildUnaryI32): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildUnaryF32): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildUnaryF64): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildBinaryI32): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildBinaryF32): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildBinaryF64): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildRelationalI32): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildRelationalF32): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildRelationalF64): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildMinOrMaxI32): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildMinOrMaxF64): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildCallInternal): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildCallImport): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildCallIndirect): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::appendExpressionList): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::discard): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::linkTarget): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::jumpToTarget): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::jumpToTargetIf): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::startLoop): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::endLoop): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::startSwitch): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::endSwitch): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::startLabel): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::endLabel): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::breakTarget): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::continueTarget): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::breakLabelTarget): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::continueLabelTarget): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::buildSwitch): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::stackHeight): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::updateTempStackHeight): Deleted.
+        (JSC::WASMFunctionSyntaxChecker::updateTempStackHeightForCall): Deleted.
+        * wasm/WASMModuleParser.cpp: Removed.
+        (JSC::WASMModuleParser::WASMModuleParser): Deleted.
+        (JSC::WASMModuleParser::parse): Deleted.
+        (JSC::WASMModuleParser::parseModule): Deleted.
+        (JSC::WASMModuleParser::parseConstantPoolSection): Deleted.
+        (JSC::WASMModuleParser::parseSignatureSection): Deleted.
+        (JSC::WASMModuleParser::parseFunctionImportSection): Deleted.
+        (JSC::WASMModuleParser::parseGlobalSection): Deleted.
+        (JSC::WASMModuleParser::parseFunctionDeclarationSection): Deleted.
+        (JSC::WASMModuleParser::parseFunctionPointerTableSection): Deleted.
+        (JSC::WASMModuleParser::parseFunctionDefinitionSection): Deleted.
+        (JSC::WASMModuleParser::parseFunctionDefinition): Deleted.
+        (JSC::WASMModuleParser::parseExportSection): Deleted.
+        (JSC::WASMModuleParser::getImportedValue): Deleted.
+        (JSC::parseWebAssembly): Deleted.
+        * wasm/WASMModuleParser.h: Removed.
+        * wasm/WASMReader.cpp: Removed.
+        (JSC::WASMReader::readUInt32): Deleted.
+        (JSC::WASMReader::readFloat): Deleted.
+        (JSC::WASMReader::readDouble): Deleted.
+        (JSC::WASMReader::readCompactInt32): Deleted.
+        (JSC::WASMReader::readCompactUInt32): Deleted.
+        (JSC::WASMReader::readString): Deleted.
+        (JSC::WASMReader::readType): Deleted.
+        (JSC::WASMReader::readExpressionType): Deleted.
+        (JSC::WASMReader::readExportFormat): Deleted.
+        (JSC::WASMReader::readByte): Deleted.
+        (JSC::WASMReader::readOpStatement): Deleted.
+        (JSC::WASMReader::readOpExpressionI32): Deleted.
+        (JSC::WASMReader::readOpExpressionF32): Deleted.
+        (JSC::WASMReader::readOpExpressionF64): Deleted.
+        (JSC::WASMReader::readOpExpressionVoid): Deleted.
+        (JSC::WASMReader::readVariableTypes): Deleted.
+        (JSC::WASMReader::readOp): Deleted.
+        (JSC::WASMReader::readSwitchCase): Deleted.
+        * wasm/WASMReader.h: Removed.
+        (JSC::WASMReader::WASMReader): Deleted.
+        (JSC::WASMReader::offset): Deleted.
+        (JSC::WASMReader::setOffset): Deleted.
+
+2016-08-05  Keith Miller  &lt;keith_miller@apple.com&gt;
+
</ins><span class="cx">         Fix 32-bit OverridesHasInstance in the DFG.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=160600
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1305,16 +1305,6 @@
</span><span class="cx">                 79EE0C001B4AFB85000385C9 /* VariableEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = 79EE0BFE1B4AFB85000385C9 /* VariableEnvironment.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 79F8FC1E1B9FED0F00CA66AB /* DFGMaximalFlushInsertionPhase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 79F8FC1C1B9FED0F00CA66AB /* DFGMaximalFlushInsertionPhase.cpp */; };
</span><span class="cx">                 79F8FC1F1B9FED0F00CA66AB /* DFGMaximalFlushInsertionPhase.h in Headers */ = {isa = PBXBuildFile; fileRef = 79F8FC1D1B9FED0F00CA66AB /* DFGMaximalFlushInsertionPhase.h */; };
</span><del>-                7B0247551B8682DD00542440 /* WASMConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B0247521B8682D500542440 /* WASMConstants.h */; settings = {ATTRIBUTES = (Private, ); }; };
-                7B0247561B8682E100542440 /* WASMFunctionParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B0247531B8682D500542440 /* WASMFunctionParser.cpp */; };
-                7B0247571B8682E400542440 /* WASMFunctionParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B0247541B8682D500542440 /* WASMFunctionParser.h */; settings = {ATTRIBUTES = (Private, ); }; };
-                7B0247591B868EB700542440 /* WASMFunctionSyntaxChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B0247581B868EAE00542440 /* WASMFunctionSyntaxChecker.h */; settings = {ATTRIBUTES = (Private, ); }; };
-                7B2E010E1B97AA6900EF5D5C /* WASMFunctionCompiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B2E010D1B97AA5800EF5D5C /* WASMFunctionCompiler.h */; };
-                7B39F76D1B62DE2E00360FB4 /* WASMModuleParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B39F7691B62DE2200360FB4 /* WASMModuleParser.cpp */; };
-                7B39F76E1B62DE3200360FB4 /* WASMModuleParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B39F76A1B62DE2200360FB4 /* WASMModuleParser.h */; settings = {ATTRIBUTES = (Private, ); }; };
-                7B39F7701B62DE3200360FB4 /* WASMReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B39F76C1B62DE2200360FB4 /* WASMReader.h */; settings = {ATTRIBUTES = (Private, ); }; };
-                7B39F7721B63574D00360FB4 /* WASMReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B39F7711B63574B00360FB4 /* WASMReader.cpp */; };
-                7B8329BF1BB21FE300649A6E /* WASMFunctionB3IRGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B8329BE1BB21FD100649A6E /* WASMFunctionB3IRGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 7B98D1361B60CD5F0023B1A4 /* JSWASMModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B98D1341B60CD5A0023B1A4 /* JSWASMModule.cpp */; };
</span><span class="cx">                 7B98D1371B60CD620023B1A4 /* JSWASMModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B98D1351B60CD5A0023B1A4 /* JSWASMModule.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 7BC547D31B6959A100959B58 /* WASMFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BC547D21B69599B00959B58 /* WASMFormat.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -1758,6 +1748,7 @@
</span><span class="cx">                 A790DD6F182F499700588807 /* JSSetIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A790DD69182F499700588807 /* JSSetIterator.cpp */; };
</span><span class="cx">                 A790DD70182F499700588807 /* JSSetIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = A790DD6A182F499700588807 /* JSSetIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A7986D5717A0BB1E00A95DD0 /* DFGEdgeUsesStructure.h in Headers */ = {isa = PBXBuildFile; fileRef = A7986D5617A0BB1E00A95DD0 /* DFGEdgeUsesStructure.h */; };
</span><ins>+                A79D3ED9C5064DD0A8466A3A /* ModuleScopeData.h in Headers */ = {isa = PBXBuildFile; fileRef = 000BEAF0DF604481AF6AB68C /* ModuleScopeData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 A7A4AE0817973B26005612B1 /* MacroAssemblerX86Common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A4AE0717973B26005612B1 /* MacroAssemblerX86Common.cpp */; };
</span><span class="cx">                 A7A8AF3417ADB5F3005AB174 /* ArrayBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A8AF2517ADB5F2005AB174 /* ArrayBuffer.cpp */; };
</span><span class="cx">                 A7A8AF3517ADB5F3005AB174 /* ArrayBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A8AF2617ADB5F3005AB174 /* ArrayBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -2130,7 +2121,6 @@
</span><span class="cx">                 FED94F2E171E3E2300BE77A4 /* Watchdog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FED94F2B171E3E2300BE77A4 /* Watchdog.cpp */; };
</span><span class="cx">                 FED94F2F171E3E2300BE77A4 /* Watchdog.h in Headers */ = {isa = PBXBuildFile; fileRef = FED94F2C171E3E2300BE77A4 /* Watchdog.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 FEF040511AAE662D00BD28B0 /* CompareAndSwapTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEF040501AAE662D00BD28B0 /* CompareAndSwapTest.cpp */; };
</span><del>-                A79D3ED9C5064DD0A8466A3A /* ModuleScopeData.h in Headers */ = {isa = PBXBuildFile; fileRef = 000BEAF0DF604481AF6AB68C /* ModuleScopeData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx"> /* End PBXBuildFile section */
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXContainerItemProxy section */
</span><span class="lines">@@ -2275,6 +2265,7 @@
</span><span class="cx"> /* End PBXCopyFilesBuildPhase section */
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXFileReference section */
</span><ins>+                000BEAF0DF604481AF6AB68C /* ModuleScopeData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleScopeData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0F0123301944EA1B00843A0C /* DFGValueStrength.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGValueStrength.cpp; path = dfg/DFGValueStrength.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F0123311944EA1B00843A0C /* DFGValueStrength.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGValueStrength.h; path = dfg/DFGValueStrength.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F0332BF18ADFAE1005F979A /* ExitingJITType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExitingJITType.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3513,16 +3504,6 @@
</span><span class="cx">                 79EE0BFE1B4AFB85000385C9 /* VariableEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VariableEnvironment.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 79F8FC1C1B9FED0F00CA66AB /* DFGMaximalFlushInsertionPhase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGMaximalFlushInsertionPhase.cpp; path = dfg/DFGMaximalFlushInsertionPhase.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 79F8FC1D1B9FED0F00CA66AB /* DFGMaximalFlushInsertionPhase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGMaximalFlushInsertionPhase.h; path = dfg/DFGMaximalFlushInsertionPhase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                7B0247521B8682D500542440 /* WASMConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WASMConstants.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7B0247531B8682D500542440 /* WASMFunctionParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WASMFunctionParser.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7B0247541B8682D500542440 /* WASMFunctionParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WASMFunctionParser.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7B0247581B868EAE00542440 /* WASMFunctionSyntaxChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WASMFunctionSyntaxChecker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7B2E010D1B97AA5800EF5D5C /* WASMFunctionCompiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WASMFunctionCompiler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7B39F7691B62DE2200360FB4 /* WASMModuleParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WASMModuleParser.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7B39F76A1B62DE2200360FB4 /* WASMModuleParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WASMModuleParser.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7B39F76C1B62DE2200360FB4 /* WASMReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WASMReader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7B39F7711B63574B00360FB4 /* WASMReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WASMReader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                7B8329BE1BB21FD100649A6E /* WASMFunctionB3IRGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WASMFunctionB3IRGenerator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 7B98D1341B60CD5A0023B1A4 /* JSWASMModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWASMModule.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7B98D1351B60CD5A0023B1A4 /* JSWASMModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWASMModule.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7BC547D21B69599B00959B58 /* WASMFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WASMFormat.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4418,7 +4399,6 @@
</span><span class="cx">                 FEDA50D51B97F4D9009A3B4F /* PingPongStackOverflowTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PingPongStackOverflowTest.h; path = API/tests/PingPongStackOverflowTest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEF040501AAE662D00BD28B0 /* CompareAndSwapTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompareAndSwapTest.cpp; path = API/tests/CompareAndSwapTest.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 FEF040521AAEC4ED00BD28B0 /* CompareAndSwapTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CompareAndSwapTest.h; path = API/tests/CompareAndSwapTest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                000BEAF0DF604481AF6AB68C /* ModuleScopeData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModuleScopeData.h; path = ModuleScopeData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx"> /* End PBXFileReference section */
</span><span class="cx"> 
</span><span class="cx"> /* Begin PBXFrameworksBuildPhase section */
</span><span class="lines">@@ -5521,17 +5501,7 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 7B98D1341B60CD5A0023B1A4 /* JSWASMModule.cpp */,
</span><span class="cx">                                 7B98D1351B60CD5A0023B1A4 /* JSWASMModule.h */,
</span><del>-                                7B0247521B8682D500542440 /* WASMConstants.h */,
</del><span class="cx">                                 7BC547D21B69599B00959B58 /* WASMFormat.h */,
</span><del>-                                7B2E010D1B97AA5800EF5D5C /* WASMFunctionCompiler.h */,
-                                7B8329BE1BB21FD100649A6E /* WASMFunctionB3IRGenerator.h */,
-                                7B0247531B8682D500542440 /* WASMFunctionParser.cpp */,
-                                7B0247541B8682D500542440 /* WASMFunctionParser.h */,
-                                7B0247581B868EAE00542440 /* WASMFunctionSyntaxChecker.h */,
-                                7B39F7691B62DE2200360FB4 /* WASMModuleParser.cpp */,
-                                7B39F76A1B62DE2200360FB4 /* WASMModuleParser.h */,
-                                7B39F7711B63574B00360FB4 /* WASMReader.cpp */,
-                                7B39F76C1B62DE2200360FB4 /* WASMReader.h */,
</del><span class="cx">                         );
</span><span class="cx">                         path = wasm;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -8190,16 +8160,9 @@
</span><span class="cx">                                 BC18C4200E16F5CD00B34460 /* VM.h in Headers */,
</span><span class="cx">                                 658D3A5619638268003C45D6 /* VMEntryRecord.h in Headers */,
</span><span class="cx">                                 FE5932A8183C5A2600A1ECCC /* VMEntryScope.h in Headers */,
</span><del>-                                7B0247551B8682DD00542440 /* WASMConstants.h in Headers */,
</del><span class="cx">                                 7BC547D31B6959A100959B58 /* WASMFormat.h in Headers */,
</span><del>-                                7B2E010E1B97AA6900EF5D5C /* WASMFunctionCompiler.h in Headers */,
-                                7B8329BF1BB21FE300649A6E /* WASMFunctionB3IRGenerator.h in Headers */,
-                                7B0247571B8682E400542440 /* WASMFunctionParser.h in Headers */,
</del><span class="cx">                                 0F6B8ADD1C4EFAC300969052 /* B3SSACalculator.h in Headers */,
</span><del>-                                7B0247591B868EB700542440 /* WASMFunctionSyntaxChecker.h in Headers */,
-                                7B39F76E1B62DE3200360FB4 /* WASMModuleParser.h in Headers */,
</del><span class="cx">                                 0F2BBD9A1C5FF3F50023EF23 /* B3VariableValue.h in Headers */,
</span><del>-                                7B39F7701B62DE3200360FB4 /* WASMReader.h in Headers */,
</del><span class="cx">                                 FED94F2F171E3E2300BE77A4 /* Watchdog.h in Headers */,
</span><span class="cx">                                 0F919D2615853CE3004A4E7D /* Watchpoint.h in Headers */,
</span><span class="cx">                                 142E313C134FF0A600AFADB5 /* Weak.h in Headers */,
</span><span class="lines">@@ -9496,10 +9459,7 @@
</span><span class="cx">                                 0F20C2591A8013AB00DA3229 /* VirtualRegister.cpp in Sources */,
</span><span class="cx">                                 E18E3A590DF9278C00D90B34 /* VM.cpp in Sources */,
</span><span class="cx">                                 FE5932A7183C5A2600A1ECCC /* VMEntryScope.cpp in Sources */,
</span><del>-                                7B0247561B8682E100542440 /* WASMFunctionParser.cpp in Sources */,
</del><span class="cx">                                 FE187A011BFBE55E0038BBCA /* JITMulGenerator.cpp in Sources */,
</span><del>-                                7B39F76D1B62DE2E00360FB4 /* WASMModuleParser.cpp in Sources */,
-                                7B39F7721B63574D00360FB4 /* WASMReader.cpp in Sources */,
</del><span class="cx">                                 26718BA41BE99F780052017B /* AirIteratedRegisterCoalescing.cpp in Sources */,
</span><span class="cx">                                 FED94F2E171E3E2300BE77A4 /* Watchdog.cpp in Sources */,
</span><span class="cx">                                 0F919D2515853CE0004A4E7D /* Watchpoint.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -880,7 +880,6 @@
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="cx">     } else if (executable-&gt;isWebAssemblyExecutable()) {
</span><span class="cx">         WebAssemblyExecutable* webAssemblyExecutable = static_cast&lt;WebAssemblyExecutable*&gt;(executable);
</span><del>-        webAssemblyExecutable-&gt;prepareForExecution(execCallee);
</del><span class="cx">         codeBlock = webAssemblyExecutable-&gt;codeBlockForCall();
</span><span class="cx">         ASSERT(codeBlock);
</span><span class="cx">         ArityCheckMode arity;
</span><span class="lines">@@ -971,9 +970,6 @@
</span><span class="cx">                     vm-&gt;getCTIStub(throwExceptionFromCallSlowPathGenerator).code().executableAddress(),
</span><span class="cx">                     reinterpret_cast&lt;void*&gt;(KeepTheFrame));
</span><span class="cx">             }
</span><del>-
-            WebAssemblyExecutable* webAssemblyExecutable = static_cast&lt;WebAssemblyExecutable*&gt;(executable);
-            webAssemblyExecutable-&gt;prepareForExecution(execCallee);
</del><span class="cx"> #endif
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejsccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jsc.cpp (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jsc.cpp        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/jsc.cpp        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -61,7 +61,6 @@
</span><span class="cx"> #include &quot;SuperSampler.h&quot;
</span><span class="cx"> #include &quot;TestRunnerUtils.h&quot;
</span><span class="cx"> #include &quot;TypeProfilerLog.h&quot;
</span><del>-#include &quot;WASMModuleParser.h&quot;
</del><span class="cx"> #include &lt;locale.h&gt;
</span><span class="cx"> #include &lt;math.h&gt;
</span><span class="cx"> #include &lt;stdio.h&gt;
</span><span class="lines">@@ -624,9 +623,6 @@
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL functionEnableExceptionFuzz(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL functionDrainMicrotasks(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL functionIs32BitPlatform(ExecState*);
</span><del>-#if ENABLE(WEBASSEMBLY)
-static EncodedJSValue JSC_HOST_CALL functionLoadWebAssembly(ExecState*);
-#endif
</del><span class="cx"> static EncodedJSValue JSC_HOST_CALL functionLoadModule(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL functionCheckModuleSyntax(ExecState*);
</span><span class="cx"> static EncodedJSValue JSC_HOST_CALL functionPlatformSupportsSamplingProfiler(ExecState*);
</span><span class="lines">@@ -853,9 +849,6 @@
</span><span class="cx"> 
</span><span class="cx">         addFunction(vm, &quot;is32BitPlatform&quot;, functionIs32BitPlatform, 0);
</span><span class="cx"> 
</span><del>-#if ENABLE(WEBASSEMBLY)
-        addFunction(vm, &quot;loadWebAssembly&quot;, functionLoadWebAssembly, 3);
-#endif
</del><span class="cx">         addFunction(vm, &quot;loadModule&quot;, functionLoadModule, 1);
</span><span class="cx">         addFunction(vm, &quot;checkModuleSyntax&quot;, functionCheckModuleSyntax, 1);
</span><span class="cx"> 
</span><span class="lines">@@ -1781,28 +1774,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(WEBASSEMBLY)
-EncodedJSValue JSC_HOST_CALL functionLoadWebAssembly(ExecState* exec)
-{
-    String fileName = exec-&gt;argument(0).toWTFString(exec);
-    if (exec-&gt;hadException())
-        return JSValue::encode(jsUndefined());
-    Vector&lt;char&gt; buffer;
-    if (!fillBufferWithContentsOfFile(fileName, buffer))
-        return JSValue::encode(exec-&gt;vm().throwException(exec, createError(exec, ASCIILiteral(&quot;Could not open file.&quot;))));
-    RefPtr&lt;WebAssemblySourceProvider&gt; sourceProvider = WebAssemblySourceProvider::create(reinterpret_cast&lt;Vector&lt;uint8_t&gt;&amp;&gt;(buffer), fileName);
-    SourceCode source(sourceProvider);
-    JSObject* imports = exec-&gt;argument(1).getObject();
-    JSArrayBuffer* arrayBuffer = jsDynamicCast&lt;JSArrayBuffer*&gt;(exec-&gt;argument(2));
-
-    String errorMessage;
-    JSWASMModule* module = parseWebAssembly(exec, source, imports, arrayBuffer, errorMessage);
-    if (!module)
-        return JSValue::encode(exec-&gt;vm().throwException(exec, createSyntaxError(exec, errorMessage)));
-    return JSValue::encode(module);
-}
-#endif
-
</del><span class="cx"> EncodedJSValue JSC_HOST_CALL functionLoadModule(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     String fileName = exec-&gt;argument(0).toWTFString(exec);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1281,7 +1281,6 @@
</span><span class="cx">     } else {
</span><span class="cx"> #if ENABLE(WEBASSEMBLY)
</span><span class="cx">         WebAssemblyExecutable* webAssemblyExecutable = static_cast&lt;WebAssemblyExecutable*&gt;(executable);
</span><del>-        webAssemblyExecutable-&gt;prepareForExecution(execCallee);
</del><span class="cx">         codeBlock = webAssemblyExecutable-&gt;codeBlockForCall();
</span><span class="cx">         ASSERT(codeBlock);
</span><span class="cx">         ArityCheckMode arity;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Executable.cpp (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Executable.cpp        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/runtime/Executable.cpp        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -37,7 +37,6 @@
</span><span class="cx"> #include &quot;ProfilerDatabase.h&quot;
</span><span class="cx"> #include &quot;TypeProfiler.h&quot;
</span><span class="cx"> #include &quot;VMInlines.h&quot;
</span><del>-#include &quot;WASMFunctionParser.h&quot;
</del><span class="cx"> #include &lt;wtf/CommaPrinter.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="lines">@@ -766,28 +765,6 @@
</span><span class="cx">         thisObject-&gt;m_codeBlockForCall-&gt;visitWeakly(visitor);
</span><span class="cx">     visitor.append(&amp;thisObject-&gt;m_module);
</span><span class="cx"> }
</span><del>-
-void WebAssemblyExecutable::prepareForExecution(ExecState* exec)
-{
-    if (hasJITCodeForCall())
-        return;
-
-    VM&amp; vm = exec-&gt;vm();
-    DeferGC deferGC(vm.heap);
-
-    WebAssemblyCodeBlock* codeBlock = WebAssemblyCodeBlock::create(&amp;vm,
-        this, exec-&gt;lexicalGlobalObject());
-
-    WASMFunctionParser::compile(vm, codeBlock, m_module.get(), m_source, m_functionIndex);
-
-    m_jitCodeForCall = codeBlock-&gt;jitCode();
-    m_jitCodeForCallWithArityCheck = MacroAssemblerCodePtr();
-    m_numParametersForCall = codeBlock-&gt;numParameters();
-
-    m_codeBlockForCall.set(vm, this, codeBlock);
-
-    Heap::heap(this)-&gt;writeBarrier(this);
-}
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void ExecutableBase::dump(PrintStream&amp; out) const
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -512,10 +512,6 @@
</span><span class="cx">         m_callableProxyObjectStructure.set(vm, this, ProxyObject::createStructure(vm, this, m_objectPrototype.get(), isCallable));
</span><span class="cx">     }
</span><span class="cx">     m_proxyRevokeStructure.set(vm, this, ProxyRevoke::createStructure(vm, this, m_functionPrototype.get()));
</span><del>-    
-#if ENABLE(WEBASSEMBLY)
-    m_wasmModuleStructure.set(vm, this, JSWASMModule::createStructure(vm, this));
-#endif
</del><span class="cx"> 
</span><span class="cx">     m_parseIntFunction.set(vm, this, JSFunction::create(vm, this, 2, vm.propertyNames-&gt;parseInt.string(), globalFuncParseInt, NoIntrinsic));
</span><span class="cx">     putDirectWithoutTransition(vm, vm.propertyNames-&gt;parseInt, m_parseIntFunction.get(), DontEnum);
</span><span class="lines">@@ -1100,9 +1096,6 @@
</span><span class="cx">     visitor.append(&amp;thisObject-&gt;m_proxyObjectStructure);
</span><span class="cx">     visitor.append(&amp;thisObject-&gt;m_callableProxyObjectStructure);
</span><span class="cx">     visitor.append(&amp;thisObject-&gt;m_proxyRevokeStructure);
</span><del>-#if ENABLE(WEBASSEMBLY)
-    visitor.append(&amp;thisObject-&gt;m_wasmModuleStructure);
-#endif
</del><span class="cx"> 
</span><span class="cx"> #define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName) \
</span><span class="cx">     visitor.append(&amp;thisObject-&gt;m_ ## lowerName ## Prototype); \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -307,9 +307,6 @@
</span><span class="cx">     WriteBarrier&lt;Structure&gt; m_proxyObjectStructure;
</span><span class="cx">     WriteBarrier&lt;Structure&gt; m_callableProxyObjectStructure;
</span><span class="cx">     WriteBarrier&lt;Structure&gt; m_proxyRevokeStructure;
</span><del>-#if ENABLE(WEBASSEMBLY)
-    WriteBarrier&lt;Structure&gt; m_wasmModuleStructure;
-#endif
</del><span class="cx"> 
</span><span class="cx"> #define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
</span><span class="cx">     WriteBarrier&lt;capitalName ## Prototype&gt; m_ ## lowerName ## Prototype; \
</span><span class="lines">@@ -583,9 +580,6 @@
</span><span class="cx">     Structure* proxyObjectStructure() const { return m_proxyObjectStructure.get(); }
</span><span class="cx">     Structure* callableProxyObjectStructure() const { return m_callableProxyObjectStructure.get(); }
</span><span class="cx">     Structure* proxyRevokeStructure() const { return m_proxyRevokeStructure.get(); }
</span><del>-#if ENABLE(WEBASSEMBLY)
-    Structure* wasmModuleStructure() const { return m_wasmModuleStructure.get(); }
-#endif
</del><span class="cx"> 
</span><span class="cx">     JS_EXPORT_PRIVATE void setRemoteDebuggingEnabled(bool);
</span><span class="cx">     JS_EXPORT_PRIVATE bool remoteDebuggingEnabled() const;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMConstantsh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/WASMConstants.h (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMConstants.h        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/wasm/WASMConstants.h        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1,329 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * =========================================================================
- *
- * Copyright (c) 2015 by the repository authors of
- * WebAssembly/polyfill-prototype-1.
- *
- * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef WASMConstants_h
-#define WASMConstants_h
-
-#if ENABLE(WEBASSEMBLY)
-
-namespace JSC {
-
-static const uint32_t wasmMagicNumber = 0x6d736177;
-
-enum class WASMOpKind {
-    Statement,
-    Expression
-};
-
-enum class WASMOpStatement : uint8_t {
-    SetLocal,
-    SetGlobal,
-    I32Store8,
-    I32StoreWithOffset8,
-    I32Store16,
-    I32StoreWithOffset16,
-    I32Store32,
-    I32StoreWithOffset32,
-    F32Store,
-    F32StoreWithOffset,
-    F64Store,
-    F64StoreWithOffset,
-    CallInternal,
-    CallIndirect,
-    CallImport,
-    Return,
-    Block,
-    If,
-    IfElse,
-    While,
-    Do,
-    Label,
-    Break,
-    BreakLabel,
-    Continue,
-    ContinueLabel,
-    Switch,
-    NumberOfWASMOpStatements
-};
-
-enum class WASMOpStatementWithImmediate : uint8_t {
-    SetLocal,
-    SetGlobal,
-    NumberOfWASMOpStatementWithImmediates
-};
-
-enum class WASMOpExpressionI32 : uint8_t {
-    ConstantPoolIndex,
-    Immediate,
-    GetLocal,
-    GetGlobal,
-    SetLocal,
-    SetGlobal,
-    SLoad8,
-    SLoadWithOffset8,
-    ULoad8,
-    ULoadWithOffset8,
-    SLoad16,
-    SLoadWithOffset16,
-    ULoad16,
-    ULoadWithOffset16,
-    Load32,
-    LoadWithOffset32,
-    Store8,
-    StoreWithOffset8,
-    Store16,
-    StoreWithOffset16,
-    Store32,
-    StoreWithOffset32,
-    CallInternal,
-    CallIndirect,
-    CallImport,
-    Conditional,
-    Comma,
-    FromF32,
-    FromF64,
-    Negate,
-    Add,
-    Sub,
-    Mul,
-    SDiv,
-    UDiv,
-    SMod,
-    UMod,
-    BitNot,
-    BitOr,
-    BitAnd,
-    BitXor,
-    LeftShift,
-    ArithmeticRightShift,
-    LogicalRightShift,
-    CountLeadingZeros,
-    LogicalNot,
-    EqualI32,
-    EqualF32,
-    EqualF64,
-    NotEqualI32,
-    NotEqualF32,
-    NotEqualF64,
-    SLessThanI32,
-    ULessThanI32,
-    LessThanF32,
-    LessThanF64,
-    SLessThanOrEqualI32,
-    ULessThanOrEqualI32,
-    LessThanOrEqualF32,
-    LessThanOrEqualF64,
-    SGreaterThanI32,
-    UGreaterThanI32,
-    GreaterThanF32,
-    GreaterThanF64,
-    SGreaterThanOrEqualI32,
-    UGreaterThanOrEqualI32,
-    GreaterThanOrEqualF32,
-    GreaterThanOrEqualF64,
-    SMin,
-    UMin,
-    SMax,
-    UMax,
-    Abs,
-    NumberOfWASMOpExpressionI32s
-};
-
-enum class WASMOpExpressionI32WithImmediate : uint8_t {
-    ConstantPoolIndex,
-    Immediate,
-    GetLocal,
-    NumberOfWASMOpExpressionI32WithImmediates
-};
-
-enum class WASMOpExpressionF32 : uint8_t {
-    ConstantPoolIndex,
-    Immediate,
-    GetLocal,
-    GetGlobal,
-    SetLocal,
-    SetGlobal,
-    Load,
-    LoadWithOffset,
-    Store,
-    StoreWithOffset,
-    CallInternal,
-    CallIndirect,
-    Conditional,
-    Comma,
-    FromS32,
-    FromU32,
-    FromF64,
-    Negate,
-    Add,
-    Sub,
-    Mul,
-    Div,
-    Abs,
-    Ceil,
-    Floor,
-    Sqrt,
-    NumberOfWASMOpExpressionF32s
-};
-
-enum class WASMOpExpressionF32WithImmediate : uint8_t {
-    ConstantPoolIndex,
-    GetLocal,
-    NumberOfWASMOpExpressionF32WithImmediates
-};
-
-enum class WASMOpExpressionF64 : uint8_t {
-    ConstantPoolIndex,
-    Immediate,
-    GetLocal,
-    GetGlobal,
-    SetLocal,
-    SetGlobal,
-    Load,
-    LoadWithOffset,
-    Store,
-    StoreWithOffset,
-    CallInternal,
-    CallIndirect,
-    CallImport,
-    Conditional,
-    Comma,
-    FromS32,
-    FromU32,
-    FromF32,
-    Negate,
-    Add,
-    Sub,
-    Mul,
-    Div,
-    Mod,
-    Min,
-    Max,
-    Abs,
-    Ceil,
-    Floor,
-    Sqrt,
-    Cos,
-    Sin,
-    Tan,
-    ACos,
-    ASin,
-    ATan,
-    ATan2,
-    Exp,
-    Ln,
-    Pow,
-    NumberOfWASMOpExpressionF64s
-};
-
-enum class WASMOpExpressionF64WithImmediate : uint8_t {
-    ConstantPoolIndex,
-    GetLocal,
-    NumberOfWASMOpExpressionF64WithImmediates
-};
-
-enum class WASMOpExpressionVoid : uint8_t {
-    CallInternal,
-    CallIndirect,
-    CallImport,
-    NumberOfWASMOpExpressionVoids
-};
-
-enum class WASMVariableTypes : uint8_t {
-    I32 = 1 &lt;&lt; 0,
-    F32 = 1 &lt;&lt; 1,
-    F64 = 1 &lt;&lt; 2,
-    NumberOfVariableTypes = 8
-};
-
-enum class WASMVariableTypesWithImmediate : uint8_t {
-    I32,
-    NumberOfVariableTypesWithImmediates
-};
-
-enum class WASMSwitchCase : uint8_t {
-    CaseWithNoStatements,
-    CaseWithStatement,
-    CaseWithBlockStatement,
-    DefaultWithNoStatements,
-    DefaultWithStatement,
-    DefaultWithBlockStatement,
-    NumberOfSwitchCases
-};
-
-enum class WASMExportFormat : uint8_t {
-    Default,
-    Record,
-    NumberOfExportFormats
-};
-
-enum class WASMTypeConversion {
-    ConvertSigned,
-    ConvertUnsigned,
-    Promote,
-    Demote,
-};
-
-enum class WASMMemoryType {
-    I8,
-    I16,
-    I32,
-    F32,
-    F64
-};
-
-enum class MemoryAccessOffsetMode { NoOffset, WithOffset };
-enum class MemoryAccessConversion { NoConversion, SignExtend, ZeroExtend };
-
-static const uint8_t hasImmediateInOpFlag = 0x80;
-
-static const unsigned opWithImmediateBits = 2;
-static const uint32_t opWithImmediateLimit = 1 &lt;&lt; opWithImmediateBits;
-
-static const unsigned immediateBits = 5;
-static const uint32_t immediateLimit = 1 &lt;&lt; immediateBits;
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)
-
-#endif // WASMConstants_h
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMFunctionB3IRGeneratorh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/WASMFunctionB3IRGenerator.h (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMFunctionB3IRGenerator.h        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/wasm/WASMFunctionB3IRGenerator.h        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1,394 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WASMFunctionB3IRGenerator_h
-#define WASMFunctionB3IRGenerator_h
-
-#if ENABLE(WEBASSEMBLY) &amp;&amp; ENABLE(FTL_JIT)
-
-#include &quot;FTLAbbreviatedTypes.h&quot;
-
-#define UNUSED 0
-
-namespace JSC {
-
-using FTL::LBasicBlock;
-using FTL::LValue;
-
-class WASMFunctionB3IRGenerator {
-public:
-    typedef LValue Expression;
-    typedef int Statement;
-    typedef Vector&lt;LValue&gt; ExpressionList;
-    struct MemoryAddress {
-        MemoryAddress(void*) { }
-        MemoryAddress(LValue index, uint32_t offset)
-            : index(index)
-            , offset(offset)
-        {
-        }
-        LValue index;
-        uint32_t offset;
-    };
-    typedef LBasicBlock JumpTarget;
-    enum class JumpCondition { Zero, NonZero };
-
-    void startFunction(const Vector&lt;WASMType&gt;&amp; arguments, uint32_t numberOfI32LocalVariables, uint32_t numberOfF32LocalVariables, uint32_t numberOfF64LocalVariables)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(arguments);
-        UNUSED_PARAM(numberOfI32LocalVariables);
-        UNUSED_PARAM(numberOfF32LocalVariables);
-        UNUSED_PARAM(numberOfF64LocalVariables);
-    }
-
-    void endFunction()
-    {
-        // FIXME: Implement this method.
-    }
-
-    LValue buildSetLocal(WASMOpKind opKind, uint32_t localIndex, LValue value, WASMType type)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(opKind);
-        UNUSED_PARAM(localIndex);
-        UNUSED_PARAM(value);
-        UNUSED_PARAM(type);
-        return UNUSED;
-    }
-
-    LValue buildSetGlobal(WASMOpKind opKind, uint32_t globalIndex, LValue value, WASMType type)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(opKind);
-        UNUSED_PARAM(globalIndex);
-        UNUSED_PARAM(value);
-        UNUSED_PARAM(type);
-        return UNUSED;
-    }
-
-    void buildReturn(LValue value, WASMExpressionType returnType)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(value);
-        UNUSED_PARAM(returnType);
-    }
-
-    LValue buildImmediateI32(uint32_t immediate)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(immediate);
-        return UNUSED;
-    }
-
-    LValue buildImmediateF32(float immediate)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(immediate);
-        return UNUSED;
-    }
-
-    LValue buildImmediateF64(double immediate)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(immediate);
-        return UNUSED;
-    }
-
-    LValue buildGetLocal(uint32_t localIndex, WASMType type)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(localIndex);
-        UNUSED_PARAM(type);
-        return UNUSED;
-    }
-
-    LValue buildGetGlobal(uint32_t globalIndex, WASMType type)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(globalIndex);
-        UNUSED_PARAM(type);
-        return UNUSED;
-    }
-
-    LValue buildConvertType(LValue value, WASMExpressionType fromType, WASMExpressionType toType, WASMTypeConversion conversion)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(value);
-        UNUSED_PARAM(fromType);
-        UNUSED_PARAM(toType);
-        UNUSED_PARAM(conversion);
-        return UNUSED;
-    }
-
-    LValue buildLoad(const MemoryAddress&amp; memoryAddress, WASMExpressionType expressionType, WASMMemoryType memoryType, MemoryAccessConversion conversion)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(memoryAddress);
-        UNUSED_PARAM(expressionType);
-        UNUSED_PARAM(memoryType);
-        UNUSED_PARAM(conversion);
-        return UNUSED;
-    }
-
-    LValue buildStore(WASMOpKind opKind, const MemoryAddress&amp; memoryAddress, WASMExpressionType expressionType, WASMMemoryType memoryType, LValue value)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(opKind);
-        UNUSED_PARAM(memoryAddress);
-        UNUSED_PARAM(expressionType);
-        UNUSED_PARAM(memoryType);
-        UNUSED_PARAM(value);
-        return UNUSED;
-    }
-
-    LValue buildUnaryI32(LValue value, WASMOpExpressionI32 op)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(value);
-        UNUSED_PARAM(op);
-        return UNUSED;
-    }
-
-    LValue buildUnaryF32(LValue value, WASMOpExpressionF32 op)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(value);
-        UNUSED_PARAM(op);
-        return UNUSED;
-    }
-
-    LValue buildUnaryF64(LValue value, WASMOpExpressionF64 op)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(value);
-        UNUSED_PARAM(op);
-        return UNUSED;
-    }
-
-    LValue buildBinaryI32(LValue left, LValue right, WASMOpExpressionI32 op)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(left);
-        UNUSED_PARAM(right);
-        UNUSED_PARAM(op);
-        return UNUSED;
-    }
-
-    LValue buildBinaryF32(LValue left, LValue right, WASMOpExpressionF32 op)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(left);
-        UNUSED_PARAM(right);
-        UNUSED_PARAM(op);
-        return UNUSED;
-    }
-
-    LValue buildBinaryF64(LValue left, LValue right, WASMOpExpressionF64 op)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(left);
-        UNUSED_PARAM(right);
-        UNUSED_PARAM(op);
-        return UNUSED;
-    }
-
-    LValue buildRelationalI32(LValue left, LValue right, WASMOpExpressionI32 op)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(left);
-        UNUSED_PARAM(right);
-        UNUSED_PARAM(op);
-        return UNUSED;
-    }
-
-    LValue buildRelationalF32(LValue left, LValue right, WASMOpExpressionI32 op)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(left);
-        UNUSED_PARAM(right);
-        UNUSED_PARAM(op);
-        return UNUSED;
-    }
-
-    LValue buildRelationalF64(LValue left, LValue right, WASMOpExpressionI32 op)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(left);
-        UNUSED_PARAM(right);
-        UNUSED_PARAM(op);
-        return UNUSED;
-    }
-
-    LValue buildMinOrMaxI32(LValue left, LValue right, WASMOpExpressionI32 op)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(left);
-        UNUSED_PARAM(right);
-        UNUSED_PARAM(op);
-        return UNUSED;
-    }
-
-    LValue buildMinOrMaxF64(LValue left, LValue right, WASMOpExpressionF64 op)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(left);
-        UNUSED_PARAM(right);
-        UNUSED_PARAM(op);
-        return UNUSED;
-    }
-
-    LValue buildCallInternal(uint32_t functionIndex, const Vector&lt;LValue&gt;&amp; argumentList, const WASMSignature&amp; signature, WASMExpressionType returnType)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(functionIndex);
-        UNUSED_PARAM(argumentList);
-        UNUSED_PARAM(signature);
-        UNUSED_PARAM(returnType);
-        return UNUSED;
-    }
-
-    LValue buildCallIndirect(uint32_t functionPointerTableIndex, LValue index, const Vector&lt;LValue&gt;&amp; argumentList, const WASMSignature&amp; signature, WASMExpressionType returnType)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(functionPointerTableIndex);
-        UNUSED_PARAM(index);
-        UNUSED_PARAM(argumentList);
-        UNUSED_PARAM(signature);
-        UNUSED_PARAM(returnType);
-        return UNUSED;
-    }
-
-    LValue buildCallImport(uint32_t functionImportIndex, const Vector&lt;LValue&gt;&amp; argumentList, const WASMSignature&amp; signature, WASMExpressionType returnType)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(functionImportIndex);
-        UNUSED_PARAM(argumentList);
-        UNUSED_PARAM(signature);
-        UNUSED_PARAM(returnType);
-        return UNUSED;
-    }
-
-    void appendExpressionList(Vector&lt;LValue&gt;&amp; expressionList, LValue value)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(expressionList);
-        UNUSED_PARAM(value);
-    }
-
-    void discard(LValue)
-    {
-    }
-
-    void linkTarget(LBasicBlock target)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(target);
-    }
-
-    void jumpToTarget(LBasicBlock target)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(target);
-    }
-
-    void jumpToTargetIf(JumpCondition, LValue value, LBasicBlock target)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(value);
-        UNUSED_PARAM(target);
-    }
-
-    void startLoop()
-    {
-        // FIXME: Implement this method.
-    }
-
-    void endLoop()
-    {
-        // FIXME: Implement this method.
-    }
-
-    void startSwitch()
-    {
-        // FIXME: Implement this method.
-    }
-
-    void endSwitch()
-    {
-        // FIXME: Implement this method.
-    }
-
-    void startLabel()
-    {
-        // FIXME: Implement this method.
-    }
-
-    void endLabel()
-    {
-        // FIXME: Implement this method.
-    }
-
-    LBasicBlock breakTarget()
-    {
-        // FIXME: Implement this method.
-        return UNUSED;
-    }
-
-    LBasicBlock continueTarget()
-    {
-        // FIXME: Implement this method.
-        return UNUSED;
-    }
-
-    LBasicBlock breakLabelTarget(uint32_t labelIndex)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(labelIndex);
-        return UNUSED;
-    }
-
-    LBasicBlock continueLabelTarget(uint32_t labelIndex)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(labelIndex);
-        return UNUSED;
-    }
-
-    void buildSwitch(LValue value, const Vector&lt;int64_t&gt;&amp; cases, const Vector&lt;LBasicBlock&gt;&amp; targets, LBasicBlock defaultTarget)
-    {
-        // FIXME: Implement this method.
-        UNUSED_PARAM(value);
-        UNUSED_PARAM(cases);
-        UNUSED_PARAM(targets);
-        UNUSED_PARAM(defaultTarget);
-    }
-};
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)
-
-#endif // WASMFunctionB3IRGenerator_h
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMFunctionCompilerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/wasm/WASMFunctionCompiler.h        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1,1541 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WASMFunctionCompiler_h
-#define WASMFunctionCompiler_h
-
-#if ENABLE(WEBASSEMBLY)
-
-#include &quot;BinarySwitch.h&quot;
-#include &quot;CCallHelpers.h&quot;
-#include &quot;JIT.h&quot;
-#include &quot;JITOperations.h&quot;
-#include &quot;JSArrayBuffer.h&quot;
-#include &quot;LinkBuffer.h&quot;
-#include &quot;MaxFrameExtentForSlowPathCall.h&quot;
-
-#define UNUSED 0
-
-namespace JSC {
-
-static int32_t JIT_OPERATION operationConvertJSValueToInt32(ExecState* exec, EncodedJSValue value)
-{
-    return JSValue::decode(value).toInt32(exec);
-}
-
-static double JIT_OPERATION operationConvertJSValueToDouble(ExecState* exec, EncodedJSValue value)
-{
-    return JSValue::decode(value).toNumber(exec);
-}
-
-#if !CPU(X86) &amp;&amp; !CPU(X86_64)
-static int32_t JIT_OPERATION operationDiv(int32_t left, int32_t right)
-{
-    return left / right;
-}
-
-static int32_t JIT_OPERATION operationMod(int32_t left, int32_t right)
-{
-    return left % right;
-}
-
-static uint32_t JIT_OPERATION operationUnsignedDiv(uint32_t left, uint32_t right)
-{
-    return left / right;
-}
-
-static uint32_t JIT_OPERATION operationUnsignedMod(uint32_t left, uint32_t right)
-{
-    return left % right;
-}
-#endif
-
-#if !USE(JSVALUE64)
-static double JIT_OPERATION operationConvertUnsignedInt32ToDouble(uint32_t value)
-{
-    return static_cast&lt;double&gt;(value);
-}
-#endif
-
-static size_t sizeOfMemoryType(WASMMemoryType memoryType)
-{
-    switch (memoryType) {
-    case WASMMemoryType::I8:
-        return 1;
-    case WASMMemoryType::I16:
-        return 2;
-    case WASMMemoryType::I32:
-    case WASMMemoryType::F32:
-        return 4;
-    case WASMMemoryType::F64:
-        return 8;
-    default:
-        ASSERT_NOT_REACHED();
-    }
-    RELEASE_ASSERT_NOT_REACHED();
-    return 0;
-}
-
-class WASMFunctionCompiler : private CCallHelpers {
-public:
-    typedef int Expression;
-    typedef int Statement;
-    typedef int ExpressionList;
-    struct MemoryAddress {
-        MemoryAddress(void*) { }
-        MemoryAddress(int, uint32_t offset)
-            : offset(offset)
-        {
-        }
-        uint32_t offset;
-    };
-    struct JumpTarget {
-        Label label;
-        JumpList jumpList;
-    };
-    enum class JumpCondition { Zero, NonZero };
-
-    WASMFunctionCompiler(VM&amp; vm, CodeBlock* codeBlock, JSWASMModule* module, unsigned stackHeight)
-        : CCallHelpers(&amp;vm, codeBlock)
-        , m_module(module)
-        , m_stackHeight(stackHeight)
-    {
-    }
-
-    void startFunction(const Vector&lt;WASMType&gt;&amp; arguments, uint32_t numberOfI32LocalVariables, uint32_t numberOfF32LocalVariables, uint32_t numberOfF64LocalVariables)
-    {
-        m_calleeSaveSpace = WTF::roundUpToMultipleOf(sizeof(StackSlot), RegisterSet::webAssemblyCalleeSaveRegisters().numberOfSetRegisters() * sizeof(void*));
-        m_codeBlock-&gt;setCalleeSaveRegisters(RegisterSet::webAssemblyCalleeSaveRegisters());
-
-        emitFunctionPrologue();
-        emitPutToCallFrameHeader(m_codeBlock, CallFrameSlot::codeBlock);
-
-        m_beginLabel = label();
-
-        addPtr(TrustedImm32(-m_calleeSaveSpace - WTF::roundUpToMultipleOf(stackAlignmentRegisters(), m_stackHeight) * sizeof(StackSlot) - maxFrameExtentForSlowPathCall), GPRInfo::callFrameRegister, GPRInfo::regT1);
-        m_stackOverflow = branchPtr(Above, AbsoluteAddress(m_vm-&gt;addressOfSoftStackLimit()), GPRInfo::regT1);
-
-        move(GPRInfo::regT1, stackPointerRegister);
-        checkStackPointerAlignment();
-
-        emitSaveCalleeSaves();
-        emitMaterializeTagCheckRegisters();
-
-        m_numberOfLocals = arguments.size() + numberOfI32LocalVariables + numberOfF32LocalVariables + numberOfF64LocalVariables;
-
-        unsigned localIndex = 0;
-        for (size_t i = 0; i &lt; arguments.size(); ++i) {
-            // FIXME: No need to do type conversion if the caller is a WebAssembly function.
-            // https://bugs.webkit.org/show_bug.cgi?id=149310
-            Address address(GPRInfo::callFrameRegister, CallFrame::argumentOffset(i) * sizeof(Register));
-#if USE(JSVALUE64)
-            JSValueRegs valueRegs(GPRInfo::regT0);
-#else
-            JSValueRegs valueRegs(GPRInfo::regT1, GPRInfo::regT0);
-#endif
-            loadValue(address, valueRegs);
-            switch (arguments[i]) {
-            case WASMType::I32:
-                convertValueToInt32(valueRegs, GPRInfo::regT0);
-                store32(GPRInfo::regT0, localAddress(localIndex++));
-                break;
-            case WASMType::F32:
-            case WASMType::F64:
-#if USE(JSVALUE64)
-                convertValueToDouble(valueRegs, FPRInfo::fpRegT0, GPRInfo::regT1);
-#else
-                convertValueToDouble(valueRegs, FPRInfo::fpRegT0, GPRInfo::regT2, FPRInfo::fpRegT1);
-#endif
-                if (arguments[i] == WASMType::F32)
-                    convertDoubleToFloat(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-                storeDouble(FPRInfo::fpRegT0, localAddress(localIndex++));
-                break;
-            default:
-                ASSERT_NOT_REACHED();
-            }
-        }
-        for (uint32_t i = 0; i &lt; numberOfI32LocalVariables; ++i)
-            store32(TrustedImm32(0), localAddress(localIndex++));
-        for (uint32_t i = 0; i &lt; numberOfF32LocalVariables; ++i)
-            store32(TrustedImm32(0), localAddress(localIndex++));
-        for (uint32_t i = 0; i &lt; numberOfF64LocalVariables; ++i) {
-#if USE(JSVALUE64)
-            store64(TrustedImm64(0), localAddress(localIndex++));
-#else
-            store32(TrustedImm32(0), localAddress(localIndex));
-            store32(TrustedImm32(0), localAddress(localIndex).withOffset(4));
-            localIndex++;
-#endif
-        }
-
-        m_codeBlock-&gt;setNumParameters(1 + arguments.size());
-    }
-
-    void endFunction()
-    {
-        ASSERT(!m_tempStackTop);
-
-        // FIXME: Remove these if the last statement is a return statement.
-#if USE(JSVALUE64)
-        JSValueRegs returnValueRegs(GPRInfo::returnValueGPR);
-#else
-        JSValueRegs returnValueRegs(GPRInfo::returnValueGPR2, GPRInfo::returnValueGPR);
-#endif
-        moveTrustedValue(jsUndefined(), returnValueRegs);
-        emitRestoreCalleeSaves();
-        emitFunctionEpilogue();
-        ret();
-
-        m_stackOverflow.link(this);
-        if (maxFrameExtentForSlowPathCall)
-            addPtr(TrustedImm32(-maxFrameExtentForSlowPathCall), stackPointerRegister);
-        setupArgumentsWithExecState(TrustedImmPtr(m_codeBlock));
-        appendCallWithExceptionCheck(operationThrowStackOverflowError);
-
-        // FIXME: Implement arity check.
-        Label arityCheck = label();
-        emitFunctionPrologue();
-        emitPutToCallFrameHeader(m_codeBlock, CallFrameSlot::codeBlock);
-        jump(m_beginLabel);
-
-        if (!m_divideErrorJumpList.empty()) {
-            m_divideErrorJumpList.link(this);
-
-            setupArgumentsExecState();
-            appendCallWithExceptionCheck(operationThrowDivideError);
-        }
-
-        if (!m_outOfBoundsErrorJumpList.empty()) {
-            m_outOfBoundsErrorJumpList.link(this);
-
-            setupArgumentsExecState();
-            appendCallWithExceptionCheck(operationThrowOutOfBoundsAccessError);
-        }
-
-        if (!m_exceptionChecks.empty()) {
-            m_exceptionChecks.link(this);
-
-            copyCalleeSavesToVMEntryFrameCalleeSavesBuffer();
-
-            // lookupExceptionHandler is passed two arguments, the VM and the exec (the CallFrame*).
-            move(TrustedImmPtr(vm()), GPRInfo::argumentGPR0);
-            move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR1);
-
-#if CPU(X86)
-            // FIXME: should use the call abstraction, but this is currently in the SpeculativeJIT layer!
-            poke(GPRInfo::argumentGPR0);
-            poke(GPRInfo::argumentGPR1, 1);
-#endif
-            m_calls.append(std::make_pair(call(), FunctionPtr(lookupExceptionHandlerFromCallerFrame).value()));
-            jumpToExceptionHandler();
-        }
-
-        LinkBuffer patchBuffer(*m_vm, *this, m_codeBlock, JITCompilationMustSucceed);
-
-        for (const auto&amp; iterator : m_calls)
-            patchBuffer.link(iterator.first, FunctionPtr(iterator.second));
-
-        for (size_t i = 0; i &lt; m_callCompilationInfo.size(); ++i) {
-            CallCompilationInfo&amp; compilationInfo = m_callCompilationInfo[i];
-            CallLinkInfo&amp; info = *compilationInfo.callLinkInfo;
-            info.setCallLocations(patchBuffer.locationOfNearCall(compilationInfo.callReturnLocation),
-                patchBuffer.locationOf(compilationInfo.hotPathBegin),
-                patchBuffer.locationOfNearCall(compilationInfo.hotPathOther));
-        }
-
-        MacroAssemblerCodePtr withArityCheck = patchBuffer.locationOf(arityCheck);
-        CodeRef result = FINALIZE_CODE(patchBuffer, (&quot;Baseline JIT code for WebAssembly&quot;));
-        m_codeBlock-&gt;setJITCode(adoptRef(new DirectJITCode(result, withArityCheck, JITCode::BaselineJIT)));
-        m_codeBlock-&gt;capabilityLevel();
-    }
-
-    int buildSetLocal(WASMOpKind opKind, uint32_t localIndex, int, WASMType type)
-    {
-        switch (type) {
-        case WASMType::I32:
-        case WASMType::F32:
-            load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT0);
-            store32(GPRInfo::regT0, localAddress(localIndex));
-            break;
-        case WASMType::F64:
-            loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT0);
-            storeDouble(FPRInfo::fpRegT0, localAddress(localIndex));
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        if (opKind == WASMOpKind::Statement)
-            m_tempStackTop--;
-        return UNUSED;
-    }
-
-    int buildSetGlobal(WASMOpKind opKind, uint32_t globalIndex, int, WASMType type)
-    {
-        move(TrustedImmPtr(&amp;m_module-&gt;globalVariables()[globalIndex]), GPRInfo::regT0);
-        switch (type) {
-        case WASMType::I32:
-        case WASMType::F32:
-            load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT1);
-            store32(GPRInfo::regT1, GPRInfo::regT0);
-            break;
-        case WASMType::F64:
-            loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT0);
-            storeDouble(FPRInfo::fpRegT0, GPRInfo::regT0);
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        if (opKind == WASMOpKind::Statement)
-            m_tempStackTop--;
-        return UNUSED;
-    }
-
-    void buildReturn(int, WASMExpressionType returnType)
-    {
-#if USE(JSVALUE64)
-        JSValueRegs returnValueRegs(GPRInfo::returnValueGPR);
-#else
-        JSValueRegs returnValueRegs(GPRInfo::returnValueGPR2, GPRInfo::returnValueGPR);
-#endif
-        switch (returnType) {
-        case WASMExpressionType::I32:
-            load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::returnValueGPR);
-#if USE(JSVALUE64)
-            or64(GPRInfo::tagTypeNumberRegister, GPRInfo::returnValueGPR);
-#else
-            move(TrustedImm32(JSValue::Int32Tag), GPRInfo::returnValueGPR2);
-#endif
-            m_tempStackTop--;
-            break;
-        case WASMExpressionType::F32:
-        case WASMExpressionType::F64:
-            loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT0);
-            if (returnType == WASMExpressionType::F32)
-                convertFloatToDouble(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-            convertDoubleToValue(FPRInfo::fpRegT0, returnValueRegs);
-            m_tempStackTop--;
-            break;
-        case WASMExpressionType::Void:
-            moveTrustedValue(jsUndefined(), returnValueRegs);
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        emitRestoreCalleeSaves();
-        emitFunctionEpilogue();
-        ret();
-    }
-
-    int buildImmediateI32(uint32_t immediate)
-    {
-        store32(Imm32(immediate), temporaryAddress(m_tempStackTop++));
-        return UNUSED;
-    }
-
-    int buildImmediateF32(float immediate)
-    {
-        store32(Imm32(bitwise_cast&lt;int32_t&gt;(immediate)), temporaryAddress(m_tempStackTop++));
-        return UNUSED;
-    }
-
-    int buildImmediateF64(double immediate)
-    {
-#if USE(JSVALUE64)
-        store64(Imm64(bitwise_cast&lt;int64_t&gt;(immediate)), temporaryAddress(m_tempStackTop++));
-#else
-        union {
-            double doubleValue;
-            int32_t int32Values[2];
-        } u = { immediate };
-        m_tempStackTop++;
-        store32(Imm32(u.int32Values[0]), temporaryAddress(m_tempStackTop - 1));
-        store32(Imm32(u.int32Values[1]), temporaryAddress(m_tempStackTop - 1).withOffset(4));
-#endif
-        return UNUSED;
-    }
-
-    int buildGetLocal(uint32_t localIndex, WASMType type)
-    {
-        switch (type) {
-        case WASMType::I32:
-        case WASMType::F32:
-            load32(localAddress(localIndex), GPRInfo::regT0);
-            store32(GPRInfo::regT0, temporaryAddress(m_tempStackTop++));
-            break;
-        case WASMType::F64:
-            loadDouble(localAddress(localIndex), FPRInfo::fpRegT0);
-            storeDouble(FPRInfo::fpRegT0, temporaryAddress(m_tempStackTop++));
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        return UNUSED;
-    }
-
-    int buildGetGlobal(uint32_t globalIndex, WASMType type)
-    {
-        move(TrustedImmPtr(&amp;m_module-&gt;globalVariables()[globalIndex]), GPRInfo::regT0);
-        switch (type) {
-        case WASMType::I32:
-        case WASMType::F32:
-            load32(GPRInfo::regT0, GPRInfo::regT0);
-            store32(GPRInfo::regT0, temporaryAddress(m_tempStackTop++));
-            break;
-        case WASMType::F64:
-            loadDouble(GPRInfo::regT0, FPRInfo::fpRegT0);
-            storeDouble(FPRInfo::fpRegT0, temporaryAddress(m_tempStackTop++));
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        return UNUSED;
-    }
-
-    int buildConvertType(int, WASMExpressionType fromType, WASMExpressionType toType, WASMTypeConversion conversion)
-    {
-        switch (fromType) {
-        case WASMExpressionType::I32:
-            load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT0);
-            ASSERT(toType == WASMExpressionType::F32 || toType == WASMExpressionType::F64);
-            if (conversion == WASMTypeConversion::ConvertSigned)
-                convertInt32ToDouble(GPRInfo::regT0, FPRInfo::fpRegT0);
-            else {
-                ASSERT(conversion == WASMTypeConversion::ConvertUnsigned);
-#if USE(JSVALUE64)
-                convertInt64ToDouble(GPRInfo::regT0, FPRInfo::fpRegT0);
-#else
-                callOperation(operationConvertUnsignedInt32ToDouble, GPRInfo::regT0, FPRInfo::fpRegT0);
-#endif
-            }
-            if (toType == WASMExpressionType::F32)
-                convertDoubleToFloat(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-            storeDouble(FPRInfo::fpRegT0, temporaryAddress(m_tempStackTop - 1));
-            break;
-        case WASMExpressionType::F32:
-            loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT0);
-            switch (toType) {
-            case WASMExpressionType::I32:
-                ASSERT(conversion == WASMTypeConversion::ConvertSigned);
-                convertFloatToDouble(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-                truncateDoubleToInt32(FPRInfo::fpRegT0, GPRInfo::regT0);
-                store32(GPRInfo::regT0, temporaryAddress(m_tempStackTop - 1));
-                break;
-            case WASMExpressionType::F64:
-                ASSERT(conversion == WASMTypeConversion::Promote);
-                convertFloatToDouble(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-                storeDouble(FPRInfo::fpRegT0, temporaryAddress(m_tempStackTop - 1));
-                break;
-            default:
-                ASSERT_NOT_REACHED();
-            }
-            break;
-        case WASMExpressionType::F64:
-            loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT0);
-            switch (toType) {
-            case WASMExpressionType::I32:
-                ASSERT(conversion == WASMTypeConversion::ConvertSigned);
-                truncateDoubleToInt32(FPRInfo::fpRegT0, GPRInfo::regT0);
-                store32(GPRInfo::regT0, temporaryAddress(m_tempStackTop - 1));
-                break;
-            case WASMExpressionType::F32:
-                ASSERT(conversion == WASMTypeConversion::Demote);
-                convertDoubleToFloat(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-                storeDouble(FPRInfo::fpRegT0, temporaryAddress(m_tempStackTop - 1));
-                break;
-            default:
-                ASSERT_NOT_REACHED();
-            }
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        return UNUSED;
-    }
-
-    int buildLoad(const MemoryAddress&amp; memoryAddress, WASMExpressionType expressionType, WASMMemoryType memoryType, MemoryAccessConversion conversion)
-    {
-        const ArrayBuffer* arrayBuffer = m_module-&gt;arrayBuffer()-&gt;impl();
-        move(TrustedImmPtr(arrayBuffer-&gt;data()), GPRInfo::regT0);
-        load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT1);
-        if (memoryAddress.offset)
-            add32(TrustedImm32(memoryAddress.offset), GPRInfo::regT1, GPRInfo::regT1);
-        and32(TrustedImm32(~(sizeOfMemoryType(memoryType) - 1)), GPRInfo::regT1);
-
-        ASSERT(arrayBuffer-&gt;byteLength() &lt; (unsigned)(1 &lt;&lt; 31));
-        if (arrayBuffer-&gt;byteLength() &gt;= sizeOfMemoryType(memoryType))
-            m_outOfBoundsErrorJumpList.append(branch32(Above, GPRInfo::regT1, TrustedImm32(arrayBuffer-&gt;byteLength() - sizeOfMemoryType(memoryType))));
-        else
-            m_outOfBoundsErrorJumpList.append(jump());
-
-        BaseIndex address = BaseIndex(GPRInfo::regT0, GPRInfo::regT1, TimesOne);
-
-        switch (expressionType) {
-        case WASMExpressionType::I32:
-            switch (memoryType) {
-            case WASMMemoryType::I8:
-                if (conversion == MemoryAccessConversion::SignExtend)
-                    load8SignedExtendTo32(address, GPRInfo::regT0);
-                else {
-                    ASSERT(conversion == MemoryAccessConversion::ZeroExtend);
-                    load8(address, GPRInfo::regT0);
-                }
-                break;
-            case WASMMemoryType::I16:
-                if (conversion == MemoryAccessConversion::SignExtend)
-                    load16SignedExtendTo32(address, GPRInfo::regT0);
-                else {
-                    ASSERT(conversion == MemoryAccessConversion::ZeroExtend);
-                    load16(address, GPRInfo::regT0);
-                }
-                break;
-            case WASMMemoryType::I32:
-                load32(address, GPRInfo::regT0);
-                break;
-            default:
-                ASSERT_NOT_REACHED();
-            }
-            store32(GPRInfo::regT0, temporaryAddress(m_tempStackTop - 1));
-            break;
-        case WASMExpressionType::F32:
-            ASSERT(memoryType == WASMMemoryType::F32 &amp;&amp; conversion == MemoryAccessConversion::NoConversion);
-            load32(address, GPRInfo::regT0);
-            store32(GPRInfo::regT0, temporaryAddress(m_tempStackTop - 1));
-            break;
-        case WASMExpressionType::F64:
-            ASSERT(memoryType == WASMMemoryType::F64 &amp;&amp; conversion == MemoryAccessConversion::NoConversion);
-            loadDouble(address, FPRInfo::fpRegT0);
-            storeDouble(FPRInfo::fpRegT0, temporaryAddress(m_tempStackTop - 1));
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        return UNUSED;
-    }
-
-    int buildStore(WASMOpKind opKind, const MemoryAddress&amp; memoryAddress, WASMExpressionType expressionType, WASMMemoryType memoryType, int)
-    {
-        const ArrayBuffer* arrayBuffer = m_module-&gt;arrayBuffer()-&gt;impl();
-        move(TrustedImmPtr(arrayBuffer-&gt;data()), GPRInfo::regT0);
-        load32(temporaryAddress(m_tempStackTop - 2), GPRInfo::regT1);
-        if (memoryAddress.offset)
-            add32(TrustedImm32(memoryAddress.offset), GPRInfo::regT1, GPRInfo::regT1);
-        and32(TrustedImm32(~(sizeOfMemoryType(memoryType) - 1)), GPRInfo::regT1);
-
-        ASSERT(arrayBuffer-&gt;byteLength() &lt; (1u &lt;&lt; 31));
-        if (arrayBuffer-&gt;byteLength() &gt;= sizeOfMemoryType(memoryType))
-            m_outOfBoundsErrorJumpList.append(branch32(Above, GPRInfo::regT1, TrustedImm32(arrayBuffer-&gt;byteLength() - sizeOfMemoryType(memoryType))));
-        else
-            m_outOfBoundsErrorJumpList.append(jump());
-
-        BaseIndex address = BaseIndex(GPRInfo::regT0, GPRInfo::regT1, TimesOne);
-
-        switch (expressionType) {
-        case WASMExpressionType::I32:
-            load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT2);
-            switch (memoryType) {
-            case WASMMemoryType::I8:
-                store8(GPRInfo::regT2, address);
-                break;
-            case WASMMemoryType::I16:
-                store16(GPRInfo::regT2, address);
-                break;
-            case WASMMemoryType::I32:
-                store32(GPRInfo::regT2, address);
-                break;
-            default:
-                ASSERT_NOT_REACHED();
-            }
-            break;
-        case WASMExpressionType::F32:
-            ASSERT(memoryType == WASMMemoryType::F32);
-            load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT2);
-            store32(GPRInfo::regT2, address);
-            break;
-        case WASMExpressionType::F64:
-            ASSERT(memoryType == WASMMemoryType::F64);
-            loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT0);
-            storeDouble(FPRInfo::fpRegT0, address);
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        m_tempStackTop -= 2;
-
-        if (opKind == WASMOpKind::Expression) {
-            switch (expressionType) {
-            case WASMExpressionType::I32:
-            case WASMExpressionType::F32:
-                store32(GPRInfo::regT2, temporaryAddress(m_tempStackTop++));
-                break;
-            case WASMExpressionType::F64:
-                storeDouble(FPRInfo::fpRegT0, temporaryAddress(m_tempStackTop++));
-                break;
-            default:
-                ASSERT_NOT_REACHED();
-            }
-        }
-        return UNUSED;
-    }
-
-    int buildUnaryI32(int, WASMOpExpressionI32 op)
-    {
-        load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT0);
-        switch (op) {
-        case WASMOpExpressionI32::Negate:
-            neg32(GPRInfo::regT0);
-            break;
-        case WASMOpExpressionI32::BitNot:
-            xor32(TrustedImm32(-1), GPRInfo::regT0);
-            break;
-        case WASMOpExpressionI32::CountLeadingZeros:
-            countLeadingZeros32(GPRInfo::regT0, GPRInfo::regT0);
-            break;
-        case WASMOpExpressionI32::LogicalNot: {
-            // FIXME: Don't use branches.
-            Jump zero = branchTest32(Zero, GPRInfo::regT0);
-            move(TrustedImm32(0), GPRInfo::regT0);
-            Jump end = jump();
-            zero.link(this);
-            move(TrustedImm32(1), GPRInfo::regT0);
-            end.link(this);
-            break;
-        }
-        case WASMOpExpressionI32::Abs: {
-            // FIXME: Don't use branches.
-            Jump end = branchTest32(PositiveOrZero, GPRInfo::regT0);
-            neg32(GPRInfo::regT0);
-            end.link(this);
-            break;
-        }
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        store32(GPRInfo::regT0, temporaryAddress(m_tempStackTop - 1));
-        return UNUSED;
-    }
-
-    int buildUnaryF32(int, WASMOpExpressionF32 op)
-    {
-        loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT1);
-        switch (op) {
-        case WASMOpExpressionF32::Negate:
-            convertFloatToDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT1);
-            negateDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            convertDoubleToFloat(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF32::Abs:
-            convertFloatToDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT1);
-            absDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            convertDoubleToFloat(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF32::Ceil:
-            callOperation(ceilf, FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF32::Floor:
-            callOperation(floorf, FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF32::Sqrt:
-            convertFloatToDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT1);
-            sqrtDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            convertDoubleToFloat(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        storeDouble(FPRInfo::fpRegT0, temporaryAddress(m_tempStackTop - 1));
-        return UNUSED;
-    }
-
-    int buildUnaryF64(int, WASMOpExpressionF64 op)
-    {
-        loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT1);
-        switch (op) {
-        case WASMOpExpressionF64::Negate:
-            negateDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF64::Abs:
-            absDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF64::Sqrt:
-            sqrtDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF64::Ceil:
-        case WASMOpExpressionF64::Floor:
-        case WASMOpExpressionF64::Cos:
-        case WASMOpExpressionF64::Sin:
-        case WASMOpExpressionF64::Tan:
-        case WASMOpExpressionF64::ACos:
-        case WASMOpExpressionF64::ASin:
-        case WASMOpExpressionF64::ATan:
-        case WASMOpExpressionF64::Exp:
-        case WASMOpExpressionF64::Ln:
-            D_JITOperation_D operation;
-            switch (op) {
-            case WASMOpExpressionF64::Ceil:
-                operation = ceil;
-                break;
-            case WASMOpExpressionF64::Floor:
-                operation = floor;
-                break;
-            case WASMOpExpressionF64::Cos:
-                operation = cos;
-                break;
-            case WASMOpExpressionF64::Sin:
-                operation = sin;
-                break;
-            case WASMOpExpressionF64::Tan:
-                operation = tan;
-                break;
-            case WASMOpExpressionF64::ACos:
-                operation = acos;
-                break;
-            case WASMOpExpressionF64::ASin:
-                operation = asin;
-                break;
-            case WASMOpExpressionF64::ATan:
-                operation = atan;
-                break;
-            case WASMOpExpressionF64::Exp:
-                operation = exp;
-                break;
-            case WASMOpExpressionF64::Ln:
-                operation = log;
-                break;
-            default:
-                RELEASE_ASSERT_NOT_REACHED();
-            }
-            callOperation(operation, FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        storeDouble(FPRInfo::fpRegT0, temporaryAddress(m_tempStackTop - 1));
-        return UNUSED;
-    }
-
-    int buildBinaryI32(int, int, WASMOpExpressionI32 op)
-    {
-        load32(temporaryAddress(m_tempStackTop - 2), GPRInfo::regT0);
-        load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT1);
-        switch (op) {
-        case WASMOpExpressionI32::Add:
-            add32(GPRInfo::regT1, GPRInfo::regT0);
-            break;
-        case WASMOpExpressionI32::Sub:
-            sub32(GPRInfo::regT1, GPRInfo::regT0);
-            break;
-        case WASMOpExpressionI32::Mul:
-            mul32(GPRInfo::regT1, GPRInfo::regT0);
-            break;
-        case WASMOpExpressionI32::SDiv:
-        case WASMOpExpressionI32::UDiv:
-        case WASMOpExpressionI32::SMod:
-        case WASMOpExpressionI32::UMod: {
-            m_divideErrorJumpList.append(branchTest32(Zero, GPRInfo::regT1));
-            if (op == WASMOpExpressionI32::SDiv || op == WASMOpExpressionI32::SMod) {
-                Jump denominatorNotNeg1 = branch32(NotEqual, GPRInfo::regT1, TrustedImm32(-1));
-                m_divideErrorJumpList.append(branch32(Equal, GPRInfo::regT0, TrustedImm32(-2147483647-1)));
-                denominatorNotNeg1.link(this);
-            }
-#if CPU(X86) || CPU(X86_64)
-            ASSERT(GPRInfo::regT0 == X86Registers::eax);
-            move(GPRInfo::regT1, X86Registers::ecx);
-            if (op == WASMOpExpressionI32::SDiv || op == WASMOpExpressionI32::SMod) {
-                x86ConvertToDoubleWord32();
-                x86Div32(X86Registers::ecx);
-            } else {
-                ASSERT(op == WASMOpExpressionI32::UDiv || op == WASMOpExpressionI32::UMod);
-                xor32(X86Registers::edx, X86Registers::edx);
-                m_assembler.divl_r(X86Registers::ecx);
-            }
-            if (op == WASMOpExpressionI32::SMod || op == WASMOpExpressionI32::UMod)
-                move(X86Registers::edx, GPRInfo::regT0);
-#else
-            // FIXME: We should be able to do an inline div on ARMv7 and ARM64.
-            switch (op) {
-            case WASMOpExpressionI32::SDiv:
-                callOperation(operationDiv, GPRInfo::regT0, GPRInfo::regT1, GPRInfo::regT0);
-                break;
-            case WASMOpExpressionI32::UDiv:
-                callOperation(operationUnsignedDiv, GPRInfo::regT0, GPRInfo::regT1, GPRInfo::regT0);
-                break;
-            case WASMOpExpressionI32::SMod:
-                callOperation(operationMod, GPRInfo::regT0, GPRInfo::regT1, GPRInfo::regT0);
-                break;
-            case WASMOpExpressionI32::UMod:
-                callOperation(operationUnsignedMod, GPRInfo::regT0, GPRInfo::regT1, GPRInfo::regT0);
-                break;
-            default:
-                ASSERT_NOT_REACHED();
-            }
-#endif
-            break;
-        }
-        case WASMOpExpressionI32::BitOr:
-            or32(GPRInfo::regT1, GPRInfo::regT0);
-            break;
-        case WASMOpExpressionI32::BitAnd:
-            and32(GPRInfo::regT1, GPRInfo::regT0);
-            break;
-        case WASMOpExpressionI32::BitXor:
-            xor32(GPRInfo::regT1, GPRInfo::regT0);
-            break;
-        case WASMOpExpressionI32::LeftShift:
-            lshift32(GPRInfo::regT1, GPRInfo::regT0);
-            break;
-        case WASMOpExpressionI32::ArithmeticRightShift:
-            rshift32(GPRInfo::regT1, GPRInfo::regT0);
-            break;
-        case WASMOpExpressionI32::LogicalRightShift:
-            urshift32(GPRInfo::regT1, GPRInfo::regT0);
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        m_tempStackTop--;
-        store32(GPRInfo::regT0, temporaryAddress(m_tempStackTop - 1));
-        return UNUSED;
-    }
-
-    int buildBinaryF32(int, int, WASMOpExpressionF32 op)
-    {
-        loadDouble(temporaryAddress(m_tempStackTop - 2), FPRInfo::fpRegT0);
-        loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT1);
-        convertFloatToDouble(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-        convertFloatToDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT1);
-        switch (op) {
-        case WASMOpExpressionF32::Add:
-            addDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF32::Sub:
-            subDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF32::Mul:
-            mulDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF32::Div:
-            divDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        default:
-            RELEASE_ASSERT_NOT_REACHED();
-        }
-        convertDoubleToFloat(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-        m_tempStackTop--;
-        storeDouble(FPRInfo::fpRegT0, temporaryAddress(m_tempStackTop - 1));
-        return UNUSED;
-    }
-
-    int buildBinaryF64(int, int, WASMOpExpressionF64 op)
-    {
-        loadDouble(temporaryAddress(m_tempStackTop - 2), FPRInfo::fpRegT0);
-        loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT1);
-        switch (op) {
-        case WASMOpExpressionF64::Add:
-            addDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF64::Sub:
-            subDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF64::Mul:
-            mulDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF64::Div:
-            divDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        case WASMOpExpressionF64::Mod:
-        case WASMOpExpressionF64::ATan2:
-        case WASMOpExpressionF64::Pow:
-            D_JITOperation_DD operation;
-            switch (op) {
-            case WASMOpExpressionF64::Mod:
-                operation = fmod;
-                break;
-            case WASMOpExpressionF64::ATan2:
-                operation = atan2;
-                break;
-            case WASMOpExpressionF64::Pow:
-                operation = pow;
-                break;
-            default:
-                RELEASE_ASSERT_NOT_REACHED();
-            }
-            callOperation(operation, FPRInfo::fpRegT0, FPRInfo::fpRegT1, FPRInfo::fpRegT0);
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-        m_tempStackTop--;
-        storeDouble(FPRInfo::fpRegT0, temporaryAddress(m_tempStackTop - 1));
-        return UNUSED;
-    }
-
-    int buildRelationalI32(int, int, WASMOpExpressionI32 op)
-    {
-        load32(temporaryAddress(m_tempStackTop - 2), GPRInfo::regT0);
-        load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT1);
-        RelationalCondition condition;
-        switch (op) {
-        case WASMOpExpressionI32::EqualI32:
-            condition = Equal;
-            break;
-        case WASMOpExpressionI32::NotEqualI32:
-            condition = NotEqual;
-            break;
-        case WASMOpExpressionI32::SLessThanI32:
-            condition = LessThan;
-            break;
-        case WASMOpExpressionI32::ULessThanI32:
-            condition = Below;
-            break;
-        case WASMOpExpressionI32::SLessThanOrEqualI32:
-            condition = LessThanOrEqual;
-            break;
-        case WASMOpExpressionI32::ULessThanOrEqualI32:
-            condition = BelowOrEqual;
-            break;
-        case WASMOpExpressionI32::SGreaterThanI32:
-            condition = GreaterThan;
-            break;
-        case WASMOpExpressionI32::UGreaterThanI32:
-            condition = Above;
-            break;
-        case WASMOpExpressionI32::SGreaterThanOrEqualI32:
-            condition = GreaterThanOrEqual;
-            break;
-        case WASMOpExpressionI32::UGreaterThanOrEqualI32:
-            condition = AboveOrEqual;
-            break;
-        default:
-            RELEASE_ASSERT_NOT_REACHED();
-        }
-        compare32(condition, GPRInfo::regT0, GPRInfo::regT1, GPRInfo::regT0);
-        m_tempStackTop--;
-        store32(GPRInfo::regT0, temporaryAddress(m_tempStackTop - 1));
-        return UNUSED;
-    }
-
-    int buildRelationalF32(int, int, WASMOpExpressionI32 op)
-    {
-        loadDouble(temporaryAddress(m_tempStackTop - 2), FPRInfo::fpRegT0);
-        loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT1);
-        convertFloatToDouble(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-        convertFloatToDouble(FPRInfo::fpRegT1, FPRInfo::fpRegT1);
-        DoubleCondition condition;
-        switch (op) {
-        case WASMOpExpressionI32::EqualF32:
-            condition = DoubleEqual;
-            break;
-        case WASMOpExpressionI32::NotEqualF32:
-            condition = DoubleNotEqual;
-            break;
-        case WASMOpExpressionI32::LessThanF32:
-            condition = DoubleLessThan;
-            break;
-        case WASMOpExpressionI32::LessThanOrEqualF32:
-            condition = DoubleLessThanOrEqual;
-            break;
-        case WASMOpExpressionI32::GreaterThanF32:
-            condition = DoubleGreaterThan;
-            break;
-        case WASMOpExpressionI32::GreaterThanOrEqualF32:
-            condition = DoubleGreaterThanOrEqual;
-            break;
-        default:
-            RELEASE_ASSERT_NOT_REACHED();
-        }
-        m_tempStackTop--;
-        Jump trueCase = branchDouble(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT1);
-        store32(TrustedImm32(0), temporaryAddress(m_tempStackTop - 1));
-        Jump end = jump();
-        trueCase.link(this);
-        store32(TrustedImm32(1), temporaryAddress(m_tempStackTop - 1));
-        end.link(this);
-        return UNUSED;
-    }
-
-    int buildRelationalF64(int, int, WASMOpExpressionI32 op)
-    {
-        loadDouble(temporaryAddress(m_tempStackTop - 2), FPRInfo::fpRegT0);
-        loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT1);
-        DoubleCondition condition;
-        switch (op) {
-        case WASMOpExpressionI32::EqualF64:
-            condition = DoubleEqual;
-            break;
-        case WASMOpExpressionI32::NotEqualF64:
-            condition = DoubleNotEqual;
-            break;
-        case WASMOpExpressionI32::LessThanF64:
-            condition = DoubleLessThan;
-            break;
-        case WASMOpExpressionI32::LessThanOrEqualF64:
-            condition = DoubleLessThanOrEqual;
-            break;
-        case WASMOpExpressionI32::GreaterThanF64:
-            condition = DoubleGreaterThan;
-            break;
-        case WASMOpExpressionI32::GreaterThanOrEqualF64:
-            condition = DoubleGreaterThanOrEqual;
-            break;
-        default:
-            RELEASE_ASSERT_NOT_REACHED();
-        }
-        m_tempStackTop--;
-        Jump trueCase = branchDouble(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT1);
-        store32(TrustedImm32(0), temporaryAddress(m_tempStackTop - 1));
-        Jump end = jump();
-        trueCase.link(this);
-        store32(TrustedImm32(1), temporaryAddress(m_tempStackTop - 1));
-        end.link(this);
-        return UNUSED;
-    }
-
-    int buildMinOrMaxI32(int, int, WASMOpExpressionI32 op)
-    {
-        load32(temporaryAddress(m_tempStackTop - 2), GPRInfo::regT0);
-        load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT1);
-        RelationalCondition condition;
-        switch (op) {
-        case WASMOpExpressionI32::SMin:
-            condition = LessThanOrEqual;
-            break;
-        case WASMOpExpressionI32::UMin:
-            condition = BelowOrEqual;
-            break;
-        case WASMOpExpressionI32::SMax:
-            condition = GreaterThanOrEqual;
-            break;
-        case WASMOpExpressionI32::UMax:
-            condition = AboveOrEqual;
-            break;
-        default:
-            RELEASE_ASSERT_NOT_REACHED();
-        }
-        Jump useLeft = branch32(condition, GPRInfo::regT0, GPRInfo::regT1);
-        store32(GPRInfo::regT1, temporaryAddress(m_tempStackTop - 2));
-        useLeft.link(this);
-        m_tempStackTop--;
-        return UNUSED;
-    }
-
-    int buildMinOrMaxF64(int, int, WASMOpExpressionF64 op)
-    {
-        loadDouble(temporaryAddress(m_tempStackTop - 2), FPRInfo::fpRegT0);
-        loadDouble(temporaryAddress(m_tempStackTop - 1), FPRInfo::fpRegT1);
-        DoubleCondition condition;
-        switch (op) {
-        case WASMOpExpressionF64::Min:
-            condition = DoubleLessThanOrEqual;
-            break;
-        case WASMOpExpressionF64::Max:
-            condition = DoubleGreaterThanOrEqual;
-            break;
-        default:
-            RELEASE_ASSERT_NOT_REACHED();
-        }
-        Jump useLeft = branchDouble(condition, FPRInfo::fpRegT0, FPRInfo::fpRegT1);
-        storeDouble(FPRInfo::fpRegT1, temporaryAddress(m_tempStackTop - 2));
-        useLeft.link(this);
-        m_tempStackTop--;
-        return UNUSED;
-    }
-
-    int buildCallInternal(uint32_t functionIndex, int, const WASMSignature&amp; signature, WASMExpressionType returnType)
-    {
-        boxArgumentsAndAdjustStackPointer(signature.arguments);
-
-        JSFunction* function = m_module-&gt;functions()[functionIndex].get();
-        move(TrustedImmPtr(function), GPRInfo::regT0);
-
-        callAndUnboxResult(returnType);
-        return UNUSED;
-    }
-
-    int buildCallIndirect(uint32_t functionPointerTableIndex, int, int, const WASMSignature&amp; signature, WASMExpressionType returnType)
-    {
-        boxArgumentsAndAdjustStackPointer(signature.arguments);
-
-        const Vector&lt;JSFunction*&gt;&amp; functions = m_module-&gt;functionPointerTables()[functionPointerTableIndex].functions;
-        move(TrustedImmPtr(functions.data()), GPRInfo::regT0);
-        load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT1);
-        m_tempStackTop--;
-        and32(TrustedImm32(functions.size() - 1), GPRInfo::regT1);
-        loadPtr(BaseIndex(GPRInfo::regT0, GPRInfo::regT1, timesPtr()), GPRInfo::regT0);
-
-        callAndUnboxResult(returnType);
-        return UNUSED;
-    }
-
-    int buildCallImport(uint32_t functionImportIndex, int, const WASMSignature&amp; signature, WASMExpressionType returnType)
-    {
-        boxArgumentsAndAdjustStackPointer(signature.arguments);
-
-        JSFunction* function = m_module-&gt;importedFunctions()[functionImportIndex].get();
-        move(TrustedImmPtr(function), GPRInfo::regT0);
-
-        callAndUnboxResult(returnType);
-        return UNUSED;
-    }
-
-    void appendExpressionList(int&amp;, int) { }
-
-    void discard(int)
-    {
-        m_tempStackTop--;
-    }
-
-    void linkTarget(JumpTarget&amp; target)
-    {
-        target.label = label();
-        target.jumpList.link(this);
-    }
-
-    void jumpToTarget(JumpTarget&amp; target)
-    {
-        if (target.label.isSet())
-            jump(target.label);
-        else
-            target.jumpList.append(jump());
-    }
-
-    void jumpToTargetIf(JumpCondition condition, int, JumpTarget&amp; target)
-    {
-        load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT0);
-        m_tempStackTop--;
-        Jump taken = branchTest32((condition == JumpCondition::Zero) ? Zero : NonZero, GPRInfo::regT0);
-        if (target.label.isSet())
-            taken.linkTo(target.label, this);
-        else
-            target.jumpList.append(taken);
-    }
-
-    void startLoop()
-    {
-        m_breakTargets.append(JumpTarget());
-        m_continueTargets.append(JumpTarget());
-    }
-
-    void endLoop()
-    {
-        m_breakTargets.removeLast();
-        m_continueTargets.removeLast();
-    }
-
-    void startSwitch()
-    {
-        m_breakTargets.append(JumpTarget());
-    }
-
-    void endSwitch()
-    {
-        m_breakTargets.removeLast();
-    }
-
-    void startLabel()
-    {
-        m_breakLabelTargets.append(JumpTarget());
-        m_continueLabelTargets.append(JumpTarget());
-
-        linkTarget(m_continueLabelTargets.last());
-    }
-
-    void endLabel()
-    {
-        linkTarget(m_breakLabelTargets.last());
-
-        m_breakLabelTargets.removeLast();
-        m_continueLabelTargets.removeLast();
-    }
-
-    JumpTarget&amp; breakTarget()
-    {
-        return m_breakTargets.last();
-    }
-
-    JumpTarget&amp; continueTarget()
-    {
-        return m_continueTargets.last();
-    }
-
-    JumpTarget&amp; breakLabelTarget(uint32_t labelIndex)
-    {
-        return m_breakLabelTargets[labelIndex];
-    }
-
-    JumpTarget&amp; continueLabelTarget(uint32_t labelIndex)
-    {
-        return m_continueLabelTargets[labelIndex];
-    }
-
-    void buildSwitch(int, const Vector&lt;int64_t&gt;&amp; cases, Vector&lt;JumpTarget&gt;&amp; targets, JumpTarget defaultTarget)
-    {
-        load32(temporaryAddress(m_tempStackTop - 1), GPRInfo::regT0);
-        m_tempStackTop--;
-        BinarySwitch binarySwitch(GPRInfo::regT0, cases, BinarySwitch::Int32);
-        while (binarySwitch.advance(*this)) {
-            unsigned index = binarySwitch.caseIndex();
-            jump(targets[index].label);
-        }
-        binarySwitch.fallThrough().linkTo(defaultTarget.label, this);
-    }
-
-private:
-    union StackSlot {
-        int32_t intValue;
-        float floatValue;
-        double doubleValue;
-    };
-
-    enum class FloatingPointPrecision { Single, Double };
-
-    Address localAddress(unsigned localIndex) const
-    {
-        ASSERT(localIndex &lt; m_numberOfLocals);
-        return Address(GPRInfo::callFrameRegister, -m_calleeSaveSpace - (localIndex + 1) * sizeof(StackSlot));
-    }
-
-    Address temporaryAddress(unsigned temporaryIndex) const
-    {
-        ASSERT(m_numberOfLocals + temporaryIndex &lt; m_stackHeight);
-        return Address(GPRInfo::callFrameRegister, -m_calleeSaveSpace - (m_numberOfLocals + temporaryIndex + 1) * sizeof(StackSlot));
-    }
-
-    void appendCall(const FunctionPtr&amp; function)
-    {
-        m_calls.append(std::make_pair(call(), function.value()));
-    }
-
-    void appendCallWithExceptionCheck(const FunctionPtr&amp; function)
-    {
-        appendCall(function);
-        m_exceptionChecks.append(emitExceptionCheck());
-    }
-
-    Call emitNakedCall(CodePtr function)
-    {
-        Call nakedCall = nearCall();
-        m_calls.append(std::make_pair(nakedCall, function.executableAddress()));
-        return nakedCall;
-    }
-
-    void appendCallSetResult(const FunctionPtr&amp; function, GPRReg result)
-    {
-        appendCall(function);
-        move(GPRInfo::returnValueGPR, result);
-    }
-
-#if CPU(X86)
-    void appendCallSetResult(const FunctionPtr&amp; function, FPRReg result, FloatingPointPrecision precision)
-    {
-        appendCall(function);
-        switch (precision) {
-        case FloatingPointPrecision::Single:
-            m_assembler.fstps(0, stackPointerRegister);
-            break;
-        case FloatingPointPrecision::Double:
-            m_assembler.fstpl(0, stackPointerRegister);
-            break;
-        }
-        loadDouble(stackPointerRegister, result);
-    }
-#elif CPU(ARM) &amp;&amp; !CPU(ARM_HARDFP)
-    void appendCallSetResult(const FunctionPtr&amp; function, FPRReg result, FloatingPointPrecision)
-    {
-        appendCall(function);
-        m_assembler.vmov(result, GPRInfo::returnValueGPR, GPRInfo::returnValueGPR2);
-    }
-#else // CPU(X86_64) || (CPU(ARM) &amp;&amp; CPU(ARM_HARDFP)) || CPU(ARM64) || CPU(MIPS) || CPU(SH4)
-    void appendCallSetResult(const FunctionPtr&amp; function, FPRReg result, FloatingPointPrecision)
-    {
-        appendCall(function);
-        moveDouble(FPRInfo::returnValueFPR, result);
-    }
-#endif
-
-#if USE(JSVALUE64)
-    void callOperation(Z_JITOperation_EJ operation, GPRReg src, GPRReg dst)
-    {
-        setupArgumentsWithExecState(src);
-        appendCallSetResult(operation, dst);
-    }
-
-    void callOperation(D_JITOperation_EJ operation, GPRReg src, FPRReg dst)
-    {
-        setupArgumentsWithExecState(src);
-        appendCallSetResult(operation, dst, FloatingPointPrecision::Double);
-    }
-#else
-// EncodedJSValue in JSVALUE32_64 is a 64-bit integer. When being compiled in ARM EABI, it must be aligned on an even-numbered register (r0, r2 or [sp]).
-// To prevent the assembler from using wrong registers, let's occupy r1 or r3 with a dummy argument when necessary.
-#if (COMPILER_SUPPORTS(EABI) &amp;&amp; CPU(ARM)) || CPU(MIPS)
-#define EABI_32BIT_DUMMY_ARG      TrustedImm32(0),
-#else
-#define EABI_32BIT_DUMMY_ARG
-#endif
-
-    void callOperation(Z_JITOperation_EJ operation, GPRReg srcTag, GPRReg srcPayload, GPRReg dst)
-    {
-        setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG srcPayload, srcTag);
-        appendCallSetResult(operation, dst);
-    }
-
-    void callOperation(D_JITOperation_EJ operation, GPRReg srcTag, GPRReg srcPayload, FPRReg dst)
-    {
-        setupArgumentsWithExecState(EABI_32BIT_DUMMY_ARG srcPayload, srcTag);
-        appendCallSetResult(operation, dst, FloatingPointPrecision::Double);
-    }
-#endif
-
-    void callOperation(float JIT_OPERATION (*operation)(float), FPRegisterID src, FPRegisterID dst)
-    {
-        setupArguments(src);
-        appendCallSetResult(operation, dst, FloatingPointPrecision::Single);
-    }
-
-    void callOperation(D_JITOperation_D operation, FPRegisterID src, FPRegisterID dst)
-    {
-        setupArguments(src);
-        appendCallSetResult(operation, dst, FloatingPointPrecision::Double);
-    }
-
-    void callOperation(int32_t JIT_OPERATION (*operation)(int32_t, int32_t), GPRReg src1, GPRReg src2, GPRReg dst)
-    {
-        setupArguments(src1, src2);
-        appendCallSetResult(operation, dst);
-    }
-
-    void callOperation(uint32_t JIT_OPERATION (*operation)(uint32_t, uint32_t), GPRReg src1, GPRReg src2, GPRReg dst)
-    {
-        setupArguments(src1, src2);
-        appendCallSetResult(operation, dst);
-    }
-
-    void callOperation(D_JITOperation_DD operation, FPRegisterID src1, FPRegisterID src2, FPRegisterID dst)
-    {
-        setupArguments(src1, src2);
-        appendCallSetResult(operation, dst, FloatingPointPrecision::Double);
-    }
-
-    void callOperation(double JIT_OPERATION (*operation)(uint32_t), GPRReg src, FPRegisterID dst)
-    {
-        setupArguments(src);
-        appendCallSetResult(operation, dst, FloatingPointPrecision::Double);
-    }
-
-    void boxArgumentsAndAdjustStackPointer(const Vector&lt;WASMType&gt;&amp; arguments)
-    {
-        size_t argumentCount = arguments.size();
-        int stackOffset = -m_calleeSaveSpace - WTF::roundUpToMultipleOf(stackAlignmentRegisters(), m_numberOfLocals + m_tempStackTop + argumentCount + 1 + CallFrame::headerSizeInRegisters);
-
-        storeTrustedValue(jsUndefined(), Address(GPRInfo::callFrameRegister, (stackOffset + CallFrame::thisArgumentOffset()) * sizeof(Register)));
-
-        for (size_t i = 0; i &lt; argumentCount; ++i) {
-            Address address(GPRInfo::callFrameRegister, (stackOffset + CallFrame::argumentOffset(i)) * sizeof(Register));
-#if USE(JSVALUE64)
-            JSValueRegs valueRegs(GPRInfo::regT0);
-#else
-            JSValueRegs valueRegs(GPRInfo::regT1, GPRInfo::regT0);
-#endif
-            switch (arguments[i]) {
-            case WASMType::I32:
-                load32(temporaryAddress(m_tempStackTop - argumentCount + i), GPRInfo::regT0);
-#if USE(JSVALUE64)
-                or64(GPRInfo::tagTypeNumberRegister, GPRInfo::regT0);
-                store64(GPRInfo::regT0, address);
-#else
-                store32(GPRInfo::regT0, address.withOffset(PayloadOffset));
-                store32(TrustedImm32(JSValue::Int32Tag), address.withOffset(TagOffset));
-#endif
-                break;
-            case WASMType::F32:
-            case WASMType::F64:
-                loadDouble(temporaryAddress(m_tempStackTop - argumentCount + i), FPRInfo::fpRegT0);
-                if (arguments[i] == WASMType::F32)
-                    convertFloatToDouble(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-                convertDoubleToValue(FPRInfo::fpRegT0, valueRegs);
-                storeValue(valueRegs, address);
-                break;
-            default:
-                ASSERT_NOT_REACHED();
-            }
-        }
-        m_tempStackTop -= argumentCount;
-
-        addPtr(TrustedImm32(stackOffset * sizeof(Register) + sizeof(CallerFrameAndPC)), GPRInfo::callFrameRegister, stackPointerRegister);
-        store32(TrustedImm32(argumentCount + 1), Address(stackPointerRegister, CallFrameSlot::argumentCount * static_cast&lt;int&gt;(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC)));
-    }
-
-    void callAndUnboxResult(WASMExpressionType returnType)
-    {
-        // regT0 holds callee.
-#if USE(JSVALUE64)
-        store64(GPRInfo::regT0, Address(stackPointerRegister, CallFrameSlot::callee * static_cast&lt;int&gt;(sizeof(Register)) - sizeof(CallerFrameAndPC)));
-#else
-        store32(GPRInfo::regT0, Address(stackPointerRegister, CallFrameSlot::callee * static_cast&lt;int&gt;(sizeof(Register)) + PayloadOffset - sizeof(CallerFrameAndPC)));
-        store32(TrustedImm32(JSValue::CellTag), Address(stackPointerRegister, CallFrameSlot::callee * static_cast&lt;int&gt;(sizeof(Register)) + TagOffset - sizeof(CallerFrameAndPC)));
-#endif
-
-        DataLabelPtr addressOfLinkedFunctionCheck;
-        Jump slowCase = branchPtrWithPatch(NotEqual, GPRInfo::regT0, addressOfLinkedFunctionCheck, TrustedImmPtr(0));
-
-        CallLinkInfo* info = m_codeBlock-&gt;addCallLinkInfo();
-        info-&gt;setUpCall(CallLinkInfo::Call, CodeOrigin(), GPRInfo::regT0);
-        m_callCompilationInfo.append(CallCompilationInfo());
-        m_callCompilationInfo.last().hotPathBegin = addressOfLinkedFunctionCheck;
-        m_callCompilationInfo.last().callLinkInfo = info;
-        m_callCompilationInfo.last().hotPathOther = nearCall();
-        Jump end = jump();
-
-        slowCase.link(this);
-        move(TrustedImmPtr(info), GPRInfo::regT2);
-        m_callCompilationInfo.last().callReturnLocation = emitNakedCall(m_vm-&gt;getCTIStub(linkCallThunkGenerator).code());
-
-        end.link(this);
-        addPtr(TrustedImm32(-m_calleeSaveSpace - WTF::roundUpToMultipleOf(stackAlignmentRegisters(), m_stackHeight) * sizeof(StackSlot) - maxFrameExtentForSlowPathCall), GPRInfo::callFrameRegister, stackPointerRegister);
-        checkStackPointerAlignment();
-
-        // FIXME: No need to do type conversion if the callee is a WebAssembly function.
-        // https://bugs.webkit.org/show_bug.cgi?id=149310
-#if USE(JSVALUE64)
-        JSValueRegs valueRegs(GPRInfo::returnValueGPR);
-#else
-        JSValueRegs valueRegs(GPRInfo::returnValueGPR2, GPRInfo::returnValueGPR);
-#endif
-        switch (returnType) {
-        case WASMExpressionType::I32:
-            convertValueToInt32(valueRegs, GPRInfo::regT0);
-            store32(GPRInfo::regT0, temporaryAddress(m_tempStackTop++));
-            break;
-        case WASMExpressionType::F32:
-        case WASMExpressionType::F64:
-#if USE(JSVALUE64)
-            convertValueToDouble(valueRegs, FPRInfo::fpRegT0, GPRInfo::nonPreservedNonReturnGPR);
-#else
-            convertValueToDouble(valueRegs, FPRInfo::fpRegT0, GPRInfo::nonPreservedNonReturnGPR, FPRInfo::fpRegT1);
-#endif
-            if (returnType == WASMExpressionType::F32)
-                convertDoubleToFloat(FPRInfo::fpRegT0, FPRInfo::fpRegT0);
-            storeDouble(FPRInfo::fpRegT0, temporaryAddress(m_tempStackTop++));
-            break;
-        case WASMExpressionType::Void:
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-    }
-
-#if USE(JSVALUE64)
-    void convertValueToInt32(JSValueRegs valueRegs, GPRReg dst)
-    {
-        Jump checkJSInt32 = branchIfInt32(valueRegs);
-
-        callOperation(operationConvertJSValueToInt32, valueRegs.gpr(), valueRegs.gpr());
-
-        checkJSInt32.link(this);
-        move(valueRegs.gpr(), dst);
-    }
-
-    void convertValueToDouble(JSValueRegs valueRegs, FPRReg dst, GPRReg scratch)
-    {
-        Jump checkJSInt32 = branchIfInt32(valueRegs);
-        Jump checkJSNumber = branchIfNumber(valueRegs, scratch);
-        JumpList end;
-
-        callOperation(operationConvertJSValueToDouble, valueRegs.gpr(), dst);
-        end.append(jump());
-
-        checkJSInt32.link(this);
-        convertInt32ToDouble(valueRegs.gpr(), dst);
-        end.append(jump());
-
-        checkJSNumber.link(this);
-        unboxDoubleWithoutAssertions(valueRegs.gpr(), scratch, dst);
-        end.link(this);
-    }
-#else
-    void convertValueToInt32(JSValueRegs valueRegs, GPRReg dst)
-    {
-        Jump checkJSInt32 = branchIfInt32(valueRegs);
-
-        callOperation(operationConvertJSValueToInt32, valueRegs.tagGPR(), valueRegs.payloadGPR(), valueRegs.payloadGPR());
-
-        checkJSInt32.link(this);
-        move(valueRegs.payloadGPR(), dst);
-    }
-
-    void convertValueToDouble(JSValueRegs valueRegs, FPRReg dst, GPRReg scratch, FPRReg fpScratch)
-    {
-        Jump checkJSInt32 = branchIfInt32(valueRegs);
-        Jump checkJSNumber = branchIfNumber(valueRegs, scratch);
-        JumpList end;
-
-        callOperation(operationConvertJSValueToDouble, valueRegs.tagGPR(), valueRegs.payloadGPR(), dst);
-        end.append(jump());
-
-        checkJSInt32.link(this);
-        convertInt32ToDouble(valueRegs.payloadGPR(), dst);
-        end.append(jump());
-
-        checkJSNumber.link(this);
-        unboxDouble(valueRegs.tagGPR(), valueRegs.payloadGPR(), dst, fpScratch);
-        end.link(this);
-    }
-#endif
-
-    void convertDoubleToValue(FPRReg fpr, JSValueRegs valueRegs)
-    {
-#if USE(JSVALUE64)
-        boxDouble(fpr, valueRegs.gpr());
-#else
-        boxDouble(fpr, valueRegs.tagGPR(), valueRegs.payloadGPR());
-#endif
-    }
-
-    JSWASMModule* m_module;
-    unsigned m_stackHeight;
-    unsigned m_numberOfLocals;
-    unsigned m_tempStackTop { 0 };
-    unsigned m_calleeSaveSpace;
-
-    Vector&lt;JumpTarget&gt; m_breakTargets;
-    Vector&lt;JumpTarget&gt; m_continueTargets;
-    Vector&lt;JumpTarget&gt; m_breakLabelTargets;
-    Vector&lt;JumpTarget&gt; m_continueLabelTargets;
-
-    Label m_beginLabel;
-    Jump m_stackOverflow;
-    JumpList m_divideErrorJumpList;
-    JumpList m_outOfBoundsErrorJumpList;
-    JumpList m_exceptionChecks;
-
-    Vector&lt;std::pair&lt;Call, void*&gt;&gt; m_calls;
-    Vector&lt;CallCompilationInfo&gt; m_callCompilationInfo;
-};
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)
-
-#endif // WASMFunctionCompiler_h
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMFunctionParsercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.cpp (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.cpp        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.cpp        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1,1225 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;WASMFunctionParser.h&quot;
-
-#if ENABLE(WEBASSEMBLY)
-
-#include &quot;JSCJSValueInlines.h&quot;
-#include &quot;JSWASMModule.h&quot;
-#include &quot;WASMFunctionCompiler.h&quot;
-#include &quot;WASMFunctionB3IRGenerator.h&quot;
-#include &quot;WASMFunctionSyntaxChecker.h&quot;
-
-#define PROPAGATE_ERROR() do { if (!m_errorMessage.isNull()) return 0; } while (0)
-#define FAIL_WITH_MESSAGE(errorMessage) do {  m_errorMessage = errorMessage; return 0; } while (0)
-#define READ_FLOAT_OR_FAIL(result, errorMessage) do { if (!m_reader.readFloat(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_DOUBLE_OR_FAIL(result, errorMessage) do { if (!m_reader.readDouble(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_COMPACT_INT32_OR_FAIL(result, errorMessage) do { if (!m_reader.readCompactInt32(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_COMPACT_UINT32_OR_FAIL(result, errorMessage) do { if (!m_reader.readCompactUInt32(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_EXPRESSION_TYPE_OR_FAIL(result, errorMessage) do { if (!m_reader.readExpressionType(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_OP_STATEMENT_OR_FAIL(hasImmediate, op, opWithImmediate, immediate, errorMessage) do { if (!m_reader.readOpStatement(hasImmediate, op, opWithImmediate, immediate)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_OP_EXPRESSION_I32_OR_FAIL(hasImmediate, op, opWithImmediate, immediate, errorMessage) do { if (!m_reader.readOpExpressionI32(hasImmediate, op, opWithImmediate, immediate)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_OP_EXPRESSION_F32_OR_FAIL(hasImmediate, op, opWithImmediate, immediate, errorMessage) do { if (!m_reader.readOpExpressionF32(hasImmediate, op, opWithImmediate, immediate)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_OP_EXPRESSION_F64_OR_FAIL(hasImmediate, op, opWithImmediate, immediate, errorMessage) do { if (!m_reader.readOpExpressionF64(hasImmediate, op, opWithImmediate, immediate)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_OP_EXPRESSION_VOID_OR_FAIL(op, errorMessage) do { if (!m_reader.readOpExpressionVoid(op)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_VARIABLE_TYPES_OR_FAIL(hasImmediate, variableTypes, variableTypesWithImmediate, immediate, errorMessage) do { if (!m_reader.readVariableTypes(hasImmediate, variableTypes, variableTypesWithImmediate, immediate)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_SWITCH_CASE_OR_FAIL(result, errorMessage) do { if (!m_reader.readSwitchCase(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define FAIL_IF_FALSE(condition, errorMessage) do { if (!(condition)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-
-#define UNUSED 0
-
-namespace JSC {
-
-static String nameOfType(WASMType type)
-{
-    switch (type) {
-    case WASMType::I32:
-        return &quot;int32&quot;;
-    case WASMType::F32:
-        return &quot;float32&quot;;
-    case WASMType::F64:
-        return &quot;float64&quot;;
-    default:
-        RELEASE_ASSERT_NOT_REACHED();
-    }
-}
-
-bool WASMFunctionParser::checkSyntax(JSWASMModule* module, const SourceCode&amp; source, size_t functionIndex, unsigned startOffsetInSource, unsigned&amp; endOffsetInSource, unsigned&amp; stackHeight, String&amp; errorMessage)
-{
-    WASMFunctionParser parser(module, source, functionIndex);
-    WASMFunctionSyntaxChecker syntaxChecker;
-    parser.m_reader.setOffset(startOffsetInSource);
-    parser.parseFunction(syntaxChecker);
-    if (!parser.m_errorMessage.isNull()) {
-        errorMessage = parser.m_errorMessage;
-        return false;
-    }
-    endOffsetInSource = parser.m_reader.offset();
-    stackHeight = syntaxChecker.stackHeight();
-    return true;
-}
-
-void WASMFunctionParser::compile(VM&amp; vm, CodeBlock* codeBlock, JSWASMModule* module, const SourceCode&amp; source, size_t functionIndex)
-{
-    WASMFunctionParser parser(module, source, functionIndex);
-    WASMFunctionCompiler compiler(vm, codeBlock, module, module-&gt;functionStackHeights()[functionIndex]);
-    parser.m_reader.setOffset(module-&gt;functionStartOffsetsInSource()[functionIndex]);
-    parser.parseFunction(compiler);
-    ASSERT(parser.m_errorMessage.isNull());
-}
-
-template &lt;class Context&gt;
-bool WASMFunctionParser::parseFunction(Context&amp; context)
-{
-    const WASMSignature&amp; signature = m_module-&gt;signatures()[m_module-&gt;functionDeclarations()[m_functionIndex].signatureIndex];
-
-    m_returnType = signature.returnType;
-
-    parseLocalVariables();
-    PROPAGATE_ERROR();
-
-    const Vector&lt;WASMType&gt;&amp; arguments = signature.arguments;
-    for (size_t i = 0; i &lt; arguments.size(); ++i)
-        m_localTypes.append(arguments[i]);
-    for (uint32_t i = 0; i &lt; m_numberOfI32LocalVariables; ++i)
-        m_localTypes.append(WASMType::I32);
-    for (uint32_t i = 0; i &lt; m_numberOfF32LocalVariables; ++i)
-        m_localTypes.append(WASMType::F32);
-    for (uint32_t i = 0; i &lt; m_numberOfF64LocalVariables; ++i)
-        m_localTypes.append(WASMType::F64);
-
-    context.startFunction(arguments, m_numberOfI32LocalVariables, m_numberOfF32LocalVariables, m_numberOfF64LocalVariables);
-
-    parseBlockStatement(context);
-    PROPAGATE_ERROR();
-
-    context.endFunction();
-    return true;
-}
-
-bool WASMFunctionParser::parseLocalVariables()
-{
-    m_numberOfI32LocalVariables = 0;
-    m_numberOfF32LocalVariables = 0;
-    m_numberOfF64LocalVariables = 0;
-
-    bool hasImmediate;
-    WASMVariableTypes variableTypes;
-    WASMVariableTypesWithImmediate variableTypesWithImmediate;
-    uint8_t immediate;
-    READ_VARIABLE_TYPES_OR_FAIL(hasImmediate, variableTypes, variableTypesWithImmediate, immediate, &quot;Cannot read the types of local variables.&quot;);
-    if (!hasImmediate) {
-        if (static_cast&lt;uint8_t&gt;(variableTypes) &amp; static_cast&lt;uint8_t&gt;(WASMVariableTypes::I32))
-            READ_COMPACT_UINT32_OR_FAIL(m_numberOfI32LocalVariables, &quot;Cannot read the number of int32 local variables.&quot;);
-        if (static_cast&lt;uint8_t&gt;(variableTypes) &amp; static_cast&lt;uint8_t&gt;(WASMVariableTypes::F32))
-            READ_COMPACT_UINT32_OR_FAIL(m_numberOfF32LocalVariables, &quot;Cannot read the number of float32 local variables.&quot;);
-        if (static_cast&lt;uint8_t&gt;(variableTypes) &amp; static_cast&lt;uint8_t&gt;(WASMVariableTypes::F64))
-            READ_COMPACT_UINT32_OR_FAIL(m_numberOfF64LocalVariables, &quot;Cannot read the number of float64 local variables.&quot;);
-    } else
-        m_numberOfI32LocalVariables = immediate;
-    return true;
-}
-
-template &lt;class Context&gt;
-ContextStatement WASMFunctionParser::parseStatement(Context&amp; context)
-{
-    bool hasImmediate;
-    WASMOpStatement op;
-    WASMOpStatementWithImmediate opWithImmediate;
-    uint8_t immediate;
-    READ_OP_STATEMENT_OR_FAIL(hasImmediate, op, opWithImmediate, immediate, &quot;Cannot read the statement opcode.&quot;);
-    if (!hasImmediate) {
-        switch (op) {
-        case WASMOpStatement::SetLocal:
-            parseSetLocal(context, WASMOpKind::Statement, WASMExpressionType::Void);
-            break;
-        case WASMOpStatement::SetGlobal:
-            parseSetGlobal(context, WASMOpKind::Statement, WASMExpressionType::Void);
-            break;
-        case WASMOpStatement::I32Store8:
-            parseStore(context, WASMOpKind::Statement, WASMExpressionType::I32, WASMMemoryType::I8, MemoryAccessOffsetMode::NoOffset);
-            break;
-        case WASMOpStatement::I32StoreWithOffset8:
-            parseStore(context, WASMOpKind::Statement, WASMExpressionType::I32, WASMMemoryType::I8, MemoryAccessOffsetMode::WithOffset);
-            break;
-        case WASMOpStatement::I32Store16:
-            parseStore(context, WASMOpKind::Statement, WASMExpressionType::I32, WASMMemoryType::I16, MemoryAccessOffsetMode::NoOffset);
-            break;
-        case WASMOpStatement::I32StoreWithOffset16:
-            parseStore(context, WASMOpKind::Statement, WASMExpressionType::I32, WASMMemoryType::I16, MemoryAccessOffsetMode::WithOffset);
-            break;
-        case WASMOpStatement::I32Store32:
-            parseStore(context, WASMOpKind::Statement, WASMExpressionType::I32, WASMMemoryType::I32, MemoryAccessOffsetMode::NoOffset);
-            break;
-        case WASMOpStatement::I32StoreWithOffset32:
-            parseStore(context, WASMOpKind::Statement, WASMExpressionType::I32, WASMMemoryType::I32, MemoryAccessOffsetMode::WithOffset);
-            break;
-        case WASMOpStatement::F32Store:
-            parseStore(context, WASMOpKind::Statement, WASMExpressionType::F32, WASMMemoryType::F32, MemoryAccessOffsetMode::NoOffset);
-            break;
-        case WASMOpStatement::F32StoreWithOffset:
-            parseStore(context, WASMOpKind::Statement, WASMExpressionType::F32, WASMMemoryType::F32, MemoryAccessOffsetMode::WithOffset);
-            break;
-        case WASMOpStatement::F64Store:
-            parseStore(context, WASMOpKind::Statement, WASMExpressionType::F64, WASMMemoryType::F64, MemoryAccessOffsetMode::NoOffset);
-            break;
-        case WASMOpStatement::F64StoreWithOffset:
-            parseStore(context, WASMOpKind::Statement, WASMExpressionType::F64, WASMMemoryType::F64, MemoryAccessOffsetMode::WithOffset);
-            break;
-        case WASMOpStatement::CallInternal:
-            parseCallInternal(context, WASMOpKind::Statement, WASMExpressionType::Void);
-            break;
-        case WASMOpStatement::CallIndirect:
-            parseCallIndirect(context, WASMOpKind::Statement, WASMExpressionType::Void);
-            break;
-        case WASMOpStatement::CallImport:
-            parseCallImport(context, WASMOpKind::Statement, WASMExpressionType::Void);
-            break;
-        case WASMOpStatement::Return:
-            parseReturnStatement(context);
-            break;
-        case WASMOpStatement::Block:
-            parseBlockStatement(context);
-            break;
-        case WASMOpStatement::If:
-            parseIfStatement(context);
-            break;
-        case WASMOpStatement::IfElse:
-            parseIfElseStatement(context);
-            break;
-        case WASMOpStatement::While:
-            parseWhileStatement(context);
-            break;
-        case WASMOpStatement::Do:
-            parseDoStatement(context);
-            break;
-        case WASMOpStatement::Label:
-            parseLabelStatement(context);
-            break;
-        case WASMOpStatement::Break:
-            parseBreakStatement(context);
-            break;
-        case WASMOpStatement::BreakLabel:
-            parseBreakLabelStatement(context);
-            break;
-        case WASMOpStatement::Continue:
-            parseContinueStatement(context);
-            break;
-        case WASMOpStatement::ContinueLabel:
-            parseContinueLabelStatement(context);
-            break;
-        case WASMOpStatement::Switch:
-            parseSwitchStatement(context);
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-    } else {
-        switch (opWithImmediate) {
-        case WASMOpStatementWithImmediate::SetLocal:
-            parseSetLocal(context, WASMOpKind::Statement, WASMExpressionType::Void, immediate);
-            break;
-        case WASMOpStatementWithImmediate::SetGlobal:
-            parseSetGlobal(context, WASMOpKind::Statement, WASMExpressionType::Void, immediate);
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-        }
-    }
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextStatement WASMFunctionParser::parseReturnStatement(Context&amp; context)
-{
-    ContextExpression expression = 0;
-    if (m_returnType != WASMExpressionType::Void) {
-        expression = parseExpression(context, m_returnType);
-        PROPAGATE_ERROR();
-    }
-    context.buildReturn(expression, m_returnType);
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextStatement WASMFunctionParser::parseBlockStatement(Context&amp; context)
-{
-    uint32_t numberOfStatements;
-    READ_COMPACT_UINT32_OR_FAIL(numberOfStatements, &quot;Cannot read the number of statements.&quot;);
-    for (uint32_t i = 0; i &lt; numberOfStatements; ++i) {
-        parseStatement(context);
-        PROPAGATE_ERROR();
-    }
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextStatement WASMFunctionParser::parseIfStatement(Context&amp; context)
-{
-    ContextJumpTarget end;
-
-    ContextExpression expression = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-
-    context.jumpToTargetIf(Context::JumpCondition::Zero, expression, end);
-
-    parseStatement(context);
-    PROPAGATE_ERROR();
-
-    context.linkTarget(end);
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextStatement WASMFunctionParser::parseIfElseStatement(Context&amp; context)
-{
-    ContextJumpTarget elseTarget;
-    ContextJumpTarget end;
-
-    ContextExpression expression = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-
-    context.jumpToTargetIf(Context::JumpCondition::Zero, expression, elseTarget);
-
-    parseStatement(context);
-    PROPAGATE_ERROR();
-
-    context.jumpToTarget(end);
-    context.linkTarget(elseTarget);
-
-    parseStatement(context);
-    PROPAGATE_ERROR();
-
-    context.linkTarget(end);
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextStatement WASMFunctionParser::parseWhileStatement(Context&amp; context)
-{
-    context.startLoop();
-    context.linkTarget(context.continueTarget());
-
-    ContextExpression expression = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-
-    context.jumpToTargetIf(Context::JumpCondition::Zero, expression, context.breakTarget());
-
-    m_breakScopeDepth++;
-    m_continueScopeDepth++;
-    parseStatement(context);
-    PROPAGATE_ERROR();
-    m_continueScopeDepth--;
-    m_breakScopeDepth--;
-
-    context.jumpToTarget(context.continueTarget());
-
-    context.linkTarget(context.breakTarget());
-    context.endLoop();
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextStatement WASMFunctionParser::parseDoStatement(Context&amp; context)
-{
-    context.startLoop();
-
-    ContextJumpTarget topOfLoop;
-    context.linkTarget(topOfLoop);
-
-    m_breakScopeDepth++;
-    m_continueScopeDepth++;
-    parseStatement(context);
-    PROPAGATE_ERROR();
-    m_continueScopeDepth--;
-    m_breakScopeDepth--;
-
-    context.linkTarget(context.continueTarget());
-
-    ContextExpression expression = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-
-    context.jumpToTargetIf(Context::JumpCondition::NonZero, expression, topOfLoop);
-
-    context.linkTarget(context.breakTarget());
-    context.endLoop();
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextStatement WASMFunctionParser::parseLabelStatement(Context&amp; context)
-{
-    context.startLabel();
-    m_labelDepth++;
-    parseStatement(context);
-    PROPAGATE_ERROR();
-    m_labelDepth--;
-    context.endLabel();
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextStatement WASMFunctionParser::parseBreakStatement(Context&amp; context)
-{
-    FAIL_IF_FALSE(m_breakScopeDepth, &quot;'break' is only valid inside a switch or loop statement.&quot;);
-    context.jumpToTarget(context.breakTarget());
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextStatement WASMFunctionParser::parseBreakLabelStatement(Context&amp; context)
-{
-    uint32_t labelIndex;
-    READ_COMPACT_UINT32_OR_FAIL(labelIndex, &quot;Cannot read the label index.&quot;);
-    FAIL_IF_FALSE(labelIndex &lt; m_labelDepth, &quot;The label index is incorrect.&quot;);
-    context.jumpToTarget(context.breakLabelTarget(labelIndex));
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextStatement WASMFunctionParser::parseContinueStatement(Context&amp; context)
-{
-    FAIL_IF_FALSE(m_continueScopeDepth, &quot;'continue' is only valid inside a loop statement.&quot;);
-    context.jumpToTarget(context.continueTarget());
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextStatement WASMFunctionParser::parseContinueLabelStatement(Context&amp; context)
-{
-    uint32_t labelIndex;
-    READ_COMPACT_UINT32_OR_FAIL(labelIndex, &quot;Cannot read the label index.&quot;);
-    FAIL_IF_FALSE(labelIndex &lt; m_labelDepth, &quot;The label index is incorrect.&quot;);
-    context.jumpToTarget(context.continueLabelTarget(labelIndex));
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextStatement WASMFunctionParser::parseSwitchStatement(Context&amp; context)
-{
-    context.startSwitch();
-    uint32_t numberOfCases;
-    READ_COMPACT_UINT32_OR_FAIL(numberOfCases, &quot;Cannot read the number of cases.&quot;);
-    ContextExpression expression = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-
-    ContextJumpTarget compare;
-    context.jumpToTarget(compare);
-
-    Vector&lt;int64_t&gt; cases;
-    Vector&lt;ContextJumpTarget&gt; targets;
-    cases.reserveInitialCapacity(numberOfCases);
-    targets.reserveInitialCapacity(numberOfCases);
-    bool hasDefault = false;
-    ContextJumpTarget defaultTarget;
-
-    m_breakScopeDepth++;
-    for (uint32_t i = 0; i &lt; numberOfCases; ++i) {
-        WASMSwitchCase switchCase;
-        READ_SWITCH_CASE_OR_FAIL(switchCase, &quot;Cannot read the switch case.&quot;);
-        switch (switchCase) {
-        case WASMSwitchCase::CaseWithNoStatements:
-        case WASMSwitchCase::CaseWithStatement:
-        case WASMSwitchCase::CaseWithBlockStatement: {
-            uint32_t value;
-            READ_COMPACT_INT32_OR_FAIL(value, &quot;Cannot read the value of the switch case.&quot;);
-            cases.uncheckedAppend(value);
-            ContextJumpTarget target;
-            context.linkTarget(target);
-            targets.uncheckedAppend(target);
-            if (switchCase == WASMSwitchCase::CaseWithStatement) {
-                parseStatement(context);
-                PROPAGATE_ERROR();
-            } else if (switchCase == WASMSwitchCase::CaseWithBlockStatement) {
-                parseBlockStatement(context);
-                PROPAGATE_ERROR();
-            }
-            break;
-        }
-        case WASMSwitchCase::DefaultWithNoStatements:
-        case WASMSwitchCase::DefaultWithStatement:
-        case WASMSwitchCase::DefaultWithBlockStatement: {
-            FAIL_IF_FALSE(i == numberOfCases - 1, &quot;The default case must be the last case.&quot;);
-            hasDefault = true;
-            context.linkTarget(defaultTarget);
-            if (switchCase == WASMSwitchCase::DefaultWithStatement) {
-                parseStatement(context);
-                PROPAGATE_ERROR();
-            } else if (switchCase == WASMSwitchCase::DefaultWithBlockStatement) {
-                parseBlockStatement(context);
-                PROPAGATE_ERROR();
-            }
-            break;
-        }
-        default:
-            ASSERT_NOT_REACHED();
-        }
-    }
-    if (!hasDefault)
-        context.linkTarget(defaultTarget);
-
-    m_breakScopeDepth--;
-
-    context.jumpToTarget(context.breakTarget());
-    context.linkTarget(compare);
-
-    context.buildSwitch(expression, cases, targets, defaultTarget);
-
-    context.linkTarget(context.breakTarget());
-    context.endSwitch();
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseExpression(Context&amp; context, WASMExpressionType expressionType)
-{
-    switch (expressionType) {
-    case WASMExpressionType::I32:
-        return parseExpressionI32(context);
-    case WASMExpressionType::F32:
-        return parseExpressionF32(context);
-    case WASMExpressionType::F64:
-        return parseExpressionF64(context);
-    case WASMExpressionType::Void:
-        return parseExpressionVoid(context);
-    default:
-        RELEASE_ASSERT_NOT_REACHED();
-    }
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseExpressionI32(Context&amp; context)
-{
-    bool hasImmediate;
-    WASMOpExpressionI32 op;
-    WASMOpExpressionI32WithImmediate opWithImmediate;
-    uint8_t immediate;
-    READ_OP_EXPRESSION_I32_OR_FAIL(hasImmediate, op, opWithImmediate, immediate, &quot;Cannot read the int32 expression opcode.&quot;);
-    if (!hasImmediate) {
-        switch (op) {
-        case WASMOpExpressionI32::ConstantPoolIndex:
-            return parseConstantPoolIndexExpressionI32(context);
-        case WASMOpExpressionI32::Immediate:
-            return parseImmediateExpressionI32(context);
-        case WASMOpExpressionI32::GetLocal:
-            return parseGetLocalExpression(context, WASMType::I32);
-        case WASMOpExpressionI32::GetGlobal:
-            return parseGetGlobalExpression(context, WASMType::I32);
-        case WASMOpExpressionI32::SetLocal:
-            return parseSetLocal(context, WASMOpKind::Expression, WASMExpressionType::I32);
-        case WASMOpExpressionI32::SetGlobal:
-            return parseSetGlobal(context, WASMOpKind::Expression, WASMExpressionType::I32);
-        case WASMOpExpressionI32::SLoad8:
-            return parseLoad(context, WASMExpressionType::I32, WASMMemoryType::I8, MemoryAccessOffsetMode::NoOffset, MemoryAccessConversion::SignExtend);
-        case WASMOpExpressionI32::SLoadWithOffset8:
-            return parseLoad(context, WASMExpressionType::I32, WASMMemoryType::I8, MemoryAccessOffsetMode::WithOffset, MemoryAccessConversion::SignExtend);
-        case WASMOpExpressionI32::ULoad8:
-            return parseLoad(context, WASMExpressionType::I32, WASMMemoryType::I8, MemoryAccessOffsetMode::NoOffset, MemoryAccessConversion::ZeroExtend);
-        case WASMOpExpressionI32::ULoadWithOffset8:
-            return parseLoad(context, WASMExpressionType::I32, WASMMemoryType::I8, MemoryAccessOffsetMode::WithOffset, MemoryAccessConversion::ZeroExtend);
-        case WASMOpExpressionI32::SLoad16:
-            return parseLoad(context, WASMExpressionType::I32, WASMMemoryType::I16, MemoryAccessOffsetMode::NoOffset, MemoryAccessConversion::SignExtend);
-        case WASMOpExpressionI32::SLoadWithOffset16:
-            return parseLoad(context, WASMExpressionType::I32, WASMMemoryType::I16, MemoryAccessOffsetMode::WithOffset, MemoryAccessConversion::SignExtend);
-        case WASMOpExpressionI32::ULoad16:
-            return parseLoad(context, WASMExpressionType::I32, WASMMemoryType::I16, MemoryAccessOffsetMode::NoOffset, MemoryAccessConversion::ZeroExtend);
-        case WASMOpExpressionI32::ULoadWithOffset16:
-            return parseLoad(context, WASMExpressionType::I32, WASMMemoryType::I16, MemoryAccessOffsetMode::WithOffset, MemoryAccessConversion::ZeroExtend);
-        case WASMOpExpressionI32::Load32:
-            return parseLoad(context, WASMExpressionType::I32, WASMMemoryType::I32, MemoryAccessOffsetMode::NoOffset);
-        case WASMOpExpressionI32::LoadWithOffset32:
-            return parseLoad(context, WASMExpressionType::I32, WASMMemoryType::I32, MemoryAccessOffsetMode::WithOffset);
-        case WASMOpExpressionI32::Store8:
-            return parseStore(context, WASMOpKind::Expression, WASMExpressionType::I32, WASMMemoryType::I8, MemoryAccessOffsetMode::NoOffset);
-        case WASMOpExpressionI32::StoreWithOffset8:
-            return parseStore(context, WASMOpKind::Expression, WASMExpressionType::I32, WASMMemoryType::I8, MemoryAccessOffsetMode::WithOffset);
-        case WASMOpExpressionI32::Store16:
-            return parseStore(context, WASMOpKind::Expression, WASMExpressionType::I32, WASMMemoryType::I16, MemoryAccessOffsetMode::NoOffset);
-        case WASMOpExpressionI32::StoreWithOffset16:
-            return parseStore(context, WASMOpKind::Expression, WASMExpressionType::I32, WASMMemoryType::I16, MemoryAccessOffsetMode::WithOffset);
-        case WASMOpExpressionI32::Store32:
-            return parseStore(context, WASMOpKind::Expression, WASMExpressionType::I32, WASMMemoryType::I32, MemoryAccessOffsetMode::NoOffset);
-        case WASMOpExpressionI32::StoreWithOffset32:
-            return parseStore(context, WASMOpKind::Expression, WASMExpressionType::I32, WASMMemoryType::I32, MemoryAccessOffsetMode::WithOffset);
-        case WASMOpExpressionI32::CallInternal:
-            return parseCallInternal(context, WASMOpKind::Expression, WASMExpressionType::I32);
-        case WASMOpExpressionI32::CallIndirect:
-            return parseCallIndirect(context, WASMOpKind::Expression, WASMExpressionType::I32);
-        case WASMOpExpressionI32::CallImport:
-            return parseCallImport(context, WASMOpKind::Expression, WASMExpressionType::I32);
-        case WASMOpExpressionI32::Conditional:
-            return parseConditional(context, WASMExpressionType::I32);
-        case WASMOpExpressionI32::Comma:
-            return parseComma(context, WASMExpressionType::I32);
-        case WASMOpExpressionI32::FromF32:
-            return parseConvertType(context, WASMExpressionType::F32, WASMExpressionType::I32, WASMTypeConversion::ConvertSigned);
-        case WASMOpExpressionI32::FromF64:
-            return parseConvertType(context, WASMExpressionType::F64, WASMExpressionType::I32, WASMTypeConversion::ConvertSigned);
-        case WASMOpExpressionI32::Negate:
-        case WASMOpExpressionI32::BitNot:
-        case WASMOpExpressionI32::CountLeadingZeros:
-        case WASMOpExpressionI32::LogicalNot:
-        case WASMOpExpressionI32::Abs:
-            return parseUnaryExpressionI32(context, op);
-        case WASMOpExpressionI32::Add:
-        case WASMOpExpressionI32::Sub:
-        case WASMOpExpressionI32::Mul:
-        case WASMOpExpressionI32::SDiv:
-        case WASMOpExpressionI32::UDiv:
-        case WASMOpExpressionI32::SMod:
-        case WASMOpExpressionI32::UMod:
-        case WASMOpExpressionI32::BitOr:
-        case WASMOpExpressionI32::BitAnd:
-        case WASMOpExpressionI32::BitXor:
-        case WASMOpExpressionI32::LeftShift:
-        case WASMOpExpressionI32::ArithmeticRightShift:
-        case WASMOpExpressionI32::LogicalRightShift:
-            return parseBinaryExpressionI32(context, op);
-        case WASMOpExpressionI32::EqualI32:
-        case WASMOpExpressionI32::NotEqualI32:
-        case WASMOpExpressionI32::SLessThanI32:
-        case WASMOpExpressionI32::ULessThanI32:
-        case WASMOpExpressionI32::SLessThanOrEqualI32:
-        case WASMOpExpressionI32::ULessThanOrEqualI32:
-        case WASMOpExpressionI32::SGreaterThanI32:
-        case WASMOpExpressionI32::UGreaterThanI32:
-        case WASMOpExpressionI32::SGreaterThanOrEqualI32:
-        case WASMOpExpressionI32::UGreaterThanOrEqualI32:
-            return parseRelationalI32ExpressionI32(context, op);
-        case WASMOpExpressionI32::EqualF32:
-        case WASMOpExpressionI32::NotEqualF32:
-        case WASMOpExpressionI32::LessThanF32:
-        case WASMOpExpressionI32::LessThanOrEqualF32:
-        case WASMOpExpressionI32::GreaterThanF32:
-        case WASMOpExpressionI32::GreaterThanOrEqualF32:
-            return parseRelationalF32ExpressionI32(context, op);
-        case WASMOpExpressionI32::EqualF64:
-        case WASMOpExpressionI32::NotEqualF64:
-        case WASMOpExpressionI32::LessThanF64:
-        case WASMOpExpressionI32::LessThanOrEqualF64:
-        case WASMOpExpressionI32::GreaterThanF64:
-        case WASMOpExpressionI32::GreaterThanOrEqualF64:
-            return parseRelationalF64ExpressionI32(context, op);
-        case WASMOpExpressionI32::SMin:
-        case WASMOpExpressionI32::UMin:
-        case WASMOpExpressionI32::SMax:
-        case WASMOpExpressionI32::UMax:
-            return parseMinOrMaxExpressionI32(context, op);
-        default:
-            ASSERT_NOT_REACHED();
-        }
-    } else {
-        switch (opWithImmediate) {
-        case WASMOpExpressionI32WithImmediate::ConstantPoolIndex:
-            return parseConstantPoolIndexExpressionI32(context, immediate);
-        case WASMOpExpressionI32WithImmediate::Immediate:
-            return parseImmediateExpressionI32(context, immediate);
-        case WASMOpExpressionI32WithImmediate::GetLocal:
-            return parseGetLocalExpression(context, WASMType::I32, immediate);
-        default:
-            ASSERT_NOT_REACHED();
-        }
-    }
-    return 0;
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseConstantPoolIndexExpressionI32(Context&amp; context, uint32_t constantPoolIndex)
-{
-    FAIL_IF_FALSE(constantPoolIndex &lt; m_module-&gt;i32Constants().size(), &quot;The constant pool index is incorrect.&quot;);
-    return context.buildImmediateI32(m_module-&gt;i32Constants()[constantPoolIndex]);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseConstantPoolIndexExpressionI32(Context&amp; context)
-{
-    uint32_t constantPoolIndex;
-    READ_COMPACT_UINT32_OR_FAIL(constantPoolIndex, &quot;Cannot read the constant pool index.&quot;);
-    return parseConstantPoolIndexExpressionI32(context, constantPoolIndex);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseImmediateExpressionI32(Context&amp; context, uint32_t immediate)
-{
-    return context.buildImmediateI32(immediate);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseImmediateExpressionI32(Context&amp; context)
-{
-    uint32_t immediate;
-    READ_COMPACT_UINT32_OR_FAIL(immediate, &quot;Cannot read the immediate.&quot;);
-    return parseImmediateExpressionI32(context, immediate);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseUnaryExpressionI32(Context&amp; context, WASMOpExpressionI32 op)
-{
-    ContextExpression expression = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-    return context.buildUnaryI32(expression, op);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseBinaryExpressionI32(Context&amp; context, WASMOpExpressionI32 op)
-{
-    ContextExpression left = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-    ContextExpression right = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-    return context.buildBinaryI32(left, right, op);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseRelationalI32ExpressionI32(Context&amp; context, WASMOpExpressionI32 op)
-{
-    ContextExpression left = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-    ContextExpression right = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-    return context.buildRelationalI32(left, right, op);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseRelationalF32ExpressionI32(Context&amp; context, WASMOpExpressionI32 op)
-{
-    ContextExpression left = parseExpressionF32(context);
-    PROPAGATE_ERROR();
-    ContextExpression right = parseExpressionF32(context);
-    PROPAGATE_ERROR();
-    return context.buildRelationalF32(left, right, op);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseRelationalF64ExpressionI32(Context&amp; context, WASMOpExpressionI32 op)
-{
-    ContextExpression left = parseExpressionF64(context);
-    PROPAGATE_ERROR();
-    ContextExpression right = parseExpressionF64(context);
-    PROPAGATE_ERROR();
-    return context.buildRelationalF64(left, right, op);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseMinOrMaxExpressionI32(Context&amp; context, WASMOpExpressionI32 op)
-{
-    uint32_t numberOfArguments;
-    READ_COMPACT_UINT32_OR_FAIL(numberOfArguments, &quot;Cannot read the number of arguments to min/max.&quot;);
-    FAIL_IF_FALSE(numberOfArguments &gt;= 2, &quot;Min/max must be passed at least 2 arguments.&quot;);
-    ContextExpression current = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-    for (uint32_t i = 1; i &lt; numberOfArguments; ++i) {
-        ContextExpression expression = parseExpressionI32(context);
-        PROPAGATE_ERROR();
-        current = context.buildMinOrMaxI32(current, expression, op);
-    }
-    return current;
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseExpressionF32(Context&amp; context)
-{
-    bool hasImmediate;
-    WASMOpExpressionF32 op;
-    WASMOpExpressionF32WithImmediate opWithImmediate;
-    uint8_t immediate;
-    READ_OP_EXPRESSION_F32_OR_FAIL(hasImmediate, op, opWithImmediate, immediate, &quot;Cannot read the float32 expression opcode.&quot;);
-    if (!hasImmediate) {
-        switch (op) {
-        case WASMOpExpressionF32::ConstantPoolIndex:
-            return parseConstantPoolIndexExpressionF32(context);
-        case WASMOpExpressionF32::Immediate:
-            return parseImmediateExpressionF32(context);
-        case WASMOpExpressionF32::GetLocal:
-            return parseGetLocalExpression(context, WASMType::F32);
-        case WASMOpExpressionF32::GetGlobal:
-            return parseGetGlobalExpression(context, WASMType::F32);
-        case WASMOpExpressionF32::SetLocal:
-            return parseSetLocal(context, WASMOpKind::Expression, WASMExpressionType::F32);
-        case WASMOpExpressionF32::SetGlobal:
-            return parseSetGlobal(context, WASMOpKind::Expression, WASMExpressionType::F32);
-        case WASMOpExpressionF32::Load:
-            return parseLoad(context, WASMExpressionType::F32, WASMMemoryType::F32, MemoryAccessOffsetMode::NoOffset);
-        case WASMOpExpressionF32::LoadWithOffset:
-            return parseLoad(context, WASMExpressionType::F32, WASMMemoryType::F32, MemoryAccessOffsetMode::WithOffset);
-        case WASMOpExpressionF32::Store:
-            return parseStore(context, WASMOpKind::Expression, WASMExpressionType::F32, WASMMemoryType::F32, MemoryAccessOffsetMode::NoOffset);
-        case WASMOpExpressionF32::StoreWithOffset:
-            return parseStore(context, WASMOpKind::Expression, WASMExpressionType::F32, WASMMemoryType::F32, MemoryAccessOffsetMode::WithOffset);
-        case WASMOpExpressionF32::CallInternal:
-            return parseCallInternal(context, WASMOpKind::Expression, WASMExpressionType::F32);
-        case WASMOpExpressionF32::CallIndirect:
-            return parseCallIndirect(context, WASMOpKind::Expression, WASMExpressionType::F32);
-        case WASMOpExpressionF32::Conditional:
-            return parseConditional(context, WASMExpressionType::F32);
-        case WASMOpExpressionF32::Comma:
-            return parseComma(context, WASMExpressionType::F32);
-        case WASMOpExpressionF32::FromS32:
-            return parseConvertType(context, WASMExpressionType::I32, WASMExpressionType::F32, WASMTypeConversion::ConvertSigned);
-        case WASMOpExpressionF32::FromU32:
-            return parseConvertType(context, WASMExpressionType::I32, WASMExpressionType::F32, WASMTypeConversion::ConvertUnsigned);
-        case WASMOpExpressionF32::FromF64:
-            return parseConvertType(context, WASMExpressionType::F64, WASMExpressionType::F32, WASMTypeConversion::Demote);
-        case WASMOpExpressionF32::Negate:
-        case WASMOpExpressionF32::Abs:
-        case WASMOpExpressionF32::Ceil:
-        case WASMOpExpressionF32::Floor:
-        case WASMOpExpressionF32::Sqrt:
-            return parseUnaryExpressionF32(context, op);
-        case WASMOpExpressionF32::Add:
-        case WASMOpExpressionF32::Sub:
-        case WASMOpExpressionF32::Mul:
-        case WASMOpExpressionF32::Div:
-            return parseBinaryExpressionF32(context, op);
-        default:
-            ASSERT_NOT_REACHED();
-        }
-    } else {
-        switch (opWithImmediate) {
-        case WASMOpExpressionF32WithImmediate::ConstantPoolIndex:
-            return parseConstantPoolIndexExpressionF32(context, immediate);
-        case WASMOpExpressionF32WithImmediate::GetLocal:
-            return parseGetLocalExpression(context, WASMType::F32, immediate);
-        default:
-            ASSERT_NOT_REACHED();
-        }
-    }
-    return 0;
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseConstantPoolIndexExpressionF32(Context&amp; context, uint32_t constantIndex)
-{
-    FAIL_IF_FALSE(constantIndex &lt; m_module-&gt;f32Constants().size(), &quot;The constant pool index is incorrect.&quot;);
-    return context.buildImmediateF32(m_module-&gt;f32Constants()[constantIndex]);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseConstantPoolIndexExpressionF32(Context&amp; context)
-{
-    uint32_t constantIndex;
-    READ_COMPACT_UINT32_OR_FAIL(constantIndex, &quot;Cannot read the constant pool index.&quot;);
-    return parseConstantPoolIndexExpressionF32(context, constantIndex);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseImmediateExpressionF32(Context&amp; context)
-{
-    float immediate;
-    READ_FLOAT_OR_FAIL(immediate, &quot;Cannot read the immediate.&quot;);
-    return context.buildImmediateF32(immediate);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseUnaryExpressionF32(Context&amp; context, WASMOpExpressionF32 op)
-{
-    ContextExpression expression = parseExpressionF32(context);
-    PROPAGATE_ERROR();
-    return context.buildUnaryF32(expression, op);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseBinaryExpressionF32(Context&amp; context, WASMOpExpressionF32 op)
-{
-    ContextExpression left = parseExpressionF32(context);
-    PROPAGATE_ERROR();
-    ContextExpression right = parseExpressionF32(context);
-    PROPAGATE_ERROR();
-    return context.buildBinaryF32(left, right, op);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseExpressionF64(Context&amp; context)
-{
-    bool hasImmediate;
-    WASMOpExpressionF64 op;
-    WASMOpExpressionF64WithImmediate opWithImmediate;
-    uint8_t immediate;
-    READ_OP_EXPRESSION_F64_OR_FAIL(hasImmediate, op, opWithImmediate, immediate, &quot;Cannot read the float64 expression opcode.&quot;);
-    if (!hasImmediate) {
-        switch (op) {
-        case WASMOpExpressionF64::ConstantPoolIndex:
-            return parseConstantPoolIndexExpressionF64(context);
-        case WASMOpExpressionF64::Immediate:
-            return parseImmediateExpressionF64(context);
-        case WASMOpExpressionF64::GetLocal:
-            return parseGetLocalExpression(context, WASMType::F64);
-        case WASMOpExpressionF64::GetGlobal:
-            return parseGetGlobalExpression(context, WASMType::F64);
-        case WASMOpExpressionF64::SetLocal:
-            return parseSetLocal(context, WASMOpKind::Expression, WASMExpressionType::F64);
-        case WASMOpExpressionF64::SetGlobal:
-            return parseSetGlobal(context, WASMOpKind::Expression, WASMExpressionType::F64);
-        case WASMOpExpressionF64::Load:
-            return parseLoad(context, WASMExpressionType::F64, WASMMemoryType::F64, MemoryAccessOffsetMode::NoOffset);
-        case WASMOpExpressionF64::LoadWithOffset:
-            return parseLoad(context, WASMExpressionType::F64, WASMMemoryType::F64, MemoryAccessOffsetMode::WithOffset);
-        case WASMOpExpressionF64::Store:
-            return parseStore(context, WASMOpKind::Expression, WASMExpressionType::F64, WASMMemoryType::F64, MemoryAccessOffsetMode::NoOffset);
-        case WASMOpExpressionF64::StoreWithOffset:
-            return parseStore(context, WASMOpKind::Expression, WASMExpressionType::F64, WASMMemoryType::F64, MemoryAccessOffsetMode::WithOffset);
-        case WASMOpExpressionF64::CallInternal:
-            return parseCallInternal(context, WASMOpKind::Expression, WASMExpressionType::F64);
-        case WASMOpExpressionF64::CallImport:
-            return parseCallImport(context, WASMOpKind::Expression, WASMExpressionType::F64);
-        case WASMOpExpressionF64::CallIndirect:
-            return parseCallIndirect(context, WASMOpKind::Expression, WASMExpressionType::F64);
-        case WASMOpExpressionF64::Conditional:
-            return parseConditional(context, WASMExpressionType::F64);
-        case WASMOpExpressionF64::Comma:
-            return parseComma(context, WASMExpressionType::F64);
-        case WASMOpExpressionF64::FromS32:
-            return parseConvertType(context, WASMExpressionType::I32, WASMExpressionType::F64, WASMTypeConversion::ConvertSigned);
-        case WASMOpExpressionF64::FromU32:
-            return parseConvertType(context, WASMExpressionType::I32, WASMExpressionType::F64, WASMTypeConversion::ConvertUnsigned);
-        case WASMOpExpressionF64::FromF32:
-            return parseConvertType(context, WASMExpressionType::F32, WASMExpressionType::F64, WASMTypeConversion::Promote);
-        case WASMOpExpressionF64::Negate:
-        case WASMOpExpressionF64::Abs:
-        case WASMOpExpressionF64::Ceil:
-        case WASMOpExpressionF64::Floor:
-        case WASMOpExpressionF64::Sqrt:
-        case WASMOpExpressionF64::Cos:
-        case WASMOpExpressionF64::Sin:
-        case WASMOpExpressionF64::Tan:
-        case WASMOpExpressionF64::ACos:
-        case WASMOpExpressionF64::ASin:
-        case WASMOpExpressionF64::ATan:
-        case WASMOpExpressionF64::Exp:
-        case WASMOpExpressionF64::Ln:
-            return parseUnaryExpressionF64(context, op);
-        case WASMOpExpressionF64::Add:
-        case WASMOpExpressionF64::Sub:
-        case WASMOpExpressionF64::Mul:
-        case WASMOpExpressionF64::Div:
-        case WASMOpExpressionF64::Mod:
-        case WASMOpExpressionF64::ATan2:
-        case WASMOpExpressionF64::Pow:
-            return parseBinaryExpressionF64(context, op);
-        case WASMOpExpressionF64::Min:
-        case WASMOpExpressionF64::Max:
-            return parseMinOrMaxExpressionF64(context, op);
-        default:
-            ASSERT_NOT_REACHED();
-        }
-    } else {
-        switch (opWithImmediate) {
-        case WASMOpExpressionF64WithImmediate::ConstantPoolIndex:
-            return parseConstantPoolIndexExpressionF64(context, immediate);
-        case WASMOpExpressionF64WithImmediate::GetLocal:
-            return parseGetLocalExpression(context, WASMType::F64, immediate);
-        default:
-            ASSERT_NOT_REACHED();
-        }
-    }
-    return 0;
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseConstantPoolIndexExpressionF64(Context&amp; context, uint32_t constantIndex)
-{
-    FAIL_IF_FALSE(constantIndex &lt; m_module-&gt;f64Constants().size(), &quot;The constant index is incorrect.&quot;);
-    return context.buildImmediateF64(m_module-&gt;f64Constants()[constantIndex]);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseConstantPoolIndexExpressionF64(Context&amp; context)
-{
-    uint32_t constantIndex;
-    READ_COMPACT_UINT32_OR_FAIL(constantIndex, &quot;Cannot read the constant index.&quot;);
-    return parseConstantPoolIndexExpressionF64(context, constantIndex);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseImmediateExpressionF64(Context&amp; context)
-{
-    double immediate;
-    READ_DOUBLE_OR_FAIL(immediate, &quot;Cannot read the immediate.&quot;);
-    return context.buildImmediateF64(immediate);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseUnaryExpressionF64(Context&amp; context, WASMOpExpressionF64 op)
-{
-    ContextExpression expression = parseExpressionF64(context);
-    PROPAGATE_ERROR();
-    return context.buildUnaryF64(expression, op);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseBinaryExpressionF64(Context&amp; context, WASMOpExpressionF64 op)
-{
-    ContextExpression left = parseExpressionF64(context);
-    PROPAGATE_ERROR();
-    ContextExpression right = parseExpressionF64(context);
-    PROPAGATE_ERROR();
-    return context.buildBinaryF64(left, right, op);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseMinOrMaxExpressionF64(Context&amp; context, WASMOpExpressionF64 op)
-{
-    uint32_t numberOfArguments;
-    READ_COMPACT_UINT32_OR_FAIL(numberOfArguments, &quot;Cannot read the number of arguments to min/max.&quot;);
-    FAIL_IF_FALSE(numberOfArguments &gt;= 2, &quot;Min/max must be passed at least 2 arguments.&quot;);
-    ContextExpression current = parseExpressionF64(context);
-    PROPAGATE_ERROR();
-    for (uint32_t i = 1; i &lt; numberOfArguments; ++i) {
-        ContextExpression expression = parseExpressionF64(context);
-        PROPAGATE_ERROR();
-        current = context.buildMinOrMaxF64(current, expression, op);
-    }
-    return current;
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseExpressionVoid(Context&amp; context)
-{
-    WASMOpExpressionVoid op;
-    READ_OP_EXPRESSION_VOID_OR_FAIL(op, &quot;Cannot read the void expression opcode.&quot;);
-    switch (op) {
-    case WASMOpExpressionVoid::CallInternal:
-        return parseCallInternal(context, WASMOpKind::Expression, WASMExpressionType::Void);
-    case WASMOpExpressionVoid::CallIndirect:
-        return parseCallIndirect(context, WASMOpKind::Expression, WASMExpressionType::Void);
-    case WASMOpExpressionVoid::CallImport:
-        return parseCallImport(context, WASMOpKind::Expression, WASMExpressionType::Void);
-    default:
-        RELEASE_ASSERT_NOT_REACHED();
-    }
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseGetLocalExpression(Context&amp; context, WASMType type, uint32_t localIndex)
-{
-    FAIL_IF_FALSE(localIndex &lt; m_localTypes.size(), &quot;The local index is incorrect.&quot;);
-    FAIL_IF_FALSE(m_localTypes[localIndex] == type, &quot;Expected a local of type &quot; + nameOfType(type) + '.');
-    return context.buildGetLocal(localIndex, type);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseGetLocalExpression(Context&amp; context, WASMType type)
-{
-    uint32_t localIndex;
-    READ_COMPACT_UINT32_OR_FAIL(localIndex, &quot;Cannot read the local index.&quot;);
-    return parseGetLocalExpression(context, type, localIndex);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseGetGlobalExpression(Context&amp; context, WASMType type)
-{
-    uint32_t globalIndex;
-    READ_COMPACT_UINT32_OR_FAIL(globalIndex, &quot;Cannot read the global index.&quot;);
-    FAIL_IF_FALSE(globalIndex &lt; m_module-&gt;globalVariableTypes().size(), &quot;The global index is incorrect.&quot;);
-    FAIL_IF_FALSE(m_module-&gt;globalVariableTypes()[globalIndex] == type, &quot;Expected a global of type &quot; + nameOfType(type) + '.');
-    return context.buildGetGlobal(globalIndex, type);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseSetLocal(Context&amp; context, WASMOpKind opKind, WASMExpressionType expressionType, uint32_t localIndex)
-{
-    FAIL_IF_FALSE(localIndex &lt; m_localTypes.size(), &quot;The local variable index is incorrect.&quot;);
-    WASMType type = m_localTypes[localIndex];
-    if (opKind == WASMOpKind::Expression)
-        FAIL_IF_FALSE(expressionType == WASMExpressionType(type), &quot;The type doesn't match.&quot;);
-    ContextExpression expression = parseExpression(context, WASMExpressionType(type));
-    PROPAGATE_ERROR();
-    return context.buildSetLocal(opKind, localIndex, expression, type);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseSetLocal(Context&amp; context, WASMOpKind opKind, WASMExpressionType expressionType)
-{
-    uint32_t localIndex;
-    READ_COMPACT_UINT32_OR_FAIL(localIndex, &quot;Cannot read the local index.&quot;);
-    return parseSetLocal(context, opKind, expressionType, localIndex);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseSetGlobal(Context&amp; context, WASMOpKind opKind, WASMExpressionType expressionType, uint32_t globalIndex)
-{
-    FAIL_IF_FALSE(globalIndex &lt; m_module-&gt;globalVariableTypes().size(), &quot;The global index is incorrect.&quot;);
-    WASMType type = m_module-&gt;globalVariableTypes()[globalIndex];
-    if (opKind == WASMOpKind::Expression)
-        FAIL_IF_FALSE(expressionType == WASMExpressionType(type), &quot;The type doesn't match.&quot;);
-    ContextExpression expression = parseExpression(context, WASMExpressionType(type));
-    PROPAGATE_ERROR();
-    return context.buildSetGlobal(opKind, globalIndex, expression, type);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseSetGlobal(Context&amp; context, WASMOpKind opKind, WASMExpressionType expressionType)
-{
-    uint32_t globalIndex;
-    READ_COMPACT_UINT32_OR_FAIL(globalIndex, &quot;Cannot read the global index.&quot;);
-    return parseSetGlobal(context, opKind, expressionType, globalIndex);
-}
-
-template &lt;class Context&gt;
-ContextMemoryAddress WASMFunctionParser::parseMemoryAddress(Context&amp; context, MemoryAccessOffsetMode offsetMode)
-{
-    uint32_t offset = 0;
-    if (offsetMode == MemoryAccessOffsetMode::WithOffset)
-        READ_COMPACT_UINT32_OR_FAIL(offset, &quot;Cannot read the address offset.&quot;);
-    ContextExpression index = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-    return ContextMemoryAddress(index, offset);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseLoad(Context&amp; context, WASMExpressionType expressionType, WASMMemoryType memoryType, MemoryAccessOffsetMode offsetMode, MemoryAccessConversion conversion)
-{
-    FAIL_IF_FALSE(m_module-&gt;arrayBuffer(), &quot;An ArrayBuffer is not provided.&quot;);
-    const ContextMemoryAddress&amp; memoryAddress = parseMemoryAddress(context, offsetMode);
-    PROPAGATE_ERROR();
-    return context.buildLoad(memoryAddress, expressionType, memoryType, conversion);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseStore(Context&amp; context, WASMOpKind opKind, WASMExpressionType expressionType, WASMMemoryType memoryType, MemoryAccessOffsetMode offsetMode)
-{
-    FAIL_IF_FALSE(m_module-&gt;arrayBuffer(), &quot;An ArrayBuffer is not provided.&quot;);
-    const ContextMemoryAddress&amp; memoryAddress = parseMemoryAddress(context, offsetMode);
-    PROPAGATE_ERROR();
-
-    ContextExpression value = parseExpression(context, expressionType);
-    PROPAGATE_ERROR();
-    return context.buildStore(opKind, memoryAddress, expressionType, memoryType, value);
-}
-
-template &lt;class Context&gt;
-ContextExpressionList WASMFunctionParser::parseCallArguments(Context&amp; context, const Vector&lt;WASMType&gt;&amp; arguments)
-{
-    ContextExpressionList argumentList;
-    for (size_t i = 0; i &lt; arguments.size(); ++i) {
-        ContextExpression expression = parseExpression(context, WASMExpressionType(arguments[i]));
-        PROPAGATE_ERROR();
-        context.appendExpressionList(argumentList, expression);
-    }
-    return argumentList;
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseCallInternal(Context&amp; context, WASMOpKind opKind, WASMExpressionType returnType)
-{
-    uint32_t functionIndex;
-    READ_COMPACT_UINT32_OR_FAIL(functionIndex, &quot;Cannot read the function index.&quot;);
-    FAIL_IF_FALSE(functionIndex &lt; m_module-&gt;functionDeclarations().size(), &quot;The function index is incorrect.&quot;);
-    const WASMSignature&amp; signature = m_module-&gt;signatures()[m_module-&gt;functionDeclarations()[functionIndex].signatureIndex];
-    if (opKind == WASMOpKind::Expression)
-        FAIL_IF_FALSE(signature.returnType == returnType, &quot;Wrong return type.&quot;);
-
-    ContextExpressionList argumentList = parseCallArguments(context, signature.arguments);
-    PROPAGATE_ERROR();
-    return context.buildCallInternal(functionIndex, argumentList, signature, returnType);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseCallIndirect(Context&amp; context, WASMOpKind opKind, WASMExpressionType returnType)
-{
-    uint32_t functionPointerTableIndex;
-    READ_COMPACT_UINT32_OR_FAIL(functionPointerTableIndex, &quot;Cannot read the function pointer table index.&quot;);
-    FAIL_IF_FALSE(functionPointerTableIndex &lt; m_module-&gt;functionPointerTables().size(), &quot;The function pointer table index is incorrect.&quot;);
-    const WASMFunctionPointerTable&amp; functionPointerTable = m_module-&gt;functionPointerTables()[functionPointerTableIndex];
-    const WASMSignature&amp; signature = m_module-&gt;signatures()[functionPointerTable.signatureIndex];
-    if (opKind == WASMOpKind::Expression)
-        FAIL_IF_FALSE(signature.returnType == returnType, &quot;Wrong return type.&quot;);
-
-    ContextExpression index = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-
-    ContextExpressionList argumentList = parseCallArguments(context, signature.arguments);
-    PROPAGATE_ERROR();
-    return context.buildCallIndirect(functionPointerTableIndex, index, argumentList, signature, returnType);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseCallImport(Context&amp; context, WASMOpKind opKind, WASMExpressionType returnType)
-{
-    uint32_t functionImportSignatureIndex;
-    READ_COMPACT_UINT32_OR_FAIL(functionImportSignatureIndex, &quot;Cannot read the function import signature index.&quot;);
-    FAIL_IF_FALSE(functionImportSignatureIndex &lt; m_module-&gt;functionImportSignatures().size(), &quot;The function import signature index is incorrect.&quot;);
-    const WASMFunctionImportSignature&amp; functionImportSignature = m_module-&gt;functionImportSignatures()[functionImportSignatureIndex];
-    const WASMSignature&amp; signature = m_module-&gt;signatures()[functionImportSignature.signatureIndex];
-    if (opKind == WASMOpKind::Expression)
-        FAIL_IF_FALSE(signature.returnType == returnType, &quot;Wrong return type.&quot;);
-
-    ContextExpressionList argumentList = parseCallArguments(context, signature.arguments);
-    PROPAGATE_ERROR();
-    return context.buildCallImport(functionImportSignature.functionImportIndex, argumentList, signature, returnType);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseConditional(Context&amp; context, WASMExpressionType expressionType)
-{
-    ContextJumpTarget elseTarget;
-    ContextJumpTarget end;
-
-    ContextExpression condition = parseExpressionI32(context);
-    PROPAGATE_ERROR();
-
-    context.jumpToTargetIf(Context::JumpCondition::Zero, condition, elseTarget);
-
-    parseExpression(context, expressionType);
-    PROPAGATE_ERROR();
-    
-    context.jumpToTarget(end);
-    context.linkTarget(elseTarget);
-
-    // We use discard() here to decrement the stack top in the baseline JIT.
-    context.discard(UNUSED);
-    parseExpression(context, expressionType);
-    PROPAGATE_ERROR();
-    
-    context.linkTarget(end);
-    return UNUSED;
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseComma(Context&amp; context, WASMExpressionType expressionType)
-{
-    WASMExpressionType leftExpressionType;
-    READ_EXPRESSION_TYPE_OR_FAIL(leftExpressionType, &quot;Cannot read the expression type.&quot;);
-    ContextExpression leftExpression = parseExpression(context, leftExpressionType);
-    PROPAGATE_ERROR();
-    if (leftExpressionType != WASMExpressionType::Void)
-        context.discard(leftExpression);
-    return parseExpression(context, expressionType);
-}
-
-template &lt;class Context&gt;
-ContextExpression WASMFunctionParser::parseConvertType(Context&amp; context, WASMExpressionType fromType, WASMExpressionType toType, WASMTypeConversion conversion)
-{
-    ContextExpression expression = parseExpression(context, fromType);
-    PROPAGATE_ERROR();
-
-    return context.buildConvertType(expression, fromType, toType, conversion);
-}
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMFunctionParserh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.h (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.h        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/wasm/WASMFunctionParser.h        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1,148 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WASMFunctionParser_h
-#define WASMFunctionParser_h
-
-#if ENABLE(WEBASSEMBLY)
-
-#include &quot;SourceCode.h&quot;
-#include &quot;WASMReader.h&quot;
-
-#define ContextExpression typename Context::Expression
-#define ContextStatement typename Context::Statement
-#define ContextExpressionList typename Context::ExpressionList
-#define ContextMemoryAddress typename Context::MemoryAddress
-#define ContextJumpTarget typename Context::JumpTarget
-
-namespace JSC {
-
-class CodeBlock;
-class JSWASMModule;
-class VM;
-
-class WASMFunctionParser {
-public:
-    static bool checkSyntax(JSWASMModule*, const SourceCode&amp;, size_t functionIndex, unsigned startOffsetInSource, unsigned&amp; endOffsetInSource, unsigned&amp; stackHeight, String&amp; errorMessage);
-    static void compile(VM&amp;, CodeBlock*, JSWASMModule*, const SourceCode&amp;, size_t functionIndex);
-
-private:
-    WASMFunctionParser(JSWASMModule* module, const SourceCode&amp; source, size_t functionIndex)
-        : m_module(module)
-        , m_reader(static_cast&lt;WebAssemblySourceProvider*&gt;(source.provider())-&gt;data())
-        , m_functionIndex(functionIndex)
-        , m_breakScopeDepth(0)
-        , m_continueScopeDepth(0)
-        , m_labelDepth(0)
-    {
-    }
-
-    template &lt;class Context&gt; bool parseFunction(Context&amp;);
-    bool parseLocalVariables();
-
-    template &lt;class Context&gt; ContextStatement parseStatement(Context&amp;);
-    template &lt;class Context&gt; ContextStatement parseReturnStatement(Context&amp;);
-    template &lt;class Context&gt; ContextStatement parseBlockStatement(Context&amp;);
-    template &lt;class Context&gt; ContextStatement parseIfStatement(Context&amp;);
-    template &lt;class Context&gt; ContextStatement parseIfElseStatement(Context&amp;);
-    template &lt;class Context&gt; ContextStatement parseWhileStatement(Context&amp;);
-    template &lt;class Context&gt; ContextStatement parseDoStatement(Context&amp;);
-    template &lt;class Context&gt; ContextStatement parseLabelStatement(Context&amp;);
-    template &lt;class Context&gt; ContextStatement parseBreakStatement(Context&amp;);
-    template &lt;class Context&gt; ContextStatement parseBreakLabelStatement(Context&amp;);
-    template &lt;class Context&gt; ContextStatement parseContinueStatement(Context&amp;);
-    template &lt;class Context&gt; ContextStatement parseContinueLabelStatement(Context&amp;);
-    template &lt;class Context&gt; ContextStatement parseSwitchStatement(Context&amp;);
-
-    template &lt;class Context&gt; ContextExpression parseExpression(Context&amp;, WASMExpressionType);
-
-    template &lt;class Context&gt; ContextExpression parseExpressionI32(Context&amp;);
-    template &lt;class Context&gt; ContextExpression parseConstantPoolIndexExpressionI32(Context&amp;, uint32_t constantPoolIndex);
-    template &lt;class Context&gt; ContextExpression parseConstantPoolIndexExpressionI32(Context&amp;);
-    template &lt;class Context&gt; ContextExpression parseImmediateExpressionI32(Context&amp;, uint32_t immediate);
-    template &lt;class Context&gt; ContextExpression parseImmediateExpressionI32(Context&amp;);
-    template &lt;class Context&gt; ContextExpression parseUnaryExpressionI32(Context&amp;, WASMOpExpressionI32);
-    template &lt;class Context&gt; ContextExpression parseBinaryExpressionI32(Context&amp;, WASMOpExpressionI32);
-    template &lt;class Context&gt; ContextExpression parseRelationalI32ExpressionI32(Context&amp;, WASMOpExpressionI32);
-    template &lt;class Context&gt; ContextExpression parseRelationalF32ExpressionI32(Context&amp;, WASMOpExpressionI32);
-    template &lt;class Context&gt; ContextExpression parseRelationalF64ExpressionI32(Context&amp;, WASMOpExpressionI32);
-    template &lt;class Context&gt; ContextExpression parseMinOrMaxExpressionI32(Context&amp;, WASMOpExpressionI32);
-
-    template &lt;class Context&gt; ContextExpression parseExpressionF32(Context&amp;);
-    template &lt;class Context&gt; ContextExpression parseConstantPoolIndexExpressionF32(Context&amp;, uint32_t constantIndex);
-    template &lt;class Context&gt; ContextExpression parseConstantPoolIndexExpressionF32(Context&amp;);
-    template &lt;class Context&gt; ContextExpression parseImmediateExpressionF32(Context&amp;);
-    template &lt;class Context&gt; ContextExpression parseUnaryExpressionF32(Context&amp;, WASMOpExpressionF32);
-    template &lt;class Context&gt; ContextExpression parseBinaryExpressionF32(Context&amp;, WASMOpExpressionF32);
-
-    template &lt;class Context&gt; ContextExpression parseExpressionF64(Context&amp;);
-    template &lt;class Context&gt; ContextExpression parseConstantPoolIndexExpressionF64(Context&amp;, uint32_t constantIndex);
-    template &lt;class Context&gt; ContextExpression parseConstantPoolIndexExpressionF64(Context&amp;);
-    template &lt;class Context&gt; ContextExpression parseImmediateExpressionF64(Context&amp;);
-    template &lt;class Context&gt; ContextExpression parseUnaryExpressionF64(Context&amp;, WASMOpExpressionF64);
-    template &lt;class Context&gt; ContextExpression parseBinaryExpressionF64(Context&amp;, WASMOpExpressionF64);
-    template &lt;class Context&gt; ContextExpression parseMinOrMaxExpressionF64(Context&amp;, WASMOpExpressionF64);
-
-    template &lt;class Context&gt; ContextExpression parseExpressionVoid(Context&amp;);
-
-    template &lt;class Context&gt; ContextExpression parseGetLocalExpression(Context&amp;, WASMType, uint32_t localIndex);
-    template &lt;class Context&gt; ContextExpression parseGetLocalExpression(Context&amp;, WASMType);
-    template &lt;class Context&gt; ContextExpression parseGetGlobalExpression(Context&amp;, WASMType);
-    template &lt;class Context&gt; ContextExpression parseSetLocal(Context&amp;, WASMOpKind, WASMExpressionType, uint32_t localIndex);
-    template &lt;class Context&gt; ContextExpression parseSetLocal(Context&amp;, WASMOpKind, WASMExpressionType);
-    template &lt;class Context&gt; ContextExpression parseSetGlobal(Context&amp;, WASMOpKind, WASMExpressionType, uint32_t globalIndex);
-    template &lt;class Context&gt; ContextExpression parseSetGlobal(Context&amp;, WASMOpKind, WASMExpressionType);
-    template &lt;class Context&gt; ContextMemoryAddress parseMemoryAddress(Context&amp;, MemoryAccessOffsetMode);
-    template &lt;class Context&gt; ContextExpression parseLoad(Context&amp;, WASMExpressionType, WASMMemoryType, MemoryAccessOffsetMode, MemoryAccessConversion = MemoryAccessConversion::NoConversion);
-    template &lt;class Context&gt; ContextExpression parseStore(Context&amp;, WASMOpKind, WASMExpressionType, WASMMemoryType, MemoryAccessOffsetMode);
-    template &lt;class Context&gt; ContextExpressionList parseCallArguments(Context&amp;, const Vector&lt;WASMType&gt;&amp; arguments);
-    template &lt;class Context&gt; ContextExpression parseCallInternal(Context&amp;, WASMOpKind, WASMExpressionType returnType);
-    template &lt;class Context&gt; ContextExpression parseCallIndirect(Context&amp;, WASMOpKind, WASMExpressionType returnType);
-    template &lt;class Context&gt; ContextExpression parseCallImport(Context&amp;, WASMOpKind, WASMExpressionType returnType);
-    template &lt;class Context&gt; ContextExpression parseConditional(Context&amp;, WASMExpressionType);
-    template &lt;class Context&gt; ContextExpression parseComma(Context&amp;, WASMExpressionType);
-    template &lt;class Context&gt; ContextExpression parseConvertType(Context&amp;, WASMExpressionType fromType, WASMExpressionType toType, WASMTypeConversion);
-
-    JSWASMModule* m_module;
-    WASMReader m_reader;
-    size_t m_functionIndex;
-    String m_errorMessage;
-
-    WASMExpressionType m_returnType;
-    Vector&lt;WASMType&gt; m_localTypes;
-    uint32_t m_numberOfI32LocalVariables;
-    uint32_t m_numberOfF32LocalVariables;
-    uint32_t m_numberOfF64LocalVariables;
-
-    unsigned m_breakScopeDepth;
-    unsigned m_continueScopeDepth;
-    unsigned m_labelDepth;
-};
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)
-
-#endif // WASMFunctionParser_h
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMFunctionSyntaxCheckerh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/WASMFunctionSyntaxChecker.h (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMFunctionSyntaxChecker.h        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/wasm/WASMFunctionSyntaxChecker.h        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1,287 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WASMFunctionSyntaxChecker_h
-#define WASMFunctionSyntaxChecker_h
-
-#if ENABLE(WEBASSEMBLY)
-
-#define UNUSED 0
-
-namespace JSC {
-
-class WASMFunctionSyntaxChecker {
-public:
-    typedef int Expression;
-    typedef int Statement;
-    typedef int ExpressionList;
-    struct MemoryAddress {
-        MemoryAddress(void*) { }
-        MemoryAddress(int, uint32_t) { }
-    };
-    typedef int JumpTarget;
-    enum class JumpCondition { Zero, NonZero };
-
-    void startFunction(const Vector&lt;WASMType&gt;&amp; arguments, uint32_t numberOfI32LocalVariables, uint32_t numberOfF32LocalVariables, uint32_t numberOfF64LocalVariables)
-    {
-        m_numberOfLocals = arguments.size() + numberOfI32LocalVariables + numberOfF32LocalVariables + numberOfF64LocalVariables;
-    }
-
-    void endFunction()
-    {
-        ASSERT(!m_tempStackTop);
-    }
-
-    int buildSetLocal(WASMOpKind opKind, uint32_t, int, WASMType)
-    {
-        if (opKind == WASMOpKind::Statement)
-            m_tempStackTop--;
-        return UNUSED;
-    }
-
-    int buildSetGlobal(WASMOpKind opKind, uint32_t, int, WASMType)
-    {
-        if (opKind == WASMOpKind::Statement)
-            m_tempStackTop--;
-        return UNUSED;
-    }
-
-    void buildReturn(int, WASMExpressionType returnType)
-    {
-        if (returnType != WASMExpressionType::Void)
-            m_tempStackTop--;
-    }
-
-    int buildImmediateI32(uint32_t)
-    {
-        m_tempStackTop++;
-        updateTempStackHeight();
-        return UNUSED;
-    }
-
-    int buildImmediateF32(float)
-    {
-        m_tempStackTop++;
-        updateTempStackHeight();
-        return UNUSED;
-    }
-
-    int buildImmediateF64(double)
-    {
-        m_tempStackTop++;
-        updateTempStackHeight();
-        return UNUSED;
-    }
-
-    int buildGetLocal(uint32_t, WASMType)
-    {
-        m_tempStackTop++;
-        updateTempStackHeight();
-        return UNUSED;
-    }
-
-    int buildGetGlobal(uint32_t, WASMType)
-    {
-        m_tempStackTop++;
-        updateTempStackHeight();
-        return UNUSED;
-    }
-
-    int buildConvertType(int, WASMExpressionType, WASMExpressionType, WASMTypeConversion)
-    {
-        return UNUSED;
-    }
-
-    int buildLoad(const MemoryAddress&amp;, WASMExpressionType, WASMMemoryType, MemoryAccessConversion)
-    {
-        return UNUSED;
-    }
-
-    int buildStore(WASMOpKind opKind, const MemoryAddress&amp;, WASMExpressionType, WASMMemoryType, int)
-    {
-        m_tempStackTop -= 2;
-        if (opKind == WASMOpKind::Expression)
-            m_tempStackTop++;
-        return UNUSED;
-    }
-
-    int buildUnaryI32(int, WASMOpExpressionI32)
-    {
-        return UNUSED;
-    }
-
-    int buildUnaryF32(int, WASMOpExpressionF32)
-    {
-        return UNUSED;
-    }
-
-    int buildUnaryF64(int, WASMOpExpressionF64)
-    {
-        return UNUSED;
-    }
-
-    int buildBinaryI32(int, int, WASMOpExpressionI32)
-    {
-        m_tempStackTop--;
-        return UNUSED;
-    }
-
-    int buildBinaryF32(int, int, WASMOpExpressionF32)
-    {
-        m_tempStackTop--;
-        return UNUSED;
-    }
-
-    int buildBinaryF64(int, int, WASMOpExpressionF64)
-    {
-        m_tempStackTop--;
-        return UNUSED;
-    }
-
-    int buildRelationalI32(int, int, WASMOpExpressionI32)
-    {
-        m_tempStackTop--;
-        return UNUSED;
-    }
-
-    int buildRelationalF32(int, int, WASMOpExpressionI32)
-    {
-        m_tempStackTop--;
-        return UNUSED;
-    }
-
-    int buildRelationalF64(int, int, WASMOpExpressionI32)
-    {
-        m_tempStackTop--;
-        return UNUSED;
-    }
-
-    int buildMinOrMaxI32(int, int, WASMOpExpressionI32)
-    {
-        m_tempStackTop--;
-        return UNUSED;
-    }
-
-    int buildMinOrMaxF64(int, int, WASMOpExpressionF64)
-    {
-        m_tempStackTop--;
-        return UNUSED;
-    }
-
-    int buildCallInternal(uint32_t, int, const WASMSignature&amp; signature, WASMExpressionType returnType)
-    {
-        size_t argumentCount = signature.arguments.size();
-        updateTempStackHeightForCall(argumentCount);
-        m_tempStackTop -= argumentCount;
-        if (returnType != WASMExpressionType::Void) {
-            m_tempStackTop++;
-            updateTempStackHeight();
-        }
-        return UNUSED;
-    }
-
-    int buildCallImport(uint32_t, int, const WASMSignature&amp; signature, WASMExpressionType returnType)
-    {
-        size_t argumentCount = signature.arguments.size();
-        updateTempStackHeightForCall(argumentCount);
-        m_tempStackTop -= argumentCount;
-        if (returnType != WASMExpressionType::Void) {
-            m_tempStackTop++;
-            updateTempStackHeight();
-        }
-        return UNUSED;
-    }
-
-    int buildCallIndirect(uint32_t, int, int, const WASMSignature&amp; signature, WASMExpressionType returnType)
-    {
-        size_t argumentCount = signature.arguments.size();
-        updateTempStackHeightForCall(argumentCount);
-        m_tempStackTop -= argumentCount + 1;
-        if (returnType != WASMExpressionType::Void)
-            m_tempStackTop++;
-        return UNUSED;
-    }
-
-    void appendExpressionList(int&amp;, int) { }
-
-    void discard(int)
-    {
-        m_tempStackTop--;
-    }
-
-    void linkTarget(const int&amp;) { }
-    void jumpToTarget(const int&amp;) { }
-    void jumpToTargetIf(JumpCondition, int, const int&amp;)
-    {
-        m_tempStackTop--;
-    }
-
-    void startLoop() { }
-    void endLoop() { }
-    void startSwitch() { }
-    void endSwitch() { }
-    void startLabel() { }
-    void endLabel() { }
-
-    int breakTarget() { return UNUSED; }
-    int continueTarget() { return UNUSED; }
-    int breakLabelTarget(uint32_t) { return UNUSED; }
-    int continueLabelTarget(uint32_t) { return UNUSED; }
-
-    void buildSwitch(int, const Vector&lt;int64_t&gt;&amp;, const Vector&lt;int&gt;&amp;, const int&amp;)
-    {
-        m_tempStackTop--;
-    }
-
-    unsigned stackHeight()
-    {
-        return m_numberOfLocals + m_tempStackHeight;
-    }
-
-private:
-    void updateTempStackHeight()
-    {
-        if (m_tempStackTop &gt; m_tempStackHeight)
-            m_tempStackHeight = m_tempStackTop;
-    }
-
-    void updateTempStackHeightForCall(size_t argumentCount)
-    {
-        // Boxed arguments + this argument + call frame header + maximum padding.
-        m_tempStackTop += argumentCount + 1 + CallFrame::headerSizeInRegisters + 1;
-        updateTempStackHeight();
-        m_tempStackTop -= argumentCount + 1 + CallFrame::headerSizeInRegisters + 1;
-    }
-
-    unsigned m_numberOfLocals;
-    unsigned m_tempStackTop { 0 };
-    unsigned m_tempStackHeight { 0 };
-};
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)
-
-#endif // WASMFunctionSyntaxChecker_h
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMModuleParsercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/WASMModuleParser.cpp (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMModuleParser.cpp        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/wasm/WASMModuleParser.cpp        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1,377 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;WASMModuleParser.h&quot;
-
-#if ENABLE(WEBASSEMBLY)
-
-#include &quot;JSArrayBuffer.h&quot;
-#include &quot;JSCInlines.h&quot;
-#include &quot;JSWASMModule.h&quot;
-#include &quot;StrongInlines.h&quot;
-#include &quot;WASMConstants.h&quot;
-#include &quot;WASMFunctionParser.h&quot;
-#include &lt;wtf/MathExtras.h&gt;
-
-#define FAIL_WITH_MESSAGE(errorMessage) do { m_errorMessage = errorMessage; return; } while (0)
-#define READ_UINT32_OR_FAIL(result, errorMessage) do { if (!m_reader.readUInt32(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_FLOAT_OR_FAIL(result, errorMessage) do { if (!m_reader.readFloat(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_DOUBLE_OR_FAIL(result, errorMessage) do { if (!m_reader.readDouble(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_COMPACT_UINT32_OR_FAIL(result, errorMessage) do { if (!m_reader.readCompactUInt32(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_STRING_OR_FAIL(result, errorMessage) do { if (!m_reader.readString(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_TYPE_OR_FAIL(result, errorMessage) do { if (!m_reader.readType(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_EXPRESSION_TYPE_OR_FAIL(result, errorMessage) do { if (!m_reader.readExpressionType(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define READ_EXPORT_FORMAT_OR_FAIL(result, errorMessage) do { if (!m_reader.readExportFormat(result)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define FAIL_IF_FALSE(condition, errorMessage) do { if (!(condition)) FAIL_WITH_MESSAGE(errorMessage); } while (0)
-#define PROPAGATE_ERROR() do { if (!m_errorMessage.isNull()) return; } while (0)
-
-namespace JSC {
-
-WASMModuleParser::WASMModuleParser(VM&amp; vm, JSGlobalObject* globalObject, const SourceCode&amp; source, JSObject* imports, JSArrayBuffer* arrayBuffer)
-    : m_vm(vm)
-    , m_globalObject(vm, globalObject)
-    , m_source(source)
-    , m_imports(vm, imports)
-    , m_reader(static_cast&lt;WebAssemblySourceProvider*&gt;(source.provider())-&gt;data())
-    , m_module(vm, JSWASMModule::create(vm, globalObject-&gt;wasmModuleStructure(), arrayBuffer))
-{
-}
-
-JSWASMModule* WASMModuleParser::parse(ExecState* exec, String&amp; errorMessage)
-{
-    parseModule(exec);
-    if (!m_errorMessage.isNull()) {
-        errorMessage = m_errorMessage;
-        return nullptr;
-    }
-    return m_module.get();
-}
-
-void WASMModuleParser::parseModule(ExecState* exec)
-{
-    uint32_t magicNumber;
-    READ_UINT32_OR_FAIL(magicNumber, &quot;Cannot read the magic number.&quot;);
-    FAIL_IF_FALSE(magicNumber == wasmMagicNumber, &quot;The magic number is incorrect.&quot;);
-
-    uint32_t outputSizeInASMJS;
-    READ_UINT32_OR_FAIL(outputSizeInASMJS, &quot;Cannot read the output size in asm.js format.&quot;);
-
-    parseConstantPoolSection();
-    PROPAGATE_ERROR();
-    parseSignatureSection();
-    PROPAGATE_ERROR();
-    parseFunctionImportSection(exec);
-    PROPAGATE_ERROR();
-    parseGlobalSection(exec);
-    PROPAGATE_ERROR();
-    parseFunctionDeclarationSection();
-    PROPAGATE_ERROR();
-    parseFunctionPointerTableSection();
-    PROPAGATE_ERROR();
-    parseFunctionDefinitionSection();
-    PROPAGATE_ERROR();
-    parseExportSection();
-    PROPAGATE_ERROR();
-
-    FAIL_IF_FALSE(!m_module-&gt;arrayBuffer() || m_module-&gt;arrayBuffer()-&gt;impl()-&gt;byteLength() &lt; (1u &lt;&lt; 31), &quot;The ArrayBuffer's length must be less than 2^31.&quot;);
-}
-
-void WASMModuleParser::parseConstantPoolSection()
-{
-    uint32_t numberOfI32Constants;
-    uint32_t numberOfF32Constants;
-    uint32_t numberOfF64Constants;
-    READ_COMPACT_UINT32_OR_FAIL(numberOfI32Constants, &quot;Cannot read the number of int32 constants.&quot;);
-    READ_COMPACT_UINT32_OR_FAIL(numberOfF32Constants, &quot;Cannot read the number of float32 constants.&quot;);
-    READ_COMPACT_UINT32_OR_FAIL(numberOfF64Constants, &quot;Cannot read the number of float64 constants.&quot;);
-    m_module-&gt;i32Constants().reserveInitialCapacity(numberOfI32Constants);
-    m_module-&gt;f32Constants().reserveInitialCapacity(numberOfF32Constants);
-    m_module-&gt;f64Constants().reserveInitialCapacity(numberOfF64Constants);
-
-    for (uint32_t i = 0; i &lt; numberOfI32Constants; ++i) {
-        uint32_t constant;
-        READ_COMPACT_UINT32_OR_FAIL(constant, &quot;Cannot read an int32 constant.&quot;);
-        m_module-&gt;i32Constants().uncheckedAppend(constant);
-    }
-    for (uint32_t i = 0; i &lt; numberOfF32Constants; ++i) {
-        float constant;
-        READ_FLOAT_OR_FAIL(constant, &quot;Cannot read a float32 constant.&quot;);
-        m_module-&gt;f32Constants().uncheckedAppend(constant);
-    }
-    for (uint32_t i = 0; i &lt; numberOfF64Constants; ++i) {
-        double constant;
-        READ_DOUBLE_OR_FAIL(constant, &quot;Cannot read a float64 constant.&quot;);
-        m_module-&gt;f64Constants().uncheckedAppend(constant);
-    }
-}
-
-void WASMModuleParser::parseSignatureSection()
-{
-    uint32_t numberOfSignatures;
-    READ_COMPACT_UINT32_OR_FAIL(numberOfSignatures, &quot;Cannot read the number of signatures.&quot;);
-    m_module-&gt;signatures().reserveInitialCapacity(numberOfSignatures);
-    for (uint32_t signatureIndex = 0; signatureIndex &lt; numberOfSignatures; ++signatureIndex) {
-        WASMSignature signature;
-        READ_EXPRESSION_TYPE_OR_FAIL(signature.returnType, &quot;Cannot read the return type.&quot;);
-        uint32_t argumentCount;
-        READ_COMPACT_UINT32_OR_FAIL(argumentCount, &quot;Cannot read the number of arguments.&quot;);
-        signature.arguments.reserveInitialCapacity(argumentCount);
-        for (uint32_t argumentIndex = 0; argumentIndex &lt; argumentCount; ++argumentIndex) {
-            WASMType type;
-            READ_TYPE_OR_FAIL(type, &quot;Cannot read the type of an argument.&quot;);
-            signature.arguments.uncheckedAppend(type);
-        }
-        m_module-&gt;signatures().uncheckedAppend(signature);
-    }
-}
-
-void WASMModuleParser::parseFunctionImportSection(ExecState* exec)
-{
-    uint32_t numberOfFunctionImports;
-    uint32_t numberOfFunctionImportSignatures;
-    READ_COMPACT_UINT32_OR_FAIL(numberOfFunctionImports, &quot;Cannot read the number of function imports.&quot;);
-    READ_COMPACT_UINT32_OR_FAIL(numberOfFunctionImportSignatures, &quot;Cannot read the number of function import signatures.&quot;);
-    m_module-&gt;functionImports().reserveInitialCapacity(numberOfFunctionImports);
-    m_module-&gt;functionImportSignatures().reserveInitialCapacity(numberOfFunctionImportSignatures);
-    m_module-&gt;importedFunctions().reserveInitialCapacity(numberOfFunctionImports);
-
-    for (uint32_t functionImportIndex = 0; functionImportIndex &lt; numberOfFunctionImports; ++functionImportIndex) {
-        WASMFunctionImport functionImport;
-        READ_STRING_OR_FAIL(functionImport.functionName, &quot;Cannot read the function import name.&quot;);
-        m_module-&gt;functionImports().uncheckedAppend(functionImport);
-
-        uint32_t numberOfSignatures;
-        READ_COMPACT_UINT32_OR_FAIL(numberOfSignatures, &quot;Cannot read the number of signatures.&quot;);
-        FAIL_IF_FALSE(numberOfSignatures &lt;= numberOfFunctionImportSignatures - m_module-&gt;functionImportSignatures().size(), &quot;The number of signatures is incorrect.&quot;);
-
-        for (uint32_t i = 0; i &lt; numberOfSignatures; ++i) {
-            WASMFunctionImportSignature functionImportSignature;
-            READ_COMPACT_UINT32_OR_FAIL(functionImportSignature.signatureIndex, &quot;Cannot read the signature index.&quot;);
-            FAIL_IF_FALSE(functionImportSignature.signatureIndex &lt; m_module-&gt;signatures().size(), &quot;The signature index is incorrect.&quot;);
-            functionImportSignature.functionImportIndex = functionImportIndex;
-            m_module-&gt;functionImportSignatures().uncheckedAppend(functionImportSignature);
-        }
-
-        JSValue value;
-        getImportedValue(exec, functionImport.functionName, value);
-        PROPAGATE_ERROR();
-        FAIL_IF_FALSE(value.isFunction(), &quot;\&quot;&quot; + functionImport.functionName + &quot;\&quot; is not a function.&quot;);
-        JSFunction* function = jsCast&lt;JSFunction*&gt;(value.asCell());
-        m_module-&gt;importedFunctions().uncheckedAppend(WriteBarrier&lt;JSFunction&gt;(m_vm, m_module.get(), function));
-    }
-    FAIL_IF_FALSE(m_module-&gt;functionImportSignatures().size() == numberOfFunctionImportSignatures, &quot;The number of function import signatures is incorrect.&quot;);
-}
-
-void WASMModuleParser::parseGlobalSection(ExecState* exec)
-{
-    uint32_t numberOfInternalI32GlobalVariables;
-    uint32_t numberOfInternalF32GlobalVariables;
-    uint32_t numberOfInternalF64GlobalVariables;
-    uint32_t numberOfImportedI32GlobalVariables;
-    uint32_t numberOfImportedF32GlobalVariables;
-    uint32_t numberOfImportedF64GlobalVariables;
-    READ_COMPACT_UINT32_OR_FAIL(numberOfInternalI32GlobalVariables, &quot;Cannot read the number of internal int32 global variables.&quot;);
-    READ_COMPACT_UINT32_OR_FAIL(numberOfInternalF32GlobalVariables, &quot;Cannot read the number of internal float32 global variables.&quot;);
-    READ_COMPACT_UINT32_OR_FAIL(numberOfInternalF64GlobalVariables, &quot;Cannot read the number of internal float64 global variables.&quot;);
-    READ_COMPACT_UINT32_OR_FAIL(numberOfImportedI32GlobalVariables, &quot;Cannot read the number of imported int32 global variables.&quot;);
-    READ_COMPACT_UINT32_OR_FAIL(numberOfImportedF32GlobalVariables, &quot;Cannot read the number of imported float32 global variables.&quot;);
-    READ_COMPACT_UINT32_OR_FAIL(numberOfImportedF64GlobalVariables, &quot;Cannot read the number of imported float64 global variables.&quot;);
-    uint32_t numberOfGlobalVariables = numberOfInternalI32GlobalVariables + numberOfInternalF32GlobalVariables + numberOfInternalF64GlobalVariables +
-        numberOfImportedI32GlobalVariables + numberOfImportedF32GlobalVariables + numberOfImportedF64GlobalVariables;
-
-    Vector&lt;WASMType&gt;&amp; globalVariableTypes = m_module-&gt;globalVariableTypes();
-    globalVariableTypes.reserveInitialCapacity(numberOfGlobalVariables);
-    Vector&lt;JSWASMModule::GlobalVariable&gt;&amp; globalVariables = m_module-&gt;globalVariables();
-    globalVariables.reserveInitialCapacity(numberOfGlobalVariables);
-    for (uint32_t i = 0; i &lt; numberOfInternalI32GlobalVariables; ++i) {
-        globalVariableTypes.uncheckedAppend(WASMType::I32);
-        globalVariables.uncheckedAppend(JSWASMModule::GlobalVariable(0));
-    }
-    for (uint32_t i = 0; i &lt; numberOfInternalF32GlobalVariables; ++i) {
-        globalVariableTypes.uncheckedAppend(WASMType::F32);
-        globalVariables.uncheckedAppend(JSWASMModule::GlobalVariable(0.0f));
-    }
-    for (uint32_t i = 0; i &lt; numberOfInternalF64GlobalVariables; ++i) {
-        globalVariableTypes.uncheckedAppend(WASMType::F64);
-        globalVariables.uncheckedAppend(JSWASMModule::GlobalVariable(0.0));
-    }
-    for (uint32_t i = 0; i &lt; numberOfImportedI32GlobalVariables; ++i) {
-        String importName;
-        READ_STRING_OR_FAIL(importName, &quot;Cannot read the import name of an int32 global variable.&quot;);
-        globalVariableTypes.uncheckedAppend(WASMType::I32);
-        JSValue value;
-        getImportedValue(exec, importName, value);
-        PROPAGATE_ERROR();
-        FAIL_IF_FALSE(value.isPrimitive() &amp;&amp; !value.isSymbol(), &quot;\&quot;&quot; + importName + &quot;\&quot; is not a primitive or is a Symbol.&quot;);
-        globalVariables.uncheckedAppend(JSWASMModule::GlobalVariable(value.toInt32(exec)));
-    }
-    for (uint32_t i = 0; i &lt; numberOfImportedF32GlobalVariables; ++i) {
-        String importName;
-        READ_STRING_OR_FAIL(importName, &quot;Cannot read the import name of a float32 global variable.&quot;);
-        globalVariableTypes.uncheckedAppend(WASMType::F32);
-        JSValue value;
-        getImportedValue(exec, importName, value);
-        PROPAGATE_ERROR();
-        FAIL_IF_FALSE(value.isPrimitive() &amp;&amp; !value.isSymbol(), &quot;\&quot;&quot; + importName + &quot;\&quot; is not a primitive or is a Symbol.&quot;);
-        globalVariables.uncheckedAppend(JSWASMModule::GlobalVariable(static_cast&lt;float&gt;(value.toNumber(exec))));
-    }
-    for (uint32_t i = 0; i &lt; numberOfImportedF64GlobalVariables; ++i) {
-        String importName;
-        READ_STRING_OR_FAIL(importName, &quot;Cannot read the import name of a float64 global variable.&quot;);
-        globalVariableTypes.uncheckedAppend(WASMType::F64);
-        JSValue value;
-        getImportedValue(exec, importName, value);
-        PROPAGATE_ERROR();
-        FAIL_IF_FALSE(value.isPrimitive() &amp;&amp; !value.isSymbol(), &quot;\&quot;&quot; + importName + &quot;\&quot; is not a primitive or is a Symbol.&quot;);
-        globalVariables.uncheckedAppend(JSWASMModule::GlobalVariable(value.toNumber(exec)));
-    }
-}
-
-void WASMModuleParser::parseFunctionDeclarationSection()
-{
-    uint32_t numberOfFunctionDeclarations;
-    READ_COMPACT_UINT32_OR_FAIL(numberOfFunctionDeclarations, &quot;Cannot read the number of function declarations.&quot;);
-    m_module-&gt;functionDeclarations().reserveInitialCapacity(numberOfFunctionDeclarations);
-    m_module-&gt;functions().reserveInitialCapacity(numberOfFunctionDeclarations);
-    m_module-&gt;functionStartOffsetsInSource().reserveInitialCapacity(numberOfFunctionDeclarations);
-    m_module-&gt;functionStackHeights().reserveInitialCapacity(numberOfFunctionDeclarations);
-    for (uint32_t i = 0; i &lt; numberOfFunctionDeclarations; ++i) {
-        WASMFunctionDeclaration functionDeclaration;
-        READ_COMPACT_UINT32_OR_FAIL(functionDeclaration.signatureIndex, &quot;Cannot read the signature index.&quot;);
-        FAIL_IF_FALSE(functionDeclaration.signatureIndex &lt; m_module-&gt;signatures().size(), &quot;The signature index is incorrect.&quot;);
-        m_module-&gt;functionDeclarations().uncheckedAppend(functionDeclaration);
-    }
-}
-
-void WASMModuleParser::parseFunctionPointerTableSection()
-{
-    uint32_t numberOfFunctionPointerTables;
-    READ_COMPACT_UINT32_OR_FAIL(numberOfFunctionPointerTables, &quot;Cannot read the number of function pointer tables.&quot;);
-    m_module-&gt;functionPointerTables().reserveInitialCapacity(numberOfFunctionPointerTables);
-    for (uint32_t i = 0; i &lt; numberOfFunctionPointerTables; ++i) {
-        WASMFunctionPointerTable functionPointerTable;
-        READ_COMPACT_UINT32_OR_FAIL(functionPointerTable.signatureIndex, &quot;Cannot read the signature index.&quot;);
-        FAIL_IF_FALSE(functionPointerTable.signatureIndex &lt; m_module-&gt;signatures().size(), &quot;The signature index is incorrect.&quot;);
-        uint32_t numberOfFunctions;
-        READ_COMPACT_UINT32_OR_FAIL(numberOfFunctions, &quot;Cannot read the number of functions of a function pointer table.&quot;);
-        FAIL_IF_FALSE(hasOneBitSet(numberOfFunctions), &quot;The number of functions must be a power of two.&quot;);
-        functionPointerTable.functionIndices.reserveInitialCapacity(numberOfFunctions);
-        functionPointerTable.functions.reserveInitialCapacity(numberOfFunctions);
-        for (uint32_t j = 0; j &lt; numberOfFunctions; ++j) {
-            uint32_t functionIndex;
-            READ_COMPACT_UINT32_OR_FAIL(functionIndex, &quot;Cannot read a function index of a function pointer table.&quot;);
-            FAIL_IF_FALSE(functionIndex &lt; m_module-&gt;functionDeclarations().size(), &quot;The function index is incorrect.&quot;);
-            FAIL_IF_FALSE(m_module-&gt;functionDeclarations()[functionIndex].signatureIndex == functionPointerTable.signatureIndex, &quot;The signature of the function doesn't match that of the function pointer table.&quot;);
-            functionPointerTable.functionIndices.uncheckedAppend(functionIndex);
-        }
-        m_module-&gt;functionPointerTables().uncheckedAppend(functionPointerTable);
-    }
-}
-
-void WASMModuleParser::parseFunctionDefinitionSection()
-{
-    for (size_t functionIndex = 0; functionIndex &lt; m_module-&gt;functionDeclarations().size(); ++functionIndex) {
-        parseFunctionDefinition(functionIndex);
-        PROPAGATE_ERROR();
-    }
-
-    for (WASMFunctionPointerTable&amp; functionPointerTable : m_module-&gt;functionPointerTables()) {
-        for (size_t i = 0; i &lt; functionPointerTable.functionIndices.size(); ++i)
-            functionPointerTable.functions.uncheckedAppend(m_module-&gt;functions()[functionPointerTable.functionIndices[i]].get());
-    }
-}
-
-void WASMModuleParser::parseFunctionDefinition(size_t functionIndex)
-{
-    unsigned startOffsetInSource = m_reader.offset();
-    unsigned endOffsetInSource;
-    unsigned stackHeight;
-    String errorMessage;
-    if (!WASMFunctionParser::checkSyntax(m_module.get(), m_source, functionIndex, startOffsetInSource, endOffsetInSource, stackHeight, errorMessage)) {
-        m_errorMessage = errorMessage;
-        return;
-    }
-    m_reader.setOffset(endOffsetInSource);
-
-    WebAssemblyExecutable* webAssemblyExecutable = WebAssemblyExecutable::create(m_vm, m_source, m_module.get(), functionIndex);
-    JSFunction* function = JSFunction::create(m_vm, webAssemblyExecutable, m_globalObject.get());
-    m_module-&gt;functions().uncheckedAppend(WriteBarrier&lt;JSFunction&gt;(m_vm, m_module.get(), function));
-    m_module-&gt;functionStartOffsetsInSource().uncheckedAppend(startOffsetInSource);
-    m_module-&gt;functionStackHeights().uncheckedAppend(stackHeight);
-}
-
-void WASMModuleParser::parseExportSection()
-{
-    WASMExportFormat exportFormat;
-    READ_EXPORT_FORMAT_OR_FAIL(exportFormat, &quot;Cannot read the export format.&quot;);
-    switch (exportFormat) {
-    case WASMExportFormat::Default: {
-        uint32_t functionIndex;
-        READ_COMPACT_UINT32_OR_FAIL(functionIndex, &quot;Cannot read the function index.&quot;);
-        FAIL_IF_FALSE(functionIndex &lt; m_module-&gt;functionDeclarations().size(), &quot;The function index is incorrect.&quot;);
-        // FIXME: Export the function.
-        break;
-    }
-    case WASMExportFormat::Record: {
-        uint32_t numberOfExports;
-        READ_COMPACT_UINT32_OR_FAIL(numberOfExports, &quot;Cannot read the number of exports.&quot;);
-        for (uint32_t exportIndex = 0; exportIndex &lt; numberOfExports; ++exportIndex) {
-            String exportName;
-            READ_STRING_OR_FAIL(exportName, &quot;Cannot read the function export name.&quot;);
-            uint32_t functionIndex;
-            READ_COMPACT_UINT32_OR_FAIL(functionIndex, &quot;Cannot read the function index.&quot;);
-            FAIL_IF_FALSE(functionIndex &lt; m_module-&gt;functionDeclarations().size(), &quot;The function index is incorrect.&quot;);
-            Identifier identifier = Identifier::fromString(&amp;m_vm, exportName);
-            m_module-&gt;putDirect(m_vm, identifier, m_module-&gt;functions()[functionIndex].get());
-        }
-        break;
-    }
-    default:
-        ASSERT_NOT_REACHED();
-    }
-}
-
-void WASMModuleParser::getImportedValue(ExecState* exec, const String&amp; importName, JSValue&amp; value)
-{
-    FAIL_IF_FALSE(m_imports, &quot;Accessing property of non-object.&quot;);
-    Identifier identifier = Identifier::fromString(&amp;m_vm, importName);
-    PropertySlot slot(m_imports.get(), PropertySlot::InternalMethodType::Get);
-    if (!m_imports-&gt;getPropertySlot(exec, identifier, slot))
-        FAIL_WITH_MESSAGE(&quot;Can't find a property named \&quot;&quot; + importName + '&quot;');
-    FAIL_IF_FALSE(slot.isValue(), &quot;\&quot;&quot; + importName + &quot;\&quot; is not a data property.&quot;);
-    // We only retrieve data properties. So, this does not cause any user-observable effect.
-    value = slot.getValue(exec, identifier);
-}
-
-JSWASMModule* parseWebAssembly(ExecState* exec, const SourceCode&amp; source, JSObject* imports, JSArrayBuffer* arrayBuffer, String&amp; errorMessage)
-{
-    WASMModuleParser moduleParser(exec-&gt;vm(), exec-&gt;lexicalGlobalObject(), source, imports, arrayBuffer);
-    return moduleParser.parse(exec, errorMessage);
-}
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMModuleParserh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/WASMModuleParser.h (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMModuleParser.h        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/wasm/WASMModuleParser.h        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1,77 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WASMModuleParser_h
-#define WASMModuleParser_h
-
-#if ENABLE(WEBASSEMBLY)
-
-#include &quot;Strong.h&quot;
-#include &quot;WASMReader.h&quot;
-#include &lt;wtf/text/WTFString.h&gt;
-
-namespace JSC {
-
-class ExecState;
-class JSArrayBuffer;
-class JSGlobalObject;
-class JSWASMModule;
-class SourceCode;
-class VM;
-
-class WASMModuleParser {
-public:
-    WASMModuleParser(VM&amp;, JSGlobalObject*, const SourceCode&amp;, JSObject* imports, JSArrayBuffer*);
-    JSWASMModule* parse(ExecState*, String&amp; errorMessage);
-
-private:
-    void parseModule(ExecState*);
-    void parseConstantPoolSection();
-    void parseSignatureSection();
-    void parseFunctionImportSection(ExecState*);
-    void parseGlobalSection(ExecState*);
-    void parseFunctionDeclarationSection();
-    void parseFunctionPointerTableSection();
-    void parseFunctionDefinitionSection();
-    void parseFunctionDefinition(size_t functionIndex);
-    void parseExportSection();
-    void getImportedValue(ExecState*, const String&amp; importName, JSValue&amp;);
-
-    VM&amp; m_vm;
-    Strong&lt;JSGlobalObject&gt; m_globalObject;
-    const SourceCode&amp; m_source;
-    Strong&lt;JSObject&gt; m_imports;
-    WASMReader m_reader;
-    Strong&lt;JSWASMModule&gt; m_module;
-    String m_errorMessage;
-};
-
-JS_EXPORT_PRIVATE JSWASMModule* parseWebAssembly(ExecState*, const SourceCode&amp;, JSObject* imports, JSArrayBuffer*, String&amp; errorMessage);
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)
-
-#endif // WASMModuleParser_h
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMReadercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/WASMReader.cpp (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMReader.cpp        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/wasm/WASMReader.cpp        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1,249 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * =========================================================================
- *
- * Copyright (c) 2015 by the repository authors of
- * WebAssembly/polyfill-prototype-1.
- *
- * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include &quot;config.h&quot;
-#include &quot;WASMReader.h&quot;
-
-#if ENABLE(WEBASSEMBLY)
-
-#include &lt;wtf/text/StringBuilder.h&gt;
-
-#define CHECK_READ(length) do { if (m_cursor + length &gt; m_buffer.end()) return false; } while (0)
-
-namespace JSC {
-
-bool WASMReader::readUInt32(uint32_t&amp; result)
-{
-    CHECK_READ(4);
-    result = m_cursor[0] | m_cursor[1] &lt;&lt; 8 | m_cursor[2] &lt;&lt; 16 | m_cursor[3] &lt;&lt; 24;
-    m_cursor += 4;
-    return true;
-}
-
-bool WASMReader::readFloat(float&amp; result)
-{
-    CHECK_READ(4);
-    union {
-        uint8_t bytes[4];
-        float floatValue;
-    } u = {
-#if CPU(BIG_ENDIAN)
-        { m_cursor[3], m_cursor[2], m_cursor[1], m_cursor[0] }
-#else
-        { m_cursor[0], m_cursor[1], m_cursor[2], m_cursor[3] }
-#endif
-    };
-    result = u.floatValue;
-    m_cursor += 4;
-    return true;
-}
-
-bool WASMReader::readDouble(double&amp; result)
-{
-    CHECK_READ(8);
-    union {
-        uint8_t bytes[8];
-        double doubleValue;
-    } u = {
-#if CPU(BIG_ENDIAN)
-        { m_cursor[7], m_cursor[6], m_cursor[5], m_cursor[4], m_cursor[3], m_cursor[2], m_cursor[1], m_cursor[0] }
-#else
-        { m_cursor[0], m_cursor[1], m_cursor[2], m_cursor[3], m_cursor[4], m_cursor[5], m_cursor[6], m_cursor[7] }
-#endif
-    };
-    result = u.doubleValue;
-    m_cursor += 8;
-    return true;
-}
-
-bool WASMReader::readCompactInt32(uint32_t&amp; result)
-{
-    uint32_t sum = 0;
-    unsigned shift = 0;
-    do {
-        CHECK_READ(1);
-        uint8_t byte = *m_cursor++;
-        if (byte &lt; 0x80) {
-            sum |= byte &lt;&lt; shift;
-            int signExtend = (32 - 7) - shift;
-            if (signExtend &gt; 0)
-                result = int32_t(sum) &lt;&lt; signExtend &gt;&gt; signExtend;
-            else
-                result = int32_t(sum);
-            return true;
-        }
-        sum |= (byte &amp; firstSevenBitsMask) &lt;&lt; shift;
-        shift += 7;
-    } while (shift &lt; 35);
-    return false;
-}
-
-bool WASMReader::readCompactUInt32(uint32_t&amp; result)
-{
-    uint32_t sum = 0;
-    unsigned shift = 0;
-    do {
-        CHECK_READ(1);
-        uint32_t byte = *m_cursor++;
-        if (byte &lt; 0x80) {
-            if ((shift == 28 &amp;&amp; byte &gt;= 0x10) || (shift &amp;&amp; !byte))
-                return false;
-            result = sum | (byte &lt;&lt; shift);
-            return true;
-        }
-        sum |= (byte &amp; firstSevenBitsMask) &lt;&lt; shift;
-        shift += 7;
-    } while (shift &lt; 35);
-    return false;
-}
-
-bool WASMReader::readString(String&amp; result)
-{
-    StringBuilder builder;
-    while (true) {
-        CHECK_READ(1);
-        char c = *m_cursor++;
-        if (!c)
-            break;
-        builder.append(c);
-    }
-    result = builder.toString();
-    return true;
-}
-
-bool WASMReader::readType(WASMType&amp; result)
-{
-    return readByte&lt;WASMType&gt;(result, static_cast&lt;uint8_t&gt;(WASMType::NumberOfTypes));
-}
-
-bool WASMReader::readExpressionType(WASMExpressionType&amp; result)
-{
-    return readByte&lt;WASMExpressionType&gt;(result, static_cast&lt;uint8_t&gt;(WASMExpressionType::NumberOfExpressionTypes));
-}
-
-bool WASMReader::readExportFormat(WASMExportFormat&amp; result)
-{
-    return readByte&lt;WASMExportFormat&gt;(result, static_cast&lt;uint8_t&gt;(WASMExportFormat::NumberOfExportFormats));
-}
-
-template &lt;class T&gt; bool WASMReader::readByte(T&amp; result, uint8_t numberOfValues)
-{
-    CHECK_READ(1);
-    uint8_t byte = *m_cursor++;
-    if (byte &gt;= numberOfValues)
-        return false;
-    result = T(byte);
-    return true;
-}
-
-bool WASMReader::readOpStatement(bool&amp; hasImmediate, WASMOpStatement&amp; op, WASMOpStatementWithImmediate&amp; opWithImmediate, uint8_t&amp; immediate)
-{
-    return readOp(hasImmediate, op, opWithImmediate, immediate,
-        static_cast&lt;uint8_t&gt;(WASMOpStatement::NumberOfWASMOpStatements),
-        static_cast&lt;uint8_t&gt;(WASMOpStatementWithImmediate::NumberOfWASMOpStatementWithImmediates));
-}
-
-bool WASMReader::readOpExpressionI32(bool&amp; hasImmediate, WASMOpExpressionI32&amp; op, WASMOpExpressionI32WithImmediate&amp; opWithImmediate, uint8_t&amp; immediate)
-{
-    return readOp(hasImmediate, op, opWithImmediate, immediate,
-        static_cast&lt;uint8_t&gt;(WASMOpExpressionI32::NumberOfWASMOpExpressionI32s),
-        static_cast&lt;uint8_t&gt;(WASMOpExpressionI32WithImmediate::NumberOfWASMOpExpressionI32WithImmediates));
-}
-
-bool WASMReader::readOpExpressionF32(bool&amp; hasImmediate, WASMOpExpressionF32&amp; op, WASMOpExpressionF32WithImmediate&amp; opWithImmediate, uint8_t&amp; immediate)
-{
-    return readOp(hasImmediate, op, opWithImmediate, immediate,
-        static_cast&lt;uint8_t&gt;(WASMOpExpressionF32::NumberOfWASMOpExpressionF32s),
-        static_cast&lt;uint8_t&gt;(WASMOpExpressionF32WithImmediate::NumberOfWASMOpExpressionF32WithImmediates));
-}
-
-bool WASMReader::readOpExpressionF64(bool&amp; hasImmediate, WASMOpExpressionF64&amp; op, WASMOpExpressionF64WithImmediate&amp; opWithImmediate, uint8_t&amp; immediate)
-{
-    return readOp(hasImmediate, op, opWithImmediate, immediate,
-        static_cast&lt;uint8_t&gt;(WASMOpExpressionF64::NumberOfWASMOpExpressionF64s),
-        static_cast&lt;uint8_t&gt;(WASMOpExpressionF64WithImmediate::NumberOfWASMOpExpressionF64WithImmediates));
-}
-
-bool WASMReader::readOpExpressionVoid(WASMOpExpressionVoid&amp; op)
-{
-    return readByte&lt;WASMOpExpressionVoid&gt;(op,
-        static_cast&lt;uint8_t&gt;(WASMOpExpressionVoid::NumberOfWASMOpExpressionVoids));
-}
-
-bool WASMReader::readVariableTypes(bool&amp; hasImmediate, WASMVariableTypes&amp; variableTypes, WASMVariableTypesWithImmediate&amp; variableTypesWithImmediate, uint8_t&amp; immediate)
-{
-    return readOp(hasImmediate, variableTypes, variableTypesWithImmediate, immediate,
-        static_cast&lt;uint8_t&gt;(WASMVariableTypes::NumberOfVariableTypes),
-        static_cast&lt;uint8_t&gt;(WASMVariableTypesWithImmediate::NumberOfVariableTypesWithImmediates));
-}
-
-template &lt;class T, class TWithImmediate&gt;
-bool WASMReader::readOp(bool&amp; hasImmediate, T&amp; op, TWithImmediate&amp; opWithImmediate, uint8_t&amp; immediate, uint8_t numberOfValues, uint8_t numberOfValuesWithImmediate)
-{
-    CHECK_READ(1);
-    uint8_t byte = *m_cursor++;
-
-    if (!(byte &amp; hasImmediateInOpFlag)) {
-        if (byte &gt;= numberOfValues)
-            return false;
-        hasImmediate = false;
-        op = T(byte);
-        return true;
-    }
-
-    uint8_t byteWithoutImmediate = (byte &gt;&gt; immediateBits) &amp; (opWithImmediateLimit - 1);
-    if (byteWithoutImmediate &gt;= numberOfValuesWithImmediate)
-        return false;
-    hasImmediate = true;
-    opWithImmediate = TWithImmediate(byteWithoutImmediate);
-    immediate = byte &amp; (immediateLimit - 1);
-    return true;
-}
-
-bool WASMReader::readSwitchCase(WASMSwitchCase&amp; result)
-{
-    return readByte&lt;WASMSwitchCase&gt;(result, static_cast&lt;uint8_t&gt;(WASMSwitchCase::NumberOfSwitchCases));
-}
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)
</del></span></pre></div>
<a id="trunkSourceJavaScriptCorewasmWASMReaderh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/JavaScriptCore/wasm/WASMReader.h (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/wasm/WASMReader.h        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/JavaScriptCore/wasm/WASMReader.h        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1,79 +0,0 @@
</span><del>-/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WASMReader_h
-#define WASMReader_h
-
-#if ENABLE(WEBASSEMBLY)
-
-#include &quot;WASMConstants.h&quot;
-#include &quot;WASMFormat.h&quot;
-#include &lt;wtf/Vector.h&gt;
-
-namespace JSC {
-
-class WASMReader {
-public:
-    WASMReader(const Vector&lt;uint8_t&gt;&amp; buffer)
-        : m_buffer(buffer)
-        , m_cursor(buffer.data())
-    {
-    }
-
-    unsigned offset() const { return m_cursor - m_buffer.data(); }
-    void setOffset(unsigned offset) { m_cursor = m_buffer.data() + offset; }
-
-    bool readUInt32(uint32_t&amp; result);
-    bool readFloat(float&amp; result);
-    bool readDouble(double&amp; result);
-    bool readCompactInt32(uint32_t&amp; result);
-    bool readCompactUInt32(uint32_t&amp; result);
-    bool readString(String&amp; result);
-    bool readType(WASMType&amp; result);
-    bool readExpressionType(WASMExpressionType&amp; result);
-    bool readExportFormat(WASMExportFormat&amp; result);
-    bool readOpStatement(bool&amp; hasImmediate, WASMOpStatement&amp;, WASMOpStatementWithImmediate&amp;, uint8_t&amp; immediate);
-    bool readOpExpressionI32(bool&amp; hasImmediate, WASMOpExpressionI32&amp;, WASMOpExpressionI32WithImmediate&amp;, uint8_t&amp; immediate);
-    bool readOpExpressionF32(bool&amp; hasImmediate, WASMOpExpressionF32&amp;, WASMOpExpressionF32WithImmediate&amp;, uint8_t&amp; immediate);
-    bool readOpExpressionF64(bool&amp; hasImmediate, WASMOpExpressionF64&amp;, WASMOpExpressionF64WithImmediate&amp;, uint8_t&amp; immediate);
-    bool readOpExpressionVoid(WASMOpExpressionVoid&amp;);
-    bool readVariableTypes(bool&amp; hasImmediate, WASMVariableTypes&amp;, WASMVariableTypesWithImmediate&amp;, uint8_t&amp; immediate);
-    bool readSwitchCase(WASMSwitchCase&amp; result);
-
-private:
-    static const uint32_t firstSevenBitsMask = 0x7f;
-
-    template &lt;class T&gt; bool readByte(T&amp; result, uint8_t numberOfValues);
-    template &lt;class T, class TWithImmediate&gt; bool readOp(bool&amp; hasImmediate, T&amp;, TWithImmediate&amp;, uint8_t&amp; immediate, uint8_t numberOfValues, uint8_t numberOfValuesWithImmediate);
-
-    const Vector&lt;uint8_t&gt;&amp; m_buffer;
-    const uint8_t* m_cursor;
-};
-
-} // namespace JSC
-
-#endif // ENABLE(WEBASSEMBLY)
-
-#endif // WASMReader_h
</del></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/WTF/ChangeLog        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-08-05  Keith Miller  &lt;keith_miller@apple.com&gt;
+
+        Delete out of date WASM code.
+        https://bugs.webkit.org/show_bug.cgi?id=160603
+
+        Reviewed by Saam Barati.
+
+        Add Feature define for WebAssembly on mac.
+
+        * wtf/FeatureDefines.h:
+
</ins><span class="cx"> 2016-08-03  Csaba Osztrogonác  &lt;ossy@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Lacking support on a arm-traditional disassembler.
</span></span></pre></div>
<a id="trunkSourceWTFwtfFeatureDefinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/FeatureDefines.h (204179 => 204180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/FeatureDefines.h        2016-08-05 18:36:21 UTC (rev 204179)
+++ trunk/Source/WTF/wtf/FeatureDefines.h        2016-08-05 18:53:49 UTC (rev 204180)
</span><span class="lines">@@ -222,6 +222,10 @@
</span><span class="cx"> #define ENABLE_VIEW_MODE_CSS_MEDIA 0
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !defined(ENABLE_WEBASSEMBLY)
+#define ENABLE_WEBASSEMBLY 0
+#endif
+
</ins><span class="cx"> #if !defined(ENABLE_WEB_ARCHIVE)
</span><span class="cx"> #define ENABLE_WEB_ARCHIVE 1
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>