diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2016-08-25 19:20:41 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-02-02 12:30:55 +0000 |
commit | 6882a04fb36642862b11efe514251d32070c3d65 (patch) | |
tree | b7959826000b061fd5ccc7512035c7478742f7b0 /Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp | |
parent | ab6df191029eeeb0b0f16f127d553265659f739e (diff) | |
download | qtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz |
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp')
-rw-r--r-- | Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp | 47 |
1 files changed, 20 insertions, 27 deletions
diff --git a/Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp b/Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp index 394246711..d314c5d48 100644 --- a/Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp +++ b/Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp @@ -27,45 +27,38 @@ #include "JSCTestRunnerUtils.h" #include "APICast.h" -#include "CodeBlock.h" -#include "Operations.h" +#include "JSCInlines.h" +#include "TestRunnerUtils.h" namespace JSC { -static FunctionExecutable* getExecutable(JSContextRef context, JSValueRef theFunctionValueRef) + +JSValueRef failNextNewCodeBlock(JSContextRef context) { - ExecState* exec = toJS(context); - JSValue theFunctionValue = toJS(exec, theFunctionValueRef); - - JSFunction* theFunction = jsDynamicCast<JSFunction*>(theFunctionValue); - if (!theFunction) - return 0; - - FunctionExecutable* executable = jsDynamicCast<FunctionExecutable*>( - theFunction->executable()); - return executable; + ExecState* exec= toJS(context); + JSLockHolder holder(exec); + return toRef(exec, failNextNewCodeBlock(exec)); } JSValueRef numberOfDFGCompiles(JSContextRef context, JSValueRef theFunctionValueRef) { - if (FunctionExecutable* executable = getExecutable(context, theFunctionValueRef)) { - CodeBlock* baselineCodeBlock = executable->baselineCodeBlockFor(CodeForCall); - - if (!baselineCodeBlock) - return JSValueMakeNumber(context, 0); - - return JSValueMakeNumber(context, baselineCodeBlock->numberOfDFGCompiles()); - } - - return JSValueMakeUndefined(context); + ExecState* exec= toJS(context); + JSLockHolder holder(exec); + return toRef(exec, numberOfDFGCompiles(toJS(exec, theFunctionValueRef))); } JSValueRef setNeverInline(JSContextRef context, JSValueRef theFunctionValueRef) { - if (FunctionExecutable* executable = getExecutable(context, theFunctionValueRef)) - executable->setNeverInline(true); - - return JSValueMakeUndefined(context); + ExecState* exec= toJS(context); + JSLockHolder holder(exec); + return toRef(exec, setNeverInline(toJS(exec, theFunctionValueRef))); +} + +JSValueRef setNeverOptimize(JSContextRef context, JSValueRef theFunctionValueRef) +{ + ExecState* exec= toJS(context); + JSLockHolder holder(exec); + return toRef(exec, setNeverOptimize(toJS(exec, theFunctionValueRef))); } } // namespace JSC |