Bug 1289987 - Part 2: Remove more VS2013 workarounds in js/. r=fitzgen
authorChris Peterson <cpeterson@mozilla.com>
Fri, 29 Jul 2016 20:28:31 -0700
changeset 349489 974cfc29c1e30561d40882c051f07724eff99491
parent 349488 49efb446f5b0977be697e0277cb27a2d5502fb76
child 349490 e5859dfe0bcbd40f4e33f4a633f73ea3473a7849
child 349588 5785e6e80c6696b6e941edcbc06583864d95ae95
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfitzgen
bugs1289987
milestone50.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 1289987 - Part 2: Remove more VS2013 workarounds in js/. r=fitzgen Take 2.
js/src/asmjs/WasmTypes.cpp
js/src/frontend/TokenStream.h
js/src/jsapi-tests/testGCHeapPostBarriers.cpp
--- a/js/src/asmjs/WasmTypes.cpp
+++ b/js/src/asmjs/WasmTypes.cpp
@@ -311,22 +311,17 @@ wasm::AddressOf(SymbolicAddress imm, Exc
       case SymbolicAddress::AtomicFetchOr:
         return FuncCast<int32_t (int32_t, int32_t, int32_t)>(js::atomics_or_asm_callout, Args_General3);
       case SymbolicAddress::AtomicFetchXor:
         return FuncCast<int32_t (int32_t, int32_t, int32_t)>(js::atomics_xor_asm_callout, Args_General3);
 #endif
       case SymbolicAddress::ModD:
         return FuncCast(NumberMod, Args_Double_DoubleDouble);
       case SymbolicAddress::SinD:
-#ifdef _WIN64
-        // Workaround a VS 2013 sin issue, see math_sin_uncached.
-        return FuncCast<double (double)>(js::math_sin_uncached, Args_Double_Double);
-#else
         return FuncCast<double (double)>(sin, Args_Double_Double);
-#endif
       case SymbolicAddress::CosD:
         return FuncCast<double (double)>(cos, Args_Double_Double);
       case SymbolicAddress::TanD:
         return FuncCast<double (double)>(tan, Args_Double_Double);
       case SymbolicAddress::ASinD:
         return FuncCast<double (double)>(fdlibm::asin, Args_Double_Double);
       case SymbolicAddress::ACosD:
         return FuncCast<double (double)>(fdlibm::acos, Args_Double_Double);
--- a/js/src/frontend/TokenStream.h
+++ b/js/src/frontend/TokenStream.h
@@ -170,34 +170,16 @@ struct Token
         RegExpFlag      reflags;        // regexp flags; use tokenbuf to access
                                         //   regexp chars
     } u;
 #ifdef DEBUG
     Modifier modifier;                  // Modifier used to get this token
     ModifierException modifierException; // Exception for this modifier
 #endif
 
-    // This constructor is necessary only for MSVC 2013 and how it compiles the
-    // initialization of TokenStream::tokens.  That field is initialized as
-    // tokens() in the constructor init-list.  This *should* zero the entire
-    // array, then (because Token has a non-trivial constructor, because
-    // TokenPos has a user-provided constructor) call the implicit Token
-    // constructor on each element, which would call the TokenPos constructor
-    // for Token::pos and do nothing.  (All of which is equivalent to just
-    // zeroing TokenStream::tokens.)  But MSVC 2013 (2010/2012 don't have this
-    // bug) doesn't zero out each element, so we need this extra constructor to
-    // make it do the right thing.  (Token is used primarily by reference or
-    // pointer, and it's only initialized a very few places, so having a
-    // user-defined constructor won't hurt perf.)  See also bug 920318.
-    Token()
-      : pos(0, 0)
-    {
-        MOZ_MAKE_MEM_UNDEFINED(&type, sizeof(type));
-    }
-
     // Mutators
 
     void setName(PropertyName* name) {
         MOZ_ASSERT(type == TOK_NAME);
         u.name = name;
     }
 
     void setAtom(JSAtom* atom) {
--- a/js/src/jsapi-tests/testGCHeapPostBarriers.cpp
+++ b/js/src/jsapi-tests/testGCHeapPostBarriers.cpp
@@ -54,23 +54,16 @@ BEGIN_TEST(testGCHeapPostBarriers)
 
     /* Currently JSObject and JSFunction objects are nursery allocated. */
     CHECK(TestHeapPostBarriersForType<JSObject>());
     CHECK(TestHeapPostBarriersForType<JSFunction>());
 
     return true;
 }
 
-MOZ_NEVER_INLINE bool
-Passthrough(bool value)
-{
-    /* Work around a Win64 optimization bug in VS2010. (Bug 1033146) */
-    return value;
-}
-
 bool
 CanAccessObject(JSObject* obj)
 {
     JS::RootedObject rootedObj(cx, obj);
     JS::RootedValue value(cx);
     CHECK(JS_GetProperty(cx, rootedObj, "x", &value));
     CHECK(value.isInt32());
     CHECK(value.toInt32() == 42);
@@ -110,19 +103,19 @@ TestHeapPostBarrierUpdate()
 
     W* ptr = nullptr;
 
     {
         auto heapPtr = cx->make_unique<W>();
         CHECK(heapPtr);
 
         W& wrapper = *heapPtr;
-        CHECK(Passthrough(wrapper.get() == nullptr));
+        CHECK(wrapper.get() == nullptr);
         wrapper = initialObj;
-        CHECK(Passthrough(wrapper == initialObj));
+        CHECK(wrapper == initialObj);
 
         ptr = heapPtr.release();
     }
 
     cx->minorGC(JS::gcreason::API);
 
     CHECK(uintptr_t(ptr->get()) != initialObjAsInt);
     CHECK(!js::gc::IsInsideNursery(ptr->get()));
@@ -142,19 +135,19 @@ TestHeapPostBarrierInitFailure()
     CHECK(initialObj != nullptr);
     CHECK(js::gc::IsInsideNursery(initialObj));
 
     {
         auto heapPtr = cx->make_unique<W>();
         CHECK(heapPtr);
 
         W& wrapper = *heapPtr;
-        CHECK(Passthrough(wrapper.get() == nullptr));
+        CHECK(wrapper.get() == nullptr);
         wrapper = initialObj;
-        CHECK(Passthrough(wrapper == initialObj));
+        CHECK(wrapper == initialObj);
     }
 
     cx->minorGC(JS::gcreason::API);
 
     return true;
 }
 
 END_TEST(testGCHeapPostBarriers)