Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 8332745
Browse files Browse the repository at this point in the history
  • Loading branch information
DanHeidinga committed May 23, 2024
2 parents 822b105 + 9d332e6 commit fd420dd
Show file tree
Hide file tree
Showing 24 changed files with 474 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public R visitTypeAsRecord(TypeElement e, P p) {
* @param p {@inheritDoc ElementKindVisitor6}
* @return the result of {@code defaultAction}
*
* @since 14
* @since 16
*/
@Override
public R visitVariableAsBindingVariable(VariableElement e, P p) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ public R visitTypeParameter(TypeParameterElement e, P p) {
* @param e {@inheritDoc ElementVisitor}
* @param p {@inheritDoc ElementVisitor}
* @return the result of scanning
*
* @since 14
*/
@Override
public R visitRecordComponent(RecordComponentElement e, P p) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ public JavaFileObject getJavaFileForOutput(Location location,
*
* @throws IllegalArgumentException {@inheritDoc}
* @throws IllegalStateException {@inheritDoc}
*
* @since 18
*/
@Override
public JavaFileObject getJavaFileForOutputForOriginatingFiles(Location location,
Expand Down Expand Up @@ -214,6 +216,8 @@ public FileObject getFileForOutput(Location location,
*
* @throws IllegalArgumentException {@inheritDoc}
* @throws IllegalStateException {@inheritDoc}
*
* @since 18
*/
@Override
public FileObject getFileForOutputForOriginatingFiles(Location location,
Expand Down
11 changes: 7 additions & 4 deletions src/jdk.compiler/share/classes/com/sun/source/tree/CaseTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ public interface CaseTree extends Tree {
* For default case, returns an empty list.
*
* @return labels for this case
* @since 12
*
* @since 14
*/
List<? extends ExpressionTree> getExpressions();

Expand Down Expand Up @@ -98,7 +99,8 @@ public interface CaseTree extends Tree {
* {@linkplain CaseKind#STATEMENT}.
*
* @return case value or null
* @since 12
*
* @since 14
*/
public default Tree getBody() {
return null;
Expand All @@ -108,7 +110,8 @@ public default Tree getBody() {
* Returns the kind of this case.
*
* @return the kind of this case
* @since 12
*
* @since 14
*/
public default CaseKind getCaseKind() {
return CaseKind.STATEMENT;
Expand All @@ -121,7 +124,7 @@ public default CaseKind getCaseKind() {
* <li>RULE: {@code case <expression> -> <expression>/<statement>}</li>
* </ul>
*
* @since 12
* @since 14
*/
public enum CaseKind {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*
* @jls 15.29 Switch Expressions
*
* @since 12
* @since 14
*/
public interface SwitchExpressionTree extends ExpressionTree {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/jdk.compiler/share/classes/com/sun/source/tree/Tree.java
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public enum Kind {
/**
* Used for instances of {@link SwitchExpressionTree}.
*
* @since 12
* @since 14
*/
SWITCH_EXPRESSION(SwitchExpressionTree.class),

Expand Down Expand Up @@ -702,7 +702,7 @@ public enum Kind {
/**
* Used for instances of {@link YieldTree}.
*
* @since 13
* @since 14
*/
YIELD(YieldTree.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ public interface TreeVisitor<R,P> {
* @param node the node being visited
* @param p a parameter value
* @return a result value
* @since 12
*
* @since 14
*/
R visitSwitchExpression(SwitchExpressionTree node, P p);

Expand Down Expand Up @@ -608,7 +609,8 @@ public interface TreeVisitor<R,P> {
* @param node the node being visited
* @param p a parameter value
* @return a result value
* @since 13
*
* @since 14
*/
R visitYield(YieldTree node, P p);
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*
* @jls 14.21 The yield Statement
*
* @since 13
* @since 14
*/
public interface YieldTree extends StatementTree {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ public R visitDocRoot(DocRootTree node, P p) {
* @param node {@inheritDoc}
* @param p {@inheritDoc}
* @return the result of scanning
*
* @since 10
*/
@Override
public R visitDocType(DocTypeTree node, P p) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ public abstract void printMessage(Diagnostic.Kind kind, CharSequence msg,
* @param tree the tree containing the entity
* @return a string containing the characters
* @spec https://www.w3.org/TR/html52 HTML Standard
*
* @since 16
*/
public abstract String getCharacters(EntityTree tree);
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public interface Plugin {
* command-line option.
*
* @return whether or not this plugin should be automatically started
*
* @since 14
*/
default boolean autoStart() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,8 @@ public R visitSwitch(SwitchTree node, P p) {
* @param node {@inheritDoc}
* @param p {@inheritDoc}
* @return the result of {@code defaultAction}
*
* @since 14
*/
@Override
public R visitSwitchExpression(SwitchExpressionTree node, P p) {
Expand Down Expand Up @@ -1047,6 +1049,8 @@ public R visitOther(Tree node, P p) {
* @param node {@inheritDoc}
* @param p {@inheritDoc}
* @return the result of {@code defaultAction}
*
* @since 14
*/
@Override
public R visitYield(YieldTree node, P p) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ public R visitSwitch(SwitchTree node, P p) {
* @param node {@inheritDoc}
* @param p {@inheritDoc}
* @return the result of scanning
*
* @since 14
*/
@Override
public R visitSwitchExpression(SwitchExpressionTree node, P p) {
Expand Down Expand Up @@ -1200,6 +1202,8 @@ public R visitErroneous(ErroneousTree node, P p) {
* @param node {@inheritDoc}
* @param p {@inheritDoc}
* @return the result of scanning
*
* @since 14
*/
@Override
public R visitYield(YieldTree node, P p) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ protected ClassFinder(Context context) {
* available from the module system.
*/
long getSupplementaryFlags(ClassSymbol c) {
if (c.name == names.module_info) {
if (jrtIndex == null || !jrtIndex.isInJRT(c.classfile) || c.name == names.module_info) {
return 0;
}

Expand All @@ -257,22 +257,17 @@ long getSupplementaryFlags(ClassSymbol c) {
try {
ModuleSymbol owningModule = packge.modle;
if (owningModule == syms.noModule) {
if (jrtIndex != null && jrtIndex.isInJRT(c.classfile)) {
JRTIndex.CtSym ctSym = jrtIndex.getCtSym(packge.flatName());
Profile minProfile = Profile.DEFAULT;
if (ctSym.proprietary)
newFlags |= PROPRIETARY;
if (ctSym.minProfile != null)
minProfile = Profile.lookup(ctSym.minProfile);
if (profile != Profile.DEFAULT && minProfile.value > profile.value) {
newFlags |= NOT_IN_PROFILE;
}
JRTIndex.CtSym ctSym = jrtIndex.getCtSym(packge.flatName());
Profile minProfile = Profile.DEFAULT;
if (ctSym.proprietary)
newFlags |= PROPRIETARY;
if (ctSym.minProfile != null)
minProfile = Profile.lookup(ctSym.minProfile);
if (profile != Profile.DEFAULT && minProfile.value > profile.value) {
newFlags |= NOT_IN_PROFILE;
}
} else if (owningModule.name == names.jdk_unsupported) {
newFlags |= PROPRIETARY;
} else {
// don't accumulate user modules in supplementaryFlags
return 0;
}
} catch (IOException ignore) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4818,7 +4818,6 @@ void checkSwitchCaseLabelDominated(JCCaseLabel unconditionalCaseLabel, List<JCCa
JCCaseLabel testCaseLabel = caseAndLabel.snd;
Type testType = labelType(testCaseLabel);
boolean dominated = false;
if (unconditionalCaseLabel == testCaseLabel) unconditionalFound = true;
if (types.isUnconditionallyExact(currentType, testType) &&
!currentType.hasTag(ERROR) && !testType.hasTag(ERROR)) {
//the current label is potentially dominated by the existing (test) label, check:
Expand All @@ -4833,11 +4832,6 @@ void checkSwitchCaseLabelDominated(JCCaseLabel unconditionalCaseLabel, List<JCCa
}
}

// Domination can occur even when we have not an unconditional pair between case labels.
if (unconditionalFound && unconditionalCaseLabel != label) {
dominated = true;
}

if (dominated) {
log.error(label.pos(), Errors.PatternDominated);
}
Expand Down
1 change: 1 addition & 0 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ compiler/c2/Test8004741.java 8235801 generic-all
compiler/c2/irTests/TestDuplicateBackedge.java 8318904 generic-all

compiler/codecache/jmx/PoolsIndependenceTest.java 8264632 macosx-all
compiler/codecache/CheckLargePages.java 8332654 linux-x64

compiler/vectorapi/reshape/TestVectorReinterpret.java 8320897 aix-ppc64,linux-ppc64le
compiler/vectorapi/VectorLogicalOpIdentityTest.java 8302459 linux-x64,windows-x64
Expand Down
Loading

0 comments on commit fd420dd

Please sign in to comment.