Bug 1074935 - Add SPS pseudo frames for JSRope flattening; r=jandem
authorNick Fitzgerald <fitzgen@gmail.com>
Fri, 18 Sep 2015 12:49:10 -0700
changeset 295926 cce8e013f935d3aa2227300bb7ea155fb0bb733a
parent 295925 d501062f060d8c4e7e2eafaa18536e3833b19d39
child 295927 65cbc7d2133957da04265f50d9db79c7dac07994
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1074935
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1074935 - Add SPS pseudo frames for JSRope flattening; r=jandem
js/src/vm/String.cpp
--- a/js/src/vm/String.cpp
+++ b/js/src/vm/String.cpp
@@ -9,16 +9,17 @@
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/PodOperations.h"
 #include "mozilla/RangedPtr.h"
 #include "mozilla/TypeTraits.h"
 
 #include "gc/Marking.h"
 #include "js/UbiNode.h"
+#include "vm/SPSProfiler.h"
 
 #include "jscntxtinlines.h"
 #include "jscompartmentinlines.h"
 
 using namespace js;
 
 using mozilla::IsSame;
 using mozilla::PodCopy;
@@ -549,16 +550,20 @@ JSRope::flattenInternal(ExclusiveContext
     if (hasTwoByteChars())
         return flattenInternal<b, char16_t>(maybecx);
     return flattenInternal<b, Latin1Char>(maybecx);
 }
 
 JSFlatString*
 JSRope::flatten(ExclusiveContext* maybecx)
 {
+    mozilla::Maybe<AutoSPSEntry> sps;
+    if (maybecx && maybecx->isJSContext())
+        sps.emplace(maybecx->asJSContext()->runtime(), "JSRope::flatten");
+
     if (zone()->needsIncrementalBarrier())
         return flattenInternal<WithIncrementalBarrier>(maybecx);
     return flattenInternal<NoBarrier>(maybecx);
 }
 
 template <AllowGC allowGC>
 JSString*
 js::ConcatStrings(ExclusiveContext* cx,