2
0
Эх сурвалжийг харах

Make fixes in ChakraCore

The last few commits in ChakraCore Linux branch have broken the NTBUILD build. This fixes those breaks.
Hitesh Kanwathirtha 9 жил өмнө
parent
commit
fc502a416e

+ 7 - 0
lib/Common/Core/CommonTypedefs.h

@@ -18,6 +18,13 @@ typedef char16 wchar;
 typedef unsigned int uint;
 typedef unsigned short ushort;
 
+// Use of ulong is not allowed in ChakraCore- uint32 should be used instead since 
+// it's our cross-platform 32 bit integer value. However, legacy code in ChakraFull
+// still depends on ulong so it's allowed for full builds.
+#ifdef NTBUILD
+typedef unsigned long ulong;
+#endif
+
 typedef signed char sbyte;
 
 typedef __int8 int8;

+ 1 - 0
lib/Runtime/Base/ThreadContext.h

@@ -853,6 +853,7 @@ public:
     JITTimer JITTelemetry;
 #endif
     ParserTimer ParserTelemetry;
+    GUID activityId;
 #endif
     void *tridentLoadAddress;
 

+ 1 - 1
lib/Runtime/Language/Arguments.h

@@ -5,7 +5,7 @@
 #pragma once
 
 #ifdef _WIN32
-#define VA_LIST_TO_VARARRAY(vl, va, callInfo) Js::Var* va = (Var*) vl;
+#define VA_LIST_TO_VARARRAY(vl, va, callInfo) Js::Var* va = (Js::Var*) vl;
 #else
 #if _M_X64
 // We use a custom calling convention to invoke JavascriptMethod based on

+ 3 - 1
lib/Runtime/Library/CompoundString.cpp

@@ -146,7 +146,9 @@ namespace Js
 
     #endif
 
-    CharCount CompoundString::Block::PointerLengthFromCharLength(const CharCount charLength)
+    // ChakraDiag includes CompoundString.cpp as a header file so this method needs to be marked as inline 
+    // to handle that case
+    JS_DIAG_INLINE CharCount CompoundString::Block::PointerLengthFromCharLength(const CharCount charLength)
     {
         return PointerAlign(charLength) / (sizeof(void *) / sizeof(char16));
     }

+ 6 - 0
lib/Runtime/Library/RuntimeLibraryPch.h

@@ -96,3 +96,9 @@
 #include "Library/ConcatString.inl"
 
 #endif // !IsJsDiag
+
+#ifdef IsJsDiag
+#define JS_DIAG_INLINE inline
+#else
+#define JS_DIAG_INLINE
+#endif

+ 7 - 3
lib/Runtime/Library/StringCopyInfo.cpp

@@ -3,6 +3,7 @@
 // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 //-------------------------------------------------------------------------------------------------------
 // ChakraDiag does not link with Runtime.lib and does not include .cpp files, so this file will be included as a header
+// For these reasons, we need the functions marked as inline in this file to remain inline
 #include "RuntimeLibraryPch.h"
 #include "DataStructures/LargeStack.h"
 
@@ -20,7 +21,10 @@ namespace Js
     #endif
     }
 
-    StringCopyInfo::StringCopyInfo(
+    // In the ChakraDiag case, this file is #included so the method needs to be marked as inline
+    // In the ChakraCore case, it's compiled standalone and then linked with, and the StringCopyInfo
+    // constructor is referenced by other translation units so it needs to not be inline
+    JS_DIAG_INLINE StringCopyInfo::StringCopyInfo(
         JavascriptString *const sourceString,
         _Inout_count_(sourceString->m_charLength) char16 *const destinationBuffer)
         : sourceString(sourceString), destinationBuffer(destinationBuffer)
@@ -33,14 +37,14 @@ namespace Js
     #endif
     }
 
-    JavascriptString *StringCopyInfo::SourceString() const
+    JS_DIAG_INLINE JavascriptString *StringCopyInfo::SourceString() const
     {
         Assert(isInitialized);
 
         return sourceString;
     }
 
-    char16 *StringCopyInfo::DestinationBuffer() const
+    JS_DIAG_INLINE char16 *StringCopyInfo::DestinationBuffer() const
     {
         Assert(isInitialized);
         return destinationBuffer;