annotate graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java @ 21556:48c1ebd24120

renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
author Doug Simon <doug.simon@oracle.com>
date Wed, 27 May 2015 00:36:16 +0200
parents 96ab2078eeaf
children 5024c80224c7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10871
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff changeset
1 /*
15345
109d6c7c40b5 implement SPARC uncommon trap stub
twisti
parents: 13227
diff changeset
2 * Copyright (c) 2013, 2014, 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
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
25 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
26 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
27 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
28 import com.oracle.jvmci.meta.Value;
16653
403b07a69400 [SPARC] Let the register allocator manage where the thread is aved during the runtime call.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 15345
diff changeset
29 import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*;
10871
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff changeset
30 import static com.oracle.graal.sparc.SPARC.*;
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff changeset
31
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff changeset
32 import com.oracle.graal.asm.sparc.*;
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff changeset
33 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
34 import com.oracle.graal.lir.asm.*;
10871
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff changeset
35 import com.oracle.graal.lir.sparc.*;
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff changeset
36
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff changeset
37 @Opcode("CRUNTIME_CALL_PROLOGUE")
17206
2d401b9ca70d [SPARC] Improve the lookup for delayable candidates, renaming interfaces/methods
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17177
diff changeset
38 final class SPARCHotSpotCRuntimeCallPrologueOp extends SPARCLIRInstruction implements SPARCTailDelayedLIRInstruction {
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
39 public static final LIRInstructionClass<SPARCHotSpotCRuntimeCallPrologueOp> TYPE = LIRInstructionClass.create(SPARCHotSpotCRuntimeCallPrologueOp.class);
10871
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff changeset
40
12456
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
41 private final int threadLastJavaSpOffset;
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 private final Register stackPointer;
16653
403b07a69400 [SPARC] Let the register allocator manage where the thread is aved during the runtime call.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 15345
diff changeset
44 @Def({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
45
16653
403b07a69400 [SPARC] Let the register allocator manage where the thread is aved during the runtime call.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 15345
diff changeset
46 public SPARCHotSpotCRuntimeCallPrologueOp(int threadLastJavaSpOffset, Register thread, Register stackPointer, 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
47 super(TYPE);
12456
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
48 this.threadLastJavaSpOffset = threadLastJavaSpOffset;
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
49 this.thread = thread;
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
50 this.stackPointer = stackPointer;
16653
403b07a69400 [SPARC] Let the register allocator manage where the thread is aved during the runtime call.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 15345
diff changeset
51 this.threadTemp = threadTemp;
12456
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
52 }
f87c68d79f07 improved support for co-existing, multiple backends (GRAAL-363)
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
53
10871
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff changeset
54 @Override
13227
1a66453f73db renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents: 12456
diff changeset
55 public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
10871
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff changeset
56 // Save last Java frame.
19682
f1b4f2613702 [SPARC] Change arithmetic ops of SPARC to functions in assembler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 17206
diff changeset
57 masm.add(stackPointer, STACK_BIAS, g4);
19684
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 19682
diff changeset
58 masm.stx(g4, new SPARCAddress(thread, threadLastJavaSpOffset));
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 // Save the thread register when calling out to 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, threadTemp, thread.asValue(LIRKind.value(Kind.Long)), delayedControlTransfer);
10871
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff changeset
62 }
c3b09d69dfde SPARC: fixes and more implementation; can now allocate objects
twisti
parents:
diff changeset
63 }