зеркало из https://github.com/mozilla/gecko-dev.git
Bug 796523 - Expire the JS timezone cache whenever we create a new compartment. r=waldo
This is a hack/heuristic to ensure that the JS timezone cache remains fresh (so that if you navigate to a new page or refresh your gmail, you always get the right timezone), while not interfering with the role the cache plays in benchmark performance.
This commit is contained in:
Родитель
9816e31ab0
Коммит
f489e4717d
|
@ -6,6 +6,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "jscntxt.h"
|
#include "jscntxt.h"
|
||||||
|
#include "jsdate.h"
|
||||||
#include "jscompartment.h"
|
#include "jscompartment.h"
|
||||||
#include "jsgc.h"
|
#include "jsgc.h"
|
||||||
#include "jsiter.h"
|
#include "jsiter.h"
|
||||||
|
@ -92,6 +93,14 @@ JSCompartment::~JSCompartment()
|
||||||
bool
|
bool
|
||||||
JSCompartment::init(JSContext *cx)
|
JSCompartment::init(JSContext *cx)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* As a hack, we clear our timezone cache every time we create a new
|
||||||
|
* compartment. This ensures that the cache is always relatively fresh, but
|
||||||
|
* shouldn't interfere with benchmarks which create tons of date objects
|
||||||
|
* (unless they also create tons of iframes, which seems unlikely).
|
||||||
|
*/
|
||||||
|
js_ClearDateCaches();
|
||||||
|
|
||||||
activeAnalysis = activeInference = false;
|
activeAnalysis = activeInference = false;
|
||||||
types.init(cx);
|
types.init(cx);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче