diff c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/InvocationSocket.java @ 2284:569d3fe7d65c

non-static VMEntries and VMExits, CompilationServer simplifications
author Lukas Stadler <lukas.stadler@jku.at>
date Thu, 07 Apr 2011 15:32:25 +0200
parents 9e5e83ca2259
children 8c426c2891c8
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/InvocationSocket.java	Mon Apr 04 21:02:45 2011 +0200
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/InvocationSocket.java	Thu Apr 07 15:32:25 2011 +0200
@@ -39,6 +39,7 @@
     private final ObjectOutputStream output;
     private final ObjectInputStream input;
     private Object delegate;
+    private DelegateCallback callback;
 
     public InvocationSocket(ObjectOutputStream output, ObjectInputStream input) {
         this.output = output;
@@ -49,6 +50,14 @@
         this.delegate = delegate;
     }
 
+    public static interface DelegateCallback {
+        public Object getDelegate();
+    }
+
+    public void setDelegateCallback(DelegateCallback callback) {
+        this.callback = callback;
+    }
+
     private static class Invocation implements Serializable {
 
         public String methodName;
@@ -95,6 +104,11 @@
                 throw new RuntimeException((Throwable) in);
             }
 
+            if (delegate == null) {
+                delegate = callback.getDelegate();
+                callback = null;
+            }
+
             Invocation invoke = (Invocation) in;
             Method method = null;
             for (Method m : delegate.getClass().getDeclaredMethods()) {