summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/TestRunnerUtils.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
commit32761a6cee1d0dee366b885b7b9c777e67885688 (patch)
treed6bec92bebfb216f4126356e55518842c2f476a1 /Source/JavaScriptCore/runtime/TestRunnerUtils.cpp
parenta4e969f4965059196ca948db781e52f7cfebf19e (diff)
downloadWebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/JavaScriptCore/runtime/TestRunnerUtils.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/TestRunnerUtils.cpp75
1 files changed, 14 insertions, 61 deletions
diff --git a/Source/JavaScriptCore/runtime/TestRunnerUtils.cpp b/Source/JavaScriptCore/runtime/TestRunnerUtils.cpp
index d13090fed..337c00e6e 100644
--- a/Source/JavaScriptCore/runtime/TestRunnerUtils.cpp
+++ b/Source/JavaScriptCore/runtime/TestRunnerUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,11 +27,11 @@
#include "TestRunnerUtils.h"
#include "CodeBlock.h"
-#include "JSCInlines.h"
+#include "Operations.h"
namespace JSC {
-FunctionExecutable* getExecutableForFunction(JSValue theFunctionValue)
+static FunctionExecutable* getExecutable(JSValue theFunctionValue)
{
JSFunction* theFunction = jsDynamicCast<JSFunction*>(theFunctionValue);
if (!theFunction)
@@ -42,20 +42,6 @@ FunctionExecutable* getExecutableForFunction(JSValue theFunctionValue)
return executable;
}
-CodeBlock* getSomeBaselineCodeBlockForFunction(JSValue theFunctionValue)
-{
- FunctionExecutable* executable = getExecutableForFunction(theFunctionValue);
- if (!executable)
- return 0;
-
- CodeBlock* baselineCodeBlock = executable->baselineCodeBlockFor(CodeForCall);
-
- if (!baselineCodeBlock)
- baselineCodeBlock = executable->baselineCodeBlockFor(CodeForConstruct);
-
- return baselineCodeBlock;
-}
-
JSValue numberOfDFGCompiles(JSValue theFunctionValue)
{
bool pretendToHaveManyCompiles = false;
@@ -65,51 +51,32 @@ JSValue numberOfDFGCompiles(JSValue theFunctionValue)
#else
pretendToHaveManyCompiles = true;
#endif
+
+ if (FunctionExecutable* executable = getExecutable(theFunctionValue)) {
+ CodeBlock* baselineCodeBlock = executable->baselineCodeBlockFor(CodeForCall);
+
+ if (!baselineCodeBlock)
+ baselineCodeBlock = executable->baselineCodeBlockFor(CodeForConstruct);
+
+ if (!baselineCodeBlock)
+ return jsNumber(0);
- if (CodeBlock* baselineCodeBlock = getSomeBaselineCodeBlockForFunction(theFunctionValue)) {
if (pretendToHaveManyCompiles)
return jsNumber(1000000.0);
return jsNumber(baselineCodeBlock->numberOfDFGCompiles());
}
- return jsNumber(0);
+ return jsUndefined();
}
JSValue setNeverInline(JSValue theFunctionValue)
{
- if (FunctionExecutable* executable = getExecutableForFunction(theFunctionValue))
+ if (FunctionExecutable* executable = getExecutable(theFunctionValue))
executable->setNeverInline(true);
return jsUndefined();
}
-JSValue setNeverOptimize(JSValue theFunctionValue)
-{
- if (FunctionExecutable* executable = getExecutableForFunction(theFunctionValue))
- executable->setNeverOptimize(true);
-
- return jsUndefined();
-}
-
-JSValue optimizeNextInvocation(JSValue theFunctionValue)
-{
-#if ENABLE(JIT)
- if (CodeBlock* baselineCodeBlock = getSomeBaselineCodeBlockForFunction(theFunctionValue))
- baselineCodeBlock->optimizeNextInvocation();
-#else
- UNUSED_PARAM(theFunctionValue);
-#endif
-
- return jsUndefined();
-}
-
-JSValue failNextNewCodeBlock(ExecState* exec)
-{
- exec->vm().setFailNextNewCodeBlock();
-
- return jsUndefined();
-}
-
JSValue numberOfDFGCompiles(ExecState* exec)
{
if (exec->argumentCount() < 1)
@@ -124,19 +91,5 @@ JSValue setNeverInline(ExecState* exec)
return setNeverInline(exec->uncheckedArgument(0));
}
-JSValue setNeverOptimize(ExecState* exec)
-{
- if (exec->argumentCount() < 1)
- return jsUndefined();
- return setNeverOptimize(exec->uncheckedArgument(0));
-}
-
-JSValue optimizeNextInvocation(ExecState* exec)
-{
- if (exec->argumentCount() < 1)
- return jsUndefined();
- return optimizeNextInvocation(exec->uncheckedArgument(0));
-}
-
} // namespace JSC