mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibJS: Wire NewClass to ClassBlueprint
Replace the ClassExpression const& reference in the NewClass instruction with a u32 class_blueprint_index. The interpreter now reads from the ClassBlueprint stored on the Executable and calls construct_class() instead of the AST-based create_class_constructor(). Literal field initializers (numbers, booleans, null, strings, negated numbers) are used directly in construct_class() without creating an ECMAScriptFunctionObject, avoiding function creation overhead for common field patterns like `x = 0` or `name = "hello"`. Set class_field_initializer_name on SharedFunctionInstanceData at codegen time for statically-known field keys (identifiers, private identifiers, string literals, and numeric literals). For computed keys, the name is set at runtime in construct_class(). ClassExpression AST nodes are no longer referenced from bytecode.
This commit is contained in:
committed by
Andreas Kling
parent
fa6a3f31dc
commit
ec2f4e4a7b
Notes:
github-actions[bot]
2026-02-11 23:01:20 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/ec2f4e4a7bd Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7896
@@ -669,7 +669,7 @@ op NewClass < Instruction
|
||||
m_dst: Operand
|
||||
m_super_class: Optional<Operand>
|
||||
m_class_environment: Operand
|
||||
m_class_expression: ClassExpression const&
|
||||
m_class_blueprint_index: u32
|
||||
m_lhs_name: Optional<IdentifierTableIndex>
|
||||
m_element_keys_count: u32
|
||||
m_element_keys: Optional<Operand>[]
|
||||
|
||||
Reference in New Issue
Block a user