Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVmSymbols.java @ 23366:45168ac6d3bc
Merge.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Fri, 29 Apr 2016 11:10:18 +0200 |
parents | 90da61843aa4 |
children | 9e1235406b59 |
rev | line source |
---|---|
14012 | 1 /* |
23336
90da61843aa4
Backout removal of HotSpotVMSymbols class.
Roland Schatz <roland.schatz@oracle.com>
parents:
23322
diff
changeset
|
2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. |
14012 | 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 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 */ | |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22598
diff
changeset
|
23 package jdk.vm.ci.hotspot; |
14012 | 24 |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22598
diff
changeset
|
25 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22598
diff
changeset
|
26 import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; |
22569
ec96f33a101d
updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents:
22542
diff
changeset
|
27 import sun.misc.Unsafe; |
14012 | 28 |
29 /** | |
30 * Class to access the C++ {@code vmSymbols} table. | |
31 */ | |
23336
90da61843aa4
Backout removal of HotSpotVMSymbols class.
Roland Schatz <roland.schatz@oracle.com>
parents:
23322
diff
changeset
|
32 final class HotSpotVmSymbols { |
14012 | 33 |
34 /** | |
15968
42eaa579e134
more improvements to runtime initialization:
Doug Simon <doug.simon@oracle.com>
parents:
15291
diff
changeset
|
35 * Returns the symbol in the {@code vmSymbols} table at position {@code index} as {@link String} |
42eaa579e134
more improvements to runtime initialization:
Doug Simon <doug.simon@oracle.com>
parents:
15291
diff
changeset
|
36 * . |
42eaa579e134
more improvements to runtime initialization:
Doug Simon <doug.simon@oracle.com>
parents:
15291
diff
changeset
|
37 * |
14012 | 38 * @param index position in the symbol table |
39 * @return the symbol at position id | |
40 */ | |
22598
ed53e370f04c
Make implementation classes package private.
Roland Schatz <roland.schatz@oracle.com>
parents:
22569
diff
changeset
|
41 static String symbolAt(int index) { |
21552
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21526
diff
changeset
|
42 HotSpotJVMCIRuntimeProvider runtime = runtime(); |
15968
42eaa579e134
more improvements to runtime initialization:
Doug Simon <doug.simon@oracle.com>
parents:
15291
diff
changeset
|
43 HotSpotVMConfig config = runtime.getConfig(); |
14012 | 44 assert config.vmSymbolsFirstSID <= index && index < config.vmSymbolsSIDLimit : "index " + index + " is out of bounds"; |
45 assert config.symbolPointerSize == Unsafe.ADDRESS_SIZE : "the following address read is broken"; | |
22542
15579668ec3a
renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents:
22541
diff
changeset
|
46 return runtime.getCompilerToVM().getSymbol(UNSAFE.getAddress(config.vmSymbolsSymbols + index * config.symbolPointerSize)); |
14012 | 47 } |
48 } |