Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Commit

Permalink
Add description
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Jul 1, 2023
1 parent dad33c8 commit e62e7aa
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,20 @@ private void genModuleDescriptorsMethod(ClassBuilder clb) {
return;
}

// Instead of adding the module descriptor calls in this method,
// helper methods are created in separate helper methods.
// Let m1, m2, ..., mn be the calls to the module descriptor builder
// Here, n is larger than moduleDescriptorsPerMethod, which will hit the 64kb limit of method length.
// thus, we create f1, f2, ... where
// - f1 calls m1, ... m_{moduleDescriptorsPerMethod-1},
// - f2 calls m_{moduleDescriptorsPerMethod}, ... m_{2xmoduleDescriptorsPerMethod-1},
// - etc.
//
// Inside m, the class SystemModulesClassGenerator.DedupSetBuilder is used.
// That class creates sets caching variables. It stores its caches in the local storage.
// Since the local storage is destroyed across each method, but the sets are needed across methods,
// the local variables are passed on to the next helper method using a list of these variables.

List<List<ModuleInfo>> splitModuleInfos = new ArrayList<>();
List<ModuleInfo> currentModuleInfos = null;
for (int index = 0; index < moduleInfos.size(); index++) {
Expand Down

0 comments on commit e62e7aa

Please sign in to comment.