Mercurial > hg > truffle
annotate agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicVtblAccess.java @ 14223:de6a9e811145
8029233: Update copyright year to match last edit in jdk8 hotspot repository for 2013
Summary: Copyright year updated for files modified during 2013
Reviewed-by: twisti, iveresov
author | mikael |
---|---|
date | Tue, 24 Dec 2013 11:48:39 -0800 |
parents | c18cbe5936b8 |
children |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
2 * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
0
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 package sun.jvm.hotspot.types.basic; | |
26 | |
27 import java.util.*; | |
28 | |
29 import sun.jvm.hotspot.debugger.*; | |
30 import sun.jvm.hotspot.types.*; | |
31 | |
32 public abstract class BasicVtblAccess implements VtblAccess { | |
33 protected SymbolLookup symbolLookup; | |
34 protected String[] dllNames; | |
35 | |
36 private Map typeToVtblMap = new HashMap(); | |
37 | |
38 public BasicVtblAccess(SymbolLookup symbolLookup, | |
39 String[] dllNames) { | |
40 this.symbolLookup = symbolLookup; | |
41 this.dllNames = dllNames; | |
42 } | |
43 | |
44 static Object nullAddress = new Object(); | |
45 | |
46 public Address getVtblForType(Type type) { | |
47 if (type == null) { | |
48 return null; | |
49 } | |
50 Object result = typeToVtblMap.get(type); | |
51 if (result == nullAddress) { | |
52 return null; | |
53 } | |
54 if (result != null) { | |
55 return (Address)result; | |
56 } | |
57 String vtblSymbol = vtblSymbolForType(type); | |
58 if (vtblSymbol == null) { | |
59 typeToVtblMap.put(type, nullAddress); | |
60 return null; | |
61 } | |
62 for (int i = 0; i < dllNames.length; i++) { | |
63 Address addr = symbolLookup.lookup(dllNames[i], vtblSymbol); | |
64 if (addr != null) { | |
65 typeToVtblMap.put(type, addr); | |
66 return addr; | |
67 } | |
68 } | |
69 typeToVtblMap.put(type, nullAddress); | |
70 return null; | |
71 } | |
72 | |
73 public void clearCaches() { | |
74 typeToVtblMap.clear(); | |
75 } | |
76 | |
77 protected abstract String vtblSymbolForType(Type type); | |
78 } |