Mercurial > hg > truffle
annotate graal/com.oracle.jvmci.code/src/com/oracle/jvmci/code/ForeignCallLinkage.java @ 21607:71b338926f2e
moved JVMCI classes into their own distributions (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 29 May 2015 22:27:38 +0200 |
parents | 48c1ebd24120 |
children |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
6521
2a0c9f20baa1
consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents:
6446
diff
changeset
|
2 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 */ |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
19507
diff
changeset
|
23 package com.oracle.jvmci.code; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
19507
diff
changeset
|
25 import com.oracle.jvmci.meta.InvokeTarget; |
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
19507
diff
changeset
|
26 import com.oracle.jvmci.meta.Value; |
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
19507
diff
changeset
|
27 import com.oracle.jvmci.meta.ForeignCallDescriptor; |
7814
bab2a51f8dbe
Introduce marker interface InvokeTarget. Remove method lookupRuntimeCall from CodeCacheProvider.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7530
diff
changeset
|
28 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
29 /** |
9739
4cd4926ec683
rename: RuntimeCallTarget -> ForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9736
diff
changeset
|
30 * The runtime specific details of a {@linkplain ForeignCallDescriptor foreign} call. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
31 */ |
9739
4cd4926ec683
rename: RuntimeCallTarget -> ForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9736
diff
changeset
|
32 public interface ForeignCallLinkage extends InvokeTarget { |
6521
2a0c9f20baa1
consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents:
6446
diff
changeset
|
33 |
9739
4cd4926ec683
rename: RuntimeCallTarget -> ForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9736
diff
changeset
|
34 /** |
10870
886c2df7a7e4
Stubs need both an outgoing and incoming calling convention.
twisti
parents:
9870
diff
changeset
|
35 * Gets the details of where parameters are passed and value(s) are returned from the caller's |
886c2df7a7e4
Stubs need both an outgoing and incoming calling convention.
twisti
parents:
9870
diff
changeset
|
36 * perspective. |
9739
4cd4926ec683
rename: RuntimeCallTarget -> ForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9736
diff
changeset
|
37 */ |
10870
886c2df7a7e4
Stubs need both an outgoing and incoming calling convention.
twisti
parents:
9870
diff
changeset
|
38 CallingConvention getOutgoingCallingConvention(); |
886c2df7a7e4
Stubs need both an outgoing and incoming calling convention.
twisti
parents:
9870
diff
changeset
|
39 |
886c2df7a7e4
Stubs need both an outgoing and incoming calling convention.
twisti
parents:
9870
diff
changeset
|
40 /** |
886c2df7a7e4
Stubs need both an outgoing and incoming calling convention.
twisti
parents:
9870
diff
changeset
|
41 * Gets the details of where parameters are passed and value(s) are returned from the callee's |
886c2df7a7e4
Stubs need both an outgoing and incoming calling convention.
twisti
parents:
9870
diff
changeset
|
42 * perspective. |
886c2df7a7e4
Stubs need both an outgoing and incoming calling convention.
twisti
parents:
9870
diff
changeset
|
43 */ |
886c2df7a7e4
Stubs need both an outgoing and incoming calling convention.
twisti
parents:
9870
diff
changeset
|
44 CallingConvention getIncomingCallingConvention(); |
6445
a2299c2fc0c6
added 'name' field to RuntimeCall so that RuntimeCall objects still format nicely in traces and logs as they did when RuntimeCall was an enum
Doug Simon <doug.simon@oracle.com>
parents:
6443
diff
changeset
|
45 |
6521
2a0c9f20baa1
consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents:
6446
diff
changeset
|
46 /** |
7530
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
47 * Returns the maximum absolute offset of PC relative call to this stub from any position in the |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
48 * code cache or -1 when not applicable. Intended for determining the required size of |
5e3d1a68664e
applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents:
7300
diff
changeset
|
49 * address/offset fields. |
6521
2a0c9f20baa1
consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents:
6446
diff
changeset
|
50 */ |
2a0c9f20baa1
consolidated framework for runtime and stub calls and moved declaration of descriptors for such calls to the source file in which they are used
Doug Simon <doug.simon@oracle.com>
parents:
6446
diff
changeset
|
51 long getMaxCallTargetOffset(); |
5580
69358a2182a3
added printf-like facility (Log.java) for logging debug output in snippets
Doug Simon <doug.simon@oracle.com>
parents:
5547
diff
changeset
|
52 |
9735
2e4f035186cf
rename: Descriptor -> ForeignCallDescriptor
Doug Simon <doug.simon@oracle.com>
parents:
9488
diff
changeset
|
53 ForeignCallDescriptor getDescriptor(); |
8969
1fa6536416db
Runtime calls that do not destroy the caller's registers need no spilling at the call site.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7814
diff
changeset
|
54 |
9454
85a836bcd796
renaming for improved clarity: hasCall -> destroysCallerSavedRegisters
Doug Simon <doug.simon@oracle.com>
parents:
8969
diff
changeset
|
55 /** |
9742
cff1e11941c0
moved temporaries from CallingConvention to ForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9739
diff
changeset
|
56 * Gets the values used/killed by this foreign call. |
cff1e11941c0
moved temporaries from CallingConvention to ForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9739
diff
changeset
|
57 */ |
cff1e11941c0
moved temporaries from CallingConvention to ForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9739
diff
changeset
|
58 Value[] getTemporaries(); |
cff1e11941c0
moved temporaries from CallingConvention to ForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9739
diff
changeset
|
59 |
cff1e11941c0
moved temporaries from CallingConvention to ForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9739
diff
changeset
|
60 /** |
9739
4cd4926ec683
rename: RuntimeCallTarget -> ForeignCallLinkage
Doug Simon <doug.simon@oracle.com>
parents:
9736
diff
changeset
|
61 * Determines if the foreign call target destroys all registers. |
19507
1cde96b96673
Fixed code format issues.
Roland Schatz <roland.schatz@oracle.com>
parents:
10870
diff
changeset
|
62 * |
9454
85a836bcd796
renaming for improved clarity: hasCall -> destroysCallerSavedRegisters
Doug Simon <doug.simon@oracle.com>
parents:
8969
diff
changeset
|
63 * @return {@code true} if the register allocator must save all live registers around a call to |
85a836bcd796
renaming for improved clarity: hasCall -> destroysCallerSavedRegisters
Doug Simon <doug.simon@oracle.com>
parents:
8969
diff
changeset
|
64 * this target |
85a836bcd796
renaming for improved clarity: hasCall -> destroysCallerSavedRegisters
Doug Simon <doug.simon@oracle.com>
parents:
8969
diff
changeset
|
65 */ |
85a836bcd796
renaming for improved clarity: hasCall -> destroysCallerSavedRegisters
Doug Simon <doug.simon@oracle.com>
parents:
8969
diff
changeset
|
66 boolean destroysRegisters(); |
9870
c65bad5126b0
pull HotSpotForeignCallLinkage.isLeaf into ForeignCallLinkage and rename to canDeoptimize
Lukas Stadler <lukas.stadler@jku.at>
parents:
9742
diff
changeset
|
67 |
c65bad5126b0
pull HotSpotForeignCallLinkage.isLeaf into ForeignCallLinkage and rename to canDeoptimize
Lukas Stadler <lukas.stadler@jku.at>
parents:
9742
diff
changeset
|
68 /** |
c65bad5126b0
pull HotSpotForeignCallLinkage.isLeaf into ForeignCallLinkage and rename to canDeoptimize
Lukas Stadler <lukas.stadler@jku.at>
parents:
9742
diff
changeset
|
69 * Determines if this is call to a function that does not deoptimize, and therefore also does |
c65bad5126b0
pull HotSpotForeignCallLinkage.isLeaf into ForeignCallLinkage and rename to canDeoptimize
Lukas Stadler <lukas.stadler@jku.at>
parents:
9742
diff
changeset
|
70 * not lock, GC or throw exceptions. That is, the thread's execution state during the call is |
c65bad5126b0
pull HotSpotForeignCallLinkage.isLeaf into ForeignCallLinkage and rename to canDeoptimize
Lukas Stadler <lukas.stadler@jku.at>
parents:
9742
diff
changeset
|
71 * never inspected by another thread. |
c65bad5126b0
pull HotSpotForeignCallLinkage.isLeaf into ForeignCallLinkage and rename to canDeoptimize
Lukas Stadler <lukas.stadler@jku.at>
parents:
9742
diff
changeset
|
72 */ |
c65bad5126b0
pull HotSpotForeignCallLinkage.isLeaf into ForeignCallLinkage and rename to canDeoptimize
Lukas Stadler <lukas.stadler@jku.at>
parents:
9742
diff
changeset
|
73 boolean canDeoptimize(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
74 } |