diff --git a/deps/chakrashim/core/lib/Runtime/Base/ThreadContext.cpp b/deps/chakrashim/core/lib/Runtime/Base/ThreadContext.cpp
index aae249d1bb7..72cbf4fcdcd 100644
--- a/deps/chakrashim/core/lib/Runtime/Base/ThreadContext.cpp
+++ b/deps/chakrashim/core/lib/Runtime/Base/ThreadContext.cpp
@@ -99,7 +99,7 @@ ThreadContext::RecyclableData::RecyclableData(Recycler *const recycler) :
#define ALLOC_XDATA (false)
#endif
-ThreadContext::ThreadContext(AllocationPolicyManager * allocationPolicyManager, JsUtil::ThreadService::ThreadServiceCallback threadServiceCallback, bool enableExperimentalFeatures) :
+ThreadContext::ThreadContext(AllocationPolicyManager * allocationPolicyManager, JsUtil::ThreadService::ThreadServiceCallback threadServiceCallback, bool enableExperimentalFeatures, bool enableSimdjsFeature) :
currentThreadId(::GetCurrentThreadId()),
stackLimitForCurrentThread(0),
stackProber(nullptr),
@@ -176,7 +176,7 @@ ThreadContext::ThreadContext(AllocationPolicyManager * allocationPolicyManager,
dynamicObjectEnumeratorCacheMap(&HeapAllocator::Instance, 16),
//threadContextFlags(ThreadContextFlagNoFlag),
telemetryBlock(&localTelemetryBlock),
- configuration(enableExperimentalFeatures),
+ configuration(enableExperimentalFeatures, enableSimdjsFeature),
jsrtRuntime(nullptr),
rootPendingClose(nullptr),
wellKnownHostTypeHTMLAllCollectionTypeId(Js::TypeIds_Undefined),
diff --git a/deps/chakrashim/core/lib/Runtime/Base/ThreadContext.h b/deps/chakrashim/core/lib/Runtime/Base/ThreadContext.h
index 69b49d28632..331717ad413 100644
--- a/deps/chakrashim/core/lib/Runtime/Base/ThreadContext.h
+++ b/deps/chakrashim/core/lib/Runtime/Base/ThreadContext.h
@@ -309,12 +309,13 @@ class JITTimer
class ThreadConfiguration
{
public:
- ThreadConfiguration(bool enableExperimentalFeatures)
+ ThreadConfiguration(bool enableExperimentalFeatures, bool enableSimdjsFeature)
{
CopyGlobalFlags();
if (enableExperimentalFeatures)
{
EnableExperimentalFeatures();
+ m_Simdjs = enableSimdjsFeature;
}
}
@@ -1004,7 +1005,7 @@ class ThreadContext sealed :
ArenaAllocator* GetThreadAlloc() { return &threadAlloc; }
static CriticalSection * GetCriticalSection() { return &s_csThreadContext; }
- ThreadContext(AllocationPolicyManager * allocationPolicyManager = nullptr, JsUtil::ThreadService::ThreadServiceCallback threadServiceCallback = nullptr, bool enableExperimentalFeatures = false);
+ ThreadContext(AllocationPolicyManager * allocationPolicyManager = nullptr, JsUtil::ThreadService::ThreadServiceCallback threadServiceCallback = nullptr, bool enableExperimentalFeatures = false, bool enableSimdjsFeature = false);
static void Add(ThreadContext *threadContext);
ThreadConfiguration const * GetConfig() const { return &configuration; }
diff --git a/deps/chakrashim/core/lib/jsrt/Jsrt.cpp b/deps/chakrashim/core/lib/jsrt/Jsrt.cpp
index d93a1b54aa3..a9f376f3208 100644
--- a/deps/chakrashim/core/lib/jsrt/Jsrt.cpp
+++ b/deps/chakrashim/core/lib/jsrt/Jsrt.cpp
@@ -83,7 +83,8 @@ STDAPI_(JsErrorCode) JsCreateRuntime(_In_ JsRuntimeAttributes attributes, _In_op
JsRuntimeAttributeDisableEval |
JsRuntimeAttributeDisableNativeCodeGeneration |
JsRuntimeAttributeEnableExperimentalFeatures |
- JsRuntimeAttributeDispatchSetExceptionsToDebugger
+ JsRuntimeAttributeDispatchSetExceptionsToDebugger |
+ JsRuntimeAttributeEnableSimdjsFeature
#ifdef ENABLE_DEBUG_CONFIG_OPTIONS
| JsRuntimeAttributeSerializeLibraryByteCode
#endif
@@ -97,7 +98,8 @@ STDAPI_(JsErrorCode) JsCreateRuntime(_In_ JsRuntimeAttributes attributes, _In_op
AllocationPolicyManager * policyManager = HeapNew(AllocationPolicyManager, (attributes & JsRuntimeAttributeDisableBackgroundWork) == 0);
bool enableExperimentalFeatures = (attributes & JsRuntimeAttributeEnableExperimentalFeatures) != 0;
- ThreadContext * threadContext = HeapNew(ThreadContext, policyManager, threadService, enableExperimentalFeatures);
+ bool enableSimdjsFeature = (attributes & JsRuntimeAttributeEnableSimdjsFeature) != 0;
+ ThreadContext * threadContext = HeapNew(ThreadContext, policyManager, threadService, enableExperimentalFeatures, enableSimdjsFeature);
if (((attributes & JsRuntimeAttributeDisableBackgroundWork) != 0)
#ifdef ENABLE_DEBUG_CONFIG_OPTIONS
diff --git a/deps/chakrashim/core/lib/jsrt/chakracommon.h b/deps/chakrashim/core/lib/jsrt/chakracommon.h
index 158a76858e3..11df9d0adf0 100644
--- a/deps/chakrashim/core/lib/jsrt/chakracommon.h
+++ b/deps/chakrashim/core/lib/jsrt/chakracommon.h
@@ -313,7 +313,13 @@
/// Calling JsSetException will also dispatch the exception to the script debugger
/// (if any) giving the debugger a chance to break on the exception.
///
- JsRuntimeAttributeDispatchSetExceptionsToDebugger = 0x00000040
+ JsRuntimeAttributeDispatchSetExceptionsToDebugger = 0x00000040,
+ ///
+ /// Runtime will enable Simdjs experimental feature. Valid only if used with
+ /// JsRuntimeAttributeEnableExperimentalFeatures
+ ///
+ JsRuntimeAttributeEnableSimdjsFeature = 0x00000080
+
} JsRuntimeAttributes;
///