annotate graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64IndirectCallOp.java @ 21720:d915361cc3a1

moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
author Doug Simon <doug.simon@oracle.com>
date Thu, 04 Jun 2015 13:35:47 +0200
parents 6df25b1418be
children 0e095e2c24e2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
1 /*
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
4 *
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
8 *
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
13 * accompanied this code).
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
14 *
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
18 *
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
21 * questions.
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
22 */
6495
75f130f2b30f moved AMD64 specific HotSpot code in com.oracle.graal.hotspot.amd64 project
Doug Simon <doug.simon@oracle.com>
parents: 6493
diff changeset
23 package com.oracle.graal.hotspot.amd64;
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
24
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
25 import com.oracle.jvmci.amd64.*;
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
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: 21551
diff changeset
27 import com.oracle.jvmci.meta.Value;
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.meta.ResolvedJavaMethod;
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
29
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
30 import static com.oracle.jvmci.code.ValueUtil.*;
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
31 import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*;
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
32
21720
d915361cc3a1 moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 21708
diff changeset
33 import com.oracle.graal.asm.amd64.*;
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
34 import com.oracle.graal.lir.*;
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
35 import com.oracle.graal.lir.amd64.*;
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
36 import com.oracle.graal.lir.amd64.AMD64Call.IndirectCallOp;
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
37 import com.oracle.graal.lir.asm.*;
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
38 import com.oracle.jvmci.hotspot.*;
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
39
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
40 /**
7530
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
41 * A register indirect call that complies with the extra conventions for such calls in HotSpot. In
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
42 * particular, the metaspace Method of the callee must be in RBX for the case where a vtable entry's
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
43 * _from_compiled_entry is the address of an C2I adapter. Such adapters expect the target method to
5e3d1a68664e applied mx eclipseformat to all Java files
Doug Simon <doug.simon@oracle.com>
parents: 7143
diff changeset
44 * be in RBX.
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
45 */
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
46 @Opcode("CALL_INDIRECT")
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
47 final class AMD64IndirectCallOp extends IndirectCallOp {
19529
8fc336a04d77 Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 17604
diff changeset
48 public static final LIRInstructionClass<AMD64IndirectCallOp> TYPE = LIRInstructionClass.create(AMD64IndirectCallOp.class);
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
49
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
50 /**
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6580
diff changeset
51 * Vtable stubs expect the metaspace Method in RBX.
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
52 */
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6580
diff changeset
53 public static final Register METHOD = AMD64.rbx;
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
54
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6580
diff changeset
55 @Use({REG}) protected Value metaspaceMethod;
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
56
21413
15a46a918fc1 removed unnecessary HotSpotCodeCache.MarkId enum (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 19529
diff changeset
57 private final HotSpotVMConfig config;
15a46a918fc1 removed unnecessary HotSpotCodeCache.MarkId enum (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 19529
diff changeset
58
15a46a918fc1 removed unnecessary HotSpotCodeCache.MarkId enum (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 19529
diff changeset
59 AMD64IndirectCallOp(ResolvedJavaMethod targetMethod, Value result, Value[] parameters, Value[] temps, Value metaspaceMethod, Value targetAddress, LIRFrameState state, HotSpotVMConfig config) {
19529
8fc336a04d77 Create TYPE fields for LIRInstruction and CompositeValue. Renaming NodeClass#get to NodeClass#create.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 17604
diff changeset
60 super(TYPE, targetMethod, result, parameters, temps, targetAddress, state);
6950
41938af2b3d8 modifications to support non-perm-gen changes in HotSpot
Doug Simon <doug.simon@oracle.com>
parents: 6580
diff changeset
61 this.metaspaceMethod = metaspaceMethod;
21413
15a46a918fc1 removed unnecessary HotSpotCodeCache.MarkId enum (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 19529
diff changeset
62 this.config = config;
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
63 }
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
64
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
65 @Override
13227
1a66453f73db renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents: 9856
diff changeset
66 public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
21413
15a46a918fc1 removed unnecessary HotSpotCodeCache.MarkId enum (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 19529
diff changeset
67 crb.recordMark(config.MARKID_INLINE_INVOKE);
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
68 Register callReg = asRegister(targetAddress);
9791
e92fdf3e1558 Register: replace usages of object identity with equals()
Bernhard Urban <bernhard.urban@jku.at>
parents: 8974
diff changeset
69 assert !callReg.equals(METHOD);
13227
1a66453f73db renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents: 9856
diff changeset
70 AMD64Call.indirectCall(crb, masm, callReg, callTarget, state);
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
71 }
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
72
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
73 @Override
17604
35ae3e916582 Make LIRInstruction an interface.
Josef Eisl <josef.eisl@jku.at>
parents: 14574
diff changeset
74 public void verify() {
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
75 super.verify();
9791
e92fdf3e1558 Register: replace usages of object identity with equals()
Bernhard Urban <bernhard.urban@jku.at>
parents: 8974
diff changeset
76 assert asRegister(metaspaceMethod).equals(METHOD);
5844
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
77 }
a432e6d43aa1 fixed bugs related to -G:+InlineVTableStubs and re-enabled it by default
Doug Simon <doug.simon@oracle.com>
parents:
diff changeset
78 }