LibJS: Stop using execute_ast_node() for class property evaluation

Instead, generate bytecode to execute their AST nodes and save the
resulting operands inside the NewClass instruction.

Moving property expression evaluation to happen before NewClass
execution also moves along creation of new private environment and
its population with private members (private members should be visible
during property evaluation).

Before:
- NewClass

After:
- CreatePrivateEnvironment
- AddPrivateName
- ...
- AddPrivateName
- NewClass
- LeavePrivateEnvironment
This commit is contained in:
Aliaksandr Kalenik 2024-05-11 22:54:41 +00:00 committed by Andreas Kling
commit 6fb1d9e516
Notes: sideshowbarker 2024-07-17 03:10:07 +09:00
9 changed files with 153 additions and 36 deletions

View file

@ -15,6 +15,7 @@
#define ENUMERATE_BYTECODE_OPS(O) \
O(Add) \
O(AddPrivateName) \
O(ArrayAppend) \
O(AsyncIteratorClose) \
O(Await) \
@ -31,6 +32,7 @@
O(CopyObjectExcludingProperties) \
O(CreateLexicalEnvironment) \
O(CreateVariableEnvironment) \
O(CreatePrivateEnvironment) \
O(CreateVariable) \
O(CreateRestParams) \
O(CreateArguments) \
@ -88,6 +90,7 @@
O(JumpUndefined) \
O(LeaveFinally) \
O(LeaveLexicalEnvironment) \
O(LeavePrivateEnvironment) \
O(LeaveUnwindContext) \
O(LeftShift) \
O(LessThan) \