Skip to content

Commit fc502a4

Browse files
Make fixes in ChakraCore
The last few commits in ChakraCore Linux branch have broken the NTBUILD build. This fixes those breaks.
1 parent 294e001 commit fc502a4

6 files changed

Lines changed: 25 additions & 5 deletions

File tree

lib/Common/Core/CommonTypedefs.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ typedef char16 wchar;
1818
typedef unsigned int uint;
1919
typedef unsigned short ushort;
2020

21+
// Use of ulong is not allowed in ChakraCore- uint32 should be used instead since
22+
// it's our cross-platform 32 bit integer value. However, legacy code in ChakraFull
23+
// still depends on ulong so it's allowed for full builds.
24+
#ifdef NTBUILD
25+
typedef unsigned long ulong;
26+
#endif
27+
2128
typedef signed char sbyte;
2229

2330
typedef __int8 int8;

lib/Runtime/Base/ThreadContext.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,7 @@ class ThreadContext sealed :
853853
JITTimer JITTelemetry;
854854
#endif
855855
ParserTimer ParserTelemetry;
856+
GUID activityId;
856857
#endif
857858
void *tridentLoadAddress;
858859

lib/Runtime/Language/Arguments.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#pragma once
66

77
#ifdef _WIN32
8-
#define VA_LIST_TO_VARARRAY(vl, va, callInfo) Js::Var* va = (Var*) vl;
8+
#define VA_LIST_TO_VARARRAY(vl, va, callInfo) Js::Var* va = (Js::Var*) vl;
99
#else
1010
#if _M_X64
1111
// We use a custom calling convention to invoke JavascriptMethod based on

lib/Runtime/Library/CompoundString.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ namespace Js
146146

147147
#endif
148148

149-
CharCount CompoundString::Block::PointerLengthFromCharLength(const CharCount charLength)
149+
// ChakraDiag includes CompoundString.cpp as a header file so this method needs to be marked as inline
150+
// to handle that case
151+
JS_DIAG_INLINE CharCount CompoundString::Block::PointerLengthFromCharLength(const CharCount charLength)
150152
{
151153
return PointerAlign(charLength) / (sizeof(void *) / sizeof(char16));
152154
}

lib/Runtime/Library/RuntimeLibraryPch.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,9 @@
9696
#include "Library/ConcatString.inl"
9797

9898
#endif // !IsJsDiag
99+
100+
#ifdef IsJsDiag
101+
#define JS_DIAG_INLINE inline
102+
#else
103+
#define JS_DIAG_INLINE
104+
#endif

lib/Runtime/Library/StringCopyInfo.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
44
//-------------------------------------------------------------------------------------------------------
55
// ChakraDiag does not link with Runtime.lib and does not include .cpp files, so this file will be included as a header
6+
// For these reasons, we need the functions marked as inline in this file to remain inline
67
#include "RuntimeLibraryPch.h"
78
#include "DataStructures/LargeStack.h"
89

@@ -20,7 +21,10 @@ namespace Js
2021
#endif
2122
}
2223

23-
StringCopyInfo::StringCopyInfo(
24+
// In the ChakraDiag case, this file is #included so the method needs to be marked as inline
25+
// In the ChakraCore case, it's compiled standalone and then linked with, and the StringCopyInfo
26+
// constructor is referenced by other translation units so it needs to not be inline
27+
JS_DIAG_INLINE StringCopyInfo::StringCopyInfo(
2428
JavascriptString *const sourceString,
2529
_Inout_count_(sourceString->m_charLength) char16 *const destinationBuffer)
2630
: sourceString(sourceString), destinationBuffer(destinationBuffer)
@@ -33,14 +37,14 @@ namespace Js
3337
#endif
3438
}
3539

36-
JavascriptString *StringCopyInfo::SourceString() const
40+
JS_DIAG_INLINE JavascriptString *StringCopyInfo::SourceString() const
3741
{
3842
Assert(isInitialized);
3943

4044
return sourceString;
4145
}
4246

43-
char16 *StringCopyInfo::DestinationBuffer() const
47+
JS_DIAG_INLINE char16 *StringCopyInfo::DestinationBuffer() const
4448
{
4549
Assert(isInitialized);
4650
return destinationBuffer;

0 commit comments

Comments
 (0)