Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java @ 22672:1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Thu, 08 Oct 2015 17:28:41 -0700 |
parents | jvmci/jdk.internal.jvmci.meta/src/jdk/internal/jvmci/meta/MemoryAccessProvider.java@dc1aeef79e7e |
children | 67c84a8b19cc |
rev | line source |
---|---|
12052
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
2 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. |
12052
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22536
diff
changeset
|
23 package jdk.vm.ci.meta; |
12052
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
25 /** |
18482
b8a622c3e99f
Move raw memory access operations to a separate interface.
Roland Schatz <roland.schatz@oracle.com>
parents:
18472
diff
changeset
|
26 * Provides memory access operations for the target VM. |
12052
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
27 */ |
18530
2906b3cc3e2f
moved application of Remote marker interface to implementation classes only
Doug Simon <doug.simon@oracle.com>
parents:
18483
diff
changeset
|
28 public interface MemoryAccessProvider { |
18472
de179c27cad3
Add support for stable array constants
Andreas Woess <andreas.woess@jku.at>
parents:
18465
diff
changeset
|
29 |
de179c27cad3
Add support for stable array constants
Andreas Woess <andreas.woess@jku.at>
parents:
18465
diff
changeset
|
30 /** |
15018
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
13488
diff
changeset
|
31 * Reads a value of this kind using a base address and a displacement. No bounds checking or |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
13488
diff
changeset
|
32 * type checking is performed. Returns {@code null} if the value is not available at this point. |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
13488
diff
changeset
|
33 * |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
13488
diff
changeset
|
34 * @param base the base address from which the value is read. |
12052
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
35 * @param displacement the displacement within the object in bytes |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
15023
diff
changeset
|
36 * @return the read value encapsulated in a {@link JavaConstant} object, or {@code null} if the |
12052
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
37 * value cannot be read. |
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
38 */ |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
39 JavaConstant readUnsafeConstant(JavaKind kind, JavaConstant base, long displacement); |
15023
652564fe42d5
Use CompressionNode for accessing compressed Klass pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
40 |
652564fe42d5
Use CompressionNode for accessing compressed Klass pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
41 /** |
652564fe42d5
Use CompressionNode for accessing compressed Klass pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
42 * Reads a primitive value using a base address and a displacement. |
652564fe42d5
Use CompressionNode for accessing compressed Klass pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
43 * |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
44 * @param kind the {@link JavaKind} of the returned {@link JavaConstant} object |
15023
652564fe42d5
Use CompressionNode for accessing compressed Klass pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
45 * @param base the base address from which the value is read |
652564fe42d5
Use CompressionNode for accessing compressed Klass pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
46 * @param displacement the displacement within the object in bytes |
652564fe42d5
Use CompressionNode for accessing compressed Klass pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
47 * @param bits the number of bits to read from memory |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
48 * @return the read value encapsulated in a {@link JavaConstant} object of {@link JavaKind} kind |
15023
652564fe42d5
Use CompressionNode for accessing compressed Klass pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
15018
diff
changeset
|
49 */ |
22536
dc1aeef79e7e
Refactoring: Rename Kind to JavaKind.
Roland Schatz <roland.schatz@oracle.com>
parents:
22054
diff
changeset
|
50 JavaConstant readPrimitiveConstant(JavaKind kind, Constant base, long displacement, int bits); |
18359
a3a2359ac88e
Support constant folding of pointer reads.
Roland Schatz <roland.schatz@oracle.com>
parents:
18295
diff
changeset
|
51 |
a3a2359ac88e
Support constant folding of pointer reads.
Roland Schatz <roland.schatz@oracle.com>
parents:
18295
diff
changeset
|
52 /** |
18483
d7cc487d1325
Move HotSpot specific functionality to new subinterface of ConstantReflectionProvider.
Roland Schatz <roland.schatz@oracle.com>
parents:
18482
diff
changeset
|
53 * Reads a Java {@link Object} value using a base address and a displacement. |
18359
a3a2359ac88e
Support constant folding of pointer reads.
Roland Schatz <roland.schatz@oracle.com>
parents:
18295
diff
changeset
|
54 * |
a3a2359ac88e
Support constant folding of pointer reads.
Roland Schatz <roland.schatz@oracle.com>
parents:
18295
diff
changeset
|
55 * @param base the base address from which the value is read |
a3a2359ac88e
Support constant folding of pointer reads.
Roland Schatz <roland.schatz@oracle.com>
parents:
18295
diff
changeset
|
56 * @param displacement the displacement within the object in bytes |
a3a2359ac88e
Support constant folding of pointer reads.
Roland Schatz <roland.schatz@oracle.com>
parents:
18295
diff
changeset
|
57 * @return the read value encapsulated in a {@link Constant} object |
a3a2359ac88e
Support constant folding of pointer reads.
Roland Schatz <roland.schatz@oracle.com>
parents:
18295
diff
changeset
|
58 */ |
18483
d7cc487d1325
Move HotSpot specific functionality to new subinterface of ConstantReflectionProvider.
Roland Schatz <roland.schatz@oracle.com>
parents:
18482
diff
changeset
|
59 JavaConstant readObjectConstant(Constant base, long displacement); |
12052
0afe7370260c
refactored constantEquals(), lookupArrayLength() and readUnsafeConstant() out of MetaAccessProvider into ConstantReflectionProvider (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
60 } |