If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

if(false)'d function unnecessarily makes parent HEAVYWEIGHT

RESOLVED INVALID

Status

()

Core
JavaScript Engine
--
minor
RESOLVED INVALID
9 years ago
5 years ago

People

(Reporter: Jesse Ruderman, Unassigned)

Tracking

(Blocks: 1 bug, {testcase})

Trunk
x86
Mac OS X
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

9 years ago
js> print(dis(function(x) { if (false) { function y () {} } }));
flags: LAMBDA HEAVYWEIGHT INTERPRETED
main:
00000:  stop

Doesn't need to be HEAVYWEIGHT, because function y is gone.
(Reporter)

Comment 1

9 years ago
Here's a case that I don't understand at all:

js> dis(function() { if (false) __proto__; })
flags: LAMBDA HEAVYWEIGHT INTERPRETED
main:
00000:  stop
__proto__ is an undeclared access, so heavyweight.  Same bug, I suspect.
(Reporter)

Comment 3

9 years ago
There's something weird going on in comment 1.  It only happens for the names "__proto__" and "__parent__".
See bug 36625. We mark the function heavyweight when we see the unqualified __proto__ or __parent__ and can't re-optimize easily.

Comment 5

5 years ago
This is heavyweight because of the non-body-level function statement which dynamically adds 'y' to the scope.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.