annotate graal/Runtime/src/com/sun/hotspot/c1x/HotSpotConstantPool.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 4e5515d09314
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) 2010 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;
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.util.*;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
25
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
26 import com.sun.cri.ri.*;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
27
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
28 /**
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
29 * Implementation of RiConstantPool for HotSpot.
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 * @author Thomas Wuerthinger, Lukas Stadler
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 public class HotSpotConstantPool extends CompilerObject implements RiConstantPool {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
34
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
35 private final long vmId;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
36
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
37 private final FastLRUIntCache<RiMethod> methodCache = new FastLRUIntCache<RiMethod>();
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
38 private final FastLRUIntCache<RiField> fieldCache = new FastLRUIntCache<RiField>();
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
39 private final FastLRUIntCache<RiType> typeCache = new FastLRUIntCache<RiType>();
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 static class FastLRUIntCache<T> implements Serializable {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
42
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
43 private static final int InitialCapacity = 4;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
44 private int lastKey;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
45 private T lastObject;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
46
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
47 private int[] keys;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
48 private Object[] objects;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49 private int count;
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 @SuppressWarnings("unchecked")
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
52 private T access(int index) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53 return (T) objects[index];
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 T get(int key) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
57 if (key == lastKey) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
58 return lastObject;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
59 } else if (count > 1) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
60 for (int i = 0; i < count; ++i) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
61 if (keys[i] == key) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
62 lastObject = access(i);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
63 lastKey = key;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
64 return lastObject;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
65 }
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 return null;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
69 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
70
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
71 public void add(int key, T object) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
72 count++;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
73 if (count == 1) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
74 lastKey = key;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
75 lastObject = object;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
76 } else {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
77 ensureSize();
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
78 keys[count - 1] = key;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
79 objects[count - 1] = object;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
80 if (count == 2) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
81 keys[0] = lastKey;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
82 objects[0] = lastObject;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
83 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
84 lastKey = key;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
85 lastObject = object;
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
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
89 private void ensureSize() {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
90 if (keys == null) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
91 keys = new int[InitialCapacity];
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
92 objects = new Object[InitialCapacity];
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
93 } else if (count > keys.length) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
94 keys = Arrays.copyOf(keys, keys.length * 2);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
95 objects = Arrays.copyOf(objects, objects.length * 2);
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 }
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 public HotSpotConstantPool(Compiler compiler, long vmId) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
101 super(compiler);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
102 this.vmId = vmId;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
103 }
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 @Override
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
106 public Object lookupConstant(int cpi) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
107 Object constant = compiler.getVMEntries().RiConstantPool_lookupConstant(vmId, cpi);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
108 return constant;
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
109 }
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 @Override
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
112 public RiSignature lookupSignature(int cpi) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
113 return compiler.getVMEntries().RiConstantPool_lookupSignature(vmId, cpi);
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 public RiMethod lookupMethod(int cpi, int byteCode) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
118 RiMethod result = methodCache.get(cpi);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
119 if (result == null) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
120 result = compiler.getVMEntries().RiConstantPool_lookupMethod(vmId, cpi, (byte) byteCode);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
121 methodCache.add(cpi, result);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
122 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
123 return result;
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 @Override
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
127 public RiType lookupType(int cpi, int opcode) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
128 RiType result = typeCache.get(cpi);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
129 if (result == null) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
130 result = compiler.getVMEntries().RiConstantPool_lookupType(vmId, cpi);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
131 typeCache.add(cpi, result);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
132 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
133 return result;
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
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
136 @Override
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
137 public RiField lookupField(int cpi, int opcode) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
138 RiField result = fieldCache.get(cpi);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
139 if (result == null) {
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
140 result = compiler.getVMEntries().RiConstantPool_lookupField(vmId, cpi, (byte) opcode);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
141 fieldCache.add(cpi, result);
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
142 }
099e697d8934 Renaming c1x4hotspotsrc => graal and HotSpotVM => Runtime
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
143 return result;
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 }