mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 10:49:00 +00:00
d215ab6d73
Right now we assign class ids to top-level classes, abstract classes as well as concrete classes. All of them have allocated from a 16-bit pool of ids. The VM FATAL()s once it hits that limit. Customers who run very large programs (significant amount of generated code) on the Dart VM have started to hit this 16-bit class limit. Concrete classes can have instances in the heap. Our current heap layout only allows 16-bit class ids to be encoded in the header word. To avoid increasing the size of heap objects or shrinking the size of the identity hash code to 16-bit we keep class ids in object headers to be 16-bit. Abstract classes cannot have instances in the heap. Though their class ids are encoded in type objects. Furthermore we sort classes in AOT/AppJIT mode to perform fast class-id range checks. To avoid impacting this optimization we treat abstract classes the same way as concrete classes. Top-level classes cannot have instances in the heap. Their class ids are only used in the runtime code, for example for hot-reload as well as part of the service protocol. => We can allocate class ids outside the 16-bit range for top-level classes, thereby freeing a significant amount of space in the 16-bit range. This CL does exactly that: We change classid_t to be int32_t. The ClassLayout::id_ can now be assigned ids outside 16-bit range for top-level classes. To do this we keep dart classes and top level classes as separate arrays in the ClassTable. Issue https://github.com/dart-lang/sdk/issues/42533 See also b/160229360 Change-Id: I6710a644e7b0ab2d4f4c792bef8e1f91cb117421 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153607 Commit-Queue: Martin Kustermann <kustermann@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> |
||
---|---|---|
.. | ||
address_sanitizer.h | ||
allocation.h | ||
assert.cc | ||
assert.h | ||
atomic.h | ||
BUILD.gn | ||
elf.h | ||
floating_point.h | ||
floating_point_win.cc | ||
floating_point_win.h | ||
globals.h | ||
growable_array.h | ||
hashmap.cc | ||
hashmap.h | ||
leak_sanitizer.h | ||
memory_sanitizer.h | ||
platform_sources.gni | ||
safe_stack.h | ||
signal_blocker.h | ||
splay-tree-inl.h | ||
splay-tree.h | ||
syslog.h | ||
syslog_android.cc | ||
syslog_fuchsia.cc | ||
syslog_linux.cc | ||
syslog_macos.cc | ||
syslog_win.cc | ||
text_buffer.cc | ||
text_buffer.h | ||
thread_sanitizer.h | ||
unaligned.h | ||
undefined_behavior_sanitizer.h | ||
unicode.cc | ||
unicode.h | ||
utils.cc | ||
utils.h | ||
utils_android.cc | ||
utils_android.h | ||
utils_fuchsia.cc | ||
utils_fuchsia.h | ||
utils_linux.cc | ||
utils_linux.h | ||
utils_macos.cc | ||
utils_macos.h | ||
utils_win.cc | ||
utils_win.h |