Bug 1160468 - Remove unnecessary pre-barrier when creating undepended string r=terrence
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 06 May 2015 09:44:42 +0100
changeset 273960 3d2d5ade77a2382d0a8b128dc95a963de28ef88e
parent 273959 aa884bc76a9d644bf82ef9410022e50d70eb0d2e
child 273961 e474db0bdba58ff3cae4f83c3573017b8d89cfa3
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1160468
milestone40.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 1160468 - Remove unnecessary pre-barrier when creating undepended string r=terrence
js/src/vm/String.cpp
--- a/js/src/vm/String.cpp
+++ b/js/src/vm/String.cpp
@@ -625,23 +625,16 @@ js::ConcatStrings<CanGC>(ExclusiveContex
 
 template JSString*
 js::ConcatStrings<NoGC>(ExclusiveContext* cx, JSString* left, JSString* right);
 
 template <typename CharT>
 JSFlatString*
 JSDependentString::undependInternal(ExclusiveContext* cx)
 {
-    /*
-     * We destroy the base() pointer in undepend, so we need a pre-barrier. We
-     * don't need a post-barrier because there aren't any outgoing pointers
-     * afterwards.
-     */
-    JSString::writeBarrierPre(base());
-
     size_t n = length();
     CharT* s = cx->pod_malloc<CharT>(n + 1);
     if (!s)
         return nullptr;
 
     AutoCheckCannotGC nogc;
     PodCopy(s, nonInlineChars<CharT>(nogc), n);
     s[n] = '\0';