summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h')
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
index 3796cc704..aadcdb06b 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
@@ -1925,6 +1925,15 @@ public:
#if !defined(NDEBUG) && !CPU(ARM)
void prepareForExternalCall()
{
+ // We're about to call out to a "native" helper function. The helper
+ // function is expected to set topCallFrame itself with the ExecState
+ // that is passed to it.
+ //
+ // We explicitly trash topCallFrame here so that we'll know if some of
+ // the helper functions are not setting topCallFrame when they should
+ // be doing so. Note: the previous value in topcallFrame was not valid
+ // anyway since it was not being updated by JIT'ed code by design.
+
for (unsigned i = 0; i < sizeof(void*) / 4; i++)
m_jit.store32(TrustedImm32(0xbadbeef), reinterpret_cast<char*>(&m_jit.globalData()->topCallFrame) + i * 4);
}