mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibJS: Cache commonly used FlyStrings in the VM
Roughly 7% of test-js runtime was spent creating FlyStrings from string literals. This patch frontloads that work and caches all the commonly used names in LibJS on a CommonPropertyNames struct that hangs off VM.
This commit is contained in:
@@ -35,7 +35,7 @@ Exception::Exception(Value value)
|
||||
{
|
||||
auto& call_stack = vm().call_stack();
|
||||
for (ssize_t i = call_stack.size() - 1; i >= 0; --i) {
|
||||
auto function_name = call_stack[i].function_name;
|
||||
String function_name = call_stack[i].function_name;
|
||||
if (function_name.is_empty())
|
||||
function_name = "<anonymous>";
|
||||
m_trace.append(function_name);
|
||||
|
||||
Reference in New Issue
Block a user