Skip to content

Commit ba6f5da

Browse files
committed
remove the JumpOutValue class
For some reason I suddenly started having cyclical dependency issues in which EJumpKind would be undefined so I decided to just remove the file since it was no longer used anyways
1 parent 20590bf commit ba6f5da

File tree

3 files changed

+0
-117
lines changed

3 files changed

+0
-117
lines changed
Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import { IValue, TLineRef } from "../types";
2-
import { LiteralValue } from "../values";
3-
import { JumpOutValue } from "../values/JumpOutValue";
42
import { InstructionBase } from "./InstructionBase";
53

64
export enum EJumpKind {
@@ -23,20 +21,4 @@ export class JumpInstruction extends InstructionBase {
2321
) {
2422
super("jump", address, kind, left, right);
2523
}
26-
27-
/**
28-
* Works with the `JumpOutValue` class to determine wether a jump should be
29-
* added if the expression wasn't jump compressed.
30-
*/
31-
static or(test: IValue, out: JumpOutValue) {
32-
if (test === out) return [];
33-
return [
34-
new JumpInstruction(
35-
out.address,
36-
out.whenTrue ? EJumpKind.NotEqual : EJumpKind.Equal,
37-
test,
38-
new LiteralValue(0),
39-
),
40-
];
41-
}
4224
}

compiler/src/values/BaseValue.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
} from "../types";
2222
import { LiteralValue, VoidValue, StoreValue } from ".";
2323
import { isDiscardedOut, pipeInsts } from "../utils";
24-
import { JumpOutValue } from "./JumpOutValue";
2524

2625
export class BaseValue extends VoidValue implements IValue {
2726
"u-"(scope: IScope, out?: TEOutput): TValueInstructions {
@@ -93,12 +92,6 @@ export class BaseValue extends VoidValue implements IValue {
9392
}
9493

9594
"!=="(scope: IScope, other: IValue, out?: TEOutput): TValueInstructions {
96-
if (out instanceof JumpOutValue && out.canHandle("!==")) {
97-
const [left, leftInst] = this.eval(scope);
98-
const [right, rightInst] = other.eval(scope);
99-
return [out, [...leftInst, ...rightInst, out.handle("!==", left, right)]];
100-
}
101-
10295
const [equal, equalInst] = this["==="](scope, other);
10396
const [result, resultInst] = equal["!"](scope, out);
10497

@@ -180,11 +173,6 @@ for (const k in operatorMap) {
180173
const [left, leftInst] = this.eval(scope);
181174
const [right, rightInst] = value.eval(scope);
182175

183-
if (out instanceof JumpOutValue && out.canHandle(key)) {
184-
const jump = out.handle(key, left, right);
185-
return [out, [...leftInst, ...rightInst, jump]];
186-
}
187-
188176
const temp = StoreValue.from(scope, out);
189177
return [
190178
temp,

compiler/src/values/JumpOutValue.ts

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)