From 6882a04fb36642862b11efe514251d32070c3d65 Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Thu, 25 Aug 2016 19:20:41 +0300 Subject: Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443) Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev --- Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp | 47 ++++++++++-------------- 1 file changed, 20 insertions(+), 27 deletions(-) (limited to 'Source/JavaScriptCore/API/JSCTestRunnerUtils.cpp') 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(theFunctionValue); - if (!theFunction) - return 0; - - FunctionExecutable* executable = jsDynamicCast( - 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 -- cgit v1.2.1