Skip to content
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

8237072: [lworld] Add support for denoting and deriving the reference projection #32

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -426,15 +426,15 @@ public boolean isReferenceProjection() {
}

/**
* Return the value projection IFF `this' happens to be derived reference projection, null
* Return the value projection IFF 'this' happens to be derived reference projection, null
* otherwise.
*/
public Symbol valueProjection() {
return null;
}

/**
* Return the reference projection IFF `this' happens to be value projection, null
* Return the reference projection IFF 'this' happens to be value projection, null
* otherwise.
*/
public Symbol referenceProjection() {
@@ -543,7 +543,7 @@ public ClassSymbol enclClass() {
}

/** The outermost class which indirectly owns this symbol.
* `outermost' being a lexical construct, should transcend
* 'outermost' being a lexical construct, should transcend
* projections
*/
public ClassSymbol outermostClass() {
@@ -1316,7 +1316,7 @@ public static class ClassSymbol extends TypeSymbol implements TypeElement {
*/
private List<RecordComponent> recordComponents = List.nil();

/* the `other' projection: If `this' is an inline class then 'projection' is its reference projection
/* the 'other' projection: If 'this' is an inline class then 'projection' is its reference projection
and vice versa.
*/
public ClassSymbol projection;
@@ -1666,20 +1666,20 @@ public ClassSymbol referenceProjection() {

projection = new ClassSymbol(projectionFlags, projectionName, projectedType, this.owner);
projection.members_field = WriteableScope.create(projection);
for (Symbol s : this.members().getSymbols(s->(s.kind == MTH || s.kind == VAR), NON_RECURSIVE)) { // TODO: TYP?, CLINT?
for (Symbol s : this.members().getSymbols(s->(s.kind == MTH || s.kind == VAR), NON_RECURSIVE)) {
Symbol clone = null;
if (s.kind == MTH) {
MethodSymbol vMethod = (MethodSymbol)s;
MethodSymbol rMethod = vMethod.clone(projection);
vMethod.projection = rMethod;
rMethod.projection = vMethod;
clone = rMethod;
MethodSymbol valMethod = (MethodSymbol)s;
MethodSymbol refMethod = valMethod.clone(projection);
valMethod.projection = refMethod;
refMethod.projection = valMethod;
clone = refMethod;
} else if (s.kind == VAR) {
VarSymbol vVar = (VarSymbol)s;
VarSymbol rVar = vVar.clone(projection);
vVar.projection = rVar;
rVar.projection = vVar;
clone = rVar;
VarSymbol valVar = (VarSymbol)s;
VarSymbol refVar = valVar.clone(projection);
valVar.projection = refVar;
refVar.projection = valVar;
clone = refVar;
}
projection.members_field.enter(clone);
}
@@ -1712,7 +1712,7 @@ public static class VarSymbol extends Symbol implements VariableElement {
*/
public int adr = -1;

/* The `other' projection: If `this' is a field of an inline class, then 'projection' is the
/* The 'other' projection: If 'this' is a field of an inline class, then 'projection' is the
its doppleganger in its referene projection class and vice versa.
*/
public VarSymbol projection;
@@ -1964,7 +1964,7 @@ public static class MethodSymbol extends Symbol implements ExecutableElement {
*/
public Attribute defaultValue = null;

/* The `other' projection: If `this' is a method of an inline class, then 'projection' is the
/* The 'other' projection: If 'this' is a method of an inline class, then 'projection' is the
its doppleganger in its referene projection class and vice versa.
*/
public MethodSymbol projection;
@@ -1024,7 +1024,7 @@ public static class ClassType extends Type implements DeclaredType, LoadableCons
*/
public List<Type> all_interfaces_field;

/* The `other' projection: If `this' is type of an inline class, then 'projection' is the
/* The 'other' projection: If 'this' is type of an inline class, then 'projection' is the
its doppleganger in its referene projection world and vice versa.
*/
public ClassType projection;
@@ -2191,7 +2191,7 @@ public Type visitClassType(ClassType t, Symbol sym) {
if (t.tsym == sym)
return t;

// No man may be an island, but the bell tolls for a value.
// No man may be an island, but the bell tolls for a value.
if (isValue(t))
return null;

@@ -898,7 +898,7 @@ boolean checkDisjoint(DiagnosticPosition pos, long flags, long set1, long set2)
}

void checkParameterizationWithValues(DiagnosticPosition pos, Type t) {
if (t.tsym != syms.classType.tsym) { // tolerate Value.class for now.
if (t.tsym != syms.classType.tsym) { // tolerate Value.class.
valueParameterizationChecker.visit(t, pos);
}
}