comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java @ 1429:abc670a709dc

* -XX:TraceC1X=0...5 controls the native c1x tracing * -Dc1x.debug=true turns on the logging proxies and lots of log output on the java side * provide more information about types to the compiler (type hierarchy, etc) * provide exception handler tables to the compiler * add exception handlers to the nmethod * correct implementation of ExceptionObject * exception handling/unwinding entry points * modified versions of handle/unwind exception stubs using standard calling conventions * exception throwing * implicit null pointer exception, implicit div by 0 exception * arraystore/classcast/arrayindex exceptions * checkcast implementation * newarray, anewarray, multinewarray implementation * correct new instance initialization * access to java class mirrors (for ldc) * unresolved methods * class resolving - class patching (asssembly prototype copying)
author Lukas Stadler <lukas.stadler@oracle.com>
date Tue, 31 Aug 2010 22:13:30 -0700
parents 760213a60e8b
children efba53f86c4f
comparison
equal deleted inserted replaced
1428:695451afc619 1429:abc670a709dc
60 } 60 }
61 61
62 public static VMEntries getVMEntries() { 62 public static VMEntries getVMEntries() {
63 if (vmEntries == null) { 63 if (vmEntries == null) {
64 try { 64 try {
65 vmEntries = LoggingProxy.getProxy(VMEntries.class, new VMEntriesNative()); 65 if (Logger.ENABLED)
66 // vmEntries = new VMEntriesNative(); 66 vmEntries = LoggingProxy.getProxy(VMEntries.class, new VMEntriesNative());
67 else
68 vmEntries = new VMEntriesNative();
67 } catch (Throwable t) { 69 } catch (Throwable t) {
68 t.printStackTrace(); 70 t.printStackTrace();
69 } 71 }
70 } 72 }
71 return vmEntries; 73 return vmEntries;
84 Socket socket = new Socket(remote, 1199); 86 Socket socket = new Socket(remote, 1199);
85 ReplacingOutputStream output = new ReplacingOutputStream(socket.getOutputStream()); 87 ReplacingOutputStream output = new ReplacingOutputStream(socket.getOutputStream());
86 ReplacingInputStream input = new ReplacingInputStream(socket.getInputStream()); 88 ReplacingInputStream input = new ReplacingInputStream(socket.getInputStream());
87 89
88 InvocationSocket invocation = new InvocationSocket(output, input); 90 InvocationSocket invocation = new InvocationSocket(output, input);
89 VMExits exits = (VMExits)Proxy.newProxyInstance(VMExits.class.getClassLoader(), new Class<?>[] {VMExits.class}, invocation); 91 VMExits exits = (VMExits) Proxy.newProxyInstance(VMExits.class.getClassLoader(), new Class<?>[] { VMExits.class}, invocation);
90 VMEntries entries = Compiler.initializeClient(exits); 92 VMEntries entries = Compiler.initializeClient(exits);
91 invocation.setDelegate(entries); 93 invocation.setDelegate(entries);
92 } else { 94 } else {
93 vmExits = LoggingProxy.getProxy(VMExits.class, new VMExitsNative()); 95 if (Logger.ENABLED)
94 // vmExits = new VMExitsNative(); 96 vmExits = LoggingProxy.getProxy(VMExits.class, new VMExitsNative());
97 else
98 vmExits = new VMExitsNative();
95 } 99 }
96 } catch (Throwable t) { 100 } catch (Throwable t) {
97 t.printStackTrace(); 101 t.printStackTrace();
98 } 102 }
99 } 103 }
118 target = new HotSpotTarget(new AMD64(), registerConfig, true, wordSize, wordSize, wordSize, stackFrameAlignment, config.vmPageSize, wordSize, wordSize, config.codeEntryAlignment, true); 122 target = new HotSpotTarget(new AMD64(), registerConfig, true, wordSize, wordSize, wordSize, stackFrameAlignment, config.vmPageSize, wordSize, wordSize, config.codeEntryAlignment, true);
119 generator = LoggingProxy.getProxy(RiXirGenerator.class, new HotSpotXirGenerator(config, target, registerConfig)); 123 generator = LoggingProxy.getProxy(RiXirGenerator.class, new HotSpotXirGenerator(config, target, registerConfig));
120 compiler = new C1XCompiler(runtime, target, generator); 124 compiler = new C1XCompiler(runtime, target, generator);
121 125
122 C1XOptions.setOptimizationLevel(3); 126 C1XOptions.setOptimizationLevel(3);
123 C1XOptions.TraceBytecodeParserLevel = 4; 127 C1XOptions.TraceBytecodeParserLevel = Logger.ENABLED ? 4 : 0;
124 C1XOptions.PrintCFGToFile = false; 128 C1XOptions.PrintCFGToFile = false;
125 C1XOptions.PrintAssembly = false;// true; 129 C1XOptions.PrintAssembly = false;// true;
126 C1XOptions.PrintCompilation = true; 130 C1XOptions.PrintCompilation = Logger.ENABLED;
127 C1XOptions.GenAssertionCode = true; 131 C1XOptions.GenAssertionCode = true;
128 C1XOptions.DetailedAsserts = true; 132 C1XOptions.DetailedAsserts = true;
129 C1XOptions.GenSpecialDivChecks = true; 133 C1XOptions.GenSpecialDivChecks = true;
134 C1XOptions.AlignCallsForPatching = true;
130 } 135 }
131 136
132 public CiCompiler getCompiler() { 137 public CiCompiler getCompiler() {
133 return compiler; 138 return compiler;
134 } 139 }