From 56ae699a27eca52cc0bb14cbc9944b62136be52b Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sun, 20 Sep 2020 21:07:29 +0200 Subject: [PATCH] Separate addPropertyAliases in two methods The quantity of data used to generate addPropertyAliases creates a big method, that is too big for java and results in "error: code too large". This is most likely due to added data between the expected version of icu and the actual version of icu in Guix. --- .../org/antlr/v4/tool/templates/unicodedata.st | 15 ++++++++++++--- .../unicode/UnicodeDataTemplateController.java | 18 ++++++++++-------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/tool/resources/org/antlr/v4/tool/templates/unicodedata.st b/tool/resources/org/antlr/v4/tool/templates/unicodedata.st index f5052b7..125d15b 100644 --- a/tool/resources/org/antlr/v4/tool/templates/unicodedata.st +++ b/tool/resources/org/antlr/v4/tool/templates/unicodedata.st @@ -1,4 +1,4 @@ -unicodedata(propertyCodePointRanges, propertyAliases) ::= << +unicodedata(propertyCodePointRanges, propertyAliasesA, propertyAliasesB) ::= << package org.antlr.v4.unicode; import java.util.Arrays; @@ -17,7 +17,7 @@ public enum UnicodeData { ; private static final Map\ propertyCodePointRanges = new HashMap\(); - private static final Map\ propertyAliases = new HashMap\(); + private static final Map\ propertyAliases = new HashMap\( + ); // Work around Java 64k bytecode method limit by splitting up static // initialization into one method per Unicode property @@ -33,8 +33,17 @@ static private void addProperty() { \}}; separator="\n\n"> // Property aliases + static private void addPropertyAliasesA() { + ".toLowerCase(Locale.US), "".toLowerCase(Locale.US)); }; separator="\n"> + } + + static private void addPropertyAliasesB() { + ".toLowerCase(Locale.US), "".toLowerCase(Locale.US)); }; separator="\n"> + } + static private void addPropertyAliases() { - ".toLowerCase(Locale.US), "".toLowerCase(Locale.US)); }; separator="\n"> + addPropertyAliasesA(); + addPropertyAliasesB(); } // Put it all together diff --git a/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java b/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java index 570190c..692cee0 100644 --- a/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java +++ b/tool/src/org/antlr/v4/unicode/UnicodeDataTemplateController.java @@ -74,17 +74,19 @@ public abstract class UnicodeDataTemplateController { addTR35ExtendedPictographicPropertyCodesToCodePointRanges(propertyCodePointRanges); addEmojiPresentationPropertyCodesToCodePointRanges(propertyCodePointRanges); - Map propertyAliases = new LinkedHashMap(); - addUnicodeCategoryCodesToNames(propertyAliases); - addUnicodeBinaryPropertyCodesToNames(propertyAliases); - addUnicodeScriptCodesToNames(propertyAliases); - addUnicodeBlocksToNames(propertyAliases); - addUnicodeIntPropertyCodesToNames(propertyAliases); - propertyAliases.put("EP", "Extended_Pictographic"); + Map propertyAliasesA = new LinkedHashMap(); + Map propertyAliasesB = new LinkedHashMap(); + addUnicodeCategoryCodesToNames(propertyAliasesA); + addUnicodeBinaryPropertyCodesToNames(propertyAliasesA); + addUnicodeScriptCodesToNames(propertyAliasesA); + addUnicodeBlocksToNames(propertyAliasesB); + addUnicodeIntPropertyCodesToNames(propertyAliasesB); + propertyAliasesB.put("EP", "Extended_Pictographic"); Map properties = new LinkedHashMap(); properties.put("propertyCodePointRanges", propertyCodePointRanges); - properties.put("propertyAliases", propertyAliases); + properties.put("propertyAliasesA", propertyAliasesA); + properties.put("propertyAliasesB", propertyAliasesB); return properties; } -- 2.28.0 rd-disk-image): Set "i586-pc-gnu" as image 'target' field, (maybe-with-target): new procedure, (system-image): honor image 'target' field using the above procedure. Mathieu Othacehe 2020-05-26image: Add partition file-system options support....* gnu/image.scm (<partition>)[file-system-options]: New field, (partition-file-system-options): new exported procedure. * gnu/system/image.scm (partition->gexp): Adapt accordingly. * gnu/build/image.scm (sexp->partition): Also adapt accordingly, (make-ext-image): and pass file-system options to mke2fs. Mathieu Othacehe 2020-05-26image: Set offset default to zero....* gnu/image.scm (<partition>)[offset]: Set to zero by default. * gnu/system/image.scm (system-disk-image): Adapt accordingly. Mathieu Othacehe 2020-05-26image: Add partition offset support....* gnu/image.scm (partition-offset): New procedure, (<partition>)[offset]: new field. * gnu/system/image.scm (system-disk-image): Apply the partition offset. Mathieu Othacehe 2020-05-05image: Add a new API....Raw disk-images and ISO9660 images are created in a Qemu virtual machine. This is quite fragile, very slow, and almost unusable without KVM. For all these reasons, add support for host image generation. This implies the use new image generation mechanisms. - Raw disk images: images of partitions are created using tools such as mke2fs and mkdosfs depending on the partition file-system type. The partition images are then assembled into a final image using genimage. - ISO9660 images: the ISO root directory is populated within the store. GNU xorriso is then called on that directory, in the exact same way as this is done in (gnu build vm) module. Those mechanisms are built upon the new (gnu image) module. * gnu/image.scm: New file. * gnu/system/image.scm: New file. * gnu/build/image: New file. * gnu/local.mk: Add them. * gnu/system/vm.scm (system-disk-image): Rename to system-disk-image-in-vm. * gnu/ci.scm (qemu-jobs): Adapt to new API. * gnu/tests/install.scm (run-install): Ditto. * guix/scripts/system.scm (system-derivation-for-action): Ditto. Mathieu Othacehe