workaround v8 performance quirks (#5207)

This commit is contained in:
Alex Lam S.L
2021-12-08 05:40:47 +00:00
committed by GitHub
parent 8f39491e96
commit bc27966a19
4 changed files with 38 additions and 31 deletions

View File

@@ -45,6 +45,7 @@
function SymbolDef(id, scope, orig, init) {
this._bits = 0;
this.defun = undefined;
this.eliminated = 0;
this.id = id;
this.init = init;
@@ -53,6 +54,7 @@ function SymbolDef(id, scope, orig, init) {
this.orig = [ orig ];
this.references = [];
this.replaced = 0;
this.safe_ids = undefined;
this.scope = scope;
}
@@ -370,7 +372,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
if (node instanceof AST_SymbolLambda) {
var def = node.thedef;
if (!redefine(node, node.scope.parent_scope.resolve())) {
delete def.defun;
def.defun = undefined;
} else if (typeof node.thedef.init !== "undefined") {
node.thedef.init = false;
} else if (def.init) {
@@ -472,7 +474,7 @@ AST_Symbol.DEFMETHOD("mark_enclosed", function(options) {
for (var s = this.scope; s; s = s.parent_scope) {
push_uniq(s.enclosed, def);
if (!options) {
delete s._var_names;
s._var_names = undefined;
} else if (options.keep_fnames) {
s.functions.each(function(d) {
push_uniq(def.scope.enclosed, d);