annotate graal/Runtime/src/com/sun/hotspot/c1x/server/ReplacingStreams.java @ 2297:099e697d8934

Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 22 Apr 2011 15:08:53 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2297
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2011 Sun Microsystems, Inc. All rights reserved.
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 *
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * that is described in this document. In particular, and without limitation, these intellectual property
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * more additional patents or pending patent applications in the U.S. and in other countries.
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * U.S. Government Rights - Commercial software. Government users are subject to the Sun
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * supplements.
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 *
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 * registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * U.S. and other countries.
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 *
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Company, Ltd.
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 */
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 package com.sun.hotspot.c1x.server;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
23 import java.io.*;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24 import java.lang.reflect.*;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
25 import java.util.*;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
26
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
27 import com.sun.cri.ci.*;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
28 import com.sun.hotspot.c1x.*;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29 import com.sun.hotspot.c1x.Compiler;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
30
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
31 public class ReplacingStreams {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
32
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
33 private IdentityHashMap<Object, Placeholder> objectMap = new IdentityHashMap<Object, Placeholder>();
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34 private ArrayList<Object> objectList = new ArrayList<Object>();
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
35
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
36 private ReplacingOutputStream output;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37 private ReplacingInputStream input;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
38
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39 private InvocationSocket invocation;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
40
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
41 public ReplacingStreams(OutputStream outputStream, InputStream inputStream) throws IOException {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42 output = new ReplacingOutputStream(new BufferedOutputStream(outputStream));
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
43 // required, because creating an ObjectOutputStream writes a header, but doesn't flush the stream
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
44 output.flush();
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 input = new ReplacingInputStream(new BufferedInputStream(inputStream));
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
46 invocation = new InvocationSocket(output, input);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48 addStaticObject(CiValue.IllegalValue);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49 addStaticObject(HotSpotProxy.DUMMY_CONSTANT_OBJ);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
50 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
51
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
52 public void setInvocationSocket(InvocationSocket invocation) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53 this.invocation = invocation;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
54 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
55
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
56 public ReplacingOutputStream getOutput() {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
57 return output;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
58 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
59
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
60 public ReplacingInputStream getInput() {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
61 return input;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
62 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
63
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
64 public InvocationSocket getInvocation() {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
65 return invocation;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
66 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
67
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
68 private void addStaticObject(Object obj) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
69 int id = objectList.size();
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
70 objectList.add(obj);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
71 objectMap.put(obj, new Placeholder(id));
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
72 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
73
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
74 public static class Placeholder implements Serializable {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
75
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
76 public final int id;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
77
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
78 public Placeholder(int id) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
79 this.id = id;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
80 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
81
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
82 @Override
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
83 public String toString() {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
84 return "#<" + id + ">";
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
85 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
86 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
87
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
88 public static class NewRemoteCallPlaceholder implements Serializable {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
89
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
90 public final Class<?>[] interfaces;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
91
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
92 public NewRemoteCallPlaceholder(Class<?>[] interfaces) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
93 this.interfaces = interfaces;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
94 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
95 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
96
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
97 public static class NewDummyPlaceholder implements Serializable {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
98 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
99
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
100 /**
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
101 * Replaces certain cir objects that cannot easily be made Serializable.
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
102 */
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
103 public class ReplacingInputStream extends ObjectInputStream {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
104
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
105 private Compiler compiler;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
106
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
107 public ReplacingInputStream(InputStream in) throws IOException {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
108 super(in);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
109 enableResolveObject(true);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
110 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
111
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
112 public void setCompiler(Compiler compiler) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
113 this.compiler = compiler;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
114 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
115
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
116 @Override
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
117 protected Object resolveObject(Object obj) throws IOException {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
118 // see ReplacingInputStream.replaceObject for details on when these types of objects are created
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
119
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
120 if (obj instanceof Placeholder) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
121 Placeholder placeholder = (Placeholder) obj;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
122 obj = objectList.get(placeholder.id);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
123 return obj;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
124 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
125
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
126 if (obj instanceof NewRemoteCallPlaceholder) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
127 NewRemoteCallPlaceholder newPlaceholder = (NewRemoteCallPlaceholder) obj;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
128 Placeholder placeholder = new Placeholder(objectList.size());
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
129 obj = Proxy.newProxyInstance(getClass().getClassLoader(), newPlaceholder.interfaces, invocation.new Handler(placeholder));
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
130 objectMap.put(obj, placeholder);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
131 objectList.add(obj);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
132 return obj;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
133 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
134
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
135 if (obj instanceof NewDummyPlaceholder) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
136 obj = new Placeholder(objectList.size());
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
137 objectMap.put(obj, (Placeholder) obj);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
138 objectList.add(obj);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
139 return obj;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
140 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
141
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
142 return obj;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
143 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
144 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
145
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
146 /**
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
147 * Replaces certain cir objects that cannot easily be made Serializable.
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
148 */
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
149 public class ReplacingOutputStream extends ObjectOutputStream {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
150
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
151 public ReplacingOutputStream(OutputStream out) throws IOException {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
152 super(out);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
153 enableReplaceObject(true);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
154 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
155
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
156 @Override
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
157 protected Object replaceObject(Object obj) throws IOException {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
158 // is the object a known instance?
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
159 Placeholder placeholder = objectMap.get(obj);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
160 if (placeholder != null) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
161 return placeholder;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
162 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
163
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
164 // is the object an instance of a class that will always be executed remotely?
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
165 if (obj instanceof Remote) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
166 return createRemoteCallPlaceholder(obj);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
167 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
168
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
169 // is the object a constant of object type?
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
170 if (obj.getClass() == CiConstant.class) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
171 CiConstant constant = (CiConstant) obj;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
172 if (constant.kind != CiKind.Object) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
173 return obj;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
174 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
175 Object contents = constant.asObject();
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
176 if (contents == null) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
177 return obj;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
178 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
179 // don't replace if the object already is a placeholder
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
180 if (contents instanceof Placeholder || contents instanceof Long) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
181 return obj;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
182 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
183 placeholder = objectMap.get(contents);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
184 if (placeholder != null) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
185 return CiConstant.forObject(placeholder);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
186 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
187 if (contents instanceof Remote) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
188 return CiConstant.forObject(createRemoteCallPlaceholder(contents));
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
189 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
190 return CiConstant.forObject(createDummyPlaceholder(contents));
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
191 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
192 return obj;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
193 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
194 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
195
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
196 public static Class<?>[] getAllInterfaces(Class<?> clazz) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
197 HashSet<Class< ? >> interfaces = new HashSet<Class<?>>();
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
198 getAllInterfaces(clazz, interfaces);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
199 return interfaces.toArray(new Class<?>[interfaces.size()]);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
200 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
201
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
202 private static void getAllInterfaces(Class<?> clazz, HashSet<Class<?>> interfaces) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
203 for (Class< ? > iface : clazz.getInterfaces()) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
204 if (!interfaces.contains(iface)) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
205 interfaces.add(iface);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
206 getAllInterfaces(iface, interfaces);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
207 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
208 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
209 if (clazz.getSuperclass() != null) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
210 getAllInterfaces(clazz.getSuperclass(), interfaces);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
211 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
212 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
213
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
214 private Object createRemoteCallPlaceholder(Object obj) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
215 // collect all interfaces that this object's class implements (proxies only support interfaces)
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
216 objectMap.put(obj, new Placeholder(objectList.size()));
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
217 objectList.add(obj);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
218 return new NewRemoteCallPlaceholder(getAllInterfaces(obj.getClass()));
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
219 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
220
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
221 public Object createDummyPlaceholder(Object obj) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
222 objectMap.put(obj, new Placeholder(objectList.size()));
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
223 objectList.add(obj);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
224 return new NewDummyPlaceholder();
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
225 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
226 }