changeset 18959:7efef7005e53

provide Stub.getStubs() method to access all installed stubs
author Doug Simon <doug.simon@oracle.com>
date Tue, 27 Jan 2015 12:25:38 +0100
parents bb0f5ab57e1e
children 858b1e3ab2ee
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java	Tue Jan 27 12:24:44 2015 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java	Tue Jan 27 12:25:38 2015 +0100
@@ -54,6 +54,8 @@
  */
 public abstract class Stub {
 
+    private static final List<Stub> stubs = new ArrayList<>();
+
     /**
      * The linkage information for a call to this stub from compiled code.
      */
@@ -107,6 +109,14 @@
     public Stub(HotSpotProviders providers, HotSpotForeignCallLinkage linkage) {
         this.linkage = linkage;
         this.providers = providers;
+        stubs.add(this);
+    }
+
+    /**
+     * Gets an immutable view of all stubs that have been created.
+     */
+    public static Collection<Stub> getStubs() {
+        return Collections.unmodifiableList(stubs);
     }
 
     /**