1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-19 09:01:00 +00:00
serenity/Userland/Libraries/LibJS
Andreas Kling 5eef07d232 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.
2021-06-13 19:11:29 +02:00
..
Bytecode LibJS: Store and maintain an "execution generation" counter 2021-06-12 18:39:23 +01:00
Heap LibJS: Don't generate unused HeapBlock names on non-SerenityOS systems 2021-06-13 19:11:29 +02:00
Runtime LibJS: Avoid lots of string-to-int during global object construction 2021-06-13 19:11:29 +02:00
Tests LibJS: Rewrite Array.prototype.slice to be spec compliant 2021-06-13 16:21:34 +01:00
AST.cpp AK: Rename Vector::append(Vector) => Vector::extend(Vector) 2021-06-12 13:24:45 +02:00
AST.h LibJS: Add a bunch of fast_is<T> to avoid slow RTTI in hot code 2021-06-13 19:11:29 +02:00
CMakeLists.txt LibJS: Add the MapIterator built-in and the key/values/entries methods 2021-06-13 00:33:18 +01:00
Console.cpp Everywhere: Use linusg@serenityos.org for my copyright headers 2021-04-22 22:51:19 +02:00
Console.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Forward.h LibJS: Add the MapIterator built-in and the key/values/entries methods 2021-06-13 00:33:18 +01:00
Interpreter.cpp LibJS: Store and maintain an "execution generation" counter 2021-06-12 18:39:23 +01:00
Interpreter.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Lexer.cpp LibJS: Use the new is_ascii_foo() helpers from AK 2021-06-13 19:11:29 +02:00
Lexer.h Userland: Allow building SerenityOS with -funsigned-char 2021-06-13 18:52:58 +02:00
MarkupGenerator.cpp LibJS: Avoid lots of string-to-int during global object construction 2021-06-13 19:11:29 +02:00
MarkupGenerator.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
Parser.cpp LibJS: Use the new is_ascii_foo() helpers from AK 2021-06-13 19:11:29 +02:00
Parser.h LibJS: Implement generator functions (only in bytecode mode) 2021-06-11 00:30:09 +02:00
SourceRange.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
SyntaxHighlighter.cpp LibWeb+LibSyntax: Implement nested syntax highlighters 2021-06-07 14:45:49 +04:30
SyntaxHighlighter.h LibWeb+LibSyntax: Implement nested syntax highlighters 2021-06-07 14:45:49 +04:30
Token.cpp LibJS: Use the new is_ascii_foo() helpers from AK 2021-06-13 19:11:29 +02:00
Token.h Everywhere: Use s.unverwerth@serenityos.org :^) 2021-05-29 12:30:08 +01:00