Bug 1376634 - Fix telemetry reports to report cacheable scripts instead of only small scripts. r=mrbkap
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Thu, 29 Jun 2017 00:48:55 +0000
changeset 601758 f83e1c86a428c6965285cbe80bc5b011a4d70f68
parent 601757 119f62fd31af3477b8dd6ceb9ab2e29b4e022f83
child 601759 5283088aa3be7081cd26fdda0a1c006e67088f40
push id66200
push userhchang@mozilla.com
push dateThu, 29 Jun 2017 03:53:43 +0000
reviewersmrbkap
bugs1376634
milestone56.0a1
Bug 1376634 - Fix telemetry reports to report cacheable scripts instead of only small scripts. r=mrbkap
dom/script/ScriptLoader.cpp
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -2156,17 +2156,17 @@ ScriptLoader::EvaluateScript(ScriptLoadR
         } else {
           MOZ_ASSERT(aRequest->IsSource());
           JS::Rooted<JSScript*> script(aes.cx());
           bool encodeBytecode = ShouldCacheBytecode(aRequest);
 
           TimeStamp start;
           if (Telemetry::CanRecordExtended()) {
             // Only record telemetry for scripts which are above the threshold.
-            if (aRequest->mCacheInfo && aRequest->mScriptText.length() < 1024) {
+            if (aRequest->mCacheInfo && aRequest->mScriptText.length() >= 1024) {
               start = TimeStamp::Now();
             }
           }
 
           {
             nsJSUtils::ExecutionContext exec(aes.cx(), global);
             exec.SetEncodeBytecode(encodeBytecode);
             TRACE_FOR_TEST(aRequest->mElement, "scriptloader_execute");