annotate c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotConstantPool.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 e5ba25730d9b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
1 /*
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
2 * Copyright (c) 2010 Sun Microsystems, Inc. All rights reserved.
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
3 *
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
4 * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
5 * that is described in this document. In particular, and without limitation, these intellectual property
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
6 * rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
7 * more additional patents or pending patent applications in the U.S. and in other countries.
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
8 *
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
9 * U.S. Government Rights - Commercial software. Government users are subject to the Sun
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
10 * Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
11 * supplements.
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
12 *
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
13 * Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
14 * registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
15 * are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
16 * U.S. and other countries.
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
17 *
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
18 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
19 * Company, Ltd.
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
20 */
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
21 package com.sun.hotspot.c1x;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
22
2284
569d3fe7d65c non-static VMEntries and VMExits, CompilationServer simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents: 2107
diff changeset
23 import java.io.*;
2062
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
24 import java.util.*;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
25
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
26 import com.sun.cri.ri.*;
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
27
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
28 /**
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
29 * Implementation of RiConstantPool for HotSpot.
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
30 *
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
31 * @author Thomas Wuerthinger, Lukas Stadler
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
32 */
2054
3c0a889a176b Added GC stats. Enabling intrinsics.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1465
diff changeset
33 public class HotSpotConstantPool extends CompilerObject implements RiConstantPool {
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
34
1445
a7b84a5e16c6 Remove caching for constant pool entries (same index can be used to retrieve e.g. type and field). Fast fail on bailout in C1X.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1437
diff changeset
35 private final long vmId;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
36
2062
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
37 private final FastLRUIntCache<RiMethod> methodCache = new FastLRUIntCache<RiMethod>();
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
38 private final FastLRUIntCache<RiField> fieldCache = new FastLRUIntCache<RiField>();
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
39 private final FastLRUIntCache<RiType> typeCache = new FastLRUIntCache<RiType>();
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
40
2284
569d3fe7d65c non-static VMEntries and VMExits, CompilationServer simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents: 2107
diff changeset
41 public static class FastLRUIntCache<T> implements Serializable {
2062
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
42
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
43 private static final int InitialCapacity = 4;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
44 private int lastKey;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
45 private T lastObject;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
46
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
47 private int[] keys;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
48 private Object[] objects;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
49 private int count;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
50
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
51 @SuppressWarnings("unchecked")
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
52 private T access(int index) {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
53 return (T) objects[index];
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
54 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
55
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
56 public T get(int key) {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
57 if (key == lastKey) {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
58 return lastObject;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
59 } else if (count > 1) {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
60 for (int i = 0; i < count; ++i) {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
61 if (keys[i] == key) {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
62 lastObject = access(i);
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
63 lastKey = key;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
64 return lastObject;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
65 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
66 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
67 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
68 return null;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
69 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
70
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
71 public void add(int key, T object) {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
72 count++;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
73 if (count == 1) {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
74 lastKey = key;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
75 lastObject = object;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
76 } else {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
77 ensureSize();
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
78 keys[count - 1] = key;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
79 objects[count - 1] = object;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
80 if (count == 2) {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
81 keys[0] = lastKey;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
82 objects[0] = lastObject;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
83 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
84 lastKey = key;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
85 lastObject = object;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
86 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
87 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
88
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
89 private void ensureSize() {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
90 if (keys == null) {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
91 keys = new int[InitialCapacity];
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
92 objects = new Object[InitialCapacity];
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
93 } else if (count > keys.length) {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
94 keys = Arrays.copyOf(keys, keys.length * 2);
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
95 objects = Arrays.copyOf(objects, objects.length * 2);
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
96 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
97 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
98 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
99
2284
569d3fe7d65c non-static VMEntries and VMExits, CompilationServer simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents: 2107
diff changeset
100 public HotSpotConstantPool(Compiler compiler, long vmId) {
569d3fe7d65c non-static VMEntries and VMExits, CompilationServer simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents: 2107
diff changeset
101 super(compiler);
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
102 this.vmId = vmId;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
103 }
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
104
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
105 @Override
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
106 public Object lookupConstant(int cpi) {
2284
569d3fe7d65c non-static VMEntries and VMExits, CompilationServer simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents: 2107
diff changeset
107 Object constant = compiler.getVMEntries().RiConstantPool_lookupConstant(vmId, cpi);
2062
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
108 return constant;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
109 }
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
110
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
111 @Override
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
112 public RiSignature lookupSignature(int cpi) {
2284
569d3fe7d65c non-static VMEntries and VMExits, CompilationServer simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents: 2107
diff changeset
113 return compiler.getVMEntries().RiConstantPool_lookupSignature(vmId, cpi);
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
114 }
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
115
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
116 @Override
2062
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
117 public RiMethod lookupMethod(int cpi, int byteCode) {
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
118 RiMethod result = methodCache.get(cpi);
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
119 if (result == null) {
2284
569d3fe7d65c non-static VMEntries and VMExits, CompilationServer simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents: 2107
diff changeset
120 result = compiler.getVMEntries().RiConstantPool_lookupMethod(vmId, cpi, (byte) byteCode);
2062
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
121 methodCache.add(cpi, result);
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
122 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
123 return result;
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
124 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
125
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
126 @Override
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
127 public RiType lookupType(int cpi, int opcode) {
2062
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
128 RiType result = typeCache.get(cpi);
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
129 if (result == null) {
2284
569d3fe7d65c non-static VMEntries and VMExits, CompilationServer simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents: 2107
diff changeset
130 result = compiler.getVMEntries().RiConstantPool_lookupType(vmId, cpi);
2062
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
131 typeCache.add(cpi, result);
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
132 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
133 return result;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
134 }
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
135
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
136 @Override
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
137 public RiField lookupField(int cpi, int opcode) {
2062
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
138 RiField result = fieldCache.get(cpi);
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
139 if (result == null) {
2284
569d3fe7d65c non-static VMEntries and VMExits, CompilationServer simplifications
Lukas Stadler <lukas.stadler@jku.at>
parents: 2107
diff changeset
140 result = compiler.getVMEntries().RiConstantPool_lookupField(vmId, cpi, (byte) opcode);
2062
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
141 fieldCache.add(cpi, result);
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
142 }
231bf6b9f5ad Added caching for constant pool entries.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 2054
diff changeset
143 return result;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1417
diff changeset
144 }
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
145 }