1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-12 22:50:59 +00:00
serenity/Userland/Libraries
Andreas Kling e46b217e42 LibJS/Bytecode: Move to a new bytecode format
This patch moves us away from the accumulator-based bytecode format to
one with explicit source and destination registers.

The new format has multiple benefits:

- ~25% faster on the Kraken and Octane benchmarks :^)
- Fewer instructions to accomplish the same thing
- Much easier for humans to read(!)

Because this change requires a fundamental shift in how bytecode is
generated, it is quite comprehensive.

Main implementation mechanism: generate_bytecode() virtual function now
takes an optional "preferred dst" operand, which allows callers to
communicate when they have an operand that would be optimal for the
result to go into. It also returns an optional "actual dst" operand,
which is where the completion value (if any) of the AST node is stored
after the node has "executed".

One thing of note that's new: because instructions can now take locals
as operands, this means we got rid of the GetLocal instruction.
A side-effect of that is we have to think about the temporal deadzone
(TDZ) a bit differently for locals (GetLocal would previously check
for empty values and interpret that as a TDZ access and throw).
We now insert special ThrowIfTDZ instructions in places where a local
access may be in the TDZ, to maintain the correct behavior.

There are a number of progressions and regressions from this test:

A number of async generator tests have been accidentally fixed while
converting the implementation to the new bytecode format. It didn't
seem useful to preserve bugs in the original code when converting it.

Some "does eval() return the correct completion value" tests have
regressed, in particular ones related to propagating the appropriate
completion after control flow statements like continue and break.
These are all fairly obscure issues, and I believe we can continue
working on them separately.

