Skip to content

Commit b76898e

Browse files
committed
[MERGE #1430 @obastemur] Merge Master to Linux
Merge pull request #1430 from obastemur:m_merge
2 parents 8e9a2dd + 88147d8 commit b76898e

File tree

161 files changed

+8270
-6713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+8270
-6713
lines changed

Build/Common.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<RuntimeTypeInfo>false</RuntimeTypeInfo>
2121
<!-- /Zi -->
2222
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
23+
<DebugInformationFormat Condition="'$(MultiProcessorCompilation)' == 'true'">OldStyle</DebugInformationFormat>
2324
<!-- /EHsc- -->
2425
<ExceptionHandling>SyncCThrow</ExceptionHandling>
2526
<!-- /Gz -->

README.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,31 @@ You can stay up-to-date on progress by following the [MSEdge developer blog](htt
88

99
## [Build Status](https://github.com/Microsoft/ChakraCore/wiki/Build-Status)
1010

11-
| | __Debug__ | __Test__ | __Release__ |
12-
|:-------:|:---------:|:--------:|:-----------:|
13-
| __x86__ | [![x86debug][x86dbgicon]][x86dbglink] | [![x86test][x86testicon]][x86testlink] | [![x86release][x86relicon]][x86rellink] |
14-
| __x64__ | [![x64debug][x64dbgicon]][x64dbglink] | [![x64test][x64testicon]][x64testlink] | [![x64release][x64relicon]][x64rellink] |
15-
| __arm__ | [![armdebug][armdbgicon]][armdbglink] | [![armtest][armtesticon]][armtestlink] | [![armrelease][armrelicon]][armrellink] |
16-
| __linux__ | [![linuxdebug][linuxdbgicon]][linuxdbglink] | [![linuxtest][linuxtesticon]][linuxtestlink] | [![linuxrelease][linuxrelicon]][linuxrellink] |
17-
| __linux (static)__ | [![linuxsdebug][linuxsdbgicon]][linuxsdbglink] | [![linuxstest][linuxstesticon]][linuxstestlink] | [![linuxsrelease][linuxsrelicon]][linuxsrellink] |
11+
| | __Debug__ | __Test__ | __Release__ |
12+
|:-----------------------------:|:---------:|:--------:|:-----------:|
13+
| __Windows (x64)__ | [![x64debug][x64dbgicon]][x64dbglink] | [![x64test][x64testicon]][x64testlink] | [![x64release][x64relicon]][x64rellink] |
14+
| __Windows (x86)__ | [![x86debug][x86dbgicon]][x86dbglink] | [![x86test][x86testicon]][x86testlink] | [![x86release][x86relicon]][x86rellink] |
15+
| __Windows (ARM)__ | [![armdebug][armdbgicon]][armdbglink] | [![armtest][armtesticon]][armtestlink] | [![armrelease][armrelicon]][armrellink] |
16+
| __Ubuntu 16.04 (x64)__ | [![linuxdebug][linuxdbgicon]][linuxdbglink] | [![linuxtest][linuxtesticon]][linuxtestlink] | [![linuxrelease][linuxrelicon]][linuxrellink] |
17+
| __Ubuntu 16.04 (x64 static)__ | [![linuxsdebug][linuxsdbgicon]][linuxsdbglink] | [![linuxstest][linuxstesticon]][linuxstestlink] | [![linuxsrelease][linuxsrelicon]][linuxsrellink] |
18+
| __OS X 10.9 (x64 static)__ | [![osxsdebug][osxsdbgicon]][osxsdbglink] | [![osxstest][osxstesticon]][osxstestlink] | [![osxsrelease][osxsrelicon]][osxsrellink] |
1819

1920
*If you see badges reading "Build: Unknown" it is likely because a build was skipped due to changes being only in files known not to affect the health of the build.*
2021

21-
[x86dbgicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x86_debug/badge/icon
22-
[x86dbglink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x86_debug/
23-
[x86testicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x86_test/badge/icon
24-
[x86testlink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x86_test/
25-
[x86relicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x86_release/badge/icon
26-
[x86rellink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x86_release/
27-
2822
[x64dbgicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x64_debug/badge/icon
2923
[x64dbglink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x64_debug/
3024
[x64testicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x64_test/badge/icon
3125
[x64testlink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x64_test/
3226
[x64relicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x64_release/badge/icon
3327
[x64rellink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x64_release/
3428

29+
[x86dbgicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x86_debug/badge/icon
30+
[x86dbglink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x86_debug/
31+
[x86testicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x86_test/badge/icon
32+
[x86testlink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x86_test/
33+
[x86relicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x86_release/badge/icon
34+
[x86rellink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/x86_release/
35+
3536
[armdbgicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/arm_debug/badge/icon
3637
[armdbglink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/arm_debug/
3738
[armtesticon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/arm_test/badge/icon
@@ -53,6 +54,13 @@ You can stay up-to-date on progress by following the [MSEdge developer blog](htt
5354
[linuxsrelicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/ubuntu_linux_release_static/badge/icon
5455
[linuxsrellink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/ubuntu_linux_release_static/
5556

57+
[osxsdbgicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/osx_osx_debug_static/badge/icon
58+
[osxsdbglink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/osx_osx_debug_static/
59+
[osxstesticon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/osx_osx_test_static/badge/icon
60+
[osxstestlink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/osx_osx_test_static/
61+
[osxsrelicon]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/osx_osx_release_static/badge/icon
62+
[osxsrellink]: http://dotnet-ci.cloudapp.net/job/Microsoft_ChakraCore/job/master/job/osx_osx_release_static/
63+
5664
Above is a table of our rolling build status. We run additional builds on a daily basis. See [Build Status](https://github.com/Microsoft/ChakraCore/wiki/Build-Status) for the status of all builds.
5765

5866
## Security

lib/Backend/EmitBuffer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class EmitBufferManager
3737
void Decommit();
3838
void Clear();
3939

40-
EmitBufferAllocation* AllocateBuffer(__in size_t bytes, __deref_bcount(bytes) BYTE** ppBuffer, ushort pdataCount = 0, ushort xdataSize = 0, bool canAllocInPreReservedHeapPageSegment = false, bool isAnyJittedCode = false);
40+
EmitBufferAllocation* AllocateBuffer(DECLSPEC_GUARD_OVERFLOW __in size_t bytes, __deref_bcount(bytes) BYTE** ppBuffer, ushort pdataCount = 0, ushort xdataSize = 0, bool canAllocInPreReservedHeapPageSegment = false, bool isAnyJittedCode = false);
4141
bool CommitBuffer(EmitBufferAllocation* allocation, __out_bcount(bytes) BYTE* destBuffer, __in size_t bytes, __in_bcount(bytes) const BYTE* sourceBuffer, __in DWORD alignPad = 0);
4242
bool ProtectBufferWithExecuteReadWriteForInterpreter(EmitBufferAllocation* allocation);
4343
bool CommitReadWriteBufferForInterpreter(EmitBufferAllocation* allocation, _In_reads_bytes_(bufferSize) BYTE* pBuffer, _In_ size_t bufferSize);
@@ -72,8 +72,8 @@ class EmitBufferManager
7272
ArenaAllocator * allocator;
7373
Js::ScriptContext * scriptContext;
7474

75-
EmitBufferAllocation * NewAllocation(size_t bytes, ushort pdataCount, ushort xdataSize, bool canAllocInPreReservedHeapPageSegment, bool isAnyJittedCode);
76-
EmitBufferAllocation* GetBuffer(EmitBufferAllocation *allocation, __in size_t bytes, __deref_bcount(bytes) BYTE** ppBuffer);
75+
EmitBufferAllocation * NewAllocation(DECLSPEC_GUARD_OVERFLOW size_t bytes, ushort pdataCount, ushort xdataSize, bool canAllocInPreReservedHeapPageSegment, bool isAnyJittedCode);
76+
EmitBufferAllocation* GetBuffer(EmitBufferAllocation *allocation, DECLSPEC_GUARD_OVERFLOW __in size_t bytes, __deref_bcount(bytes) BYTE** ppBuffer);
7777

7878
bool FinalizeAllocation(EmitBufferAllocation *allocation);
7979
CustomHeap::Heap allocationHeap;

lib/Backend/GlobHashTable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ValueHashTable
5555
SListBase<HashBucket> * table;
5656

5757
public:
58-
static ValueHashTable * New(JitArenaAllocator *allocator, uint tableSize)
58+
static ValueHashTable * New(JitArenaAllocator *allocator, DECLSPEC_GUARD_OVERFLOW uint tableSize)
5959
{
6060
return AllocatorNewPlus(JitArenaAllocator, allocator, (tableSize*sizeof(SListBase<HashBucket>)), ValueHashTable, allocator, tableSize);
6161
}

lib/Backend/GlobOpt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21446,7 +21446,7 @@ GlobOpt::EmitMemop(Loop * loop, LoopCount *loopCount, const MemOpEmitData* emitD
2144621446
case TyInt16:
2144721447
case TyInt32:
2144821448
case TyInt64:
21449-
_snwprintf_s(constBuf, constBufSize, sizeof(IntConstType) == 8 ? _u("lld%") : _u("%d"), candidate->constant.u.intConst.value);
21449+
_snwprintf_s(constBuf, constBufSize, sizeof(IntConstType) == 8 ? _u("%lld") : _u("%d"), candidate->constant.u.intConst.value);
2145021450
break;
2145121451
case TyFloat32:
2145221452
case TyFloat64:

lib/Backend/GlobOptBailOut.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,10 @@ GlobOpt::CaptureValues(BasicBlock *block, BailOutInfo * bailOutInfo)
240240
bailOutInfo->capturedValues.constantValues.Clear(this->func->m_alloc);
241241
bailOutConstValuesIter.SetNext(&bailOutInfo->capturedValues.constantValues);
242242
bailOutInfo->capturedValues.constantValues = capturedValues.constantValues;
243-
capturedValues.constantValues.Reset();
244243

245244
bailOutInfo->capturedValues.copyPropSyms.Clear(this->func->m_alloc);
246245
bailOutCopySymsIter.SetNext(&bailOutInfo->capturedValues.copyPropSyms);
247246
bailOutInfo->capturedValues.copyPropSyms = capturedValues.copyPropSyms;
248-
capturedValues.copyPropSyms.Reset();
249247

250248
if (!PHASE_OFF(Js::IncrementalBailoutPhase, func))
251249
{

lib/Backend/IR.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ struct CapturedValues
2626
SListBase<ConstantStackSymValue> constantValues; // Captured constant values during glob opt
2727
SListBase<CopyPropSyms> copyPropSyms; // Captured copy prop values during glob opt
2828
BVSparse<JitArenaAllocator> * argObjSyms; // Captured arg object symbols during glob opt
29+
30+
~CapturedValues()
31+
{
32+
// Reset SListBase to be exception safe. Captured values are from GlobOpt->func->alloc
33+
// in normal case the 2 SListBase are empty so no Clear needed, also no need to Clear in exception case
34+
constantValues.Reset();
35+
copyPropSyms.Reset();
36+
}
2937
};
3038

3139
class LoweredBasicBlock;

lib/Backend/Lower.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313

1414
#include "ExternalLowerer.h"
1515

16-
#include "ExternalLowerer.h"
17-
1816
///----------------------------------------------------------------------------
1917
///
2018
/// Lowerer::Lower
@@ -8404,6 +8402,7 @@ Lowerer::LowerLdArrViewElem(IR::Instr * instr)
84048402
IR::Opnd * src2 = instr->GetSrc2();
84058403

84068404
IR::Instr * done;
8405+
84078406
if (indexOpnd || m_func->GetJnFunction()->GetAsmJsFunctionInfoWithLock()->AccessNeedsBoundCheck((uint32)src1->AsIndirOpnd()->GetOffset()))
84088407
{
84098408
// CMP indexOpnd, src2(arrSize)
@@ -20242,7 +20241,7 @@ Lowerer::GenerateLdSuper(IR::Instr* instrInsert)
2024220241
Assert(dstOpnd->IsRegOpnd());
2024320242
LowererMD::CreateAssign(dstOpnd, opndUndefAddress, instrInsert);
2024420243

20245-
IR::Opnd * functionObjOpnd;
20244+
IR::Opnd * functionObjOpnd = nullptr;
2024620245
m_lowererMD.LoadFunctionObjectOpnd(instrInsert, functionObjOpnd);
2024720246
LowererMD::CreateAssign(instanceRegOpnd, functionObjOpnd, instrInsert);
2024820247

lib/Backend/NativeCodeData.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class NativeCodeData
3636
Allocator();
3737
~Allocator();
3838

39-
char * Alloc(size_t requestedBytes);
40-
char * AllocZero(size_t requestedBytes);
39+
char * Alloc(DECLSPEC_GUARD_OVERFLOW size_t requestedBytes);
40+
char * AllocZero(DECLSPEC_GUARD_OVERFLOW size_t requestedBytes);
4141
NativeCodeData * Finalize();
4242
void Free(void * buffer, size_t byteSize);
4343

lib/Backend/amd64/LowererMDArch.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,20 @@ LowererMDArch::LoadDynamicArgumentUsingLength(IR::Instr *instr)
12211221
IR::Instr *
12221222
LowererMDArch::LoadDoubleHelperArgument(IR::Instr * instrInsert, IR::Opnd * opndArg)
12231223
{
1224-
Assert(opndArg->IsFloat64());
1224+
IR::Opnd * float64Opnd;
1225+
if (opndArg->GetType() == TyFloat32)
1226+
{
1227+
float64Opnd = IR::RegOpnd::New(TyFloat64, m_func);
1228+
IR::Instr * instr = IR::Instr::New(Js::OpCode::CVTSS2SD, float64Opnd, opndArg, this->m_func);
1229+
instrInsert->InsertBefore(instr);
1230+
}
1231+
else
1232+
{
1233+
float64Opnd = opndArg;
1234+
}
1235+
1236+
Assert(opndArg->IsFloat());
1237+
12251238
return LoadHelperArgument(instrInsert, opndArg);
12261239
}
12271240

0 commit comments

Comments
 (0)