Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java @ 21708:6df25b1418be
moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 03 Jun 2015 18:06:44 +0200 |
parents | 5024c80224c7 |
children | d915361cc3a1 |
rev | line source |
---|---|
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
1 /* |
19529
8fc336a04d77
Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
17206
diff
changeset
|
2 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
4 * |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
8 * |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
13 * accompanied this code). |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
14 * |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
18 * |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
21 * questions. |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
22 */ |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
23 package com.oracle.graal.hotspot.sparc; |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
24 |
21708
6df25b1418be
moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21673
diff
changeset
|
25 import com.oracle.jvmci.asm.sparc.*; |
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:
19685
diff
changeset
|
26 import com.oracle.jvmci.code.Register; |
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:
19685
diff
changeset
|
27 import com.oracle.jvmci.meta.Kind; |
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:
19685
diff
changeset
|
28 import com.oracle.jvmci.meta.LIRKind; |
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:
19685
diff
changeset
|
29 import com.oracle.jvmci.meta.Value; |
21673
5024c80224c7
moved com.oracle.graal.[amd64|sparc] to com.oracle.jvmci.[amd64|sparc] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21556
diff
changeset
|
30 |
16653
403b07a69400
[SPARC] Let the register allocator manage where the thread is aved during the runtime call.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
13227
diff
changeset
|
31 import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*; |
21673
5024c80224c7
moved com.oracle.graal.[amd64|sparc] to com.oracle.jvmci.[amd64|sparc] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21556
diff
changeset
|
32 import static com.oracle.jvmci.sparc.SPARC.*; |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
33 |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
34 import com.oracle.graal.lir.*; |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
35 import com.oracle.graal.lir.asm.*; |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
36 import com.oracle.graal.lir.sparc.*; |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
37 |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
38 @Opcode("CRUNTIME_CALL_EPILOGUE") |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
39 final class SPARCHotSpotCRuntimeCallEpilogueOp extends SPARCLIRInstruction { |
19529
8fc336a04d77
Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
17206
diff
changeset
|
40 public static final LIRInstructionClass<SPARCHotSpotCRuntimeCallEpilogueOp> TYPE = LIRInstructionClass.create(SPARCHotSpotCRuntimeCallEpilogueOp.class); |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
41 |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
42 private final int threadLastJavaSpOffset; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
43 private final int threadLastJavaPcOffset; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
44 private final int threadJavaFrameAnchorFlagsOffset; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
45 private final Register thread; |
16653
403b07a69400
[SPARC] Let the register allocator manage where the thread is aved during the runtime call.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
13227
diff
changeset
|
46 @Use({REG, STACK}) protected Value threadTemp; |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
47 |
16653
403b07a69400
[SPARC] Let the register allocator manage where the thread is aved during the runtime call.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
13227
diff
changeset
|
48 public SPARCHotSpotCRuntimeCallEpilogueOp(int threadLastJavaSpOffset, int threadLastJavaPcOffset, int threadJavaFrameAnchorFlagsOffset, Register thread, Value threadTemp) { |
19529
8fc336a04d77
Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
17206
diff
changeset
|
49 super(TYPE); |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
50 this.threadLastJavaSpOffset = threadLastJavaSpOffset; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
51 this.threadLastJavaPcOffset = threadLastJavaPcOffset; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
52 this.threadJavaFrameAnchorFlagsOffset = threadJavaFrameAnchorFlagsOffset; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
53 this.thread = thread; |
16653
403b07a69400
[SPARC] Let the register allocator manage where the thread is aved during the runtime call.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents:
13227
diff
changeset
|
54 this.threadTemp = threadTemp; |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
55 } |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
56 |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
57 @Override |
13227
1a66453f73db
renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
58 public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
59 |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
60 // Restore the thread register when coming back from the runtime. |
17206
2d401b9ca70d
[SPARC] Improve the lookup for delayable candidates, renaming interfaces/methods
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17177
diff
changeset
|
61 SPARCMove.move(crb, masm, thread.asValue(LIRKind.value(Kind.Long)), threadTemp, SPARCDelayedControlTransfer.DUMMY); |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
62 |
11233 | 63 // Reset last Java frame, last Java PC and flags. |
19684
00d7b0adaf66
[SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17206
diff
changeset
|
64 masm.stx(g0, new SPARCAddress(thread, threadLastJavaSpOffset)); |
00d7b0adaf66
[SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17206
diff
changeset
|
65 masm.stx(g0, new SPARCAddress(thread, threadLastJavaPcOffset)); |
00d7b0adaf66
[SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
17206
diff
changeset
|
66 masm.stw(g0, new SPARCAddress(thread, threadJavaFrameAnchorFlagsOffset)); |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
67 } |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
68 } |