2090 switch(kind) { |
2090 switch(kind) { |
2091 default: |
2091 default: |
2092 if (m.containsKey(lambdaIdent.sym)) { |
2092 if (m.containsKey(lambdaIdent.sym)) { |
2093 Symbol tSym = m.get(lambdaIdent.sym); |
2093 Symbol tSym = m.get(lambdaIdent.sym); |
2094 JCTree t = make.Ident(tSym).setType(lambdaIdent.type); |
2094 JCTree t = make.Ident(tSym).setType(lambdaIdent.type); |
2095 tSym.setTypeAttributes(lambdaIdent.sym.getRawTypeAttributes()); |
|
2096 return t; |
2095 return t; |
2097 } |
2096 } |
2098 break; |
2097 break; |
2099 case CAPTURED_OUTER_THIS: |
2098 case CAPTURED_OUTER_THIS: |
2100 if (lambdaIdent.sym.owner.kind == TYP && m.containsKey(lambdaIdent.sym.owner)) { |
2099 if (lambdaIdent.sym.owner.kind == TYP && m.containsKey(lambdaIdent.sym.owner)) { |
2101 // Transform outer instance variable references anchoring them to the captured synthetic. |
2100 // Transform outer instance variable references anchoring them to the captured synthetic. |
2102 Symbol tSym = m.get(lambdaIdent.sym.owner); |
2101 Symbol tSym = m.get(lambdaIdent.sym.owner); |
2103 JCExpression t = make.Ident(tSym).setType(lambdaIdent.sym.owner.type); |
2102 JCExpression t = make.Ident(tSym).setType(lambdaIdent.sym.owner.type); |
2104 tSym.setTypeAttributes(lambdaIdent.sym.owner.getRawTypeAttributes()); |
|
2105 t = make.Select(t, lambdaIdent.name); |
2103 t = make.Select(t, lambdaIdent.name); |
2106 t.setType(lambdaIdent.type); |
2104 t.setType(lambdaIdent.type); |
2107 TreeInfo.setSymbol(t, lambdaIdent.sym); |
2105 TreeInfo.setSymbol(t, lambdaIdent.sym); |
2108 return t; |
2106 return t; |
2109 } |
2107 } |
2120 Assert.check(fieldAccess.name == names._this); |
2118 Assert.check(fieldAccess.name == names._this); |
2121 Map<Symbol, Symbol> m = translatedSymbols.get(LambdaSymbolKind.CAPTURED_OUTER_THIS); |
2119 Map<Symbol, Symbol> m = translatedSymbols.get(LambdaSymbolKind.CAPTURED_OUTER_THIS); |
2122 if (m.containsKey(fieldAccess.sym.owner)) { |
2120 if (m.containsKey(fieldAccess.sym.owner)) { |
2123 Symbol tSym = m.get(fieldAccess.sym.owner); |
2121 Symbol tSym = m.get(fieldAccess.sym.owner); |
2124 JCExpression t = make.Ident(tSym).setType(fieldAccess.sym.owner.type); |
2122 JCExpression t = make.Ident(tSym).setType(fieldAccess.sym.owner.type); |
2125 tSym.setTypeAttributes(fieldAccess.sym.owner.getRawTypeAttributes()); |
|
2126 return t; |
2123 return t; |
2127 } |
2124 } |
2128 return null; |
2125 return null; |
2129 } |
2126 } |
2130 |
2127 |
2320 PARAM, // original to translated lambda parameters |
2317 PARAM, // original to translated lambda parameters |
2321 LOCAL_VAR, // original to translated lambda locals |
2318 LOCAL_VAR, // original to translated lambda locals |
2322 CAPTURED_VAR, // variables in enclosing scope to translated synthetic parameters |
2319 CAPTURED_VAR, // variables in enclosing scope to translated synthetic parameters |
2323 CAPTURED_THIS, // class symbols to translated synthetic parameters (for captured member access) |
2320 CAPTURED_THIS, // class symbols to translated synthetic parameters (for captured member access) |
2324 CAPTURED_OUTER_THIS, // used when `this' capture is illegal, but outer this capture is legit (JDK-8129740) |
2321 CAPTURED_OUTER_THIS, // used when `this' capture is illegal, but outer this capture is legit (JDK-8129740) |
2325 TYPE_VAR // original to translated lambda type variables |
2322 TYPE_VAR; // original to translated lambda type variables |
|
2323 |
|
2324 boolean propagateAnnotations() { |
|
2325 switch (this) { |
|
2326 case CAPTURED_VAR: |
|
2327 case CAPTURED_THIS: |
|
2328 case CAPTURED_OUTER_THIS: |
|
2329 return false; |
|
2330 default: |
|
2331 return true; |
|
2332 } |
|
2333 } |
2326 } |
2334 } |
2327 |
2335 |
2328 /** |
2336 /** |
2329 * **************************************************************** |
2337 * **************************************************************** |
2330 * Signature Generation |
2338 * Signature Generation |