1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibJS: Use the IdentifierTable for NewFunction and NewClass lhs names

This makes them trivially copyable, which is an assumption multiple
optimizations use when rebuilding the instruction stream.

This fixes most optimized crashes in the test262 suite.
This commit is contained in:
Hendiadyoin1 2023-06-28 18:17:13 +02:00 committed by Andreas Kling
parent c21255da7f
commit 37067cf3ca
6 changed files with 32 additions and 28 deletions

View file

@ -85,9 +85,9 @@ public:
void push_home_object(Register);
void pop_home_object();
void emit_new_function(JS::FunctionExpression const&, Optional<DeprecatedFlyString const&> lhs_name);
void emit_new_function(JS::FunctionExpression const&, Optional<IdentifierTableIndex> lhs_name);
CodeGenerationErrorOr<void> emit_named_evaluation_if_anonymous_function(Expression const&, Optional<DeprecatedFlyString const&> lhs_name);
CodeGenerationErrorOr<void> emit_named_evaluation_if_anonymous_function(Expression const&, Optional<IdentifierTableIndex> lhs_name);
void begin_continuable_scope(Label continue_target, Vector<DeprecatedFlyString> const& language_label_set);
void end_continuable_scope();