Closed Bug 1294683 Opened 9 years ago Closed 9 years ago

The eval cache isn't being hit

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jonco, Assigned: jonco)

Details

I tried to come up with a testcase for bug 1294566 but couldn't find a way to get a hit in the eval cache because IsEvalCacheCandidate always seems to return false. static bool IsEvalCacheCandidate(JSScript* script) { // Make sure there are no inner objects which might use the wrong parent // and/or call scope by reusing the previous eval's script. Skip the // script's first object, which entrains the eval's scope. return script->savedCallerFun() && !script->hasSingletons() && script->objects()->length == 1; } In situations where the first two conditions pass I always see two objects in the script->objects() array: a JSFunction and a StaticBlockScope. jandem suggested that the checks on the length of the inner object array were out of date and might not make sense any more. I tested the sunspider date-format-tofte test and this doesn't hit the eval cache either.
From what I recall the eval cache was made to improve the performance of one sunsipder benchmark which generate function calls like: eval(name + "()"); Maybe double check with sunspider, if you have any hit, or if there is an issue.
(In reply to Jon Coppeard (:jonco) from comment #0) > I tried to come up with a testcase for bug 1294566 but couldn't find a way > to get a hit in the eval cache because IsEvalCacheCandidate always seems to > return false. > > static bool > IsEvalCacheCandidate(JSScript* script) > { > // Make sure there are no inner objects which might use the wrong parent > // and/or call scope by reusing the previous eval's script. Skip the > // script's first object, which entrains the eval's scope. > return script->savedCallerFun() && > !script->hasSingletons() && > script->objects()->length == 1; > } > > In situations where the first two conditions pass I always see two objects > in the script->objects() array: a JSFunction and a StaticBlockScope. > > jandem suggested that the checks on the length of the inner object array > were out of date and might not make sense any more. > > I tested the sunspider date-format-tofte test and this doesn't hit the eval > cache either. Jan's IRC comments were right, the eval static scope stuff I did a while back accidentally disabled the eval cache. Bug 1263355 moved scopes into their own GC thing and their own array, and thus re-enabled the eval cache, and surfaced the bug I saw in bug 1294566. So don't worry about the eval cache not working for now, bug 1263355 (inadvertently) fixed it.
This will be fixed by bug 1263355.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.