Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Simd.Js Code #4541

Merged
merged 3 commits into from
Feb 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/Backend/Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@

#include "Library/StackScriptFunction.h"

// SIMD_JS
#include "Library/SimdLib.h"
// SIMD
#include "Language/SimdOps.h"

// =================
Expand Down
46 changes: 0 additions & 46 deletions lib/Backend/BackwardPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1754,19 +1754,6 @@ BackwardPass::ProcessBailOutCopyProps(BailOutInfo * bailOutInfo, BVSparse<JitAre
typeSpecSym = float64StackSym;
Assert(float64StackSym);
}
#ifdef ENABLE_SIMDJS
// SIMD_JS
else if (bailOutInfo->liveSimd128F4Syms->Test(symId))
{
simd128StackSym = stackSym->GetSimd128F4EquivSym(nullptr);
typeSpecSym = simd128StackSym;
}
else if (bailOutInfo->liveSimd128I4Syms->Test(symId))
{
simd128StackSym = stackSym->GetSimd128I4EquivSym(nullptr);
typeSpecSym = simd128StackSym;
}
#endif
else
{
Assert(bailOutInfo->liveVarSyms->Test(symId));
Expand Down Expand Up @@ -2391,21 +2378,12 @@ BackwardPass::ProcessBailOutInfo(IR::Instr * instr, BailOutInfo * bailOutInfo)
// ToVars that can more easily be eliminated due to being dead stores.

#if DBG
#ifdef ENABLE_SIMDJS
// SIMD_JS
// Simd128 syms should be live in at most one form
tempBv->And(bailOutInfo->liveSimd128F4Syms, bailOutInfo->liveSimd128I4Syms);
#endif
Assert(tempBv->IsEmpty());

// Verify that all syms to restore are live in some fashion
tempBv->Minus(byteCodeUpwardExposedUsed, bailOutInfo->liveVarSyms);
tempBv->Minus(bailOutInfo->liveLosslessInt32Syms);
tempBv->Minus(bailOutInfo->liveFloat64Syms);
#ifdef ENABLE_SIMDJS
tempBv->Minus(bailOutInfo->liveSimd128F4Syms);
tempBv->Minus(bailOutInfo->liveSimd128I4Syms);
#endif
Assert(tempBv->IsEmpty());
#endif

Expand Down Expand Up @@ -2475,30 +2453,6 @@ BackwardPass::ProcessBailOutInfo(IR::Instr * instr, BailOutInfo * bailOutInfo)
float64StackSym->m_requiresBailOnNotNumber = true;
}
NEXT_BITSET_IN_SPARSEBV;

#ifdef ENABLE_SIMDJS
// SIMD_JS
tempBv->Or(bailOutInfo->liveSimd128F4Syms, bailOutInfo->liveSimd128I4Syms);
tempBv->And(byteCodeUpwardExposedUsed);
byteCodeUpwardExposedUsed->Minus(tempBv);
FOREACH_BITSET_IN_SPARSEBV(symId, tempBv)
{
StackSym * stackSym = this->func->m_symTable->FindStackSym(symId);
Assert(stackSym->GetType() == TyVar);
StackSym * simd128Sym = nullptr;
if (bailOutInfo->liveSimd128F4Syms->Test(symId))
{
simd128Sym = stackSym->GetSimd128F4EquivSym(nullptr);
}
else
{
Assert(bailOutInfo->liveSimd128I4Syms->Test(symId));
simd128Sym = stackSym->GetSimd128I4EquivSym(nullptr);
}
byteCodeUpwardExposedUsed->Set(simd128Sym->m_id);
}
NEXT_BITSET_IN_SPARSEBV;
#endif
}
// Var
// Any remaining syms to restore will be restored from their var versions
Expand Down
227 changes: 9 additions & 218 deletions lib/Backend/BailOut.cpp

Large diffs are not rendered by default.

