home *** CD-ROM | disk | FTP | other *** search
- package espresso;
-
- class CondItem extends Item {
- int opcode;
- Label falseJumps;
- Label trueJumps;
-
- CondItem negate() {
- return new CondItem(Gen.negate(this.opcode), this.falseJumps, this.trueJumps);
- }
-
- Label jumpFalse() {
- return Gen.mergeLabels(this.falseJumps, Gen.branch(Gen.negate(this.opcode)));
- }
-
- Label jumpTrue() {
- return Gen.mergeLabels(this.trueJumps, Gen.branch(this.opcode));
- }
-
- CondItem mkCond() {
- return this;
- }
-
- void stash(Typ var1, int var2) {
- throw new CompilerError("stash");
- }
-
- void drop(Typ var1) {
- this.load(var1);
- Item.stackItem.drop(var1);
- }
-
- void duplicate(Typ var1) {
- this.load(var1);
- Item.stackItem.duplicate(var1);
- }
-
- void load(Typ var1) {
- Label var2 = null;
- Label var3 = this.jumpFalse();
- if (this.trueJumps != null || this.opcode != Gen.dontgoto) {
- Gen.resolve(this.trueJumps);
- Gen.emitop(4);
- var2 = Gen.branch(167);
- }
-
- if (var3 != null) {
- Gen.resolve(var3);
- Gen.emitop(3);
- }
-
- Gen.resolve(var2);
- }
-
- CondItem(int var1) {
- this(var1, (Label)null, (Label)null);
- }
-
- CondItem(int var1, Label var2, Label var3) {
- super(12);
- this.opcode = var1;
- this.trueJumps = var2;
- this.falseJumps = var3;
- }
- }
-