Mercurial > hg > graal-compiler
comparison graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java @ 2866:7f14e6b48a9c
added dead code elimination
added ValueAnchor (temp workaround)
more inlining logic (now uses DCE)
IdealGraphPrinter: print even if Scheduler fails
added inlining and DCE tracing options to C1XOptions
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Tue, 07 Jun 2011 16:27:08 +0200 |
parents | 7596ae867a7b |
children | 5c545fef2c81 |
comparison
equal
deleted
inserted
replaced
2845:e55543ff91fd | 2866:7f14e6b48a9c |
---|---|
119 this.frameState = new FrameStateBuilder(method, graph); | 119 this.frameState = new FrameStateBuilder(method, graph); |
120 } | 120 } |
121 | 121 |
122 /** | 122 /** |
123 * Builds the graph for a the specified {@code IRScope}. | 123 * Builds the graph for a the specified {@code IRScope}. |
124 * @param scope the top IRScope | 124 * |
125 * @param createUnwind setting this to true will always generate an unwind block, even if there is no exception | |
126 * handler and the method is not synchronized | |
125 */ | 127 */ |
126 public void build() { | 128 public void build(boolean createUnwind) { |
127 if (log != null) { | 129 if (log != null) { |
128 log.println(); | 130 log.println(); |
129 log.println("Compiling " + method); | 131 log.println("Compiling " + method); |
130 } | 132 } |
131 | 133 |
159 // 4A.3 setup an exception handler to unlock the root method synchronized object | 161 // 4A.3 setup an exception handler to unlock the root method synchronized object |
160 syncHandler = new CiExceptionHandler(0, method.code().length, Instruction.SYNCHRONIZATION_ENTRY_BCI, 0, null); | 162 syncHandler = new CiExceptionHandler(0, method.code().length, Instruction.SYNCHRONIZATION_ENTRY_BCI, 0, null); |
161 } else { | 163 } else { |
162 // 4B.1 simply finish the start block | 164 // 4B.1 simply finish the start block |
163 finishStartBlock(startBlock); | 165 finishStartBlock(startBlock); |
166 | |
167 if (createUnwind) { | |
168 syncHandler = new CiExceptionHandler(0, method.code().length, Instruction.SYNCHRONIZATION_ENTRY_BCI, 0, null); | |
169 } | |
164 } | 170 } |
165 | 171 |
166 // 5. SKIPPED: look for intrinsics | 172 // 5. SKIPPED: look for intrinsics |
167 | 173 |
168 // 6B.1 do the normal parsing | 174 // 6B.1 do the normal parsing |
542 | 548 |
543 private void genArithmeticOp(CiKind result, int opcode, CiKind x, CiKind y, boolean canTrap) { | 549 private void genArithmeticOp(CiKind result, int opcode, CiKind x, CiKind y, boolean canTrap) { |
544 Value yValue = frameState.pop(y); | 550 Value yValue = frameState.pop(y); |
545 Value xValue = frameState.pop(x); | 551 Value xValue = frameState.pop(x); |
546 Value result1 = append(new ArithmeticOp(opcode, result, xValue, yValue, isStrict(method.accessFlags()), canTrap, graph)); | 552 Value result1 = append(new ArithmeticOp(opcode, result, xValue, yValue, isStrict(method.accessFlags()), canTrap, graph)); |
553 append(new ValueAnchor(result1, graph)); | |
547 frameState.push(result, result1); | 554 frameState.push(result, result1); |
548 } | 555 } |
549 | 556 |
550 private void genNegateOp(CiKind kind) { | 557 private void genNegateOp(CiKind kind) { |
551 frameState.push(kind, append(new NegateOp(frameState.pop(kind), graph))); | 558 frameState.push(kind, append(new NegateOp(frameState.pop(kind), graph))); |