74 changes: 3 additions & 71 deletions lib/Backend/BailOut.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ class BailOutInfo
byteCodeUpwardExposedUsed(nullptr), polymorphicCacheIndex((uint)-1), startCallCount(0), startCallInfo(nullptr), bailOutInstr(nullptr),
totalOutParamCount(0), argOutSyms(nullptr), bailOutRecord(nullptr), wasCloned(false), isInvertedBranch(false), sharedBailOutKind(true), outParamInlinedArgSlot(nullptr),
liveVarSyms(nullptr), liveLosslessInt32Syms(nullptr), liveFloat64Syms(nullptr),
#ifdef ENABLE_SIMDJS
liveSimd128F4Syms(nullptr),
liveSimd128I4Syms(nullptr), liveSimd128I8Syms(nullptr), liveSimd128I16Syms(nullptr),
liveSimd128U4Syms(nullptr), liveSimd128U8Syms(nullptr), liveSimd128U16Syms(nullptr),
liveSimd128B4Syms(nullptr), liveSimd128B8Syms(nullptr), liveSimd128B16Syms(nullptr),
liveSimd128D2Syms(nullptr),
#endif
branchConditionOpnd(nullptr),
stackLiteralBailOutInfoCount(0), stackLiteralBailOutInfo(nullptr)
{
Expand Down Expand Up @@ -105,22 +98,6 @@ class BailOutInfo
BVSparse<JitArenaAllocator> * liveVarSyms;
BVSparse<JitArenaAllocator> * liveLosslessInt32Syms; // These are only the live int32 syms that fully represent the var-equivalent sym's value (see GlobOpt::FillBailOutInfo)
BVSparse<JitArenaAllocator> * liveFloat64Syms;

#ifdef ENABLE_SIMDJS
// SIMD_JS
BVSparse<JitArenaAllocator> * liveSimd128F4Syms;
BVSparse<JitArenaAllocator> * liveSimd128I4Syms;
BVSparse<JitArenaAllocator> * liveSimd128I8Syms;
BVSparse<JitArenaAllocator> * liveSimd128I16Syms;
BVSparse<JitArenaAllocator> * liveSimd128U4Syms;
BVSparse<JitArenaAllocator> * liveSimd128U8Syms;
BVSparse<JitArenaAllocator> * liveSimd128U16Syms;
BVSparse<JitArenaAllocator> * liveSimd128B4Syms;
BVSparse<JitArenaAllocator> * liveSimd128B8Syms;
BVSparse<JitArenaAllocator> * liveSimd128B16Syms;
BVSparse<JitArenaAllocator> * liveSimd128D2Syms;
#endif

int * outParamOffsets;

BVSparse<JitArenaAllocator> * outParamInlinedArgSlot;
Expand Down Expand Up @@ -207,9 +184,7 @@ class BailOutRecord
}

public:
void IsOffsetNativeIntOrFloat(uint offsetIndex, int argOutSlotStart, bool * pIsFloat64, bool * pIsInt32,
bool * pIsSimd128F4, bool * pIsSimd128I4, bool * pIsSimd128I8, bool * pIsSimd128I16,
bool * pIsSimd128U4, bool * pIsSimd128U8, bool * pIsSimd128U16, bool * pIsSimd128B4, bool * pIsSimd128B8, bool * pIsSimd128B16) const;
void IsOffsetNativeIntOrFloat(uint offsetIndex, int argOutSlotStart, bool * pIsFloat64, bool * pIsInt32) const;

template <typename Fn>
void MapStartCallParamCounts(Fn fn);
Expand Down Expand Up @@ -268,9 +243,7 @@ class BailOutRecord
void * argoutRestoreAddress = nullptr) const;
void RestoreValue(IR::BailOutKind bailOutKind, Js::JavascriptCallStackLayout * layout, Js::Var * values, Js::ScriptContext * scriptContext,
bool fromLoopBody, Js::Var * registerSaves, Js::InterpreterStackFrame * newInstance, Js::Var* pArgumentsObject, void * argoutRestoreAddress,
uint regSlot, int offset, bool isLocal, bool isFloat64, bool isInt32,
bool isSimd128F4, bool isSimd128I4, bool isSimd128I8, bool isSimd128I16,
bool isSimd128U4, bool isSimd128U8, bool isSimd128U16, bool isSimd128B4, bool isSimd128B8, bool isSimd128B16 ) const;
uint regSlot, int offset, bool isLocal, bool isFloat64, bool isInt32) const;

void AdjustOffsetsForDiagMode(Js::JavascriptCallStackLayout * layout, Js::ScriptFunction * function) const;

Expand All @@ -292,19 +265,6 @@ class BailOutRecord
BVFixed * argOutLosslessInt32Syms; // Used for int-type-specialized ArgOut symbols (which are native int and for bailout we need tagged ints).
#ifdef _M_IX86
BVFixed * isOrphanedArgSlot;
#endif
#ifdef ENABLE_SIMDJS
// SIMD_JS
BVFixed * argOutSimd128F4Syms;
BVFixed * argOutSimd128I4Syms;
BVFixed * argOutSimd128I8Syms;
BVFixed * argOutSimd128I16Syms;
BVFixed * argOutSimd128U4Syms;
BVFixed * argOutSimd128U8Syms;
BVFixed * argOutSimd128U16Syms;
BVFixed * argOutSimd128B4Syms;
BVFixed * argOutSimd128B8Syms;
BVFixed * argOutSimd128B16Syms;
#endif
uint * startCallOutParamCounts;
int * outParamOffsets;
Expand All @@ -318,19 +278,6 @@ class BailOutRecord
#ifdef _M_IX86
FixupNativeDataPointer(isOrphanedArgSlot, chunkList);
#endif
#ifdef ENABLE_SIMDJS
FixupNativeDataPointer(argOutSimd128F4Syms, chunkList);
FixupNativeDataPointer(argOutSimd128I4Syms, chunkList);
FixupNativeDataPointer(argOutSimd128I8Syms, chunkList);
FixupNativeDataPointer(argOutSimd128I16Syms, chunkList);
FixupNativeDataPointer(argOutSimd128U4Syms, chunkList);
FixupNativeDataPointer(argOutSimd128U8Syms, chunkList);
FixupNativeDataPointer(argOutSimd128U16Syms, chunkList);
FixupNativeDataPointer(argOutSimd128B4Syms, chunkList);
FixupNativeDataPointer(argOutSimd128B8Syms, chunkList);
FixupNativeDataPointer(argOutSimd128B16Syms, chunkList);
#endif

