# HG changeset patch # User Peter Hofer # Date 1302534721 -7200 # Node ID 175e7b4d73220f19c8e6285393260bffa212ae0f # Parent 12846d31d7eceeeedc4e82822d22600a960ddefd In CompilerImpl, instantiate C1XCompiler lazily (i.e. just before the first compilation) so that C1XOptions are already set during C1XCompiler's initialization diff -r 12846d31d7ec -r 175e7b4d7322 c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/CompilerImpl.java --- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/CompilerImpl.java Mon Apr 11 14:31:21 2011 +0200 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/CompilerImpl.java Mon Apr 11 17:12:01 2011 +0200 @@ -43,7 +43,11 @@ private final VMEntries vmEntries; private final VMExits vmExits; - private final C1XCompiler compiler; + private C1XCompiler compiler; + private final HotSpotRuntime runtime; + private final RiXirGenerator generator; + private final HotSpotTarget target; + private final HotSpotRegisterConfig registerConfig; public static Compiler getInstance() { if (theInstance == null) { @@ -159,22 +163,25 @@ C1XOptions.InvokeSnippetAfterArguments = true; C1XOptions.StackShadowPages = config.stackShadowPages; - HotSpotRuntime runtime = new HotSpotRuntime(config, this); - HotSpotRegisterConfig registerConfig = runtime.globalStubRegConfig; + runtime = new HotSpotRuntime(config, this); + registerConfig = runtime.globalStubRegConfig; final int wordSize = 8; final int stackFrameAlignment = 16; - HotSpotTarget target = new HotSpotTarget(new AMD64(), true, wordSize, stackFrameAlignment, config.vmPageSize, wordSize, true); + target = new HotSpotTarget(new AMD64(), true, wordSize, stackFrameAlignment, config.vmPageSize, wordSize, true); RiXirGenerator generator = new HotSpotXirGenerator(config, target, registerConfig, this); if (Logger.ENABLED) { generator = LoggingProxy.getProxy(RiXirGenerator.class, generator); } - compiler = new C1XCompiler(runtime, target, generator, registerConfig); + this.generator = generator; } @Override public C1XCompiler getCompiler() { + if (compiler == null) { + compiler = new C1XCompiler(runtime, target, generator, registerConfig); + } return compiler; }