Forráskód Böngészése

Fixing prefast warning and copyright header error
fix some line endings

Akrosh Gandhi 8 éve
szülő
commit
1f3a3f4e6b

+ 4 - 0
lib/Backend/LowerMDShared.cpp

@@ -6780,6 +6780,8 @@ LowererMD::EmitLoadFloat(IR::Opnd *dst, IR::Opnd *src, IR::Instr *insertInstr, I
 
     if (BailOutInfo::IsBailOutOnImplicitCalls(bailOutKind))
     {
+        _Analysis_assume_(instrBailOut != nullptr);
+
         instr = instr->ConvertToBailOutInstr(instrBailOut->GetBailOutInfo(), bailOutKind);
         if (instrBailOut->GetBailOutInfo()->bailOutInstr == instrBailOut)
         {
@@ -8405,6 +8407,8 @@ LowererMD::EmitFloatToInt(IR::Opnd *dst, IR::Opnd *src, IR::Instr *instrInsert,
 
     if (BailOutInfo::IsBailOutOnImplicitCalls(bailOutKind))
     {
+        _Analysis_assume_(instrBailOut != nullptr);
+
         instr = instr->ConvertToBailOutInstr(instrBailOut->GetBailOutInfo(), bailOutKind);
         if (instrBailOut->GetBailOutInfo()->bailOutInstr == instrBailOut)
         {

+ 30 - 30
lib/Common/Common/Int32Math.h

@@ -1,30 +1,30 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-#pragma once
-#include "IntMathCommon.h"
-
-class Int32Math: public IntMathCommon<int32>
-{
-public:
-    static bool Add(int32 left, int32 right, int32 *pResult);
-    static bool Mul(int32 left, int32 right, int32 *pResult);
-    static bool Mul(int32 left, int32 right, int32 *pResult, int32* pOverflowValue);
-
-    static bool Shl(int32 left, int32 right, int32 *pResult);
-    static bool Shr(int32 left, int32 right, int32 *pResult);
-    static bool ShrU(int32 left, int32 right, int32 *pResult);
-};
-
-template <>
-inline bool Math::IncImpl<int32>(int32 val, int32 *pResult)
-{
-    return Int32Math::Inc(val, pResult);
-}
-
-template <>
-inline bool Math::AddImpl<int32>(int32 left, int32 right, int32 *pResult)
-{
-    return Int32Math::Add(left, right, pResult);
-}
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+#pragma once
+#include "IntMathCommon.h"
+
+class Int32Math: public IntMathCommon<int32>
+{
+public:
+    static bool Add(int32 left, int32 right, int32 *pResult);
+    static bool Mul(int32 left, int32 right, int32 *pResult);
+    static bool Mul(int32 left, int32 right, int32 *pResult, int32* pOverflowValue);
+
+    static bool Shl(int32 left, int32 right, int32 *pResult);
+    static bool Shr(int32 left, int32 right, int32 *pResult);
+    static bool ShrU(int32 left, int32 right, int32 *pResult);
+};
+
+template <>
+inline bool Math::IncImpl<int32>(int32 val, int32 *pResult)
+{
+    return Int32Math::Inc(val, pResult);
+}
+
+template <>
+inline bool Math::AddImpl<int32>(int32 left, int32 right, int32 *pResult)
+{
+    return Int32Math::Add(left, right, pResult);
+}

+ 50 - 50
lib/Common/Common/MathUtil.h

@@ -118,54 +118,54 @@ public:
         return AlignOverflowCheck(size, alignment, DefaultOverflowPolicy);
     }
 
-    // Postfix increment "val++", call overflowFn() first if overflow
-    template <typename T, class Func>
-    static T PostInc(T& val, const Func& overflowFn)
-    {
-        T tmp = val;
-        if (IncImpl(val, &tmp))
-        {
-            overflowFn();  // call before changing val
-        }
-
-        T old = val;
-        val = tmp;
-        return old;
-    }
-
-    // Postfix increment "val++", call DefaultOverflowPolicy() first if overflow
-    template <typename T>
-    static T PostInc(T& val)
-    {
-        return PostInc(val, DefaultOverflowPolicy);
-    }
-
-    template <typename T>
-    static bool IncImpl(T val, T *pResult)
-    {
-        CompileAssert(false);  // must implement template specialization on type T
-    }
-
-    template <typename T, class Func>
-    static T Add(T left, T right, const Func& overflowFn)
-    {
-        T result;
-        if (AddImpl(left, right, &result))
-        {
-            overflowFn();
-        }
-        return result;
-    }
-
-    template <typename T>
-    static T Add(T left, T right)
-    {
-        return Add(left, right, DefaultOverflowPolicy);
-    }
-
-    template <typename T>
-    static bool AddImpl(T left, T right, T *pResult)
-    {
-        CompileAssert(false);  // must implement template specialization on type T
-    }
+    // Postfix increment "val++", call overflowFn() first if overflow
+    template <typename T, class Func>
+    static T PostInc(T& val, const Func& overflowFn)
+    {
+        T tmp = val;
+        if (IncImpl(val, &tmp))
+        {
+            overflowFn();  // call before changing val
+        }
+
+        T old = val;
+        val = tmp;
+        return old;
+    }
+
+    // Postfix increment "val++", call DefaultOverflowPolicy() first if overflow
+    template <typename T>
+    static T PostInc(T& val)
+    {
+        return PostInc(val, DefaultOverflowPolicy);
+    }
+
+    template <typename T>
+    static bool IncImpl(T val, T *pResult)
+    {
+        CompileAssert(false);  // must implement template specialization on type T
+    }
+
+    template <typename T, class Func>
+    static T Add(T left, T right, const Func& overflowFn)
+    {
+        T result;
+        if (AddImpl(left, right, &result))
+        {
+            overflowFn();
+        }
+        return result;
+    }
+
+    template <typename T>
+    static T Add(T left, T right)
+    {
+        return Add(left, right, DefaultOverflowPolicy);
+    }
+
+    template <typename T>
+    static bool AddImpl(T left, T right, T *pResult)
+    {
+        CompileAssert(false);  // must implement template specialization on type T
+    }
 };

+ 1 - 1
lib/Runtime/Types/DictionaryTypeHandler.h

@@ -208,7 +208,7 @@ namespace Js
         void Add(const PropertyRecord* propertyId, PropertyAttributes attributes, ScriptContext *const scriptContext);
         void Add(const PropertyRecord* propertyId, PropertyAttributes attributes, bool isInitialized, bool isFixed, bool usedAsFixed, ScriptContext *const scriptContext);
 
-        void EnsureSlotCapacity(DynamicObject * instance, T increment = 1);
+        void EnsureSlotCapacity(DynamicObject * instance, T increment = 1);
 
         BOOL AddProperty(DynamicObject* instance, const PropertyRecord* propertyRecord, Var value, PropertyAttributes attributes, PropertyValueInfo* info, PropertyOperationFlags flags, bool throwIfNotExtensible, SideEffects possibleSideEffects);
         ES5ArrayTypeHandlerBase<T>* ConvertToES5ArrayType(DynamicObject *instance);

+ 5 - 0
test/fieldopts/equiv-mismatch2.js

@@ -1,3 +1,8 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft Corporation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
 var shouldBailout = false;
 var runningJITtedCode = false;
 var reuseObjects = false;

+ 5 - 0
test/typedarray/reentry1.js

@@ -1,3 +1,8 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft Corporation and contributors. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
 function go(){
 a1 = [1.1,2.2]
 a2 = [1.1,2.2]