Mercurial > hg > truffle
annotate graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java @ 13227:1a66453f73db
renamed TargetMethodAssembler to CompilationResultBuilder
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 03 Dec 2013 10:51:16 +0100 |
parents | f87c68d79f07 |
children | 403b07a69400 |
rev | line source |
---|---|
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
1 /* |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. |
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 |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
25 import static com.oracle.graal.sparc.SPARC.*; |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
26 |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
27 import com.oracle.graal.api.code.*; |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
28 import com.oracle.graal.asm.sparc.*; |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
29 import com.oracle.graal.asm.sparc.SPARCAssembler.Stw; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
30 import com.oracle.graal.asm.sparc.SPARCAssembler.Stx; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
31 import com.oracle.graal.asm.sparc.SPARCMacroAssembler.Mov; |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
32 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
|
33 import com.oracle.graal.lir.asm.*; |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
34 import com.oracle.graal.lir.sparc.*; |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
35 |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
36 @Opcode("CRUNTIME_CALL_EPILOGUE") |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
37 final class SPARCHotSpotCRuntimeCallEpilogueOp extends SPARCLIRInstruction { |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
38 |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
39 private final int threadLastJavaSpOffset; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
40 private final int threadLastJavaPcOffset; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
41 private final int threadJavaFrameAnchorFlagsOffset; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
42 private final Register thread; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
43 |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
44 public SPARCHotSpotCRuntimeCallEpilogueOp(int threadLastJavaSpOffset, int threadLastJavaPcOffset, int threadJavaFrameAnchorFlagsOffset, Register thread) { |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
45 this.threadLastJavaSpOffset = threadLastJavaSpOffset; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
46 this.threadLastJavaPcOffset = threadLastJavaPcOffset; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
47 this.threadJavaFrameAnchorFlagsOffset = threadJavaFrameAnchorFlagsOffset; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
48 this.thread = thread; |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
49 } |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
50 |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
51 @Override |
13227
1a66453f73db
renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents:
12456
diff
changeset
|
52 public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
53 |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
54 // Restore the thread register when coming back from the runtime. |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
55 new Mov(l7, thread).emit(masm); |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
56 |
11233 | 57 // Reset last Java frame, last Java PC and flags. |
12456
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
58 new Stx(g0, new SPARCAddress(thread, threadLastJavaSpOffset)).emit(masm); |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
59 new Stx(g0, new SPARCAddress(thread, threadLastJavaPcOffset)).emit(masm); |
f87c68d79f07
improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents:
12431
diff
changeset
|
60 new Stw(g0, new SPARCAddress(thread, threadJavaFrameAnchorFlagsOffset)).emit(masm); |
10871
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
61 } |
c3b09d69dfde
SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff
changeset
|
62 } |