Unreviewed, reland r230697, r230720, and r230724.
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2018 09:47:19 +0000 (09:47 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2018 09:47:19 +0000 (09:47 +0000)
commit039831708f6abf5d82a17f3674b94f9f7fe168b8
tree298dabd3adbae1c6a89cebdac76cfed7851d0883
parentf84a650be8d56917a27afac422291e9965eeebdf
Unreviewed, reland r230697, r230720, and r230724.
https://bugs.webkit.org/show_bug.cgi?id=184600

JSTests:

* wasm.yaml:
* wasm/modules/constant.wasm: Added.
* wasm/modules/constant.wat: Added.
* wasm/modules/default-import-star-error.js: Added.
(then):
* wasm/modules/default-import-star-error/entry.wasm: Added.
* wasm/modules/default-import-star-error/entry.wat: Added.
* wasm/modules/default-import-star-error/t0.js: Added.
* wasm/modules/default-import-star-error/t1.js: Added.
* wasm/modules/default-import-star-error/t2.js: Added.
(export.default.Cocoa):
* wasm/modules/js-wasm-cycle.js: Added.
* wasm/modules/js-wasm-cycle/entry.js: Added.
(from.string_appeared_here.export.return42):
* wasm/modules/js-wasm-cycle/sum.wasm: Added.
* wasm/modules/js-wasm-cycle/sum.wat: Added.
* wasm/modules/js-wasm-function-namespace.js: Added.
(assert.throws):
* wasm/modules/js-wasm-function.js: Added.
(assert.throws):
* wasm/modules/js-wasm-global-namespace.js: Added.
(assert.throws):
* wasm/modules/js-wasm-global.js: Added.
(assert.throws):
* wasm/modules/js-wasm-memory-namespace.js: Added.
(assert.throws):
* wasm/modules/js-wasm-memory.js: Added.
(assert.throws):
* wasm/modules/js-wasm-start.js: Added.
(then):
* wasm/modules/js-wasm-table-namespace.js: Added.
(assert.throws):
* wasm/modules/js-wasm-table.js: Added.
(assert.throws):
* wasm/modules/memory.wasm: Added.
* wasm/modules/memory.wat: Added.
* wasm/modules/run-from-wasm.wasm: Added.
* wasm/modules/run-from-wasm.wat: Added.
* wasm/modules/run-from-wasm/check.js: Added.
(export.check):
* wasm/modules/start.wasm: Added.
* wasm/modules/start.wat: Added.
* wasm/modules/sum.wasm: Added.
* wasm/modules/sum.wat: Added.
* wasm/modules/table.wasm: Added.
* wasm/modules/table.wat: Added.
* wasm/modules/wasm-imports-js-exports.js: Added.
* wasm/modules/wasm-imports-js-exports/imports.wasm: Added.
* wasm/modules/wasm-imports-js-exports/imports.wat: Added.
* wasm/modules/wasm-imports-js-exports/sum.js: Added.
(export.sum):
* wasm/modules/wasm-imports-js-re-exports-wasm-exports.js: Added.
* wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wasm: Added.
* wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat: Added.
* wasm/modules/wasm-imports-js-re-exports-wasm-exports/re-export.js: Added.
* wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wasm: Added.
* wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat: Added.
* wasm/modules/wasm-imports-wasm-exports.js: Added.
* wasm/modules/wasm-imports-wasm-exports/imports.wasm: Added.
* wasm/modules/wasm-imports-wasm-exports/imports.wat: Added.
* wasm/modules/wasm-imports-wasm-exports/sum.wasm: Added.
* wasm/modules/wasm-imports-wasm-exports/sum.wat: Added.
* wasm/modules/wasm-js-cycle.js: Added.
* wasm/modules/wasm-js-cycle/entry.wasm: Added.
* wasm/modules/wasm-js-cycle/entry.wat: Added.
* wasm/modules/wasm-js-cycle/sum.js: Added.
(from.string_appeared_here.export.sum):
* wasm/modules/wasm-wasm-cycle.js: Added.
* wasm/modules/wasm-wasm-cycle/entry.wasm: Added.
* wasm/modules/wasm-wasm-cycle/entry.wat: Added.
* wasm/modules/wasm-wasm-cycle/sum.wasm: Added.
* wasm/modules/wasm-wasm-cycle/sum.wat: Added.

Source/JavaScriptCore:

With CatchScope check.

* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/ModuleLoaderPrototype.js:
(globalPrivate.newRegistryEntry):
(requestInstantiate):
(link):
* jsc.cpp:
(convertShebangToJSComment):
(fillBufferWithContentsOfFile):
(fetchModuleFromLocalFileSystem):
(GlobalObject::moduleLoaderFetch):
(functionDollarAgentStart):
(checkException):
(runWithOptions):
* parser/NodesAnalyzeModule.cpp:
(JSC::ImportDeclarationNode::analyzeModule):
* parser/SourceProvider.h:
(JSC::WebAssemblySourceProvider::create):
(JSC::WebAssemblySourceProvider::WebAssemblySourceProvider):
* runtime/AbstractModuleRecord.cpp:
(JSC::AbstractModuleRecord::hostResolveImportedModule):
(JSC::AbstractModuleRecord::resolveImport):
(JSC::AbstractModuleRecord::link):
(JSC::AbstractModuleRecord::evaluate):
(JSC::identifierToJSValue): Deleted.
* runtime/AbstractModuleRecord.h:
(JSC::AbstractModuleRecord::moduleEnvironmentMayBeNull):
(JSC::AbstractModuleRecord::ImportEntry::isNamespace const): Deleted.
* runtime/JSModuleEnvironment.cpp:
(JSC::JSModuleEnvironment::getOwnNonIndexPropertyNames):
* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::evaluate):
* runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::link):
(JSC::JSModuleRecord::instantiateDeclarations):
* runtime/JSModuleRecord.h:
* runtime/ModuleLoaderPrototype.cpp:
(JSC::moduleLoaderPrototypeParseModule):
(JSC::moduleLoaderPrototypeRequestedModules):
(JSC::moduleLoaderPrototypeModuleDeclarationInstantiation):
* wasm/WasmCreationMode.h: Copied from Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.h.
* wasm/js/JSWebAssemblyHelpers.h:
(JSC::getWasmBufferFromValue):
(JSC::createSourceBufferFromValue):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::finalizeCreation):
(JSC::JSWebAssemblyInstance::createPrivateModuleKey):
(JSC::JSWebAssemblyInstance::create):
* wasm/js/JSWebAssemblyInstance.h:
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::prepareLink):
(JSC::WebAssemblyModuleRecord::link):
* wasm/js/WebAssemblyModuleRecord.h:
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::resolve):
(JSC::instantiate):
(JSC::compileAndInstantiate):
(JSC::WebAssemblyPrototype::instantiate):
(JSC::webAssemblyInstantiateFunc):
(JSC::webAssemblyValidateFunc):
* wasm/js/WebAssemblyPrototype.h:

