1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00
ladybird/Userland/Libraries/LibJS
Andreas Kling 3c74dc9f4d LibJS: Segregate GC-allocated objects by type
This patch adds two macros to declare per-type allocators:

- JS_DECLARE_ALLOCATOR(TypeName)
- JS_DEFINE_ALLOCATOR(TypeName)

When used, they add a type-specific CellAllocator that the Heap will
delegate allocation requests to.

The result of this is that GC objects of the same type always end up
within the same HeapBlock, drastically reducing the ability to perform
type confusion attacks.

It also improves HeapBlock utilization, since each block now has cells
sized exactly to the type used within that block. (Previously we only
had a handful of block sizes available, and most GC allocations ended
up with a large amount of slack in their tails.)

There is a small performance hit from this, but I'm sure we can make
up for it elsewhere.

Note that the old size-based allocators still exist, and we fall back
to them for any type that doesn't have its own CellAllocator.
2023-11-19 12:10:31 +01:00
..
Bytecode LibJS: Instantiate primitive array expressions using a single operation 2023-11-18 08:37:34 +01:00
Contrib/Test262 LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
Heap LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
JIT LibJS: Instantiate primitive array expressions using a single operation 2023-11-18 08:37:34 +01:00
Runtime LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
Tests LibJS: Change Intl.Locale info APIs from property getters to methods 2023-11-13 20:10:58 +01:00
AST.cpp LibJS: Inline fast case for Value::to_{boolean,number,numeric,primitive} 2023-10-07 07:13:52 +02:00
AST.h LibJS: Instantiate primitive array expressions using a single operation 2023-11-18 08:37:34 +01:00
CMakeLists.txt LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
Console.cpp LibJS: Inline fast case for Value::to_{boolean,number,numeric,primitive} 2023-10-07 07:13:52 +02:00
Console.h LibJS: Begin implementing console.dir 2023-06-22 06:46:27 +02:00
CyclicModule.cpp LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
CyclicModule.h LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
Forward.h LibJS: Introduce Builtins 2023-11-17 19:06:25 +01:00
Lexer.cpp AK: Make "foo"_string infallible 2023-08-07 16:03:27 +02:00
Lexer.h Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
MarkupGenerator.cpp LibJS: Use OrderedHashMap for the Shape property table 2023-09-17 21:00:11 +02:00
MarkupGenerator.h LibJS: Fix redundancy-detection when printing raw values 2023-06-15 08:09:16 +02:00
Module.cpp LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
Module.h LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
Parser.cpp LibJS: Don't create arguments object due to o.arguments access 2023-11-16 13:26:21 +01:00
Parser.h LibJS: Don't create arguments object due to o.arguments access 2023-11-16 13:26:21 +01:00
ParserError.cpp LibJS: Add to_string definitions to CodeGenerationError and ParserError 2023-02-17 09:14:23 -05:00
ParserError.h LibJS: Add to_string definitions to CodeGenerationError and ParserError 2023-02-17 09:14:23 -05:00
Position.h LibJS: Make line-and-column resolution fast for large minified JS 2023-09-12 17:21:42 +02:00
Print.cpp LibJS: Make Value::to_string_without_side_effects() infallible 2023-08-09 17:09:16 +02:00
Print.h Everywhere: Remove the AK:: qualifier from Stream usages 2023-02-13 00:50:07 +00:00
SafeFunction.h LibJS: Add GC graph dumper 2023-08-17 18:27:02 +02:00
Script.cpp LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
Script.h LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
SourceCode.cpp LibJS: Make line-and-column resolution fast for large minified JS 2023-09-12 17:21:42 +02:00
SourceCode.h LibJS: Make line-and-column resolution fast for large minified JS 2023-09-12 17:21:42 +02:00
SourceRange.h LibJS: Make line-and-column resolution fast for large minified JS 2023-09-12 17:21:42 +02:00
SourceTextModule.cpp LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
SourceTextModule.h LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
SyntaxHighlighter.cpp LibSyntax+Userland: Make LibSyntax not depend on LibGUI 2023-08-29 07:57:39 -04:00
SyntaxHighlighter.h LibSyntax: Teach each highlighter about it's comment syntax 2022-11-27 18:28:43 -07:00
SyntheticModule.cpp LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
SyntheticModule.h LibJS: Segregate GC-allocated objects by type 2023-11-19 12:10:31 +01:00
Token.cpp AK+Everywhere: Remove the null state of DeprecatedString 2023-10-13 18:33:21 +03:30
Token.h LibJS: Remove DeprecatedString usage from Token 2023-01-26 20:25:25 +00:00