# HG changeset patch # User Josef Eisl # Date 1396285213 -7200 # Node ID bd08e610e6f37584766395f1545c6fd262274f98 # Parent 31a9c79399c8616dcdbd9efe01f066fba70e5024 BaselineCompiler: create BytecodeParser. diff -r 31a9c79399c8 -r bd08e610e6f3 graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineCompiler.java --- a/graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineCompiler.java Tue Apr 01 18:51:14 2014 +0200 +++ b/graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineCompiler.java Mon Mar 31 19:00:13 2014 +0200 @@ -52,6 +52,7 @@ import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind; import com.oracle.graal.nodes.java.*; +import com.oracle.graal.phases.*; /** * The {@code GraphBuilder} class parses the bytecode of a method and builds the IR graph. @@ -65,133 +66,130 @@ } private final MetaAccessProvider metaAccess; - private ConstantPool constantPool; - private ResolvedJavaMethod method; - private int entryBCI; - private ProfilingInfo profilingInfo; - private BytecodeStream stream; // the bytecode stream - - private Backend backend; - private LIRGenerator lirGen; - private LIRFrameStateBuilder frameState; - private LIRGenerationResult lirGenRes; - - private BciBlock currentBlock; - - private ValueNode methodSynchronizedObject; - private ExceptionDispatchBlock unwindBlock; private final GraphBuilderConfiguration graphBuilderConfig; - private BciBlock[] loopHeaders; - private AbstractBytecodeParser parserHelper; - - /** - * Meters the number of actual bytecodes parsed. - */ - public static final DebugMetric BytecodesParsed = Debug.metric("BytecodesParsed"); - - protected ResolvedJavaMethod getMethod() { - return method; - } public CompilationResult generate(ResolvedJavaMethod method, int entryBCI, Backend backend, CompilationResult compilationResult, ResolvedJavaMethod installedCodeOwner, - CompilationResultBuilderFactory factory) { - this.method = method; - this.entryBCI = entryBCI; - this.backend = backend; - profilingInfo = method.getProfilingInfo(); + CompilationResultBuilderFactory factory, OptimisticOptimizations optimisticOpts) { + ProfilingInfo profilingInfo = method.getProfilingInfo(); assert method.getCode() != null : "method must contain bytecodes: " + method; - this.stream = new BytecodeStream(method.getCode()); - this.constantPool = method.getConstantPool(); - unwindBlock = null; - methodSynchronizedObject = null; + BytecodeStream stream = new BytecodeStream(method.getCode()); + ConstantPool constantPool = method.getConstantPool(); TTY.Filter filter = new TTY.Filter(PrintFilter.getValue(), method); - frameState = new LIRFrameStateBuilder(method); + LIRFrameStateBuilder frameState = new LIRFrameStateBuilder(method); + + BytecodeParser parser = new BytecodeParser(metaAccess, method, graphBuilderConfig, optimisticOpts, frameState, stream, profilingInfo, constantPool, entryBCI, backend); // build blocks and LIR instructions try { - build(); + parser.build(); } finally { filter.remove(); } // emitCode Assumptions assumptions = new Assumptions(OptAssumptions.getValue()); - GraalCompiler.emitCode(backend, assumptions, lirGenRes, compilationResult, installedCodeOwner, factory); + GraalCompiler.emitCode(backend, assumptions, parser.lirGenRes, compilationResult, installedCodeOwner, factory); return compilationResult; } - protected void build() { - if (PrintProfilingInformation.getValue()) { - TTY.println("Profiling info for " + MetaUtil.format("%H.%n(%p)", method)); - TTY.println(MetaUtil.indent(MetaUtil.profileToString(profilingInfo, method, CodeUtil.NEW_LINE), " ")); + public void setParameter(int i, Variable emitMove) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + public void processBlock(BciBlock block) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + private static class BytecodeParser extends AbstractBytecodeParser { + private Backend backend; + private LIRGenerator lirGen; + private LIRGenerationResult lirGenRes; + private BciBlock[] loopHeaders; + + public BytecodeParser(MetaAccessProvider metaAccess, ResolvedJavaMethod method, GraphBuilderConfiguration graphBuilderConfig, OptimisticOptimizations optimisticOpts, + LIRFrameStateBuilder frameState, BytecodeStream stream, ProfilingInfo profilingInfo, ConstantPool constantPool, int entryBCI, Backend backend) { + + super(metaAccess, method, graphBuilderConfig, optimisticOpts, frameState, stream, profilingInfo, constantPool, entryBCI); + this.backend = backend; } - try (Indent indent = Debug.logAndIndent("build graph for %s", method)) { - - // compute the block map, setup exception handlers and get the entrypoint(s) - BciBlockMapping blockMap = BciBlockMapping.create(method); - loopHeaders = blockMap.loopHeaders; - - // add predecessors - for (BciBlock block : blockMap.blocks) { - for (BciBlock successor : block.getSuccessors()) { - successor.getPredecessors().add(block); - } - } - - if (isSynchronized(method.getModifiers())) { - throw GraalInternalError.unimplemented("Handle synchronized methods"); - } - - // TODO: clear non live locals - - currentBlock = blockMap.startBlock; - if (blockMap.startBlock.isLoopHeader) { - throw GraalInternalError.unimplemented("Handle start block as loop header"); + protected void build() { + if (PrintProfilingInformation.getValue()) { + TTY.println("Profiling info for " + MetaUtil.format("%H.%n(%p)", method)); + TTY.println(MetaUtil.indent(MetaUtil.profileToString(profilingInfo, method, CodeUtil.NEW_LINE), " ")); } - // add loops ? how do we add looks when we haven't parsed the bytecode? + try (Indent indent = Debug.logAndIndent("build graph for %s", method)) { + + // compute the block map, setup exception handlers and get the entrypoint(s) + BciBlockMapping blockMap = BciBlockMapping.create(method); + loopHeaders = blockMap.loopHeaders; - // create the control flow graph - LIRControlFlowGraph cfg = new LIRControlFlowGraph(blockMap.blocks.toArray(new BciBlock[0]), new Loop[0]); + // add predecessors + for (BciBlock block : blockMap.blocks) { + for (BciBlock successor : block.getSuccessors()) { + successor.getPredecessors().add(block); + } + } - BlocksToDoubles blockProbabilities = new BlocksToDoubles(blockMap.blocks.size()); - for (BciBlock b : blockMap.blocks) { - blockProbabilities.put(b, 1); - } + if (isSynchronized(method.getModifiers())) { + throw GraalInternalError.unimplemented("Handle synchronized methods"); + } + + // TODO: clear non live locals + + currentBlock = blockMap.startBlock; + if (blockMap.startBlock.isLoopHeader) { + throw GraalInternalError.unimplemented("Handle start block as loop header"); + } + + // add loops ? how do we add looks when we haven't parsed the bytecode? + + // create the control flow graph + LIRControlFlowGraph cfg = new LIRControlFlowGraph(blockMap.blocks.toArray(new BciBlock[0]), new Loop[0]); - // create the LIR - List> linearScanOrder = ComputeBlockOrder.computeLinearScanOrder(blockMap.blocks.size(), blockMap.startBlock, blockProbabilities); - List> codeEmittingOrder = ComputeBlockOrder.computeCodeEmittingOrder(blockMap.blocks.size(), blockMap.startBlock, blockProbabilities); - LIR lir = new LIR(cfg, linearScanOrder, codeEmittingOrder); + BlocksToDoubles blockProbabilities = new BlocksToDoubles(blockMap.blocks.size()); + for (BciBlock b : blockMap.blocks) { + blockProbabilities.put(b, 1); + } + + // create the LIR + List> linearScanOrder = ComputeBlockOrder.computeLinearScanOrder(blockMap.blocks.size(), blockMap.startBlock, blockProbabilities); + List> codeEmittingOrder = ComputeBlockOrder.computeCodeEmittingOrder(blockMap.blocks.size(), blockMap.startBlock, blockProbabilities); + LIR lir = new LIR(cfg, linearScanOrder, codeEmittingOrder); - FrameMap frameMap = backend.newFrameMap(); - TargetDescription target = backend.getTarget(); - CallingConvention cc = CodeUtil.getCallingConvention(backend.getProviders().getCodeCache(), CallingConvention.Type.JavaCallee, method, false); - this.lirGenRes = backend.newLIRGenerationResult(lir, frameMap, null); - this.lirGen = backend.newLIRGenerator(cc, lirGenRes); + FrameMap frameMap = backend.newFrameMap(); + TargetDescription target = backend.getTarget(); + CallingConvention cc = CodeUtil.getCallingConvention(backend.getProviders().getCodeCache(), CallingConvention.Type.JavaCallee, method, false); + this.lirGenRes = backend.newLIRGenerationResult(lir, frameMap, null); + this.lirGen = backend.newLIRGenerator(cc, lirGenRes); + + try (Scope ds = Debug.scope("BackEnd", lir)) { + try (Scope s = Debug.scope("LIRGen", lirGen)) { - try (Scope ds = Debug.scope("BackEnd", lir)) { - try (Scope s = Debug.scope("LIRGen", lirGen)) { + // possibly add all the arguments to slots in the local variable array + + for (BciBlock block : blockMap.blocks) { + } - // possibly add all the arguments to slots in the local variable array - - for (BciBlock block : blockMap.blocks) { + lirGen.beforeRegisterAllocation(); + Debug.dump(lir, "After LIR generation"); + } catch (Throwable e) { + throw Debug.handle(e); } - lirGen.beforeRegisterAllocation(); - Debug.dump(lir, "After LIR generation"); - } catch (Throwable e) { - throw Debug.handle(e); - } + try (Scope s = Debug.scope("Allocator")) { - try (Scope s = Debug.scope("Allocator")) { - - if (backend.shouldAllocateRegisters()) { - new LinearScan(target, lir, frameMap).allocate(); + if (backend.shouldAllocateRegisters()) { + new LinearScan(target, lir, frameMap).allocate(); + } + } catch (Throwable e) { + throw Debug.handle(e); } } catch (Throwable e) { throw Debug.handle(e); @@ -199,17 +197,427 @@ } catch (Throwable e) { throw Debug.handle(e); } - } catch (Throwable e) { - throw Debug.handle(e); + } + + @Override + protected void handleUnresolvedLoadConstant(JavaType type) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void handleUnresolvedCheckCast(JavaType type, Value object) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void handleUnresolvedInstanceOf(JavaType type, Value object) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void handleUnresolvedNewInstance(JavaType type) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void handleUnresolvedNewObjectArray(JavaType type, Value length) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void handleUnresolvedNewMultiArray(JavaType type, List dims) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void handleUnresolvedLoadField(JavaField field, Value receiver) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void handleUnresolvedStoreField(JavaField field, Value value, Value receiver) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void handleUnresolvedExceptionType(Representation representation, JavaType type) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genLoadIndexed(Value index, Value array, Kind kind) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genStoreIndexed(Value array, Value index, Kind kind, Value value) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genIntegerAdd(Kind kind, Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genIntegerSub(Kind kind, Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genIntegerMul(Kind kind, Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genFloatAdd(Kind kind, Value x, Value y, boolean isStrictFP) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genFloatSub(Kind kind, Value x, Value y, boolean isStrictFP) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genFloatMul(Kind kind, Value x, Value y, boolean isStrictFP) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); } - } + + @Override + protected Value genFloatDiv(Kind kind, Value x, Value y, boolean isStrictFP) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genFloatRem(Kind kind, Value x, Value y, boolean isStrictFP) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genIntegerDiv(Kind kind, Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genIntegerRem(Kind kind, Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genNegateOp(Value x) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genLeftShift(Kind kind, Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genRightShift(Kind kind, Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genUnsignedRightShift(Kind kind, Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genAnd(Kind kind, Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genOr(Kind kind, Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genXor(Kind kind, Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genNormalizeCompare(Value x, Value y, boolean isUnorderedLess) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genFloatConvert(FloatConvert op, Value input) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genNarrow(Value input, int bitCount) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genSignExtend(Value input, int bitCount) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genZeroExtend(Value input, int bitCount) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genObjectEquals(Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } - public void setParameter(int i, Variable emitMove) { - frameState.storeLocal(i, emitMove); - } + @Override + protected Value genIntegerEquals(Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genIntegerLessThan(Value x, Value y) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genUnique(Value x) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genIf(Value condition, Value falseSuccessor, Value trueSuccessor, double d) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void genThrow() { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genCheckCast(ResolvedJavaType type, Value object, JavaTypeProfile profileForTypeCheck, boolean b) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genInstanceOf(ResolvedJavaType type, Value object, JavaTypeProfile profileForTypeCheck) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genConditional(Value x) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value createNewInstance(ResolvedJavaType type, boolean fillContents) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value createNewArray(ResolvedJavaType elementType, Value length, boolean fillContents) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value createNewMultiArray(ResolvedJavaType type, List dims) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genLoadField(Value receiver, ResolvedJavaField field) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void emitNullCheck(Value receiver) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void emitBoundsCheck(Value index, Value length) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genArrayLength(Value x) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genStoreField(Value receiver, ResolvedJavaField field, Value value) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void genInvokeStatic(JavaMethod target) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void genInvokeInterface(JavaMethod target) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } - public void processBlock(BciBlock block) { - // TODO Auto-generated method stub - throw GraalInternalError.unimplemented("Auto-generated method stub"); + @Override + protected void genInvokeDynamic(JavaMethod target) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void genInvokeVirtual(JavaMethod target) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void genInvokeSpecial(JavaMethod target) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void genReturn(Value x) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genMonitorEnter(Value x) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genMonitorExit(Value x, Value returnValue) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void genJsr(int dest) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void genRet(int localIndex) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void setBlockSuccessor(Value switchNode, int i, Value createBlockTarget) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genIntegerSwitch(Value value, int size, int[] keys, double[] keyProbabilities, int[] keySuccessors) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value appendConstant(Constant constant) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value append(Value v) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value genDeoptimization() { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value createTarget(BciBlock trueBlock, AbstractFrameStateBuilder state) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected Value createBlockTarget(double probability, BciBlock bciBlock, AbstractFrameStateBuilder stateAfter) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void processBlock(BciBlock block) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void appendGoto(Value target) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + + @Override + protected void iterateBytecodesForBlock(BciBlock block) { + // TODO Auto-generated method stub + throw GraalInternalError.unimplemented("Auto-generated method stub"); + } + } } diff -r 31a9c79399c8 -r bd08e610e6f3 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Tue Apr 01 18:51:14 2014 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Mon Mar 31 19:00:13 2014 +0200 @@ -103,7 +103,7 @@ /** * Set up a test for a non-default backend. The test should check (via {@link #getBackend()} ) * whether the desired backend is available. - * + * * @param arch the name of the desired backend architecture */ public GraalCompilerTest(Class arch) { @@ -262,7 +262,7 @@ /** * Parses a Java method to produce a graph. - * + * * @param methodName the name of the method in {@code this.getClass()} to be parsed */ protected StructuredGraph parse(String methodName) { @@ -500,7 +500,8 @@ private CompilationResult compileBaseline(ResolvedJavaMethod javaMethod) { try (Scope bds = Debug.scope("CompileBaseline", javaMethod, providers.getCodeCache())) { BaselineCompiler baselineCompiler = new BaselineCompiler(GraphBuilderConfiguration.getDefault(), providers.getMetaAccess()); - return baselineCompiler.generate(javaMethod, -1, getBackend(), new CompilationResult(), javaMethod, CompilationResultBuilderFactory.Default); + OptimisticOptimizations optimisticOpts = OptimisticOptimizations.ALL; + return baselineCompiler.generate(javaMethod, -1, getBackend(), new CompilationResult(), javaMethod, CompilationResultBuilderFactory.Default, optimisticOpts); } catch (Throwable e) { throw Debug.handle(e); } @@ -527,7 +528,7 @@ /** * Prepends a non-null receiver argument to a given list or args. - * + * * @param receiver the receiver argument to prepend if it is non-null */ protected Object[] argsWithReceiver(Object receiver, Object... args) { @@ -612,7 +613,7 @@ /** * Gets installed code for a given method and graph, compiling it first if necessary. - * + * * @param forceCompile specifies whether to ignore any previous code cached for the (method, * key) pair */ @@ -674,7 +675,7 @@ /** * Parses a Java method to produce a graph. - * + * * @param methodName the name of the method in {@code this.getClass()} to be parsed */ protected StructuredGraph parseProfiled(String methodName) { @@ -729,7 +730,7 @@ /** * Inject a probability for a branch condition into the profiling information of this test case. - * + * * @param p the probability that cond is true * @param cond the condition of the branch * @return cond @@ -741,7 +742,7 @@ /** * Inject an iteration count for a loop condition into the profiling information of this test * case. - * + * * @param i the iteration count of the loop * @param cond the condition of the loop * @return cond diff -r 31a9c79399c8 -r bd08e610e6f3 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Tue Apr 01 18:51:14 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Mon Mar 31 19:00:13 2014 +0200 @@ -259,7 +259,8 @@ if (UseBaselineCompiler.getValue() == true) { HotSpotProviders providers = backend.getProviders(); BaselineCompiler baselineCompiler = new BaselineCompiler(GraphBuilderConfiguration.getDefault(), providers.getMetaAccess()); - result = baselineCompiler.generate(method, -1, backend, new CompilationResult(), method, CompilationResultBuilderFactory.Default); + OptimisticOptimizations optimisticOpts = OptimisticOptimizations.ALL; + result = baselineCompiler.generate(method, -1, backend, new CompilationResult(), method, CompilationResultBuilderFactory.Default, optimisticOpts); } else { Map graphCache = null; if (GraalOptions.CacheGraphs.getValue()) {