Optimize out clearing MV register when all calls are to JS builtins
The commit 8d384458 handles the situation where a function body doesn't contain function calls, which makes the resetting of the multiple-value register at function return unnecessary. However, it leaves out another similar situation, namely, when the calls are to JS builtins, which don't ever produce multiple values. E. g.,
(defun foo (x)
(new (*array
(parse-int x)
((@ *object create) *some-proto (create)))))
can be safely translated to
function foo(x) {
return new Array(parseInt(x), Object.create(SomeProto, { }));
}
leaving out the __PS_MV_REG = [];
.
Attached herewith is a patch which does the extra optimization.