mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:18:12 +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:
parent
9f6c5f68b6
commit
7b863330dc
45 changed files with 651 additions and 392 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue