本文整理汇总了C++中FunctionExecutable::recompile方法的典型用法代码示例。如果您正苦于以下问题:C++ FunctionExecutable::recompile方法的具体用法?C++ FunctionExecutable::recompile怎么用?C++ FunctionExecutable::recompile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FunctionExecutable
的用法示例。
在下文中一共展示了FunctionExecutable::recompile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: recompileAllJSFunctions
void Debugger::recompileAllJSFunctions(JSGlobalData* globalData)
{
// If JavaScript is running, it's not safe to recompile, since we'll end
// up throwing away code that is live on the stack.
ASSERT(!globalData->dynamicGlobalObject);
if (globalData->dynamicGlobalObject)
return;
typedef HashSet<FunctionExecutable*> FunctionExecutableSet;
typedef HashMap<SourceProvider*, ExecState*> SourceProviderMap;
FunctionExecutableSet functionExecutables;
SourceProviderMap sourceProviders;
LiveObjectIterator it = globalData->heap.primaryHeapBegin();
LiveObjectIterator heapEnd = globalData->heap.primaryHeapEnd();
for ( ; it != heapEnd; ++it) {
if (!(*it)->inherits(&JSFunction::info))
continue;
JSFunction* function = asFunction(*it);
if (function->executable()->isHostFunction())
continue;
FunctionExecutable* executable = function->jsExecutable();
// Check if the function is already in the set - if so,
// we've already retranslated it, nothing to do here.
if (!functionExecutables.add(executable).second)
continue;
ExecState* exec = function->scope().globalObject()->JSGlobalObject::globalExec();
executable->recompile(exec);
if (function->scope().globalObject()->debugger() == this)
sourceProviders.add(executable->source().provider(), exec);
}
// Call sourceParsed() after reparsing all functions because it will execute
// JavaScript in the inspector.
SourceProviderMap::const_iterator end = sourceProviders.end();
for (SourceProviderMap::const_iterator iter = sourceProviders.begin(); iter != end; ++iter)
sourceParsed(iter->second, SourceCode(iter->first), -1, UString());
}