equal
deleted
inserted
replaced
1892 } |
1892 } |
1893 break; |
1893 break; |
1894 case NULLCHK: |
1894 case NULLCHK: |
1895 result = od.load(); |
1895 result = od.load(); |
1896 code.emitop0(dup); |
1896 code.emitop0(dup); |
1897 genNullCheck(tree.pos()); |
1897 genNullCheck(tree); |
1898 break; |
1898 break; |
1899 default: |
1899 default: |
1900 Assert.error(); |
1900 Assert.error(); |
1901 } |
1901 } |
1902 } |
1902 } |
1903 } |
1903 } |
1904 |
1904 |
1905 /** Generate a null check from the object value at stack top. */ |
1905 /** Generate a null check from the object value at stack top. */ |
1906 private void genNullCheck(DiagnosticPosition pos) { |
1906 private void genNullCheck(JCTree tree) { |
|
1907 code.statBegin(tree.pos); |
1907 if (allowBetterNullChecks) { |
1908 if (allowBetterNullChecks) { |
1908 callMethod(pos, syms.objectsType, names.requireNonNull, |
1909 callMethod(tree.pos(), syms.objectsType, names.requireNonNull, |
1909 List.of(syms.objectType), true); |
1910 List.of(syms.objectType), true); |
1910 } else { |
1911 } else { |
1911 callMethod(pos, syms.objectType, names.getClass, |
1912 callMethod(tree.pos(), syms.objectType, names.getClass, |
1912 List.nil(), false); |
1913 List.nil(), false); |
1913 } |
1914 } |
1914 code.emitop0(pop); |
1915 code.emitop0(pop); |
1915 } |
1916 } |
1916 |
1917 |
2085 if (!selectSuper && (ssym == null || ssym.kind != TYP)) |
2086 if (!selectSuper && (ssym == null || ssym.kind != TYP)) |
2086 base = base.load(); |
2087 base = base.load(); |
2087 base.drop(); |
2088 base.drop(); |
2088 } else { |
2089 } else { |
2089 base.load(); |
2090 base.load(); |
2090 genNullCheck(tree.selected.pos()); |
2091 genNullCheck(tree.selected); |
2091 } |
2092 } |
2092 result = items. |
2093 result = items. |
2093 makeImmediateItem(sym.type, ((VarSymbol) sym).getConstValue()); |
2094 makeImmediateItem(sym.type, ((VarSymbol) sym).getConstValue()); |
2094 } else { |
2095 } else { |
2095 if (isInvokeDynamic(sym)) { |
2096 if (isInvokeDynamic(sym)) { |