annotate c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java @ 1470:ef7761803480

Fixes to get running again after C1X changes to pointer maps and register configuration.
author Thomas Wuerthinger <wuerthinger@ssw.jku.at>
date Tue, 23 Nov 2010 15:45:45 +0100
parents 2c754f3a2722
children 7641338cfc92
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.
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
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.
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
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.
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
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.
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
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
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
23 import java.lang.reflect.Proxy;
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
24 import java.net.*;
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
25
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
26 import com.sun.c1x.*;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
27 import com.sun.c1x.target.amd64.*;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
28 import com.sun.cri.ci.*;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
29 import com.sun.cri.ri.*;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
30 import com.sun.cri.xir.*;
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
31 import com.sun.hotspot.c1x.logging.*;
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
32 import com.sun.hotspot.c1x.server.CompilationServer.ReplacingInputStream;
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
33 import com.sun.hotspot.c1x.server.CompilationServer.ReplacingOutputStream;
1416
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 /**
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
36 * Singleton class holding the instance of the C1XCompiler.
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
37 *
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
38 * @author Thomas Wuerthinger, Lukas Stadler
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
39 */
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
40 public final class Compiler {
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
41
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
42 private static Compiler theInstance;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
43
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
44 public static Compiler getInstance() {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
45 if (theInstance == null) {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
46 theInstance = new Compiler();
1438
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1437
diff changeset
47 Runtime.getRuntime().addShutdownHook(new ShutdownThread());
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
48 }
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
49 return theInstance;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
50 }
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
51
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
52 private static VMEntries vmEntries;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
53
1438
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1437
diff changeset
54
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1437
diff changeset
55 public static class ShutdownThread extends Thread {
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1437
diff changeset
56 @Override
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1437
diff changeset
57 public void run() {
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1437
diff changeset
58 VMExitsNative.compileMethods = false;
1465
2c754f3a2722 Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1458
diff changeset
59 if (C1XOptions.PrintMetrics) {
2c754f3a2722 Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1458
diff changeset
60 C1XMetrics.print();
2c754f3a2722 Inlining of static final field values. Java mirror instead of VmID. Support for PrintMetrics option.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1458
diff changeset
61 }
1438
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1437
diff changeset
62 if (C1XOptions.PrintTimers) {
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1437
diff changeset
63 C1XTimers.print();
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1437
diff changeset
64 }
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1437
diff changeset
65 }
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1437
diff changeset
66 }
a7a0ef3c6858 Added timing printout on VM shutdown.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1437
diff changeset
67
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
68 public static VMExits initializeServer(VMEntries entries) {
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
69 if (Logger.ENABLED) {
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
70 vmEntries = LoggingProxy.getProxy(VMEntries.class, entries);
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
71 vmExits = LoggingProxy.getProxy(VMExits.class, new VMExitsNative());
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
72 } else {
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
73 vmEntries = entries;
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
74 vmExits = new VMExitsNative();
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
75 }
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
76 return vmExits;
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
77 }
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
78
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
79 private static VMEntries initializeClient(VMExits exits) {
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
80 vmEntries = new VMEntriesNative();
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
81 vmExits = exits;
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
82 return vmEntries;
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
83 }
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
84
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
85 public static VMEntries getVMEntries() {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
86 if (vmEntries == null) {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
87 try {
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
88 vmEntries = new VMEntriesNative();
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
89 if (CountingProxy.ENABLED) {
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
90 vmEntries = CountingProxy.getProxy(VMEntries.class, vmEntries);
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
91 }
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
92 if (Logger.ENABLED) {
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
93 vmEntries = LoggingProxy.getProxy(VMEntries.class, vmEntries);
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
94 }
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
95 } catch (Throwable t) {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
96 t.printStackTrace();
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
97 }
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
98 }
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
99 return vmEntries;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
100 }
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
101
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
102 private static VMExits vmExits;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
103
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
104 public static VMExits getVMExits() {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
105 if (vmExits == null) {
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
106 String remote = System.getProperty("c1x.remote");
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
107 assert theInstance == null;
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
108 assert vmEntries == null;
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
109 try {
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
110 if (remote != null) {
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
111 System.out.println("C1X compiler started in client/server mode, connection to server " + remote);
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
112 Socket socket = new Socket(remote, 1199);
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
113 ReplacingOutputStream output = new ReplacingOutputStream(socket.getOutputStream());
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
114 ReplacingInputStream input = new ReplacingInputStream(socket.getInputStream());
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
115
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
116 InvocationSocket invocation = new InvocationSocket(output, input);
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
117 VMExits exits = (VMExits) Proxy.newProxyInstance(VMExits.class.getClassLoader(), new Class<?>[] {VMExits.class}, invocation);
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
118 VMEntries entries = Compiler.initializeClient(exits);
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
119 invocation.setDelegate(entries);
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
120 } else {
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
121 vmExits = new VMExitsNative();
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
122 if (CountingProxy.ENABLED) {
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
123 vmExits = CountingProxy.getProxy(VMExits.class, vmExits);
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
124 }
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
125 if (Logger.ENABLED) {
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
126 vmExits = LoggingProxy.getProxy(VMExits.class, vmExits);
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
127 }
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
128 }
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
129 } catch (Throwable t) {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
130 t.printStackTrace();
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
131 }
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
132 }
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
133 return vmExits;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
134 }
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
135
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
136 private final CiCompiler compiler;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
137 private final HotSpotVMConfig config;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
138 private final HotSpotRuntime runtime;
1455
43a93774d24f Syncing changes with C1X.
Doug Simon <doug.simon@oracle.com>
parents: 1444
diff changeset
139 private final HotSpotRegisterConfig registerConfig;
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
140 private final CiTarget target;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
141 private final RiXirGenerator generator;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
142
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
143 private Compiler() {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
144 config = getVMEntries().getConfiguration();
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
145 config.check();
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
146
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
147 runtime = new HotSpotRuntime(config);
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
148 final int wordSize = 8;
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
149 final int stackFrameAlignment = 16;
1470
ef7761803480 Fixes to get running again after C1X changes to pointer maps and register configuration.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents: 1465
diff changeset
150 registerConfig = runtime.globalStubRegConfig;
1455
43a93774d24f Syncing changes with C1X.
Doug Simon <doug.simon@oracle.com>
parents: 1444
diff changeset
151 target = new HotSpotTarget(new AMD64(), true, wordSize, wordSize, wordSize, stackFrameAlignment, config.vmPageSize, wordSize, wordSize, config.codeEntryAlignment, true);
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
152
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
153 if (Logger.ENABLED) {
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
154 generator = LoggingProxy.getProxy(RiXirGenerator.class, new HotSpotXirGenerator(config, target, registerConfig));
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
155 } else {
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
156 generator = new HotSpotXirGenerator(config, target, registerConfig);
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
157 }
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: 1438
diff changeset
158 compiler = new C1XCompiler(runtime, target, generator, registerConfig);
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
159
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
160 // these options are important - c1x4hotspot will not generate correct code without them
1423
760213a60e8b * rewrite of the code installation
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1422
diff changeset
161 C1XOptions.GenSpecialDivChecks = true;
1433
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
162 C1XOptions.NullCheckUniquePc = true;
efba53f86c4f various fixes and enhancements
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1429
diff changeset
163 C1XOptions.invokeinterfaceTemplatePos = true;
1434
72cfb36c6bb2 * enabled all jtt tests
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1433
diff changeset
164 C1XOptions.StackShadowPages = config.stackShadowPages;
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
165 }
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
166
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
167 public CiCompiler getCompiler() {
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
168 return compiler;
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
169 }
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
170
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
171 public HotSpotVMConfig getConfig() {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
172 return config;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
173 }
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
174
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
175 public HotSpotRuntime getRuntime() {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
176 return runtime;
1420
44efca8a02d6 reformatting similar to other maxine projects (tabs, etc.)
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1419
diff changeset
177 }
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
178
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
179 public RiRegisterConfig getRegisterConfig() {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
180 return registerConfig;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
181 }
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
182
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
183 public CiTarget getTarget() {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
184 return target;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
185 }
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
186
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
187 public RiXirGenerator getGenerator() {
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
188 return generator;
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
189 }
6223633ce7dd changed VMExit/VMEntries to non-static, added eclipse c++ project, CIR interface changes
Lukas Stadler <lukas.stadler@oracle.com>
parents: 1420
diff changeset
190
1416
1b41af477605 Added HotSpotVM project Java source files.
Thomas Wuerthinger <thomas.wuerthinger@gmail.com>
parents:
diff changeset
191 }