Skip to content

Commit 49f5d95

Browse files
committed
[MERGE chakra-core#833] Adding back the flag for enabling opHelper checks only on jshost and ch hosts
Merge pull request chakra-core#833 from satheeshravi:Bug6628276 OpHelper Checks will be disabled on WebCrawler runs. These asserts do not seem make enough sense when they come from the crawler runs - as reverse engineering the scenario seems pretty tough. These asserts in DbCheckPostLowerer do not imply that there is a functional bug - it will indicate more of a code layout issue. With Louis' advice, these checks are enabled only on jshost and ch hosts.
2 parents 77cbb2f + 6ec3571 commit 49f5d95

4 files changed

Lines changed: 9 additions & 1 deletion

File tree

bin/ch/ChakraRtInterface.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ class ChakraRTInterface
136136
static HRESULT SetCheckMemoryLeakFlag(bool flag) { return CHECKED_CALL(SetCheckMemoryLeakFlag, flag); }
137137
static HRESULT SetEnableCheckMemoryLeakOutput(bool flag) { return CHECKED_CALL(SetEnableCheckMemoryLeakOutput, flag); }
138138
#endif
139+
#ifdef DEBUG
140+
static HRESULT SetCheckOpHelpersFlag(bool flag) { return CHECKED_CALL(SetCheckOpHelpersFlag, flag); }
141+
#endif
139142

140143
static HRESULT GetCrashOnExceptionFlag(bool * flag)
141144
{

bin/ch/ch.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,10 @@ HRESULT ExecuteTest(LPCWSTR fileName)
378378
JsContextRef context = JS_INVALID_REFERENCE;
379379
IfJsErrorFailLog(ChakraRTInterface::JsCreateContext(runtime, &context));
380380
IfJsErrorFailLog(ChakraRTInterface::JsSetCurrentContext(context));
381+
382+
#ifdef DEBUG
383+
ChakraRTInterface::SetCheckOpHelpersFlag(true);
384+
#endif
381385

382386
if (!WScriptJsrt::Initialize())
383387
{

lib/Backend/DbCheckPostLower.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
void
1010
DbCheckPostLower::Check()
1111
{
12-
bool doOpHelperCheck = !this->func->isPostLayout;
12+
bool doOpHelperCheck = Js::Configuration::Global.flags.CheckOpHelpers && !this->func->isPostLayout;
1313
bool isInHelperBlock = false;
1414

1515
FOREACH_INSTR_IN_FUNC_EDITING(instr, instrNext, this->func)

lib/Common/ConfigFlagsList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ FLAGNR(Boolean, CheckEmitBufferPermissions, "Check JIT code buffers at commit an
783783
FLAGR (Boolean, CheckMemoryLeak , "Check for heap memory leak", false)
784784
FLAGR (String, DumpOnLeak , "Create a dump on failed memory leak check", nullptr)
785785
#endif
786+
FLAGNR(Boolean, CheckOpHelpers , "Verify opHelper labels in the JIT are set properly", false)
786787
FLAGNR(Boolean, CloneInlinedPolymorphicCaches, "Clones polymorphic inline caches in inlined functions", DEFAULT_CONFIG_CloneInlinedPolymorphicCaches)
787788
FLAGNR(Boolean, ConcurrentRuntime , "Enable Concurrent GC and background JIT when creating runtime", DEFAULT_CONFIG_ConcurrentRuntime)
788789
FLAGNR(Boolean, Console , "Create console window in GUI app", false)

0 commit comments

Comments
 (0)