Java Code Examples for com.sun.tools.javac.code.Flags#NATIVE
The following examples show how to use
com.sun.tools.javac.code.Flags#NATIVE .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GenStubs.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * methods: remove method bodies, make methods native */ @Override public void visitMethodDef(JCMethodDecl tree) { tree.mods = translate(tree.mods); tree.restype = translate(tree.restype); tree.typarams = translateTypeParams(tree.typarams); tree.params = translateVarDefs(tree.params); tree.thrown = translate(tree.thrown); if (tree.body != null) { if ((currClassMods & Flags.INTERFACE) != 0) { tree.mods.flags &= ~(Flags.DEFAULT | Flags.STATIC); } else { tree.mods.flags |= Flags.NATIVE; } tree.body = null; } result = tree; }
Example 2
Source File: JNIWriter.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private boolean needsHeader(ClassSymbol c, boolean checkNestedClasses) { if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0) return false; for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if (i.sym.kind == Kinds.MTH && (i.sym.flags() & Flags.NATIVE) != 0) return true; for (Attribute.Compound a: i.sym.getDeclarationAttributes()) { if (a.type.tsym == syms.nativeHeaderType.tsym) return true; } } if (checkNestedClasses) { for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if ((i.sym.kind == Kinds.TYP) && needsHeader(((ClassSymbol) i.sym), true)) return true; } } return false; }
Example 3
Source File: GenStubs.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * methods: remove method bodies, make methods native */ @Override public void visitMethodDef(JCMethodDecl tree) { tree.mods = translate(tree.mods); tree.restype = translate(tree.restype); tree.typarams = translateTypeParams(tree.typarams); tree.params = translateVarDefs(tree.params); tree.thrown = translate(tree.thrown); if (tree.body != null) { if ((currClassMods & Flags.INTERFACE) != 0) { tree.mods.flags &= ~(Flags.DEFAULT | Flags.STATIC); } else { tree.mods.flags |= Flags.NATIVE; } tree.body = null; } result = tree; }
Example 4
Source File: JNIWriter.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
private boolean needsHeader(ClassSymbol c, boolean checkNestedClasses) { if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0) return false; for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if (i.sym.kind == Kinds.MTH && (i.sym.flags() & Flags.NATIVE) != 0) return true; for (Attribute.Compound a: i.sym.getDeclarationAttributes()) { if (a.type.tsym == syms.nativeHeaderType.tsym) return true; } } if (checkNestedClasses) { for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if ((i.sym.kind == Kinds.TYP) && needsHeader(((ClassSymbol) i.sym), true)) return true; } } return false; }
Example 5
Source File: GenStubs.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * methods: remove method bodies, make methods native */ @Override public void visitMethodDef(JCMethodDecl tree) { tree.mods = translate(tree.mods); tree.restype = translate(tree.restype); tree.typarams = translateTypeParams(tree.typarams); tree.params = translateVarDefs(tree.params); tree.thrown = translate(tree.thrown); if (tree.body != null) { if ((currClassMods & Flags.INTERFACE) != 0) { tree.mods.flags &= ~(Flags.DEFAULT | Flags.STATIC); } else { tree.mods.flags |= Flags.NATIVE; } tree.body = null; } result = tree; }
Example 6
Source File: JNIWriter.java From hottub with GNU General Public License v2.0 | 6 votes |
private boolean needsHeader(ClassSymbol c, boolean checkNestedClasses) { if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0) return false; for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if (i.sym.kind == Kinds.MTH && (i.sym.flags() & Flags.NATIVE) != 0) return true; for (Attribute.Compound a: i.sym.getDeclarationAttributes()) { if (a.type.tsym == syms.nativeHeaderType.tsym) return true; } } if (checkNestedClasses) { for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if ((i.sym.kind == Kinds.TYP) && needsHeader(((ClassSymbol) i.sym), true)) return true; } } return false; }
Example 7
Source File: GenStubs.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * methods: remove method bodies, make methods native */ @Override public void visitMethodDef(JCMethodDecl tree) { tree.mods = translate(tree.mods); tree.restype = translate(tree.restype); tree.typarams = translateTypeParams(tree.typarams); tree.params = translateVarDefs(tree.params); tree.thrown = translate(tree.thrown); if (tree.body != null) { if ((currClassMods & Flags.INTERFACE) != 0) { tree.mods.flags &= ~(Flags.DEFAULT | Flags.STATIC); } else { tree.mods.flags |= Flags.NATIVE; } tree.body = null; } result = tree; }
Example 8
Source File: GenStubs.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * methods: remove method bodies, make methods native */ @Override public void visitMethodDef(JCMethodDecl tree) { tree.mods = translate(tree.mods); tree.restype = translate(tree.restype); tree.typarams = translateTypeParams(tree.typarams); tree.params = translateVarDefs(tree.params); tree.thrown = translate(tree.thrown); if (tree.body != null) { if ((currClassMods & Flags.INTERFACE) != 0) { tree.mods.flags &= ~(Flags.DEFAULT | Flags.STATIC); } else { tree.mods.flags |= Flags.NATIVE; } tree.body = null; } result = tree; }
Example 9
Source File: JNIWriter.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
private boolean needsHeader(ClassSymbol c, boolean checkNestedClasses) { if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0) return false; for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if (i.sym.kind == Kinds.MTH && (i.sym.flags() & Flags.NATIVE) != 0) return true; for (Attribute.Compound a: i.sym.getDeclarationAttributes()) { if (a.type.tsym == syms.nativeHeaderType.tsym) return true; } } if (checkNestedClasses) { for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if ((i.sym.kind == Kinds.TYP) && needsHeader(((ClassSymbol) i.sym), true)) return true; } } return false; }
Example 10
Source File: GenStubs.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * methods: remove method bodies, make methods native */ @Override public void visitMethodDef(JCMethodDecl tree) { tree.mods = translate(tree.mods); tree.restype = translate(tree.restype); tree.typarams = translateTypeParams(tree.typarams); tree.params = translateVarDefs(tree.params); tree.thrown = translate(tree.thrown); if (tree.body != null) { if ((currClassMods & Flags.INTERFACE) != 0) { tree.mods.flags &= ~(Flags.DEFAULT | Flags.STATIC); } else { tree.mods.flags |= Flags.NATIVE; } tree.body = null; } result = tree; }
Example 11
Source File: TreeMaker.java From netbeans with Apache License 2.0 | 6 votes |
public ModifiersTree removeModifiersModifier(ModifiersTree modifiers, Modifier modifier) { long c = ((JCModifiers) modifiers).flags & ~Flags.GENERATEDCONSTR; switch (modifier) { case ABSTRACT: c = c & ~Flags.ABSTRACT; break; case FINAL: c = c & ~Flags.FINAL; break; case NATIVE: c = c & ~Flags.NATIVE; break; case PRIVATE: c = c & ~Flags.PRIVATE; break; case PROTECTED: c = c & ~Flags.PROTECTED; break; case PUBLIC: c = c & ~Flags.PUBLIC; break; case STATIC: c = c & ~Flags.STATIC; break; case STRICTFP: c = c & ~Flags.STRICTFP; break; case SYNCHRONIZED: c = c & ~Flags.SYNCHRONIZED; break; case TRANSIENT: c = c & ~Flags.TRANSIENT; break; case VOLATILE: c = c & ~Flags.VOLATILE; break; case DEFAULT: c = c & ~Flags.DEFAULT; break; default: break; } return Modifiers(c, modifiers.getAnnotations()); }
Example 12
Source File: TreeMaker.java From netbeans with Apache License 2.0 | 6 votes |
public ModifiersTree addModifiersModifier(ModifiersTree modifiers, Modifier modifier) { long c = ((JCModifiers) modifiers).flags & ~Flags.GENERATEDCONSTR; switch (modifier) { case ABSTRACT: c = c | Flags.ABSTRACT; break; case FINAL: c = c | Flags.FINAL; break; case NATIVE: c = c | Flags.NATIVE; break; case PRIVATE: c = c | Flags.PRIVATE; break; case PROTECTED: c = c | Flags.PROTECTED; break; case PUBLIC: c = c | Flags.PUBLIC; break; case STATIC: c = c | Flags.STATIC; break; case STRICTFP: c = c | Flags.STRICTFP; break; case SYNCHRONIZED: c = c | Flags.SYNCHRONIZED; break; case TRANSIENT: c = c | Flags.TRANSIENT; break; case VOLATILE: c = c | Flags.VOLATILE; break; case DEFAULT: c = c | Flags.DEFAULT; break; default: break; } return Modifiers(c, modifiers.getAnnotations()); }
Example 13
Source File: TreeFactory.java From netbeans with Apache License 2.0 | 6 votes |
public static long modifiersToFlags(Set<Modifier> flagset) { long flags = 0L; for (Modifier mod : flagset) switch (mod) { case PUBLIC: flags |= Flags.PUBLIC; break; case PROTECTED: flags |= Flags.PROTECTED; break; case PRIVATE: flags |= Flags.PRIVATE; break; case ABSTRACT: flags |= Flags.ABSTRACT; break; case STATIC: flags |= Flags.STATIC; break; case FINAL: flags |= Flags.FINAL; break; case TRANSIENT: flags |= Flags.TRANSIENT; break; case VOLATILE: flags |= Flags.VOLATILE; break; case SYNCHRONIZED: flags |= Flags.SYNCHRONIZED; break; case NATIVE: flags |= Flags.NATIVE; break; case STRICTFP: flags |= Flags.STRICTFP; break; case DEFAULT: flags |= Flags.DEFAULT; break; default: throw new AssertionError("Unknown Modifier: " + mod); //NOI18N } return flags; }
Example 14
Source File: JNIWriter.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private boolean needsHeader(ClassSymbol c, boolean checkNestedClasses) { if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0) return false; for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if (i.sym.kind == Kinds.MTH && (i.sym.flags() & Flags.NATIVE) != 0) return true; for (Attribute.Compound a: i.sym.getDeclarationAttributes()) { if (a.type.tsym == syms.nativeHeaderType.tsym) return true; } } if (checkNestedClasses) { for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if ((i.sym.kind == Kinds.TYP) && needsHeader(((ClassSymbol) i.sym), true)) return true; } } return false; }
Example 15
Source File: GenStubs.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * methods: remove method bodies, make methods native */ @Override public void visitMethodDef(JCMethodDecl tree) { tree.mods = translate(tree.mods); tree.restype = translate(tree.restype); tree.typarams = translateTypeParams(tree.typarams); tree.params = translateVarDefs(tree.params); tree.thrown = translate(tree.thrown); if (tree.body != null) { if ((currClassMods & Flags.INTERFACE) != 0) { tree.mods.flags &= ~(Flags.DEFAULT | Flags.STATIC); } else { tree.mods.flags |= Flags.NATIVE; } tree.body = null; } result = tree; }
Example 16
Source File: JNIWriter.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private boolean needsHeader(ClassSymbol c, boolean checkNestedClasses) { if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0) return false; for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if (i.sym.kind == Kinds.MTH && (i.sym.flags() & Flags.NATIVE) != 0) return true; for (Attribute.Compound a: i.sym.getDeclarationAttributes()) { if (a.type.tsym == syms.nativeHeaderType.tsym) return true; } } if (checkNestedClasses) { for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if ((i.sym.kind == Kinds.TYP) && needsHeader(((ClassSymbol) i.sym), true)) return true; } } return false; }
Example 17
Source File: GenStubs.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * methods: remove method bodies, make methods native */ @Override public void visitMethodDef(JCMethodDecl tree) { tree.mods = translate(tree.mods); tree.restype = translate(tree.restype); tree.typarams = translateTypeParams(tree.typarams); tree.params = translateVarDefs(tree.params); tree.thrown = translate(tree.thrown); if (tree.body != null) { if ((currClassMods & Flags.INTERFACE) != 0) { tree.mods.flags &= ~(Flags.DEFAULT | Flags.STATIC); } else { tree.mods.flags |= Flags.NATIVE; } tree.body = null; } result = tree; }
Example 18
Source File: JNIWriter.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
private boolean needsHeader(ClassSymbol c, boolean checkNestedClasses) { if (c.isLocal() || (c.flags() & Flags.SYNTHETIC) != 0) return false; for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if (i.sym.kind == Kinds.MTH && (i.sym.flags() & Flags.NATIVE) != 0) return true; for (Attribute.Compound a: i.sym.getDeclarationAttributes()) { if (a.type.tsym == syms.nativeHeaderType.tsym) return true; } } if (checkNestedClasses) { for (Scope.Entry i = c.members_field.elems; i != null; i = i.sibling) { if ((i.sym.kind == Kinds.TYP) && needsHeader(((ClassSymbol) i.sym), true)) return true; } } return false; }