Skip to content

Remove local sharing logic #2540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Oct 23, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions src/builtins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,6 @@ function builtin_bswap(ctx: BuiltinContext): ExpressionRef {
if (type.kind == TypeKind.I16) {
res = compiler.ensureSmallIntegerWrap(res, Type.i16);
}
flow.freeTempLocal(temp);
return res;
}
case TypeKind.I32:
Expand Down Expand Up @@ -1227,7 +1226,6 @@ function builtin_bswap(ctx: BuiltinContext): ExpressionRef {
module.i32(8)
),
);
flow.freeTempLocal(temp);
return res;
}
// fall-through
Expand Down Expand Up @@ -1306,10 +1304,6 @@ function builtin_bswap(ctx: BuiltinContext): ExpressionRef {
res,
module.i64(32)
);

flow.freeTempLocal(temp2);
flow.freeTempLocal(temp1);

return res;
}
}
Expand Down Expand Up @@ -1487,8 +1481,6 @@ function builtin_rotl(ctx: BuiltinContext): ExpressionRef {
)
)
);
flow.freeTempLocal(temp2);
flow.freeTempLocal(temp1);

return ret;
}
Expand Down Expand Up @@ -1561,8 +1553,6 @@ function builtin_rotr(ctx: BuiltinContext): ExpressionRef {
)
)
);
flow.freeTempLocal(temp2);
flow.freeTempLocal(temp1);

return ret;
}
Expand Down Expand Up @@ -1627,8 +1617,6 @@ function builtin_abs(ctx: BuiltinContext): ExpressionRef {
),
module.local_get(temp2.index, TypeRef.I32)
);
flow.freeTempLocal(temp2);
flow.freeTempLocal(temp1);
return ret;
}
case TypeKind.ISIZE: {
Expand All @@ -1653,8 +1641,6 @@ function builtin_abs(ctx: BuiltinContext): ExpressionRef {
),
module.local_get(temp2.index, options.sizeTypeRef)
);
flow.freeTempLocal(temp2);
flow.freeTempLocal(temp1);
return ret;
}
case TypeKind.I64: {
Expand All @@ -1677,8 +1663,6 @@ function builtin_abs(ctx: BuiltinContext): ExpressionRef {
),
module.local_get(temp2.index, TypeRef.I64)
);
flow.freeTempLocal(temp2);
flow.freeTempLocal(temp1);
return ret;
}
case TypeKind.F32: return module.unary(UnaryOp.AbsF32, arg0);
Expand Down Expand Up @@ -1750,8 +1734,6 @@ function builtin_max(ctx: BuiltinContext): ExpressionRef {
),
typeRef
);
flow.freeTempLocal(temp2);
flow.freeTempLocal(temp1);
return ret;
}
}
Expand Down Expand Up @@ -1820,8 +1802,6 @@ function builtin_min(ctx: BuiltinContext): ExpressionRef {
),
typeRef
);
flow.freeTempLocal(temp2);
flow.freeTempLocal(temp1);
return ret;
}
}
Expand Down Expand Up @@ -2155,7 +2135,6 @@ function builtin_isNaN(ctx: BuiltinContext): ExpressionRef {
module.local_tee(temp.index, arg0, false), // f32
module.local_get(temp.index, TypeRef.F32)
);
flow.freeTempLocal(temp);
return ret;
}
case TypeKind.F64: {
Expand All @@ -2171,7 +2150,6 @@ function builtin_isNaN(ctx: BuiltinContext): ExpressionRef {
module.local_tee(temp.index, arg0, false), // f64
module.local_get(temp.index, TypeRef.F64)
);
flow.freeTempLocal(temp);
return ret;
}
}
Expand Down Expand Up @@ -2237,7 +2215,6 @@ function builtin_isFinite(ctx: BuiltinContext): ExpressionRef {
),
module.f32(0)
);
flow.freeTempLocal(temp);
return ret;
}
case TypeKind.F64: {
Expand All @@ -2259,7 +2236,6 @@ function builtin_isFinite(ctx: BuiltinContext): ExpressionRef {
),
module.f64(0)
);
flow.freeTempLocal(temp);
return ret;
}
}
Expand Down Expand Up @@ -3518,7 +3494,6 @@ function builtin_assert(ctx: BuiltinContext): ExpressionRef {
module.local_get(temp.index, TypeRef.I32),
abort
);
flow.freeTempLocal(temp);
return ret;
}
case TypeKind.I64:
Expand All @@ -3531,7 +3506,6 @@ function builtin_assert(ctx: BuiltinContext): ExpressionRef {
abort,
module.local_get(temp.index, TypeRef.I64)
);
flow.freeTempLocal(temp);
return ret;
}
case TypeKind.ISIZE:
Expand All @@ -3545,7 +3519,6 @@ function builtin_assert(ctx: BuiltinContext): ExpressionRef {
abort,
module.local_get(temp.index, compiler.options.sizeTypeRef)
);
flow.freeTempLocal(temp);
return ret;
}
case TypeKind.F32: {
Expand All @@ -3558,7 +3531,6 @@ function builtin_assert(ctx: BuiltinContext): ExpressionRef {
abort,
module.local_get(temp.index, TypeRef.F32)
);
flow.freeTempLocal(temp);
return ret;
}
case TypeKind.F64: {
Expand All @@ -3571,7 +3543,6 @@ function builtin_assert(ctx: BuiltinContext): ExpressionRef {
abort,
module.local_get(temp.index, TypeRef.F64)
);
flow.freeTempLocal(temp);
return ret;
}
case TypeKind.FUNCREF:
Expand All @@ -3593,7 +3564,6 @@ function builtin_assert(ctx: BuiltinContext): ExpressionRef {
abort,
module.local_get(temp.index, type.toRef())
);
flow.freeTempLocal(temp);
return ret;
}
}
Expand Down
Loading