1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 19:58:11 +00:00

LibJS: Don't track executing AST nodes in a Vector

Instead just link together the InterpreterNodeScopes in a linked list.
This was surprisingly hot on CanvasCycle.
This commit is contained in:
Andreas Kling 2021-03-21 17:38:42 +01:00
parent 46e61d208b
commit e0abfcb27d
4 changed files with 27 additions and 29 deletions

View file

@ -45,11 +45,8 @@ Exception::Exception(Value value)
}
if (auto* interpreter = vm.interpreter_if_exists()) {
auto& node_stack = interpreter->node_stack();
for (ssize_t i = node_stack.size() - 1; i >= 0; --i) {
auto* node = node_stack[i];
VERIFY(node);
m_source_ranges.append(node->source_range());
for (auto* node_chain = interpreter->executing_ast_node_chain(); node_chain; node_chain = node_chain->previous) {
m_source_ranges.append(node_chain->node.source_range());
}
}
}