|
| 1 | +2017-04-04 Keith Miller <keith_miller@apple.com> |
| 2 | + |
| 3 | + WebAssembly: ModuleInformation should be a ref counted thing that can be shared across threads. |
| 4 | + https://bugs.webkit.org/show_bug.cgi?id=170478 |
| 5 | + |
| 6 | + Reviewed by Saam Barati. |
| 7 | + |
| 8 | + ModuleInformation has been moved to its own file and is now |
| 9 | + ThreadSafeRefCounted. All the Strings we used to keep in the |
| 10 | + ModuleInformation have been switched to Vector<LChar> this has the |
| 11 | + advantage that it can be passed across threads. However, this does |
| 12 | + mean that we need to decode the utf8 strings in each thread. This |
| 13 | + is likely not a problem because: |
| 14 | + |
| 15 | + 1) most modules have few imports/exports/custom sections. |
| 16 | + 2) most of the time they are ascii so the conversion is cheap. |
| 17 | + 3) we only have to do it once per thread, and there shouldn't be too many. |
| 18 | + |
| 19 | + This patch also removes |
| 20 | + moduleSignatureIndicesToUniquedSignatureIndices since that |
| 21 | + information can already be recovered from the |
| 22 | + SignatureInformation. |
| 23 | + |
| 24 | + * JavaScriptCore.xcodeproj/project.pbxproj: |
| 25 | + * jsc.cpp: |
| 26 | + (functionTestWasmModuleFunctions): |
| 27 | + * runtime/Identifier.h: |
| 28 | + (JSC::Identifier::fromString): |
| 29 | + * wasm/WasmB3IRGenerator.cpp: |
| 30 | + (JSC::Wasm::parseAndCompile): |
| 31 | + * wasm/WasmB3IRGenerator.h: |
| 32 | + * wasm/WasmFormat.cpp: |
| 33 | + (JSC::Wasm::makeString): |
| 34 | + (JSC::Wasm::ModuleInformation::~ModuleInformation): Deleted. |
| 35 | + * wasm/WasmFormat.h: |
| 36 | + (JSC::Wasm::makeString): |
| 37 | + (JSC::Wasm::ModuleInformation::functionIndexSpaceSize): Deleted. |
| 38 | + (JSC::Wasm::ModuleInformation::isImportedFunctionFromFunctionIndexSpace): Deleted. |
| 39 | + (JSC::Wasm::ModuleInformation::signatureIndexFromFunctionIndexSpace): Deleted. |
| 40 | + (JSC::Wasm::ModuleInformation::importFunctionCount): Deleted. |
| 41 | + (JSC::Wasm::ModuleInformation::internalFunctionCount): Deleted. |
| 42 | + * wasm/WasmFunctionParser.h: |
| 43 | + (JSC::Wasm::FunctionParser<Context>::FunctionParser): |
| 44 | + * wasm/WasmModuleInformation.cpp: Copied from Source/JavaScriptCore/wasm/WasmValidate.h. |
| 45 | + (JSC::Wasm::ModuleInformation::~ModuleInformation): |
| 46 | + * wasm/WasmModuleInformation.h: Added. |
| 47 | + (JSC::Wasm::ModuleInformation::functionIndexSpaceSize): |
| 48 | + (JSC::Wasm::ModuleInformation::isImportedFunctionFromFunctionIndexSpace): |
| 49 | + (JSC::Wasm::ModuleInformation::signatureIndexFromFunctionIndexSpace): |
| 50 | + (JSC::Wasm::ModuleInformation::importFunctionCount): |
| 51 | + (JSC::Wasm::ModuleInformation::internalFunctionCount): |
| 52 | + (JSC::Wasm::ModuleInformation::ModuleInformation): |
| 53 | + * wasm/WasmModuleParser.cpp: |
| 54 | + * wasm/WasmModuleParser.h: |
| 55 | + (JSC::Wasm::ModuleParser::ModuleParser): |
| 56 | + * wasm/WasmParser.h: |
| 57 | + (JSC::Wasm::Parser<SuccessType>::consumeUTF8String): |
| 58 | + * wasm/WasmPlan.cpp: |
| 59 | + (JSC::Wasm::Plan::Plan): |
| 60 | + (JSC::Wasm::Plan::parseAndValidateModule): |
| 61 | + (JSC::Wasm::Plan::prepare): |
| 62 | + (JSC::Wasm::Plan::compileFunctions): |
| 63 | + (JSC::Wasm::Plan::complete): |
| 64 | + (JSC::Wasm::Plan::cancel): |
| 65 | + * wasm/WasmPlan.h: |
| 66 | + (JSC::Wasm::Plan::internalFunctionCount): |
| 67 | + (JSC::Wasm::Plan::takeModuleInformation): |
| 68 | + * wasm/WasmSignature.cpp: |
| 69 | + (JSC::Wasm::SignatureInformation::get): |
| 70 | + * wasm/WasmSignature.h: |
| 71 | + * wasm/WasmValidate.cpp: |
| 72 | + (JSC::Wasm::validateFunction): |
| 73 | + * wasm/WasmValidate.h: |
| 74 | + * wasm/js/JSWebAssemblyHelpers.h: |
| 75 | + (JSC::createSourceBufferFromValue): |
| 76 | + * wasm/js/JSWebAssemblyModule.cpp: |
| 77 | + (JSC::JSWebAssemblyModule::createStub): |
| 78 | + (JSC::JSWebAssemblyModule::JSWebAssemblyModule): |
| 79 | + (JSC::JSWebAssemblyModule::finishCreation): |
| 80 | + * wasm/js/JSWebAssemblyModule.h: |
| 81 | + (JSC::JSWebAssemblyModule::moduleInformation): |
| 82 | + (JSC::JSWebAssemblyModule::source): |
| 83 | + * wasm/js/WebAssemblyInstanceConstructor.cpp: |
| 84 | + (JSC::constructJSWebAssemblyInstance): |
| 85 | + * wasm/js/WebAssemblyModuleConstructor.cpp: |
| 86 | + (JSC::WebAssemblyModuleConstructor::createModule): |
| 87 | + * wasm/js/WebAssemblyModulePrototype.cpp: |
| 88 | + (JSC::webAssemblyModuleProtoCustomSections): |
| 89 | + (JSC::webAssemblyModuleProtoImports): |
| 90 | + (JSC::webAssemblyModuleProtoExports): |
| 91 | + * wasm/js/WebAssemblyModuleRecord.cpp: |
| 92 | + (JSC::WebAssemblyModuleRecord::link): |
| 93 | + * wasm/js/WebAssemblyModuleRecord.h: |
| 94 | + * wasm/js/WebAssemblyPrototype.cpp: |
| 95 | + (JSC::webAssemblyCompileFunc): |
| 96 | + (JSC::instantiate): |
| 97 | + (JSC::compileAndInstantiate): |
| 98 | + |
1 | 99 | 2017-04-04 Filip Pizlo <fpizlo@apple.com> |
2 | 100 |
|
3 | 101 | B3::fixSSA() needs a tune-up |
|
0 commit comments