reduce memory pressure via bit fields (#5203)

This commit is contained in:
Alex Lam S.L
2021-12-06 03:30:05 +00:00
committed by GitHub
parent b0799105c2
commit 033d8d9405
8 changed files with 97 additions and 21 deletions

View File

@@ -898,7 +898,7 @@ Compressor.prototype.compress = function(node) {
if (left.equivalent_to(right) && !left.has_side_effects(compressor)) {
right.walk(tw);
walk_prop(left);
node.__drop = true;
node.redundant = true;
return true;
}
if (ld && right instanceof AST_LambdaExpression) {
@@ -2274,7 +2274,7 @@ Compressor.prototype.compress = function(node) {
stop_if_hit = if_hit;
stop_after = after;
can_replace = replace;
delete fn.collapse_scanning;
fn.collapse_scanning = false;
if (!abort) return false;
abort = false;
return true;
@@ -4919,7 +4919,7 @@ Compressor.prototype.compress = function(node) {
}
if (node instanceof AST_Scope && node !== fn) return true;
}));
delete fn.evaluating;
fn.evaluating = false;
if (!found) return;
}
return this;
@@ -4935,7 +4935,7 @@ Compressor.prototype.compress = function(node) {
});
fn.evaluating = true;
val = val._eval(compressor, ignore_side_effects, cached, depth);
delete fn.evaluating;
fn.evaluating = false;
}
cached_args.forEach(function(node) {
delete node._eval;
@@ -8055,7 +8055,7 @@ Compressor.prototype.compress = function(node) {
}) && all(fn.argnames, function(argname) {
return !argname.match_symbol(return_false);
}) && !(fn.rest && fn.rest.match_symbol(return_false));
delete fn.new;
fn.new = false;
return result;
}
function drop_class(self, compressor, first_in_statement) {
@@ -11640,7 +11640,7 @@ Compressor.prototype.compress = function(node) {
if (compressor.option("dead_code")) {
if (self.left instanceof AST_PropAccess) {
if (self.operator == "=") {
if (self.__drop) {
if (self.redundant) {
var exprs = [ self.left.expression ];
if (self.left instanceof AST_Sub) exprs.push(self.left.property);
exprs.push(self.right);