Bug 984684 - Do not fire barriers on shared atoms; r=bhackett
authorTerrence Cole <terrence@mozilla.com>
Mon, 17 Mar 2014 16:52:10 -0700
changeset 173980 405082f9ce44df654bbf678da509aeecf0e1dcbc
parent 173979 0d6987eee490fca6a0fcbab93a5f2a0f347c335b
child 173981 1d805dccc3572d5108c4a9cc06180c047a2ceaa4
push id26438
push userphilringnalda@gmail.com
push dateTue, 18 Mar 2014 05:39:07 +0000
treeherderautoland@89275f0ae29f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs984684
milestone31.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 984684 - Do not fire barriers on shared atoms; r=bhackett
js/src/gc/StoreBuffer.cpp
--- a/js/src/gc/StoreBuffer.cpp
+++ b/js/src/gc/StoreBuffer.cpp
@@ -372,16 +372,18 @@ JS::HeapValuePostBarrier(JS::Value *valu
     runtime->gcStoreBuffer.putRelocatableValue(valuep);
 }
 
 JS_PUBLIC_API(void)
 JS::HeapValueRelocate(JS::Value *valuep)
 {
     /* Called with old contents of *valuep before overwriting. */
     JS_ASSERT(JSVAL_IS_TRACEABLE(*valuep));
+    if (valuep->isString() && StringIsPermanentAtom(valuep->toString()))
+        return;
     JSRuntime *runtime = static_cast<js::gc::Cell *>(valuep->toGCThing())->runtimeFromMainThread();
     runtime->gcStoreBuffer.removeRelocatableValue(valuep);
 }
 
 template class StoreBuffer::MonoTypeBuffer<StoreBuffer::ValueEdge>;
 template class StoreBuffer::MonoTypeBuffer<StoreBuffer::CellPtrEdge>;
 template class StoreBuffer::MonoTypeBuffer<StoreBuffer::SlotEdge>;
 template class StoreBuffer::MonoTypeBuffer<StoreBuffer::WholeCellEdges>;