Tools:

* Scripts/run-jsc-stress-tests:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230759 268f45cc-cd09-0410-ab3c-d52691b4dbfc
82 files changed:
JSTests/ChangeLog
JSTests/wasm.yaml
JSTests/wasm/modules/constant.wasm [new file with mode: 0644]
JSTests/wasm/modules/constant.wat [new file with mode: 0644]
JSTests/wasm/modules/default-import-star-error.js [new file with mode: 0644]
JSTests/wasm/modules/default-import-star-error/entry.wasm [new file with mode: 0644]
JSTests/wasm/modules/default-import-star-error/entry.wat [new file with mode: 0644]
JSTests/wasm/modules/default-import-star-error/t0.js [new file with mode: 0644]
JSTests/wasm/modules/default-import-star-error/t1.js [new file with mode: 0644]
JSTests/wasm/modules/default-import-star-error/t2.js [new file with mode: 0644]
JSTests/wasm/modules/js-wasm-cycle.js [new file with mode: 0644]
JSTests/wasm/modules/js-wasm-cycle/entry.js [new file with mode: 0644]
JSTests/wasm/modules/js-wasm-cycle/sum.wasm [new file with mode: 0644]
JSTests/wasm/modules/js-wasm-cycle/sum.wat [new file with mode: 0644]
JSTests/wasm/modules/js-wasm-function-namespace.js [new file with mode: 0644]
JSTests/wasm/modules/js-wasm-function.js [new file with mode: 0644]
JSTests/wasm/modules/js-wasm-global-namespace.js [new file with mode: 0644]
JSTests/wasm/modules/js-wasm-global.js [new file with mode: 0644]
JSTests/wasm/modules/js-wasm-memory-namespace.js [new file with mode: 0644]
JSTests/wasm/modules/js-wasm-memory.js [new file with mode: 0644]
JSTests/wasm/modules/js-wasm-start.js [new file with mode: 0644]
JSTests/wasm/modules/js-wasm-table-namespace.js [new file with mode: 0644]
JSTests/wasm/modules/js-wasm-table.js [new file with mode: 0644]
JSTests/wasm/modules/memory.wasm [new file with mode: 0644]
JSTests/wasm/modules/memory.wat [new file with mode: 0644]
JSTests/wasm/modules/run-from-wasm.wasm [new file with mode: 0644]
JSTests/wasm/modules/run-from-wasm.wat [new file with mode: 0644]
JSTests/wasm/modules/run-from-wasm/check.js [new file with mode: 0644]
JSTests/wasm/modules/start.wasm [new file with mode: 0644]
JSTests/wasm/modules/start.wat [new file with mode: 0644]
JSTests/wasm/modules/sum.wasm [new file with mode: 0644]
JSTests/wasm/modules/sum.wat [new file with mode: 0644]
JSTests/wasm/modules/table.wasm [new file with mode: 0644]
JSTests/wasm/modules/table.wat [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-js-exports.js [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-js-exports/imports.wasm [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-js-exports/imports.wat [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-js-exports/sum.js [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports.js [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wasm [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/imports.wat [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/re-export.js [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wasm [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-js-re-exports-wasm-exports/sum.wat [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-wasm-exports.js [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-wasm-exports/imports.wasm [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-wasm-exports/imports.wat [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-wasm-exports/sum.wasm [new file with mode: 0644]
JSTests/wasm/modules/wasm-imports-wasm-exports/sum.wat [new file with mode: 0644]
JSTests/wasm/modules/wasm-js-cycle.js [new file with mode: 0644]
JSTests/wasm/modules/wasm-js-cycle/entry.wasm [new file with mode: 0644]
JSTests/wasm/modules/wasm-js-cycle/entry.wat [new file with mode: 0644]
JSTests/wasm/modules/wasm-js-cycle/sum.js [new file with mode: 0644]
JSTests/wasm/modules/wasm-wasm-cycle.js [new file with mode: 0644]
JSTests/wasm/modules/wasm-wasm-cycle/entry.wasm [new file with mode: 0644]
JSTests/wasm/modules/wasm-wasm-cycle/entry.wat [new file with mode: 0644]
JSTests/wasm/modules/wasm-wasm-cycle/sum.wasm [new file with mode: 0644]
JSTests/wasm/modules/wasm-wasm-cycle/sum.wat [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/builtins/ModuleLoaderPrototype.js
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/parser/NodesAnalyzeModule.cpp
Source/JavaScriptCore/parser/SourceProvider.h
Source/JavaScriptCore/runtime/AbstractModuleRecord.cpp
Source/JavaScriptCore/runtime/AbstractModuleRecord.h
Source/JavaScriptCore/runtime/JSModuleEnvironment.cpp
Source/JavaScriptCore/runtime/JSModuleLoader.cpp
Source/JavaScriptCore/runtime/JSModuleRecord.cpp
Source/JavaScriptCore/runtime/JSModuleRecord.h
Source/JavaScriptCore/runtime/ModuleLoaderPrototype.cpp
Source/JavaScriptCore/wasm/WasmCreationMode.h [new file with mode: 0644]
Source/JavaScriptCore/wasm/js/JSWebAssemblyHelpers.h
Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.cpp
Source/JavaScriptCore/wasm/js/JSWebAssemblyInstance.h
Source/JavaScriptCore/wasm/js/WebAssemblyInstanceConstructor.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.h
Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyPrototype.h
Tools/ChangeLog
Tools/Scripts/run-jsc-stress-tests