annotate graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java @ 13227:1a66453f73db

renamed TargetMethodAssembler to CompilationResultBuilder
author Doug Simon <doug.simon@oracle.com>
date Tue, 03 Dec 2013 10:51:16 +0100
parents 7080a96be216
children 6bab029d6e3a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10792
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
1 /*
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
4 *
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
7 * published by the Free Software Foundation.
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
8 *
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
13 * accompanied this code).
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
14 *
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
18 *
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
21 * questions.
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
22 */
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
23 package com.oracle.graal.hotspot.sparc;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
24
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
25 import static com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind.*;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
26 import static com.oracle.graal.sparc.SPARC.*;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
27
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
28 import com.oracle.graal.api.meta.*;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
29 import com.oracle.graal.asm.sparc.*;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
30 import com.oracle.graal.asm.sparc.SPARCMacroAssembler.*;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
31 import com.oracle.graal.hotspot.*;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
32 import com.oracle.graal.hotspot.bridge.*;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
33 import com.oracle.graal.lir.*;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
34 import com.oracle.graal.lir.sparc.SPARCCall.DirectCallOp;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
35 import com.oracle.graal.lir.asm.*;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
36 import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
37
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
38 /**
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
39 * A direct call that complies with the conventions for such calls in HotSpot. In particular, for
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
40 * calls using an inline cache, a MOVE instruction is emitted just prior to the aligned direct call.
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
41 */
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
42 @Opcode("CALL_DIRECT")
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
43 final class SPARCHotspotDirectVirtualCallOp extends DirectCallOp {
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
44
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
45 private final InvokeKind invokeKind;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
46
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
47 SPARCHotspotDirectVirtualCallOp(ResolvedJavaMethod target, Value result, Value[] parameters, Value[] temps, LIRFrameState state, InvokeKind invokeKind) {
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
48 super(target, result, parameters, temps, state);
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
49 this.invokeKind = invokeKind;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
50 assert invokeKind == InvokeKind.Interface || invokeKind == InvokeKind.Virtual;
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
51 }
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
52
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
53 @Override
13227
1a66453f73db renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
54 public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) {
10792
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
55 // The mark for an invocation that uses an inline cache must be placed at the
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
56 // instruction that loads the Klass from the inline cache.
13227
1a66453f73db renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
57 crb.recordMark(invokeKind == Virtual ? Marks.MARK_INVOKEVIRTUAL : Marks.MARK_INVOKEINTERFACE);
12431
7080a96be216 rename: graalRuntime -> runtime, getGraalRuntime -> getRuntime
Doug Simon <doug.simon@oracle.com>
parents: 11233
diff changeset
58 new Setx(HotSpotGraalRuntime.runtime().getConfig().nonOopBits, g3, true).emit(masm);
13227
1a66453f73db renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents: 12431
diff changeset
59 super.emitCode(crb, masm);
10792
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
60 }
7a8d6ba83a04 SPARC: fixes and more stuff works
twisti
parents:
diff changeset
61 }