/** * Sets the fields that were referenced from the bytecodes that were used as input to the * compilation. * * @param accessedFields the collected set of fields accessed during compilation */ public void setFields(EconomicSet<ResolvedJavaField> accessedFields) { if (accessedFields != null) { fields = accessedFields.toArray(new ResolvedJavaField[accessedFields.size()]); } }
@CompilerDirectives.TruffleBoundary static String[] findUniquePublicMemberNames(Class<?> clazz, boolean onlyStatic, boolean includeInternal) throws SecurityException { JavaClassDesc classDesc = JavaClassDesc.forClass(clazz); EconomicSet<String> names = EconomicSet.create(); names.addAll(classDesc.getFieldNames(onlyStatic)); names.addAll(classDesc.getMethodNames(onlyStatic, includeInternal)); if (onlyStatic) { names.add("class"); if (Modifier.isPublic(clazz.getModifiers())) { // no support for non-static member types now for (Class<?> t : clazz.getClasses()) { if (!isStaticTypeOrInterface(t)) { continue; } names.add(t.getSimpleName()); } } } return names.toArray(new String[names.size()]); }
@CompilerDirectives.TruffleBoundary static String[] findUniquePublicMemberNames(Class<?> clazz, boolean onlyStatic, boolean includeInternal) throws SecurityException { HostClassDesc classDesc = HostClassDesc.forClass(clazz); EconomicSet<String> names = EconomicSet.create(); names.addAll(classDesc.getFieldNames(onlyStatic)); names.addAll(classDesc.getMethodNames(onlyStatic, includeInternal)); if (onlyStatic) { names.add("class"); if (!TruffleOptions.AOT) { // GR-13208: SVM does not support Class.getClasses() yet if (Modifier.isPublic(clazz.getModifiers())) { // no support for non-static member types now for (Class<?> t : clazz.getClasses()) { if (!isStaticTypeOrInterface(t)) { continue; } names.add(t.getSimpleName()); } } } } return names.toArray(new String[names.size()]); }