The net test262 result is a progression though. :^)
2024-02-19 21:45:27 +01:00
..
LibAccelGfx LibAccelGfx+LibWeb+WebContent: Handle OpenGL Context init errors 2024-01-24 19:43:51 +01:00
LibArchive Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
LibAudio LibAudio/Wav: Always use u32 for the sample rate 2024-02-14 22:21:44 -05:00
LibC AK: Make IndexSequence use size_t 2024-02-11 18:53:00 +01:00
LibCards Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibChess Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
LibCMake LibSyntax+Userland: Make LibSyntax not depend on LibGUI 2023-08-29 07:57:39 -04:00
LibCodeComprehension Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibCompress LibCompress/Deflate: Remove three useless FIXMEs 2024-01-14 21:22:35 +01:00
LibConfig Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibCore Everywhere: Prefer _string when constructing strings from literals 2024-02-08 11:01:10 -05:00
LibCoredump Everywhere: Remove references to UserspaceEmulator 2024-01-29 20:20:55 +00:00
LibCpp Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibCrypt Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibCrypto LibCrypto: Add support for the POSIX cksum algorithm 2024-01-18 18:01:26 +03:30
LibDebug Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibDesktop LibDesktop: Add menu_name() to AppFile 2024-01-14 15:16:45 -07:00
LibDeviceTree Userland: Remove LibCore dependency from libraries that do not use it 2024-01-22 08:48:34 -05:00
LibDiff AK: Remove ByteString from GenericLexer 2024-01-12 17:03:53 -07:00
LibDNS Userland: Remove LibCore dependency from libraries that do not use it 2024-01-22 08:48:34 -05:00
LibDSP Everywhere: Prefer VERIFY over assert() 2024-02-05 07:03:53 -05:00
LibEDID Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibELF LibC+LibELF: Pass information from linker via magic lookup 2024-01-24 22:17:49 -07:00
LibFileSystem LibFileSystem+Everywhere: Return ByteString from read_link() 2024-01-16 08:42:34 +00:00
LibFileSystemAccessClient LibFileSystemAccessClient+Userland: Return file paths as ByteStrings 2024-01-29 23:14:39 +00:00
LibGemini Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
LibGfx LibGfx/ICC: Add a one-element cache for CLUT conversions 2024-02-19 07:16:05 +00:00
LibGL LibGL: Add API stubs 2024-02-14 15:09:53 +01:00
LibGLSL LibGLSL: Add tests for GLSL parser 2023-08-18 15:29:48 +02:00
LibGPU Userland: Remove LibCore dependency from libraries that do not use it 2024-01-22 08:48:34 -05:00
LibGUI Base: Create user default Music and Pictures directories 2024-02-05 16:30:52 +01:00
LibHTTP LibHTTP: Ensure the ending \r\n is present before trying to read a line 2024-01-21 21:13:58 +01:00
LibIDL LibIDL: Emit an error when two decls of the same function are present 2024-02-16 15:26:43 +01:00
LibImageDecoderClient ImageDecoder: Add plumbing to allow a client to request an ideal size 2024-01-07 20:10:22 +01:00
LibIMAP Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
LibIPC LibIPC: Avoid redundant copy of every tranferred IPC message 2024-01-03 10:17:00 +01:00
LibJIT Userland: Remove LibCore dependency from libraries that do not use it 2024-01-22 08:48:34 -05:00
LibJS LibJS/Bytecode: Move to a new bytecode format 2024-02-19 21:45:27 +01:00
LibKeyboard Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibLine LibLine: Add internal functions to search character forwards & backwards 2024-02-11 08:50:51 +01:00
LibLocale Userland: Remove LibCore dependency from libraries that do not use it 2024-01-22 08:48:34 -05:00
LibMain
LibManual Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
LibMarkdown Everywhere: Use to_number<T> instead of to_{int,uint,float,double} 2023-12-23 20:41:07 +01:00
LibPartition
LibPCIDB Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibPDF LibPDF: Implement stream CIDToGIDMaps for Type0 CIDFontType2 fonts 2024-02-18 15:43:33 -05:00
LibProtocol LibProtocol: Don't assume request creation will succeed across IPC 2024-01-10 23:37:57 +01:00
LibRegex Userland: Remove LibCore dependency from libraries that do not use it 2024-01-22 08:48:34 -05:00
LibRIFF Userland: Remove LibCore dependency from libraries that do not use it 2024-01-22 08:48:34 -05:00
LibSanitizer LibSanitizer: Add _abort variants of UBSan handlers 2023-08-13 05:14:07 +02:00
LibSemVer Libraries: Implement SemVer for version parsing and comparisons 2024-02-15 18:23:05 +01:00
LibSoftGPU LibSoftGPU: Optimize GPU::Vertex lists 2023-10-15 12:14:07 +02:00
LibSQL LibSQL: Allow constructing SQL values from a String 2024-01-26 20:22:39 +01:00
LibSymbolication AK+Everywhere: Remove JsonValue APIs with implicit default values 2024-01-21 15:47:53 -07:00
LibSyntax Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibSystem
LibTest LibFileSystem+Userland: Return ByteString from real_path() 2024-01-16 08:42:34 +00:00
LibTextCodec LibTextCodec+AK: Don't validate UTF-8 strings twice 2023-12-30 13:49:50 +01:00
LibThreading Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibTimeZone Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibTLS RequestServer+LibTLS: Allow applications to specify multiple root certs 2024-02-08 08:49:32 -07:00
LibUnicode Userland: Remove LibCore dependency from libraries that do not use it 2024-01-22 08:48:34 -05:00
LibUSBDB Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibVideo LibVideo: Replace DeprecatedFlyString with FlyString 2024-01-14 15:00:13 -07:00
LibVirtGPU LibGL+Lib*GPU: Set model view and projection matrices separately 2023-10-15 12:14:07 +02:00
LibVT LibVT: Ability to generate each of the 32 ASCII control characters 2024-02-11 08:50:51 +01:00
LibWasm LibWasm: Implement all remaining comparison SIMD instructions 2024-02-18 23:50:50 +01:00
LibWeb LibWeb: Use [ExplicitNull] in Animation.idl 2024-02-19 14:51:56 -05:00
LibWebSocket Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibWebView Ladybird+WebContent: Update IPC calls to handle multiple traversables 2024-02-03 20:51:37 -05:00
LibX86 Everywhere: Rename {Deprecated => Byte}String 2023-12-17 18:25:10 +03:30
LibXML AK+LibXML+JSSpecCompiler: Move LineTrackingLexer to AK 2024-02-16 15:26:43 +01:00
CMakeLists.txt Libraries: Implement SemVer for version parsing and comparisons 2024-02-15 18:23:05 +01:00