diff options
author | Andreas Kling <kling@serenityos.org> | 2021-06-13 18:59:07 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-13 19:11:29 +0200 |
commit | 5eef07d232fc179f0640bbb8cff575cd239c4d65 (patch) | |
tree | f2793ff33530445dcf110b42d0013636ee52c11c /Userland/Games/Solitaire | |
parent | 53a8a11973cb4be1dc688fc245775540630bf87d (diff) | |
download | serenity-5eef07d232fc179f0640bbb8cff575cd239c4d65.zip |
LibJS: Avoid lots of string-to-int during global object construction
We were doing a *lot* of string-to-int conversion while creating a new
global object. This happened because Object::put() would try to convert
the property name (string) to an integer to see if it refers to an
indexed property.
Sidestep this issue by using PropertyName for the CommonPropertyNames
struct on VM (vm.names.foo), and giving PropertyName a flag that tells
us whether it's a string that *may be* a number.
All CommonPropertyNames are set up so they are known to not be numbers.
Diffstat (limited to 'Userland/Games/Solitaire')
0 files changed, 0 insertions, 0 deletions