-
Notifications
You must be signed in to change notification settings - Fork 78
Map and Mmapper as trait objects
#732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
167536c to
94c5063
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally good. But I think we should use conditional compilation, and avoid including 64bits mmapper and vmmap in 32 bits if they don't work on 32 bits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR converts `Map` and `Mmapper` instances into trait objects, which builds an abstraction layer over the different VM allocation and mapping policy. This is useful for compressed pointers or 39-bit virtual space support, as they will need to use a different `Map` or `Mmapper` other than the default 64-bit implementation. --------- Co-authored-by: Yi Lin <qinsoon@gmail.com> (cherry picked from commit 5cff944)
This CL refactors the `vm_layout_constants` related code and changes all the related compile-time constants to run-time constants, so that VM bindings can configure them during boot time based on dynamic user inputs. This is a necessary refactoring to support compressed pointers. For most of the VMs (e.g. OpenJDK), compressed pointers are enabled at run-time based on command line arguments, and VM bindings should be able to enable compressed pointer heap dynamically during the VM boot process. Such a process usually involves dynamically configuring heap ranges, space memory layout, and choosing a different `VMMap` implementation [1]. Thus all `vm_layout_constants`, including heap constants, should be made as boot-time configurable, instead of compile-time constants. This CL also makes risc-v's 39-bit heap support easier, as it now should only involve adding a new set of `vm_layout_constants`. [1] This is already done by #732
This PR convert
MapandMmapperinstances into trait objects, which builds an abstraction layer over the different VM allocation and mapping policy. This is useful for compressed pointers or 39-bit virtual space support, as they will need to use a differentMaporMmapperother than the default 64-bit implementation.