Skip to content

8333725: Compiler Prototyping for Deconstructors #94

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

Draft
wants to merge 105 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
4c7b0ba
8333725: Compiler Prototyping for Deconstructors
biboudis Jun 6, 2024
61327bf
Fix translation of dtors with primitives and array types
biboudis Jun 17, 2024
80a3f46
Merge remote-tracking branch 'refs/remotes/upstream-amber/master' int…
biboudis Jun 17, 2024
875eb34
Restore JTreg flag
biboudis Jun 17, 2024
0eab5db
Address review 1/n
biboudis Jun 18, 2024
5d18264
Allow deeper reflection for getDeclaredDeconstructors
biboudis Jun 20, 2024
ebf223a
Replace with getSystemResourceAsStream
biboudis Jun 21, 2024
ddfe967
Attempting to fix ElementKind for variables inside a deconstructor/pa…
lahodaj Jun 23, 2024
e61f2d3
Fix NPE for null ClassLoader
biboudis Jun 24, 2024
f172fdc
Merge remote-tracking branch 'origin-amber/matchers-experiment' into …
biboudis Jun 24, 2024
32cca7c
Fix mangling
biboudis Jul 2, 2024
ad8bf16
Fix private
biboudis Jul 2, 2024
c584729
Fix tests after depending on java.base/sun.invoke.util
biboudis Jul 3, 2024
f6d33bb
Add test for NestedPatternDeclarations
biboudis Jul 9, 2024
5f35991
Records have an implicit deconstructor declaration that cannot be exp…
biboudis Jul 10, 2024
4804806
Adjust mangling
biboudis Jul 10, 2024
172d46a
Adjusts pattern overloading
biboudis Jul 16, 2024
987a35a
Align overloading of patterns in classes with record classes
biboudis Jul 19, 2024
b4341bd
Merge remote-tracking branch 'refs/remotes/upstream-amber/master' int…
biboudis Jul 19, 2024
b62b5c7
Clean-up whitespaces
biboudis Jul 19, 2024
16a7f99
Support running in non--parameters-mode
biboudis Aug 8, 2024
4780fa5
Making annotation processing work with patterns. (#6)
lahodaj Aug 9, 2024
6ab9242
Fix annotation processing with matchers
biboudis Aug 9, 2024
7163f37
Fix annotation processing with matchers (2)
biboudis Aug 12, 2024
ade7e12
Update Indify
biboudis Aug 13, 2024
84d94ff
Fix exhaustiveness bug
biboudis Aug 30, 2024
09d8083
A crude sketch for Lookup.unreflectDeconstructor (#7)
lahodaj Aug 30, 2024
69d7f7f
Fix uniqueness of patterns
biboudis Aug 31, 2024
c3b8f0e
Fix resolved pattern declaration resolution check for null
biboudis Aug 31, 2024
09128ed
Resolve unreflected deconstructor to work with invokeExact
biboudis Sep 2, 2024
512193a
Switching to Carriers.boxedComponentValueArray (#8)
viktorklang-ora Sep 9, 2024
934602d
Introduce Deconstructor <: MemberPattern <: Executable (#9)
biboudis Sep 25, 2024
58bfec1
Add instanceof statement (#10)
biboudis Sep 25, 2024
c1c4e60
Remove VM preliminary work
biboudis Oct 31, 2024
f5c926b
Merge remote-tracking branch 'upstream-amber/master' into matchers-ex…
biboudis Oct 31, 2024
b8cbc6f
Merge remote-tracking branch 'upstream-amber/master' into matchers-ex…
biboudis Nov 1, 2024
522cf97
Fix crashes
biboudis Nov 3, 2024
2837063
Fix target checking for ElementType.DECONSTRUCTOR/METHOD when applied…
biboudis Nov 4, 2024
fdeeb84
Fix examples
biboudis Nov 4, 2024
509c1ed
Merge branch 'master' into matchers-experiment
biboudis Nov 4, 2024
4b4a760
Invoke Patterns through PatternBootstraps
biboudis Oct 2, 2024
b71d7ef
Fix imports
biboudis Nov 2, 2024
d7c8539
Merge remote-tracking branch 'upstream-amber/master' into matchers-ex…
biboudis Nov 11, 2024
78e849b
Merge remote-tracking branch 'upstream-amber/master' into matchers-ex…
biboudis Nov 19, 2024
f0f9b58
Initial support for pattern in ct.sym. (#11)
lahodaj Dec 3, 2024
c14bbc8
Merge remote-tracking branch 'upstream-amber/master' into matchers-ex…
biboudis Dec 3, 2024
a78ebd9
Merge remote-tracking branch 'upstream-amber/master' into matchers-ex…
biboudis Dec 10, 2024
77a1ffe
Adjust Overloading (#12)
biboudis Jan 17, 2025
f0ec972
Separate PatternType from MethodType (#13)
lahodaj Jan 17, 2025
061d021
Merge branch 'master' into matchers-experiment
biboudis Jan 17, 2025
dacb173
Fix in Flow
biboudis Jan 17, 2025
2d58793
Fix whitespaces
biboudis Jan 17, 2025
1831b6c
Fix instanceof statement reporting
biboudis Jan 23, 2025
f902c8f
Properly reading and applying Signature attribute/type for patterns (…
lahodaj Jan 28, 2025
341cd28
Fix partial order in pattern overloading
biboudis Feb 5, 2025
5dc30e7
Add the missing case
biboudis Feb 5, 2025
b314dba
Improve error reporting around overloading
biboudis Feb 7, 2025
e13c919
Attempting to add match-failed + partial deconstructors. No support f…
lahodaj Feb 7, 2025
6c08011
Addding forgotten file. (#16)
lahodaj Feb 7, 2025
3466195
Fixing tests. (#17)
biboudis Feb 8, 2025
a0fb99f
Erase pattern signature for deconstructors (implicit or explicit) (#19)
biboudis Feb 11, 2025
c0e514b
Merge branch 'master-amber' into matchers-experiment
biboudis Feb 12, 2025
7e0ea40
Clean whitespaces
biboudis Feb 12, 2025
d96152d
Fix separate compilation issue for generic patterns in ClassReader an…
biboudis Feb 12, 2025
22fb2a2
Whitespaces
biboudis Feb 12, 2025
1ff137d
Avoid null in PatternType
biboudis Feb 13, 2025
13bde79
Precomputing accessors and Carrier constructor for the synthetic patt…
lahodaj Feb 28, 2025
12b901c
First round of instance patterns. No patterns with separate instance …
lahodaj Mar 12, 2025
bdb9836
Handle MatchCandidate properly (#22)
biboudis Mar 14, 2025
f90c88b
Pretty
biboudis Mar 17, 2025
3c91572
Merge branch 'master-amber' into matchers-experiment
biboudis Mar 17, 2025
ed9b61a
Restore deleted import
biboudis Mar 17, 2025
be40cc2
Instance patterns represented by instance methods in the translation …
biboudis Mar 21, 2025
3cf5e66
Add static patterns (#24)
biboudis Mar 21, 2025
8d31a4d
Whitespaces
biboudis Mar 21, 2025
2ebceab
Merge branch 'master-amber' into matchers-experiment
biboudis Mar 22, 2025
3bfc549
Homogenise translation. All pattern methods use one argument
biboudis Mar 23, 2025
6dd8924
Merge branch 'master-amber' into matchers-experiment
biboudis Mar 28, 2025
be6c078
Add extra parameter for initialized carrier (#25)
biboudis Apr 23, 2025
6a99c3f
Merge remote-tracking branch 'upstream-amber/master' into matchers-ex…
lahodaj Apr 24, 2025
7b75066
Merge remote-tracking branch 'biboudis-amber/matchers-experiment' int…
lahodaj Apr 24, 2025
76e2ea9
Using ParameterableDescription.
lahodaj Apr 24, 2025
a1dd4ac
Merge pull request #26 from lahodaj/matchers-experiment
biboudis Apr 28, 2025
f212776
Whitespaces
biboudis Apr 28, 2025
ca426e3
Fix parameterableAttributes order for patternDescription
biboudis May 6, 2025
9dc3b0d
Merge branch 'master-amber' into matchers-experiment-after-newaccessf…
biboudis May 7, 2025
82d0a20
Fix AttributeWriter and ClassFile after new AccessFlags
biboudis May 7, 2025
e3a5892
Fix matcher and access flags
liach May 7, 2025
737edc2
Merge pull request #27 from liach/fix/matcher-af
biboudis May 7, 2025
57ad495
Merge branch 'master' into matchers-experiment
biboudis May 7, 2025
ab3ae87
Update ListModuleDeps
biboudis May 7, 2025
ceef6db
Attempt 1
biboudis May 8, 2025
e05b788
Merge pull request #28 from biboudis/matchers-experiment-fix-windows-…
biboudis May 8, 2025
7f39861
Merge branch 'master-amber' into matchers-experiment
biboudis May 9, 2025
d513926
Merge branch 'master-amber' into matchers-experiment
biboudis May 23, 2025
2afc54d
Improving Carriers, adjusting pattern translation to the new Carriers.
lahodaj May 27, 2025
c81ffd5
Fixing test.
lahodaj May 27, 2025
cd5ae3e
Cleanup.
lahodaj May 27, 2025
47dd83d
The reflection does not need to go through Carriers.
lahodaj Jun 4, 2025
d2057fb
Cleanup - removing unnecessary throws.
lahodaj Jun 4, 2025
153efef
Simplifying reflection, as suggested
lahodaj Jun 4, 2025
a3c86cd
Fixing a crash when javac is highlighting a deconstructor
lahodaj Jun 17, 2025
92e995b
Merge pull request #32 from lahodaj/fixing-crash-deconstructor
biboudis Jun 17, 2025
338175f
Fixing tests.
lahodaj Jun 27, 2025
619b4aa
Merge pull request #30 from lahodaj/matchers-experiment-new-carriers
biboudis Jul 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -941,16 +941,28 @@ private void addAttributes(MethodDescription desc, MethodBuilder builder) {
if (desc.annotationDefaultValue != null) {
builder.with(AnnotationDefaultAttribute.of(createAttributeValue(desc.annotationDefaultValue)));
}
parameterableAttributes(desc).forEach(el -> builder.with((MethodElement) el));
if (desc.patternDescription != null) {
MethodTypeDesc methodType = MethodTypeDesc.ofDescriptor(desc.patternDescription.descriptor);
List<Attribute<?>> result = new ArrayList<>();
result.addAll(parameterableAttributes(desc.patternDescription).reversed());
builder.with(PatternAttribute.of(desc.patternDescription.name, desc.patternDescription.flags, methodType, result));
}
}

private List<Attribute<?>> parameterableAttributes(ParameterableDescription desc) {
List<Attribute<?>> result = new ArrayList<>();
if (desc.classParameterAnnotations != null && !desc.classParameterAnnotations.isEmpty()) {
builder.with(RuntimeInvisibleParameterAnnotationsAttribute.of(createParameterAnnotations(desc.classParameterAnnotations)));
result.add(RuntimeInvisibleParameterAnnotationsAttribute.of(createParameterAnnotations(desc.classParameterAnnotations)));
}
if (desc.runtimeParameterAnnotations != null && !desc.runtimeParameterAnnotations.isEmpty()) {
builder.with(RuntimeVisibleParameterAnnotationsAttribute.of(createParameterAnnotations(desc.runtimeParameterAnnotations)));
result.add(RuntimeVisibleParameterAnnotationsAttribute.of(createParameterAnnotations(desc.runtimeParameterAnnotations)));
}
if (desc.methodParameters != null && !desc.methodParameters.isEmpty()) {
builder.with(MethodParametersAttribute.of(desc.methodParameters.stream()
result.add(MethodParametersAttribute.of(desc.methodParameters.stream()
.map(mp -> MethodParameterInfo.ofParameter(Optional.ofNullable(mp.name), mp.flags)).collect(Collectors.toList())));
}
return result;
}

private void addAttributes(FieldDescription desc, FieldBuilder builder) {
Expand Down Expand Up @@ -2165,8 +2177,8 @@ private boolean readAttribute(FeatureDescription feature, Attribute<?> attr) {
case EnclosingMethodAttribute _ -> {
return false;
}
case RuntimeVisibleParameterAnnotationsAttribute a -> ((MethodDescription) feature).runtimeParameterAnnotations = parameterAnnotations2Description(a.parameterAnnotations());
case RuntimeInvisibleParameterAnnotationsAttribute a -> ((MethodDescription) feature).classParameterAnnotations = parameterAnnotations2Description(a.parameterAnnotations());
case RuntimeVisibleParameterAnnotationsAttribute a -> ((ParameterableDescription) feature).runtimeParameterAnnotations = parameterAnnotations2Description(a.parameterAnnotations());
case RuntimeInvisibleParameterAnnotationsAttribute a -> ((ParameterableDescription) feature).classParameterAnnotations = parameterAnnotations2Description(a.parameterAnnotations());
case ModuleAttribute a -> {
ModuleHeaderDescription header = (ModuleHeaderDescription) feature;
header.name = a.moduleName().name().stringValue();
Expand Down Expand Up @@ -2204,15 +2216,28 @@ private boolean readAttribute(FeatureDescription feature, Attribute<?> attr) {
return rcd;
}).collect(Collectors.toList());
}
case MethodParametersAttribute a -> ((MethodDescription) feature).methodParameters = a.parameters().stream()
.map(mpi -> new MethodDescription.MethodParam(mpi.flagsMask(), mpi.name().map(Utf8Entry::stringValue).orElse(null)))
case MethodParametersAttribute a -> ((ParameterableDescription) feature).methodParameters = a.parameters().stream()
.map(mpi -> new ParameterableDescription.MethodParam(mpi.flagsMask(), mpi.name().map(Utf8Entry::stringValue).orElse(null)))
.collect(Collectors.toList());
case PermittedSubclassesAttribute a -> {
var chd = (ClassHeaderDescription) feature;
chd.isSealed = true;
chd.permittedSubclasses = a.permittedSubclasses().stream().map(ClassEntry::asInternalName).collect(Collectors.toList());
}
case ModuleMainClassAttribute a -> ((ModuleHeaderDescription) feature).moduleMainClass = a.mainClass().asInternalName();
case PatternAttribute a -> {
assert feature instanceof MethodDescription;
MethodDescription method = (MethodDescription) feature;
PatternDescription pd = new PatternDescription();
pd.flags = a.patternFlagsMask();
pd.name = a.patternName().stringValue();
pd.descriptor = a.patternMethodType().stringValue();
for (Attribute<?> patternAttr : a.attributes()) {
readAttribute(pd, patternAttr);
}
method.patternDescription = pd;
break;
}
case RuntimeVisibleTypeAnnotationsAttribute a -> {/* do nothing for now */}
default -> throw new IllegalArgumentException("Unhandled attribute: " + attr.attributeName()); // Do nothing
}
Expand Down Expand Up @@ -3264,15 +3289,13 @@ protected void readInnerClasses(LineBasedReader reader) throws IOException {

}

static class MethodDescription extends FeatureDescription {
static class MethodDescription extends ParameterableDescription {
static int METHODS_FLAGS_NORMALIZATION = ~0;
String name;
String descriptor;
List<String> thrownTypes;
Object annotationDefaultValue;
List<List<AnnotationDescription>> classParameterAnnotations;
List<List<AnnotationDescription>> runtimeParameterAnnotations;
List<MethodParam> methodParameters;
PatternDescription patternDescription;

public MethodDescription() {
flagsNormalization = METHODS_FLAGS_NORMALIZATION;
Expand Down Expand Up @@ -3309,6 +3332,9 @@ public boolean equals(Object obj) {
if (!Objects.equals(this.annotationDefaultValue, other.annotationDefaultValue)) {
return false;
}
if (!Objects.equals(this.patternDescription, other.patternDescription)) {
return false;
}
return true;
}

Expand All @@ -3331,6 +3357,144 @@ public void write(Appendable output, String baselineVersion, String version) thr
if (annotationDefaultValue != null)
output.append(" annotationDefaultValue " + quote(AnnotationDescription.dumpAnnotationValue(annotationDefaultValue), false));
writeAttributes(output);
output.append("\n");

if (patternDescription != null) {
patternDescription.write(output, baselineVersion, version);
}
}

@Override
public boolean read(LineBasedReader reader) throws IOException {
if (!"method".equals(reader.lineKey))
return false;

name = reader.attributes.get("name");
descriptor = reader.attributes.get("descriptor");

String thrownTypesValue = reader.attributes.get("thrownTypes");

if (thrownTypesValue != null) {
thrownTypes = deserializeList(thrownTypesValue);
}

String inAnnotationDefaultValue = reader.attributes.get("annotationDefaultValue");

if (inAnnotationDefaultValue != null) {
annotationDefaultValue = parseAnnotationValue(inAnnotationDefaultValue, new int[1]);
}

readAttributes(reader);

reader.moveNext();

if ("pattern-info".equals(reader.lineKey)) {
patternDescription = new PatternDescription();
patternDescription.read(reader);
}

return true;
}

}

static class PatternDescription extends ParameterableDescription {
String name;
String descriptor;

public PatternDescription() {
}

@Override
public int hashCode() {
int hash = super.hashCode();
hash = 59 * hash + Objects.hashCode(this.name);
hash = 59 * hash + Objects.hashCode(this.descriptor);
return hash;
}

@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (!super.equals(obj)) {
return false;
}
final MethodDescription other = (MethodDescription) obj;
if (!Objects.equals(this.name, other.name)) {
return false;
}
if (!Objects.equals(this.descriptor, other.descriptor)) {
return false;
}
return true;
}

@Override
public void write(Appendable output, String baselineVersion, String version) throws IOException {
output.append("pattern-info");
output.append(" name " + quote(name, false));
output.append(" descriptor " + quote(descriptor, false));
writeAttributes(output);
output.append("\n");
}

@Override
public boolean read(LineBasedReader reader) throws IOException {
if (!"pattern-info".equals(reader.lineKey))
return false;

name = reader.attributes.get("name");
descriptor = reader.attributes.get("descriptor");

readAttributes(reader);

reader.moveNext();

return true;
}

}

static abstract class ParameterableDescription extends FeatureDescription {
List<List<AnnotationDescription>> classParameterAnnotations;
List<List<AnnotationDescription>> runtimeParameterAnnotations;
List<MethodParam> methodParameters;

public ParameterableDescription() {
}

@Override
public int hashCode() {
int hash = super.hashCode();
return hash;
}

@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (!super.equals(obj)) {
return false;
}
final MethodDescription other = (MethodDescription) obj;
if (!Objects.equals(this.classParameterAnnotations, other.classParameterAnnotations)) {
return false;
}
if (!Objects.equals(this.runtimeParameterAnnotations, other.runtimeParameterAnnotations)) {
return false;
}
if (!Objects.equals(this.methodParameters, other.methodParameters)) {
return false;
}
return true;
}

@Override
public void writeAttributes(Appendable output) throws IOException {
super.writeAttributes(output);
if (classParameterAnnotations != null && !classParameterAnnotations.isEmpty()) {
output.append(" classParameterAnnotations ");
for (List<AnnotationDescription> pa : classParameterAnnotations) {
Expand Down Expand Up @@ -3358,31 +3522,11 @@ public void write(Appendable output, String baselineVersion, String version) thr
.collect(Collectors.toList());
output.append(" methodParameters " + serializeList(paramsAsStrings));
}
output.append("\n");
}

@Override
public boolean read(LineBasedReader reader) throws IOException {
if (!"method".equals(reader.lineKey))
return false;

name = reader.attributes.get("name");
descriptor = reader.attributes.get("descriptor");

String thrownTypesValue = reader.attributes.get("thrownTypes");

if (thrownTypesValue != null) {
thrownTypes = deserializeList(thrownTypesValue);
}

String inAnnotationDefaultValue = reader.attributes.get("annotationDefaultValue");

if (inAnnotationDefaultValue != null) {
annotationDefaultValue = parseAnnotationValue(inAnnotationDefaultValue, new int[1]);
}

readAttributes(reader);

protected void readAttributes(LineBasedReader reader) {
super.readAttributes(reader);
String inClassParamAnnotations = reader.attributes.get("classParameterAnnotations");
if (inClassParamAnnotations != null) {
List<List<AnnotationDescription>> annos = new ArrayList<>();
Expand Down Expand Up @@ -3418,21 +3562,9 @@ public boolean read(LineBasedReader reader) throws IOException {
.map(string2Param)
.collect(Collectors.toList());
}

reader.moveNext();

return true;
}

public static class MethodParam {
public final int flags;
public final String name;

public MethodParam(int flags, String name) {
this.flags = flags;
this.name = name;
}
}
public record MethodParam(int flags, String name) {}
}

static class FieldDescription extends FeatureDescription {
Expand Down
12 changes: 8 additions & 4 deletions make/modules/jdk.compiler/Gendata.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,27 @@ COMPILECREATESYMBOLS_ADD_EXPORTS := \

# TODO: Unify with jdk.javadoc-gendata. Should only compile this once and share.
$(eval $(call SetupJavaCompilation, COMPILE_CREATE_SYMBOLS, \
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK), \
COMPILER := buildjdk, \
SRC := $(TOPDIR)/make/langtools/src/classes, \
INCLUDES := build/tools/symbolgenerator, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/create_symbols_javac, \
DISABLED_WARNINGS := options, \
JAVAC_FLAGS := \
--module-path $(JDK_OUTPUTDIR)/modules \
--system none \
--add-modules jdk.compiler \
$(COMPILECREATESYMBOLS_ADD_EXPORTS), \
))

$(SUPPORT_OUTPUTDIR)/symbols/ct.sym: $(COMPILE_CREATE_SYMBOLS) $(SYMBOL_FILES) \
# TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK), \
# COMPILER := buildjdk, \

$(SUPPORT_OUTPUTDIR)/symbols/ct.sym: $(COMPILE_CREATE_SYMBOLS) $(SYMBOL_FILES) $(JDK_OUTPUTDIR)/bin/java$(EXECUTABLE_SUFFIX) \
$(MODULE_INFOS) $(CT_MODULES_API_TARGETS)
$(RM) -r $(@D)
$(MKDIR) -p $(@D)
$(ECHO) Creating ct.sym classes
$(ECHO) $(CT_MODULES) $(CT_TRANSITIVE_MODULES) $(CT_EXTRA_MODULES) >$(SUPPORT_OUTPUTDIR)/symbols/included-modules
$(BUILD_JAVA_SMALL) \
$(FIXPATH) $(JDK_OUTPUTDIR)/bin/java$(EXECUTABLE_SUFFIX) \
$(COMPILECREATESYMBOLS_ADD_EXPORTS) \
-classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols_javac \
build.tools.symbolgenerator.CreateSymbols \
Expand Down
24 changes: 11 additions & 13 deletions make/modules/jdk.javadoc/Gendata.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,21 @@ JAVADOC_MODULESOURCEPATH := $(call GetModuleSrcPath)
CT_DATA_DESCRIPTION += $(TOPDIR)/src/jdk.compiler/share/data/symbols/symbols

COMPILECREATESYMBOLS_ADD_EXPORTS := \
--add-exports java.base/jdk.internal=java.compiler.interim,jdk.compiler.interim \
--add-exports jdk.internal.opt/jdk.internal.opt=jdk.compiler.interim,jdk.javadoc.interim \
--add-exports jdk.compiler.interim/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler.interim/com.sun.tools.javac.code=ALL-UNNAMED \
--add-exports jdk.compiler.interim/com.sun.tools.javac.util=ALL-UNNAMED \
--add-exports jdk.compiler.interim/com.sun.tools.javac.jvm=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
#

$(eval $(call SetupJavaCompilation, COMPILE_CREATE_SYMBOLS, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
SRC := $(TOPDIR)/make/langtools/src/classes \
$(TOPDIR)/src/jdk.jdeps/share/classes, \
SRC := $(TOPDIR)/make/langtools/src/classes, \
INCLUDES := build/tools/symbolgenerator, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/create_symbols_javadoc, \
DISABLED_WARNINGS := options, \
JAVAC_FLAGS := \
$(INTERIM_LANGTOOLS_ARGS) \
--module-path $(JDK_OUTPUTDIR)/modules \
--system none \
--add-modules jdk.compiler \
$(COMPILECREATESYMBOLS_ADD_EXPORTS), \
))

Expand All @@ -67,15 +65,15 @@ ELEMENT_LISTS_DIR := $(JDK_JAVADOC_DIR)/$(ELEMENT_LISTS_PKG)
$(JDK_JAVADOC_DIR)/_element_lists.marker: \
$(COMPILE_CREATE_SYMBOLS) \
$(wildcard $(TOPDIR)/src/jdk.compiler/share/data/symbols/*) \
$(MODULE_INFOS)
$(MODULE_INFOS) $(JDK_OUTPUTDIR)/bin/java$(EXECUTABLE_SUFFIX)
$(call MakeTargetDir)
$(call LogInfo, Creating javadoc element lists)
$(RM) $(ELEMENT_LISTS_DIR)/element-list-{$(call CommaList, \
$(call sequence, $(GENERATE_SYMBOLS_FROM_JDK_VERSION), \
$(JDK_SOURCE_TARGET_VERSION)))}.txt
# Generate element-list files for JDK 11 to current-1
$(call ExecuteWithLog, $@_historic, \
$(JAVA_SMALL) $(INTERIM_LANGTOOLS_ARGS) \
$(FIXPATH) $(JDK_OUTPUTDIR)/bin/java$(EXECUTABLE_SUFFIX) \
$(COMPILECREATESYMBOLS_ADD_EXPORTS) \
-classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols_javadoc \
build.tools.symbolgenerator.CreateSymbols \
Expand All @@ -86,7 +84,7 @@ $(JDK_JAVADOC_DIR)/_element_lists.marker: \
)
# Generate element-list file for the current JDK version
$(call ExecuteWithLog, $@_current, \
$(JAVA_SMALL) $(INTERIM_LANGTOOLS_ARGS) \
$(FIXPATH) $(JDK_OUTPUTDIR)/bin/java$(EXECUTABLE_SUFFIX) \
$(COMPILECREATESYMBOLS_ADD_EXPORTS) \
-classpath $(BUILDTOOLS_OUTPUTDIR)/create_symbols_javadoc \
build.tools.symbolgenerator.JavadocElementList \
Expand Down
Loading