annotate graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotSafepointOp.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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
1 /*
19526
8fc336a04d77 Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 16663
diff changeset
2 * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
4 *
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
7 * published by the Free Software Foundation.
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
8 *
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
13 * accompanied this code).
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
14 *
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
18 *
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
21 * questions.
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
22 */
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
23 package com.oracle.graal.hotspot.sparc;
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
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.*;
6df25b1418be moved com.oracle.asm.** to jvmci-util.jar (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21673
diff changeset
26 import com.oracle.jvmci.asm.sparc.SPARCMacroAssembler.*;
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: 21551
diff changeset
27 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: 21551
diff changeset
28 import com.oracle.jvmci.code.InfopointReason;
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: 21551
diff changeset
29 import com.oracle.jvmci.code.RegisterValue;
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: 21551
diff changeset
30 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: 21551
diff changeset
31 import com.oracle.jvmci.meta.AllocatableValue;
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
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
33 import static com.oracle.jvmci.sparc.SPARC.*;
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
34
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
35 import com.oracle.graal.lir.*;
14991
64dcb92ee75a Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 14847
diff changeset
36 import com.oracle.graal.lir.asm.*;
15298
e4d6c613d552 Move LIRGeneratorTool to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents: 14991
diff changeset
37 import com.oracle.graal.lir.gen.*;
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
38 import com.oracle.graal.lir.sparc.*;
21551
5324104ac4f3 moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21526
diff changeset
39 import com.oracle.jvmci.hotspot.*;
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
40
15332
c30076386ff9 Suppress wrong FindBugs warning in SPARCHotSpotSafepointOp.
Josef Eisl <josef.eisl@jku.at>
parents: 15298
diff changeset
41 import edu.umd.cs.findbugs.annotations.*;
c30076386ff9 Suppress wrong FindBugs warning in SPARCHotSpotSafepointOp.
Josef Eisl <josef.eisl@jku.at>
parents: 15298
diff changeset
42
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
43 /**
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
44 * Emits a safepoint poll.
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
45 */
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
46 @Opcode("SAFEPOINT")
11760
ce0b00597980 made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents: 10913
diff changeset
47 public class SPARCHotSpotSafepointOp extends SPARCLIRInstruction {
19526
8fc336a04d77 Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 16663
diff changeset
48 public static final LIRInstructionClass<SPARCHotSpotSafepointOp> TYPE = LIRInstructionClass.create(SPARCHotSpotSafepointOp.class);
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
49
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
50 @State protected LIRFrameState state;
15332
c30076386ff9 Suppress wrong FindBugs warning in SPARCHotSpotSafepointOp.
Josef Eisl <josef.eisl@jku.at>
parents: 15298
diff changeset
51 @SuppressFBWarnings(value = "BC_IMPOSSIBLE_CAST", justification = "changed by the register allocator") @Temp({OperandFlag.REG}) private AllocatableValue temp;
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
52
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
53 private final HotSpotVMConfig config;
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
54
14847
c132602c640e Apply LIRGenerator refactoring to SPARC backend.
Josef Eisl <josef.eisl@jku.at>
parents: 14836
diff changeset
55 public SPARCHotSpotSafepointOp(LIRFrameState state, HotSpotVMConfig config, LIRGeneratorTool tool) {
19526
8fc336a04d77 Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 16663
diff changeset
56 super(TYPE);
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
57 this.state = state;
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
58 this.config = config;
19526
8fc336a04d77 Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 16663
diff changeset
59 this.temp = tool.newVariable(LIRKind.value(tool.target().wordKind));
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
60 }
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
61
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
62 @Override
13227
1a66453f73db renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
63 public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
11760
ce0b00597980 made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents: 10913
diff changeset
64 Register scratch = ((RegisterValue) temp).getRegister();
13227
1a66453f73db renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
65 emitCode(crb, masm, config, false, state, scratch);
11760
ce0b00597980 made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents: 10913
diff changeset
66 }
ce0b00597980 made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents: 10913
diff changeset
67
13227
1a66453f73db renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
68 public static void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm, HotSpotVMConfig config, boolean atReturn, LIRFrameState state, Register scratch) {
10913
19a7856e3ab9 remove SafepointPollOffset
twisti
parents: 10871
diff changeset
69 new Setx(config.safepointPollingAddress, scratch).emit(masm);
21413
15a46a918fc1 removed unnecessary HotSpotCodeCache.MarkId enum (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 19678
diff changeset
70 crb.recordMark(atReturn ? config.MARKID_POLL_RETURN_FAR : config.MARKID_POLL_FAR);
16663
4ccd6b6b6780 [SPARC] Putting safepoint to the right instruction in code.
Stefan Anzinger <stefan.anzinger@gmail.com>
parents: 16094
diff changeset
71 final int pos = masm.position();
19677
00d7b0adaf66 [SPARC] Change ld/st ops of SPARC to functions
Stefan Anzinger <stefan.anzinger@oracle.com>
parents: 16663
diff changeset
72 masm.ldx(new SPARCAddress(scratch, 0), g0);
11760
ce0b00597980 made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents: 10913
diff changeset
73 if (state != null) {
13227
1a66453f73db renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents: 12559
diff changeset
74 crb.recordInfopoint(pos, state, InfopointReason.SAFEPOINT);
11760
ce0b00597980 made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents: 10913
diff changeset
75 }
10694
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
76 }
31266ceb86ef SPARC: Can compile and run two or three methods of a bootstrap.
twisti
parents:
diff changeset
77 }