Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java @ 2869:fc75fd3fa5e4
merge (inlining broken)
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Tue, 07 Jun 2011 19:21:23 +0200 |
parents | 5c545fef2c81 7a4e6e11877f |
children |
comparison
equal
deleted
inserted
replaced
2868:6d24c27902a2 | 2869:fc75fd3fa5e4 |
---|---|
561 } | 561 } |
562 | 562 |
563 private void genShiftOp(CiKind kind, int opcode) { | 563 private void genShiftOp(CiKind kind, int opcode) { |
564 Value s = frameState.ipop(); | 564 Value s = frameState.ipop(); |
565 Value x = frameState.pop(kind); | 565 Value x = frameState.pop(kind); |
566 frameState.push(kind, append(new Shift(opcode, x, s, graph))); | 566 Shift v; |
567 switch(opcode){ | |
568 case ISHL: | |
569 case LSHL: v = new LeftShift(kind, x, s, graph); break; | |
570 case ISHR: | |
571 case LSHR: v = new RightShift(kind, x, s, graph); break; | |
572 case IUSHR: | |
573 case LUSHR: v = new UnsignedRightShift(kind, x, s, graph); break; | |
574 default: | |
575 throw new CiBailout("should not reach"); | |
576 } | |
577 frameState.push(kind, append(v)); | |
567 } | 578 } |
568 | 579 |
569 private void genLogicOp(CiKind kind, int opcode) { | 580 private void genLogicOp(CiKind kind, int opcode) { |
570 Value y = frameState.pop(kind); | 581 Value y = frameState.pop(kind); |
571 Value x = frameState.pop(kind); | 582 Value x = frameState.pop(kind); |
584 } | 595 } |
585 | 596 |
586 private void genCompareOp(CiKind kind, int opcode, CiKind resultKind) { | 597 private void genCompareOp(CiKind kind, int opcode, CiKind resultKind) { |
587 Value y = frameState.pop(kind); | 598 Value y = frameState.pop(kind); |
588 Value x = frameState.pop(kind); | 599 Value x = frameState.pop(kind); |
589 Value value = append(new Materialize(opcode, resultKind, x, y, graph)); | 600 Value value = append(new NormalizeCompare(opcode, resultKind, x, y, graph)); |
590 if (!resultKind.isVoid()) { | 601 if (!resultKind.isVoid()) { |
591 frameState.ipush(value); | 602 frameState.ipush(value); |
592 } | 603 } |
593 } | 604 } |
594 | 605 |
609 appendGoto(createTargetAt(toBCI, frameState)); | 620 appendGoto(createTargetAt(toBCI, frameState)); |
610 } | 621 } |
611 | 622 |
612 private void ifNode(Value x, Condition cond, Value y) { | 623 private void ifNode(Value x, Condition cond, Value y) { |
613 assert !x.isDeleted() && !y.isDeleted(); | 624 assert !x.isDeleted() && !y.isDeleted(); |
614 If ifNode = new If(x, cond, y, graph); | 625 If ifNode = new If(new Compare(x, cond, y, graph), graph); |
615 append(ifNode); | 626 append(ifNode); |
616 Instruction tsucc = createTargetAt(stream().readBranchDest(), frameState); | 627 Instruction tsucc = createTargetAt(stream().readBranchDest(), frameState); |
617 ifNode.setBlockSuccessor(0, tsucc); | 628 ifNode.setBlockSuccessor(0, tsucc); |
618 Instruction fsucc = createTargetAt(stream().nextBCI(), frameState); | 629 Instruction fsucc = createTargetAt(stream().nextBCI(), frameState); |
619 ifNode.setBlockSuccessor(1, fsucc); | 630 ifNode.setBlockSuccessor(1, fsucc); |