ladybird/Libraries/LibJS/Bytecode
Andreas Kling e486ad2c0c AsmIntGen: Use platform-optimal codegen for NaN-boxing operations
Convert extract_tag, unbox_int32, unbox_object, box_int32, and
box_int32_clean from DSL macros into codegen instructions, allowing
each backend to emit optimal platform-specific code.

On aarch64, this produces significant improvements:

- extract_tag: single `lsr xD, xS, #48` instead of `mov` + `lsr`
  (3-operand shifts are free on ARM). Saves 1 instruction at 57
  call sites.

- unbox_object: single `and xD, xS, #0xffffffffffff` instead of
  `mov` + `shl` + `shr`. The 48-bit mask is a valid ARM64 logical
  immediate. Saves 2 instructions at 6 call sites.

- box_int32: `mov wD, wS` + `movk xD, #tag, lsl #48` instead of
  `mov` + `and 0xFFFFFFFF` + `movabs tag` + `or`. The w-register
  mov zero-extends, and movk overwrites just the top 16 bits.
  Saves 2 instructions and no longer clobbers t0 (rax).

- box_int32_clean: `movk xD, #tag, lsl #48` (1 instruction) instead
  of `mov` + `movabs tag` + `or` (saves 2 instructions, no t0
  clobber).

On x86_64, the generated code is equivalent to the old macros.
2026-03-07 22:18:22 +01:00
..
AsmInterpreter AsmIntGen: Use platform-optimal codegen for NaN-boxing operations 2026-03-07 22:18:22 +01:00
ASTCodegen.cpp LibJS: Consolidate Put bytecode instructions and reduce code bloat 2026-03-04 18:53:12 +01:00
BasicBlock.cpp LibJS: Stop worrying about Instruction destructors 2025-11-21 09:46:03 +01:00
BasicBlock.h LibJS: Collapse handler/finalizer into single exception handler target 2026-02-09 16:35:39 +01:00
BuiltinAbstractOperationsEnabled.h LibJS: Introduce NativeJavaScriptBackedFunction 2025-11-30 11:54:54 +01:00
Builtins.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Builtins.h LibJS: Skip generic call when using regexp builtins in StringPrototype 2025-12-13 13:51:12 -06:00
Bytecode.def LibJS: Consolidate Put bytecode instructions and reduce code bloat 2026-03-04 18:53:12 +01:00
ClassBlueprint.h LibJS: Add ClassBlueprint data structures 2026-02-11 23:57:41 +01:00
Executable.cpp LibJS: Add dump_to_string() for AST nodes and bytecode executables 2026-02-24 09:39:42 +01:00
Executable.h LibJS: Add dump_to_string() for AST nodes and bytecode executables 2026-02-24 09:39:42 +01:00
FormatOperand.h LibJS: Flatten Operand to 32-bit index in bytecode instruction stream 2025-12-09 21:44:13 -06:00
Generator.cpp LibJS: Consolidate Put bytecode instructions and reduce code bloat 2026-03-04 18:53:12 +01:00
Generator.h LibJS: Consolidate TDZ check emission into Generator helper 2026-02-17 20:44:57 +01:00
IdentifierTable.cpp LibJS+LibWeb+WebContent: Port JS::PropertyKey to UTF-16 2025-08-05 07:07:15 -04:00
IdentifierTable.h LibJS: Give Interpreter a direct pointer to the identifier table 2025-10-07 23:50:51 +02:00
Instruction.cpp LibJS: Flatten Operand to 32-bit index in bytecode instruction stream 2025-12-09 21:44:13 -06:00
Instruction.h Meta: Reformat QtCreator file-listing script for readability 2026-02-23 13:10:03 +01:00
Interpreter.cpp LibJS: Add AsmInterpreter, a low-level assembly bytecode interpreter 2026-03-07 13:09:59 +01:00
Interpreter.h LibJS: Move Interpreter::get/set inline and expose internals 2026-03-07 13:09:59 +01:00
Label.cpp Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Label.h LibJS: Revert Enable EXPLICIT_SYMBOL_EXPORT 2025-07-22 11:51:29 -04:00
Operand.h LibJS: Flatten Operand to 32-bit index in bytecode instruction stream 2025-12-09 21:44:13 -06:00
PropertyAccess.h LibJS: Consolidate Put bytecode instructions and reduce code bloat 2026-03-04 18:53:12 +01:00
PropertyKeyTable.cpp LibJS: Cache fully-formed PropertyKeys in Executable 2025-12-11 14:34:45 -06:00
PropertyKeyTable.h LibJS+LibWeb: Add missing GC marking visits 2026-01-07 12:48:58 +01:00
PutKind.h LibJS: Consolidate Put bytecode instructions and reduce code bloat 2026-03-04 18:53:12 +01:00
RegexTable.cpp LibJS: Don't rerun regexp optimizer every time a regexp literal is used 2025-12-12 11:43:35 -06:00
RegexTable.h LibJS: Don't rerun regexp optimizer every time a regexp literal is used 2025-12-12 11:43:35 -06:00
Register.h LibJS: Replace implicit environment stack with explicit registers 2026-02-09 16:35:39 +01:00
ScopedOperand.cpp LibJS: Flatten Operand to 32-bit index in bytecode instruction stream 2025-12-09 21:44:13 -06:00
ScopedOperand.h LibJS: Revert Enable EXPLICIT_SYMBOL_EXPORT 2025-07-22 11:51:29 -04:00
StringTable.cpp LibJS+LibWeb: Port interned bytecode strings to UTF-16 2025-08-14 10:27:08 +02:00
StringTable.h LibJS+LibWeb: Port interned bytecode strings to UTF-16 2025-08-14 10:27:08 +02:00