Skip to content

Commit 5f23929

Browse files
CAG2MarkLPTK
authored andcommitted
remove unneeded code
1 parent 73feb5f commit 5f23929

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

hkmc2/shared/src/main/scala/hkmc2/codegen/StackSafeTransform.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class StackSafeTransform(depthLimit: Int)(using State):
5555
val handlerSym = TempSymbol(None, "stackHandler")
5656
val resSym = TempSymbol(None, "res")
5757
val handlerRes = TempSymbol(None, "res")
58-
val curOffsetSym = TempSymbol(None, "curOffset")
5958

6059
val clsSym = ClassSymbol(
6160
Tree.TypeDef(syntax.Cls, Tree.Error(), N, N),
@@ -70,13 +69,11 @@ class StackSafeTransform(depthLimit: Int)(using State):
7069
BlockMemberSymbol("perform", Nil), resumeSym, ParamList(ParamListFlags.empty, Nil, N) :: Nil,
7170
/*
7271
fun perform() =
73-
let curOffset = stackOffset
7472
stackOffset = stackDepth
7573
let ret = resume()
7674
ret
7775
*/
7876
blockBuilder
79-
.assign(curOffsetSym, stackOffsetPath)
8077
.assignFieldN(predefPath, STACK_OFFSET_IDENT, stackDepthPath)
8178
.assign(handlerRes, Call(Value.Ref(resumeSym), Nil)(true))
8279
.ret(handlerRes.asPath)

hkmc2/shared/src/test/mlscript/handlers/StackSafety.mls

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ hi(0)
8989
//│ }
9090
//│ perform() {
9191
//│ return globalThis.Predef.__mkEffect(stackHandler, (resume) => {
92-
//│ let res2, curOffset, res3, Cont$1;
92+
//│ let res2, res3, Cont$1;
9393
//│ Cont$1 = function Cont$(pc1) { return new Cont$.class(pc1); };
9494
//│ Cont$1.class = class Cont$ extends globalThis.Predef.__Cont.class {
9595
//│ constructor(pc) {
@@ -111,7 +111,6 @@ hi(0)
111111
//│ }
112112
//│ toString() { return "Cont$(" + this.pc + ")"; }
113113
//│ };
114-
//│ curOffset = globalThis.Predef.__stackOffset;
115114
//│ globalThis.Predef.__stackOffset = globalThis.Predef.__stackDepth;
116115
//│ res3 = resume();
117116
//│ if (res3 instanceof globalThis.Predef.__EffectSig.class) {
@@ -282,7 +281,7 @@ sum(10000)
282281
//│ }
283282
//│ perform() {
284283
//│ return globalThis.Predef.__mkEffect(stackHandler, (resume) => {
285-
//│ let res3, curOffset, res4, Cont$1;
284+
//│ let res3, res4, Cont$1;
286285
//│ Cont$1 = function Cont$(pc1) { return new Cont$.class(pc1); };
287286
//│ Cont$1.class = class Cont$ extends globalThis.Predef.__Cont.class {
288287
//│ constructor(pc) {
@@ -304,7 +303,6 @@ sum(10000)
304303
//│ }
305304
//│ toString() { return "Cont$(" + this.pc + ")"; }
306305
//│ };
307-
//│ curOffset = globalThis.Predef.__stackOffset;
308306
//│ globalThis.Predef.__stackOffset = globalThis.Predef.__stackDepth;
309307
//│ res4 = resume();
310308
//│ if (res4 instanceof globalThis.Predef.__EffectSig.class) {

0 commit comments

Comments
 (0)