001package daikon.chicory; 002 003import java.util.ArrayDeque; 004import java.util.ArrayList; 005import java.util.Deque; 006import java.util.List; 007import org.checkerframework.checker.lock.qual.GuardedBy; 008 009/** 010 * Data that is shared across Chicory. The primary users are Instrument.java and Runtime.java. As 011 * those classes may be executing on different threads, these items must be accessed via 012 * synchronized statements. 013 */ 014@SuppressWarnings( 015 "initialization.fields.uninitialized") // library initialized in code added by run-time 016// instrumentation 017public class SharedData { 018 /** 019 * List of classes recently transformed. This list is examined in each enter/exit and the decl 020 * information for any new classes are printed out and the class is then removed from the list. 021 */ 022 // The order of this list depends on the order of loading by the JVM. 023 // Declared as Deque instead of List to permit use of removeFirst(). 024 public static final @GuardedBy("<self>") Deque<ClassInfo> new_classes = 025 new ArrayDeque<ClassInfo>(); 026 027 /** List of all instrumented classes. */ 028 public static final @GuardedBy("<self>") List<ClassInfo> all_classes = new ArrayList<>(); 029 030 /** List of all instrumented methods. */ 031 public static final @GuardedBy("<self>") List<MethodInfo> methods = new ArrayList<>(); 032}