comparison c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java @ 1433:efba53f86c4f

various fixes and enhancements * correct refmap->oopmap conversion (register numbering, stack slot numbering) * fixes for inlining (correct scoping in exception handler lookup, NPE in scope conversion) * support for "jump to runtime stub" (patching code needs to be aware of jmp instruction) * provide more information about methods (to allow inlining: has_balanced_monitors, etc.) * fixes to signature type lookup * isSubTypeOf: correct handling of array classes * RiType: componentType/arrayOf * prologue: inline cache check, icmiss stub * klass state check (resolved but not initialized) in newinstance * card table write barriers * c1x classes are optional (to allow running c1 without them) * correct for stored frame pointer in calling conventions (methods with arguments on stack) * getType(Class<?>) for some basic types, used for optimizations and folding * RiMethod/RiType: throw exception instead of silent failure on unsupported operations * RiType: resolved/unresolved array type support * refactoring: new on-demand template generation mechanism * optimizations: template specialization for no_null_check, given length, etc.
author Lukas Stadler <lukas.stadler@oracle.com>
date Thu, 16 Sep 2010 19:42:20 -0700
parents abc670a709dc
children 72cfb36c6bb2
comparison
equal deleted inserted replaced
1432:b61a43cd1255 1433:efba53f86c4f
46 } 46 }
47 47
48 private static VMEntries vmEntries; 48 private static VMEntries vmEntries;
49 49
50 public static VMExits initializeServer(VMEntries entries) { 50 public static VMExits initializeServer(VMEntries entries) {
51 vmEntries = LoggingProxy.getProxy(VMEntries.class, entries); 51 if (Logger.ENABLED) {
52 vmExits = LoggingProxy.getProxy(VMExits.class, new VMExitsNative()); 52 vmEntries = LoggingProxy.getProxy(VMEntries.class, entries);
53 vmExits = LoggingProxy.getProxy(VMExits.class, new VMExitsNative());
54 } else {
55 vmEntries = entries;
56 vmExits = new VMExitsNative();
57 }
53 return vmExits; 58 return vmExits;
54 } 59 }
55 60
56 private static VMEntries initializeClient(VMExits exits) { 61 private static VMEntries initializeClient(VMExits exits) {
57 vmEntries = new VMEntriesNative(); 62 vmEntries = new VMEntriesNative();
60 } 65 }
61 66
62 public static VMEntries getVMEntries() { 67 public static VMEntries getVMEntries() {
63 if (vmEntries == null) { 68 if (vmEntries == null) {
64 try { 69 try {
65 if (Logger.ENABLED) 70 if (Logger.ENABLED) {
66 vmEntries = LoggingProxy.getProxy(VMEntries.class, new VMEntriesNative()); 71 vmEntries = LoggingProxy.getProxy(VMEntries.class, new VMEntriesNative());
67 else 72 } else {
68 vmEntries = new VMEntriesNative(); 73 vmEntries = new VMEntriesNative();
74 }
69 } catch (Throwable t) { 75 } catch (Throwable t) {
70 t.printStackTrace(); 76 t.printStackTrace();
71 } 77 }
72 } 78 }
73 return vmEntries; 79 return vmEntries;
90 InvocationSocket invocation = new InvocationSocket(output, input); 96 InvocationSocket invocation = new InvocationSocket(output, input);
91 VMExits exits = (VMExits) Proxy.newProxyInstance(VMExits.class.getClassLoader(), new Class<?>[] { VMExits.class}, invocation); 97 VMExits exits = (VMExits) Proxy.newProxyInstance(VMExits.class.getClassLoader(), new Class<?>[] { VMExits.class}, invocation);
92 VMEntries entries = Compiler.initializeClient(exits); 98 VMEntries entries = Compiler.initializeClient(exits);
93 invocation.setDelegate(entries); 99 invocation.setDelegate(entries);
94 } else { 100 } else {
95 if (Logger.ENABLED) 101 if (Logger.ENABLED) {
96 vmExits = LoggingProxy.getProxy(VMExits.class, new VMExitsNative()); 102 vmExits = LoggingProxy.getProxy(VMExits.class, new VMExitsNative());
97 else 103 } else {
98 vmExits = new VMExitsNative(); 104 vmExits = new VMExitsNative();
105 }
99 } 106 }
100 } catch (Throwable t) { 107 } catch (Throwable t) {
101 t.printStackTrace(); 108 t.printStackTrace();
102 } 109 }
103 } 110 }
118 runtime = new HotSpotRuntime(config); 125 runtime = new HotSpotRuntime(config);
119 final int wordSize = 8; 126 final int wordSize = 8;
120 final int stackFrameAlignment = 16; 127 final int stackFrameAlignment = 16;
121 registerConfig = new HotSpotRegisterConfig(config); 128 registerConfig = new HotSpotRegisterConfig(config);
122 target = new HotSpotTarget(new AMD64(), registerConfig, true, wordSize, wordSize, wordSize, stackFrameAlignment, config.vmPageSize, wordSize, wordSize, config.codeEntryAlignment, true); 129 target = new HotSpotTarget(new AMD64(), registerConfig, true, wordSize, wordSize, wordSize, stackFrameAlignment, config.vmPageSize, wordSize, wordSize, config.codeEntryAlignment, true);
123 generator = LoggingProxy.getProxy(RiXirGenerator.class, new HotSpotXirGenerator(config, target, registerConfig)); 130
131 if (Logger.ENABLED) {
132 generator = LoggingProxy.getProxy(RiXirGenerator.class, new HotSpotXirGenerator(config, target, registerConfig));
133 } else {
134 generator = new HotSpotXirGenerator(config, target, registerConfig);
135 }
124 compiler = new C1XCompiler(runtime, target, generator); 136 compiler = new C1XCompiler(runtime, target, generator);
125 137
126 C1XOptions.setOptimizationLevel(3); 138 C1XOptions.setOptimizationLevel(3);
127 C1XOptions.TraceBytecodeParserLevel = Logger.ENABLED ? 4 : 0; 139 C1XOptions.UseDeopt = false;
140 C1XOptions.IRChecking = Logger.ENABLED;
141 C1XOptions.TraceBytecodeParserLevel = 0;
142 // C1XOptions.TraceBytecodeParserLevel = Logger.ENABLED ? 4 : 0;
128 C1XOptions.PrintCFGToFile = false; 143 C1XOptions.PrintCFGToFile = false;
129 C1XOptions.PrintAssembly = false;// true; 144 C1XOptions.PrintAssembly = false;// true;
130 C1XOptions.PrintCompilation = Logger.ENABLED; 145 C1XOptions.PrintCompilation = Logger.ENABLED;
131 C1XOptions.GenAssertionCode = true; 146 C1XOptions.GenAssertionCode = Logger.ENABLED;
132 C1XOptions.DetailedAsserts = true; 147 C1XOptions.DetailedAsserts = Logger.ENABLED;
148
133 C1XOptions.GenSpecialDivChecks = true; 149 C1XOptions.GenSpecialDivChecks = true;
134 C1XOptions.AlignCallsForPatching = true; 150 C1XOptions.AlignCallsForPatching = true;
151 C1XOptions.NullCheckUniquePc = true;
152 C1XOptions.invokeinterfaceTemplatePos = true;
135 } 153 }
136 154
137 public CiCompiler getCompiler() { 155 public CiCompiler getCompiler() {
138 return compiler; 156 return compiler;
139 } 157 }