Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add in place interpreter optimizations
https://bugs.webkit.org/show_bug.cgi?id=259798 rdar://113358427 Reviewed by Justin Michaud. Added a variety of optimizations to improve the performance of the in-place interpreter: - Added new mini-interpreters (mINT, uINT, and argumINT) to optimize the calling convention by not loading/storing registers pessimistically. - argumINT also allows locals to index directly using their original index. - Added a "condensing" behavior that allows long runs of block/loop and end instructions to be skipped when interpreting by modifying metadata entries to jump past these groups of instructions. - Transitioned to unaligned metadata, allowing almost all instructions to save bytes by compacting their metadata. - Added compact forms for i32.const and local.get/set, which allow IPInt to read directly from the bytecode if the index is <128, saving 4B of metadata. Scores 37.755 on JS2's Wasm tests, versus 34.926 for LLInt. Startup time on UE4 Zen Garden: starts up 7.2% faster (220 ms vs 237 ms), while utilizing 9.1% less memory (421 MB vs 463 MB) * JSTests/wasm/ipint-tests/ipint-test-nesting.js: Added. (from.string_appeared_here.import.as.assert.from.string_appeared_here.let.wat.module.func.export.string_appeared_here.result.i32.block.result.i32.block.result.i32.block.result.i32.block.result.i32.block.result.i32.block.result.i32.block.result.i32.block.result.i32.block.result.i32.block.result.i32.block.result.i32.i32.const.3.br.5.block.param.i32.result.i32.block.result.i32.i32.const.2.i32.add.return.func.export.string_appeared_here.param.i32.result.i32.block.block.block.loop.block.loop.block.local.0.i32.const.1.i32.add.local.0.loop.block.nop.loop.loop.loop.local.0.local.0.local.0.return.async test): * Source/JavaScriptCore/llint/InPlaceInterpreter.asm: * Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.cpp: (JSC::Wasm::FunctionIPIntMetadataGenerator::addBlankSpace): (JSC::Wasm::FunctionIPIntMetadataGenerator::addRawValue): (JSC::Wasm::FunctionIPIntMetadataGenerator::addLEB128ConstantInt32AndLength): (JSC::Wasm::FunctionIPIntMetadataGenerator::addLEB128ConstantAndLengthForType): (JSC::Wasm::FunctionIPIntMetadataGenerator::addReturnData): * Source/JavaScriptCore/wasm/WasmFunctionIPIntMetadataGenerator.h: * Source/JavaScriptCore/wasm/WasmIPIntGenerator.cpp: (JSC::Wasm::IPIntGenerator::condenseControlFlowInstructions): (JSC::Wasm::IPIntGenerator::addBlock): (JSC::Wasm::IPIntGenerator::addLoop): Canonical link: https://commits.webkit.org/266826@main
- Loading branch information