summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/TestRunnerUtils.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-05-20 09:56:07 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-05-20 09:56:07 +0000
commit41386e9cb918eed93b3f13648cbef387e371e451 (patch)
treea97f9d7bd1d9d091833286085f72da9d83fd0606 /Source/JavaScriptCore/runtime/TestRunnerUtils.cpp
parente15dd966d523731101f70ccf768bba12435a0208 (diff)
downloadWebKitGtk-tarball-41386e9cb918eed93b3f13648cbef387e371e451.tar.gz
webkitgtk-2.4.9webkitgtk-2.4.9
Diffstat (limited to 'Source/JavaScriptCore/runtime/TestRunnerUtils.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/TestRunnerUtils.cpp53
1 files changed, 14 insertions, 39 deletions
diff --git a/Source/JavaScriptCore/runtime/TestRunnerUtils.cpp b/Source/JavaScriptCore/runtime/TestRunnerUtils.cpp
index 3c5dac7a0..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,36 +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 optimizeNextInvocation(JSValue theFunctionValue)
-{
-#if ENABLE(JIT)
- if (CodeBlock* baselineCodeBlock = getSomeBaselineCodeBlockForFunction(theFunctionValue))
- baselineCodeBlock->optimizeNextInvocation();
-#else
- UNUSED_PARAM(theFunctionValue);
-#endif
-
- return jsUndefined();
-}
-
JSValue numberOfDFGCompiles(ExecState* exec)
{
if (exec->argumentCount() < 1)
@@ -109,12 +91,5 @@ JSValue setNeverInline(ExecState* exec)
return setNeverInline(exec->uncheckedArgument(0));
}
-JSValue optimizeNextInvocation(ExecState* exec)
-{
- if (exec->argumentCount() < 1)
- return jsUndefined();
- return optimizeNextInvocation(exec->uncheckedArgument(0));
-}
-
} // namespace JSC