-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vm] Assign top-level classes cids outside 16-bit range
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 #42533 See also b/160229360 Change-Id: I6710a644e7b0ab2d4f4c792bef8e1f91cb117421 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153607 Commit-Queue: Martin Kustermann <[email protected]> Reviewed-by: Ryan Macnak <[email protected]>
- Loading branch information
1 parent
4f66bb0
commit d215ab6
Showing
24 changed files
with
470 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.