annotate c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java @ 1473:cb04e4217df0

Sync with CRI/C1X changes.
author Doug Simon <doug.simon@oracle.com>
date Tue, 30 Nov 2010 15:13:57 +0100
parents ef7761803480
children c0b1d6a44a02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
1 /*
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
2 * Copyright (c) 2010 Sun Microsystems, Inc. All rights reserved.
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
3 *
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
4 * Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
5 * that is described in this document. In particular, and without limitation, these intellectual property
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
6 * rights may include one or more of the U.S. patents listed at http://www.sun.com/patents and one or
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
7 * more additional patents or pending patent applications in the U.S. and in other countries.
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
8 *
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
9 * U.S. Government Rights - Commercial software. Government users are subject to the Sun
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
10 * Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
11 * supplements.
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
12 *
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
13 * Use is subject to license terms. Sun, Sun Microsystems, the Sun logo, Java and Solaris are trademarks or
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
14 * registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
15 * are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
16 * U.S. and other countries.
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
17 *
1437
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
18 * UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open
9e5e83ca2259 Enabled -C1X:OPTIONS when running HotSpot/C1X. Enabled checkstyle for the HotSpotVM Java project.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1434
diff changeset
19 * Company, Ltd.
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
20 */
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
21 package com.sun.hotspot.c1x;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
22
1439
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
23 import static com.sun.c1x.target.amd64.AMD64.*;
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
24
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
25 import java.util.*;
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
26
1440
4d1d3bd140f9 Updated for changes in CRI.
Doug Simon <doug.simon@oracle.com>
parents: 1439
diff changeset
27 import com.sun.c1x.target.amd64.*;
4d1d3bd140f9 Updated for changes in CRI.
Doug Simon <doug.simon@oracle.com>
parents: 1439
diff changeset
28 import com.sun.c1x.util.*;
4d1d3bd140f9 Updated for changes in CRI.
Doug Simon <doug.simon@oracle.com>
parents: 1439
diff changeset
29 import com.sun.cri.ci.*;
4d1d3bd140f9 Updated for changes in CRI.
Doug Simon <doug.simon@oracle.com>
parents: 1439
diff changeset
30 import com.sun.cri.ci.CiCallingConvention.Type;
4d1d3bd140f9 Updated for changes in CRI.
Doug Simon <doug.simon@oracle.com>
parents: 1439
diff changeset
31 import com.sun.cri.ci.CiRegister.RegisterFlag;
1439
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
32 import com.sun.cri.ri.*;
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
33
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
34 /**
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
35 * @author Thomas Wuerthinger
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
36 *
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
37 */
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
38 public class HotSpotRegisterConfig implements RiRegisterConfig {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
39
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
40 // be careful - the contents of this array are duplicated in c1x_CodeInstaller.cpp
1439
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
41 private final CiRegister[] allocatable = {
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
42 rax, rbx, rcx, rdx, rsi, rdi, r8, r9, /* r10, */r11, r12, r13, r14,
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
43 xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
44 xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
45 };
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
46
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
47 private final EnumMap<RegisterFlag, CiRegister[]> categorized = CiRegister.categorize(allocatable);
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
48
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
49 private final RiRegisterAttributes[] attributesMap;
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
50
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
51 @Override
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
52 public CiRegister[] getAllocatableRegisters() {
1439
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
53 return allocatable;
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
54 }
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
55
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
56 @Override
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
57 public EnumMap<RegisterFlag, CiRegister[]> getCategorizedAllocatableRegisters() {
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
58 return categorized;
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
59 }
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
60
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
61 @Override
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
62 public RiRegisterAttributes[] getAttributesMap() {
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
63 return attributesMap;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
64 }
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
65
1418
55ac38887415 modifications for linux: argument register layout, makefile
Lukas Stadler <lukas.stadler@jku.at>
parents: 1416
diff changeset
66 private final CiRegister[] generalParameterRegisters;
1439
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
67 private final CiRegister[] xmmParameterRegisters = {xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7};
1440
4d1d3bd140f9 Updated for changes in CRI.
Doug Simon <doug.simon@oracle.com>
parents: 1439
diff changeset
68 private final CiRegister[] allParameterRegisters;
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
69
1470
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
70 private final CiRegister[] rsaRegs = {
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
71 rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi,
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
72 r8, r9, r10, r11, r12, r13, r14, r15,
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
73 xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7,
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
74 xmm8, xmm9, xmm10, xmm11, xmm12, xmm13, xmm14, xmm15
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
75 };
1455
43a93774d24f Syncing changes with C1X.
Doug Simon <doug.simon@oracle.com>
parents: 1448
diff changeset
76
1470
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
77 private final CiCalleeSaveArea registerSaveArea;
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
78
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
79
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
80 public HotSpotRegisterConfig(HotSpotVMConfig config, boolean globalStubConfig) {
1421
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
81 if (config.windowsOs) {
1439
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
82 generalParameterRegisters = new CiRegister[] {rdx, r8, r9, rdi, rsi, rcx};
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
83 } else {
1439
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
84 generalParameterRegisters = new CiRegister[] {rsi, rdx, rcx, r8, r9, rdi};
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
85 }
1470
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
86
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
87 if (globalStubConfig) {
1473
cb04e4217df0 Sync with CRI/C1X changes.
Doug Simon <doug.simon@oracle.com>
parents: 1470
diff changeset
88 registerSaveArea = new CiCalleeSaveArea(-1, 8, rsaRegs);
1470
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
89 } else {
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
90 registerSaveArea = CiCalleeSaveArea.EMPTY;
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
91 }
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
92
1439
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
93 attributesMap = RiRegisterAttributes.createMap(this, AMD64.allRegisters);
1440
4d1d3bd140f9 Updated for changes in CRI.
Doug Simon <doug.simon@oracle.com>
parents: 1439
diff changeset
94 allParameterRegisters = Arrays.copyOf(generalParameterRegisters, generalParameterRegisters.length + xmmParameterRegisters.length);
4d1d3bd140f9 Updated for changes in CRI.
Doug Simon <doug.simon@oracle.com>
parents: 1439
diff changeset
95 System.arraycopy(xmmParameterRegisters, 0, allParameterRegisters, generalParameterRegisters.length, xmmParameterRegisters.length);
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
96 }
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
97
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
98 @Override
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
99 public CiRegister[] getCallerSaveRegisters() {
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
100 return getAllocatableRegisters();
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
101 }
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
102
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
103 @Override
1473
cb04e4217df0 Sync with CRI/C1X changes.
Doug Simon <doug.simon@oracle.com>
parents: 1470
diff changeset
104 public CiRegister getRegisterForRole(int index) {
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
105 throw new UnsupportedOperationException();
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
106 }
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
107
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
108 @Override
1448
9196a2b32950 Modified C++ to reflect changes in calling convention CRI code.
Doug Simon <doug.simon@oracle.com>
parents: 1440
diff changeset
109 public CiCallingConvention getCallingConvention(Type type, CiKind[] parameters, CiTarget target) {
9196a2b32950 Modified C++ to reflect changes in calling convention CRI code.
Doug Simon <doug.simon@oracle.com>
parents: 1440
diff changeset
110 if (type == Type.NativeCall) {
1440
4d1d3bd140f9 Updated for changes in CRI.
Doug Simon <doug.simon@oracle.com>
parents: 1439
diff changeset
111 throw new UnsupportedOperationException();
4d1d3bd140f9 Updated for changes in CRI.
Doug Simon <doug.simon@oracle.com>
parents: 1439
diff changeset
112 }
1448
9196a2b32950 Modified C++ to reflect changes in calling convention CRI code.
Doug Simon <doug.simon@oracle.com>
parents: 1440
diff changeset
113 return callingConvention(parameters, type, target);
1440
4d1d3bd140f9 Updated for changes in CRI.
Doug Simon <doug.simon@oracle.com>
parents: 1439
diff changeset
114 }
4d1d3bd140f9 Updated for changes in CRI.
Doug Simon <doug.simon@oracle.com>
parents: 1439
diff changeset
115
1473
cb04e4217df0 Sync with CRI/C1X changes.
Doug Simon <doug.simon@oracle.com>
parents: 1470
diff changeset
116 public CiRegister[] getCallingConventionRegisters(Type type, RegisterFlag flag) {
1440
4d1d3bd140f9 Updated for changes in CRI.
Doug Simon <doug.simon@oracle.com>
parents: 1439
diff changeset
117 return allParameterRegisters;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
118 }
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
119
1448
9196a2b32950 Modified C++ to reflect changes in calling convention CRI code.
Doug Simon <doug.simon@oracle.com>
parents: 1440
diff changeset
120 private CiCallingConvention callingConvention(CiKind[] types, Type type, CiTarget target) {
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
121 CiValue[] locations = new CiValue[types.length];
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
122
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
123 int currentGeneral = 0;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
124 int currentXMM = 0;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
125 int currentStackIndex = 0;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
126
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
127 for (int i = 0; i < types.length; i++) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
128 final CiKind kind = types[i];
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
129
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
130 switch (kind) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
131 case Byte:
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
132 case Boolean:
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
133 case Short:
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
134 case Char:
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
135 case Int:
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
136 case Long:
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
137 case Word:
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
138 case Object:
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
139 if (currentGeneral < generalParameterRegisters.length) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
140 CiRegister register = generalParameterRegisters[currentGeneral++];
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
141 locations[i] = register.asValue(kind);
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
142 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
143 break;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
144 case Float:
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
145 case Double:
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
146 if (currentXMM < xmmParameterRegisters.length) {
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
147 CiRegister register = xmmParameterRegisters[currentXMM++];
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
148 locations[i] = register.asValue(kind);
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
149 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
150 break;
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
151 default:
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
152 throw Util.shouldNotReachHere();
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
153 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
154
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
155 if (locations[i] == null) {
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
156 // we need to adjust for the frame pointer stored on the stack, which shifts incoming arguments by one slot
1448
9196a2b32950 Modified C++ to reflect changes in calling convention CRI code.
Doug Simon <doug.simon@oracle.com>
parents: 1440
diff changeset
157 locations[i] = CiStackSlot.get(kind.stackKind(), currentStackIndex + (type.out ? 0 : 1), !type.out);
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
158 currentStackIndex += target.spillSlots(kind);
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
159 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
160 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
161
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
162 return new CiCallingConvention(locations, currentStackIndex * target.spillSlotSize);
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
163 }
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
164
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
165 @Override
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
166 public CiRegister getReturnRegister(CiKind kind) {
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
167 switch (kind) {
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
168 case Boolean:
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
169 case Byte:
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
170 case Char:
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
171 case Short:
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
172 case Int:
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
173 case Long:
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
174 case Object:
1425
98fffb304868 tlab-allocated "new instance", invokespecial, support for static fields in COMPILER_CLASSES_DO
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1423
diff changeset
175 case Word:
1439
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
176 return rax;
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
177 case Float:
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
178 case Double:
1439
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
179 return xmm0;
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
180 case Void:
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
181 case Illegal:
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
182 return null;
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
183 default:
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
184 throw new UnsupportedOperationException("no return register for type " + kind);
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
185 }
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
186 }
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
187
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
188 @Override
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
189 public CiRegister getScratchRegister() {
1439
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
190 return r10;
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
191 }
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
192
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
193 @Override
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
194 public CiRegister getFrameRegister() {
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
195 return rsp;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
196 }
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
197
1468
e4cd5d2de7e1 Changes to sync with CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 1455
diff changeset
198 public CiCalleeSaveArea getCalleeSaveArea() {
1470
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1468
diff changeset
199 return registerSaveArea;
1455
43a93774d24f Syncing changes with C1X.
Doug Simon <doug.simon@oracle.com>
parents: 1448
diff changeset
200 }
43a93774d24f Syncing changes with C1X.
Doug Simon <doug.simon@oracle.com>
parents: 1448
diff changeset
201
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
202 @Override
1439
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
203 public String toString() {
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
204 String res = String.format(
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
205 "Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" +
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
206 "CallerSave: " + Arrays.toString(getCallerSaveRegisters()) + "%n" +
1468
e4cd5d2de7e1 Changes to sync with CRI changes.
Doug Simon <doug.simon@oracle.com>
parents: 1455
diff changeset
207 "CalleeSave: " + getCalleeSaveArea() + "%n" +
1439
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
208 "Scratch: " + getScratchRegister() + "%n");
d0c8d3a2a7e8 Modified domake script to use (and require) JRE7 environment variable for find the base of a JRE 7 installation. This script no also ensures that $JRE7/lib/amd64/jvm.cfg has the right value for '-client'.
Doug Simon <doug.simon@oracle.com>
parents: 1437
diff changeset
209 return res;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
210 }
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
211 }