public static void groupFrameFields(Map<Set<FrameField>, List<String>> readGroups, Map<Set<FrameField>, List<String>> writeGroups, JRubyMethod anno, String simpleName) { if (anno.reads().length > 0) { Set<FrameField> reads = new HashSet<>(Arrays.asList(anno.reads())); List<String> nameList = readGroups.get(reads); if (nameList == null) readGroups.put(reads, nameList = new ArrayList<>()); if (anno.name().length == 0) { nameList.add(simpleName); } else { nameList.addAll(Arrays.asList(anno.name())); } } if (anno.writes().length > 0) { Set<FrameField> writes = new HashSet<>(Arrays.asList(anno.writes())); List<String> nameList = writeGroups.get(writes); if (nameList == null) writeGroups.put(writes, nameList = new ArrayList<>()); if (anno.name().length == 0) { nameList.add(simpleName); } else { nameList.addAll(Arrays.asList(anno.name())); } } }
public static void groupFrameFields(Map<Set<FrameField>, List<String>> readGroups, Map<Set<FrameField>, List<String>> writeGroups, JRubyMethod anno, String simpleName) { if (anno.reads().length > 0) { Set<FrameField> reads = new HashSet<>(Arrays.asList(anno.reads())); List<String> nameList = readGroups.get(reads); if (nameList == null) readGroups.put(reads, nameList = new ArrayList<>()); if (anno.name().length == 0) { nameList.add(simpleName); } else { nameList.addAll(Arrays.asList(anno.name())); } } if (anno.writes().length > 0) { Set<FrameField> writes = new HashSet<>(Arrays.asList(anno.writes())); List<String> nameList = writeGroups.get(writes); if (nameList == null) writeGroups.put(writes, nameList = new ArrayList<>()); if (anno.name().length == 0) { nameList.add(simpleName); } else { nameList.addAll(Arrays.asList(anno.name())); } } }
if (anno.reads().length > 0 && readGroups == Collections.EMPTY_MAP) readGroups = new HashMap<>(); if (anno.writes().length > 0 && writeGroups == Collections.EMPTY_MAP) writeGroups = new HashMap<>();
if (anno.reads().length > 0 && readGroups == Collections.EMPTY_MAP) readGroups = new HashMap<>(); if (anno.writes().length > 0 && writeGroups == Collections.EMPTY_MAP) writeGroups = new HashMap<>();
scope = true; for (FrameField field : anno.reads()) { frame |= field.needsFrame(); scope |= field.needsScope();
scope = true; for (FrameField field : anno.reads()) { frame |= field.needsFrame(); scope |= field.needsScope();
/** * Produce a CallConfiguration name that represents what *caller* methods must prepare for * the method with this annotation. * * @see org.jruby.internal.runtime.methods.CallConfiguration#getCallerCallConfigByAnno(JRubyMethod) */ public static String getCallerCallConfigNameByAnno(JRubyMethod jrubyMethod) { boolean frame = false; boolean scope = false; for (FrameField field : jrubyMethod.reads()) { frame |= field.needsFrame(); scope |= field.needsScope(); } for (FrameField field : jrubyMethod.writes()) { frame |= field.needsFrame(); scope |= field.needsScope(); } return getCallConfigName(frame, scope); }
/** * Produce a CallConfiguration that represents what *caller* methods must prepare for * the method with this annotation. * * @see org.jruby.anno.AnnotationHelper#getCallerCallConfigNameByAnno(org.jruby.anno.JRubyMethod) */ public static CallConfiguration getCallerCallConfigByAnno(JRubyMethod jrubyMethod) { boolean frame = false; boolean scope = false; for (FrameField field : jrubyMethod.reads()) { frame |= field.needsFrame(); scope |= field.needsScope(); } for (FrameField field : jrubyMethod.writes()) { frame |= field.needsFrame(); scope |= field.needsScope(); } return getCallConfig(frame, scope); }
/** * Produce a CallConfiguration that represents what *caller* methods must prepare for * the method with this annotation. * * @see org.jruby.anno.AnnotationHelper#getCallerCallConfigNameByAnno(org.jruby.anno.JRubyMethod) */ public static CallConfiguration getCallerCallConfigByAnno(JRubyMethod jrubyMethod) { boolean frame = false; boolean scope = false; for (FrameField field : jrubyMethod.reads()) { frame |= field.needsFrame(); scope |= field.needsScope(); } for (FrameField field : jrubyMethod.writes()) { frame |= field.needsFrame(); scope |= field.needsScope(); } return getCallConfig(frame, scope); }
/** * Produce a CallConfiguration name that represents what *caller* methods must prepare for * the method with this annotation. * * @see org.jruby.internal.runtime.methods.CallConfiguration#getCallerCallConfigByAnno(JRubyMethod) */ public static String getCallerCallConfigNameByAnno(JRubyMethod jrubyMethod) { boolean frame = false; boolean scope = false; for (FrameField field : jrubyMethod.reads()) { frame |= field.needsFrame(); scope |= field.needsScope(); } for (FrameField field : jrubyMethod.writes()) { frame |= field.needsFrame(); scope |= field.needsScope(); } return getCallConfigName(frame, scope); }
scope = true; for (FrameField field : jrubyMethod.reads()) { frame |= field.needsFrame(); scope |= field.needsScope();
scope = true; for (FrameField field : jrubyMethod.reads()) { frame |= field.needsFrame(); scope |= field.needsScope();