// special handling for startCallOutParamCounts and outParamOffsets, becuase it points to middle of the allocation
uint* startCallOutParamCountsStart = startCallOutParamCounts - startCallIndex;
NativeCodeData::AddFixupEntry(startCallOutParamCounts, startCallOutParamCountsStart, &this->startCallOutParamCounts, this, chunkList);
Expand Down Expand Up @@ -457,19 +404,6 @@ struct GlobalBailOutRecordDataRow
unsigned regSlot : 30;
unsigned isFloat : 1;
unsigned isInt : 1;
#ifdef ENABLE_SIMDJS
// SIMD_JS
unsigned isSimd128F4 : 1;
unsigned isSimd128I4 : 1;
unsigned isSimd128I8 : 1;
unsigned isSimd128I16 : 1;
unsigned isSimd128B4 : 1;
unsigned isSimd128B8 : 1;
unsigned isSimd128B16 : 1;
unsigned isSimd128U4 : 1;
unsigned isSimd128U8 : 1;
unsigned isSimd128U16 : 1;
#endif
};

struct GlobalBailOutRecordDataTable
Expand All @@ -491,9 +425,7 @@ struct GlobalBailOutRecordDataTable
bool isScopeObjRestored : 1;

void Finalize(NativeCodeData::Allocator *allocator, JitArenaAllocator *tempAlloc);
void AddOrUpdateRow(JitArenaAllocator *allocator, uint32 bailOutRecordId, uint32 regSlot, bool isFloat, bool isInt,
bool isSimd128F4, bool isSimd128I4, bool isSimd128I8, bool isSimd128I16, bool isSimd128U4, bool isSimd128U8, bool isSimd128U16, bool isSimd128B4, bool isSimd128B8, bool isSimd128B16,
int32 offset, uint *lastUpdatedRowIndex);
void AddOrUpdateRow(JitArenaAllocator *allocator, uint32 bailOutRecordId, uint32 regSlot, bool isFloat, bool isInt, int32 offset, uint *lastUpdatedRowIndex);

template<class Fn>
void IterateGlobalBailOutRecordTableRows(uint32 bailOutRecordId, Fn callback)
Expand Down
17 changes: 0 additions & 17 deletions lib/Backend/BailOutKind.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,6 @@ BAIL_OUT_KIND(BailOutOnFailedHoistedLoopCountBasedBoundCheck, 0)
BAIL_OUT_KIND(BailOutForGeneratorYield, 0)
BAIL_OUT_KIND(BailOutOnException, 0)
BAIL_OUT_KIND(BailOutOnEarlyExit, 0)

#ifdef ENABLE_SIMDJS
// SIMD_JS
BAIL_OUT_KIND(BailOutSimd128F4Only, 0)
BAIL_OUT_KIND(BailOutSimd128I4Only, 0)
BAIL_OUT_KIND(BailOutSimd128I8Only, 0)
BAIL_OUT_KIND(BailOutSimd128I16Only, 0)
BAIL_OUT_KIND(BailOutSimd128U4Only, 0)
BAIL_OUT_KIND(BailOutSimd128U8Only, 0)
BAIL_OUT_KIND(BailOutSimd128U16Only, 0)
BAIL_OUT_KIND(BailOutSimd128B4Only, 0)
BAIL_OUT_KIND(BailOutSimd128B8Only, 0)
BAIL_OUT_KIND(BailOutSimd128B16Only, 0)
BAIL_OUT_KIND(BailOutSimd128D2Only, 0)
BAIL_OUT_KIND(BailOutNoSimdTypeSpec, 0)
#endif

BAIL_OUT_KIND(BailOutKindEnd, 0)

// One bailout instruction can have multiple of the following reasons for bailout combined with any of the above. These tell
Expand Down
1 change: 0 additions & 1 deletion lib/Backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ add_library (Chakra.Backend OBJECT
GlobOptExpr.cpp
GlobOptFields.cpp
GlobOptIntBounds.cpp
GlobOptSimd128.cpp
IR.cpp
IRBuilder.cpp
IRBuilderAsmJs.cpp
Expand Down
1 change: 0 additions & 1 deletion lib/Backend/Chakra.Backend.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@
<ClCompile Include="$(MSBuildThisFileDirectory)EquivalentTypeSet.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)GlobOptBailOut.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)GlobOptExpr.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)GlobOptSimd128.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)GlobOptFields.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)GlobOptIntBounds.cpp" />
<ClCompile Include="$(MSBuildThisFileDirectory)Backend.cpp">
Expand Down
Loading