Bug 1147224 - Only keep the optimization information of the last time IonBuilder visits a bytecode location. (r=djvj)

This commit is contained in:
Shu-yu Guo 2015-03-26 14:16:58 -07:00
parent 9ec35438a8
commit 32abf472e0
2 changed files with 11 additions and 0 deletions

View File

@ -1040,6 +1040,11 @@ IonBuilder::startTrackingOptimizations()
// OOMs are handled as if optimization tracking were turned off.
if (!trackedOptimizationSites_.append(site))
site = nullptr;
} else {
// The same bytecode may be visited multiple times (see
// restartLoop). Only the last time matters, so clear any previous
// tracked optimizations.
site->optimizations()->clear();
}
if (site)

View File

@ -107,6 +107,12 @@ class TrackedOptimizations : public TempObject
currentAttempt_(UINT32_MAX)
{ }
void clear() {
types_.clear();
attempts_.clear();
currentAttempt_ = UINT32_MAX;
}
bool trackTypeInfo(OptimizationTypeInfo &&ty);
bool trackAttempt(JS::TrackedStrategy strategy);