Skip to content

Commit c60f732

Browse files
committed
generic changes
1 parent c30b864 commit c60f732

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

compiler/src/flow/graph.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,12 @@ export class Graph {
187187

188188
for (const node of block.instructions.nodes()) {
189189
const inst = node.instruction;
190-
if (isLowerable(inst)) {
191-
cursor.position = node;
192-
inst.lower(c, cursor);
193-
cursor.position = node;
194-
cursor.removeInstruction();
195-
}
190+
if (!isLowerable(inst)) continue;
191+
192+
cursor.position = node;
193+
inst.lower(c, cursor);
194+
cursor.position = node;
195+
cursor.removeInstruction();
196196
}
197197
});
198198
}

compiler/src/flow/instructions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { ICompilerContext } from "../CompilerContext";
33
import { CompilerError } from "../CompilerError";
44
import { InstructionBase, SetInstruction } from "../instructions";
55
import { IInstruction, Location, TLiteral, es } from "../types";
6-
import { nullId } from "../utils";
76
import { LiteralValue } from "../values";
87
import { Block, TEdge } from "./block";
98
import { GlobalId, ImmutableId } from "./id";

compiler/src/values/FunctionValue.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
nodeName,
77
pipeInsts,
88
} from "../utils";
9-
import { Compiler } from "../Compiler";
109
import { CompilerError } from "../CompilerError";
1110
import {
1211
AddressResolver,
@@ -34,6 +33,8 @@ import {
3433
DestructuringValue,
3534
TDestructuringMembers,
3635
} from "./DestructuringValue";
36+
import { ICompilerContext } from "../CompilerContext";
37+
import { ImmutableId } from "../flow";
3738

3839
export type TFunctionValueInitParams = (childScope: IScope) => {
3940
paramStores: StoreValue[];
@@ -67,7 +68,7 @@ export class FunctionValue extends VoidValue implements IFunctionValue {
6768
private inline!: boolean;
6869
private tryingInline!: boolean;
6970
private body: es.BlockStatement;
70-
private c: Compiler;
71+
private c: ICompilerContext;
7172
private callSize!: number;
7273
private inlineTemp!: IValue;
7374
private inlineEnd?: LiteralValue<number | null>;
@@ -80,11 +81,13 @@ export class FunctionValue extends VoidValue implements IFunctionValue {
8081
body,
8182
c,
8283
out,
84+
id,
8385
}: {
8486
scope: IScope;
8587
body: es.BlockStatement;
86-
c: Compiler;
87-
params: es.Identifier[];
88+
c: ICompilerContext;
89+
params: FunctionParam[];
90+
id: ImmutableId;
8891
out?: TEOutput;
8992
}) {
9093
super();

0 commit comments

Comments
 (0)