Commit c47eff9c authored by treat@webkit.org's avatar treat@webkit.org

2009-06-19 Adam Treat <adam.treat@torchmobile.com>

        Reviewed by Oliver Hunt.

        https://bugs.webkit.org/show_bug.cgi?id=26540
        Currently the SunSpider test driver lacks an option to run a test suite that
        will test JavaScriptCore parsing performance only.  This patch adds just such
        a test suite and option to SunSpider as well as the jsc test shell.  I've included
        three large javascript source files found in the wild: jquery, mootools and prototype.
        Combined with the concatenation of all three, these form a new testsuite to measure
        and test pure JavaScriptCore parsing performance.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44870 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 91f86b0d
009-06-19 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
2009-06-19 Adam Treat <adam.treat@torchmobile.com>
Reviewed by Oliver Hunt.
https://bugs.webkit.org/show_bug.cgi?id=26540
Modify the test shell to add a new function 'checkSyntax' that will
only parse the source instead of executing it. In this way we can test
pure parsing performance against some of the larger scripts in the wild.
* jsc.cpp:
(GlobalObject::GlobalObject):
(functionCheckSyntax):
2009-06-19 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
Reviewed by Darin Adler.
......
......@@ -75,6 +75,7 @@ static JSValue JSC_HOST_CALL functionGC(ExecState*, JSObject*, JSValue, const Ar
static JSValue JSC_HOST_CALL functionVersion(ExecState*, JSObject*, JSValue, const ArgList&);
static JSValue JSC_HOST_CALL functionRun(ExecState*, JSObject*, JSValue, const ArgList&);
static JSValue JSC_HOST_CALL functionLoad(ExecState*, JSObject*, JSValue, const ArgList&);
static JSValue JSC_HOST_CALL functionCheckSyntax(ExecState*, JSObject*, JSValue, const ArgList&);
static JSValue JSC_HOST_CALL functionReadline(ExecState*, JSObject*, JSValue, const ArgList&);
static NO_RETURN JSValue JSC_HOST_CALL functionQuit(ExecState*, JSObject*, JSValue, const ArgList&);
......@@ -184,6 +185,7 @@ GlobalObject::GlobalObject(const Vector<UString>& arguments)
putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "version"), functionVersion));
putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "run"), functionRun));
putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "load"), functionLoad));
putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 1, Identifier(globalExec(), "checkSyntax"), functionCheckSyntax));
putDirectFunction(globalExec(), new (globalExec()) NativeFunctionWrapper(globalExec(), prototypeFunctionStructure(), 0, Identifier(globalExec(), "readline"), functionReadline));
#if ENABLE(SAMPLING_FLAGS)
......@@ -264,6 +266,22 @@ JSValue JSC_HOST_CALL functionLoad(ExecState* exec, JSObject* o, JSValue v, cons
return result.value();
}
JSValue JSC_HOST_CALL functionCheckSyntax(ExecState* exec, JSObject* o, JSValue v, const ArgList& args)
{
UNUSED_PARAM(o);
UNUSED_PARAM(v);
UString fileName = args.at(0).toString(exec);
Vector<char> script;
if (!fillBufferWithContentsOfFile(fileName, script))
return throwError(exec, GeneralError, "Could not open file.");
JSGlobalObject* globalObject = exec->lexicalGlobalObject();
Completion result = checkSyntax(globalObject->globalExec(), makeSource(script.data(), fileName));
if (result.complType() == Throw)
exec->setException(result.value());
return result.value();
}
#if ENABLE(SAMPLING_FLAGS)
JSValue JSC_HOST_CALL functionSetSamplingFlags(ExecState* exec, JSObject*, JSValue, const ArgList& args)
{
......
2009-06-19 Adam Treat <adam.treat@torchmobile.com>
Reviewed by Oliver Hunt.
https://bugs.webkit.org/show_bug.cgi?id=26540
Currently the SunSpider test driver lacks an option to run a test suite that
will test JavaScriptCore parsing performance only. This patch adds just such
a test suite and option to SunSpider as well as the jsc test shell. I've included
three large javascript source files found in the wild: jquery, mootools and prototype.
Combined with the concatenation of all three, these form a new testsuite to measure
and test pure JavaScriptCore parsing performance.
* resources/sunspider-standalone-driver.js:
Load the js with parse-only flag if it is part of the parse-only suite.
* sunspider:
Add the parse-only suite to the list of options.
* sunspider-compare-results:
Add the parse-only suite to the list of options.
* tests/LIST-PARSE-ONLY: Added.
* tests/parse-only/concat-jquery-mootools-prototype.js: Added.
A very large concatenation of the scripts found below. This js takes ~30ms to parse on my machine.
* tests/parse-only/jquery-1.3.2.js: Added.
Latest version from jquery.com.
* tests/parse-only/mootools-1.2.2-core-nc.js: Added.
Latest version from mootools.net.
* tests/parse-only/prototype-1.6.0.3.js: Added.
Latest version from prototypejs.org.
2009-06-13 Steve Falkenburg <sfalken@apple.com>
Update V8 benchmark to version 4.
......
......@@ -32,7 +32,10 @@ times.length = tests.length;
for (var j = 0; j < tests.length; j++) {
var testName = "tests/" + tests[j] + ".js";
var startTime = new Date;
load(testName);
if (testName.indexOf('parse-only') >= 0)
checkSyntax(testName);
else
load(testName);
times[j] = new Date() - startTime;
gc();
}
......
......@@ -38,6 +38,7 @@ my $runShark20 = 0;
my $runSharkCache = 0;
my $ubench = 0;
my $v8suite = 0;
my $parseonly = 0;
my $jsShellPath;
my $jsShellArgs = "";
my $setBaseline = 0;
......@@ -58,6 +59,7 @@ Usage: $programName --shell=[path] [options]
--shark-cache Like --shark, but performs a L2 cache-miss sample instead of time sample
--ubench Use microbenchmark suite instead of regular tests (to check for core execution regressions)
--v8-suite Use the V8 benchmark suite
--parse-only Use the parse-only benchmark suite
EOF
GetOptions('runs=i' => \$testRuns,
......@@ -69,12 +71,14 @@ GetOptions('runs=i' => \$testRuns,
'shark-cache' => \$runSharkCache,
'ubench' => \$ubench,
'v8-suite' => \$v8suite,
'parse-only' => \$parseonly,
'tests=s' => \$testsPattern,
'help' => \$showHelp);
my $resultDirectory = "sunspider-results";
$resultDirectory = "ubench-results" if ($ubench);
$resultDirectory = "v8-results" if ($v8suite);
$resultDirectory = "parse-only-results" if ($parseonly);
$runShark = 1 if $runSharkCache;
$runShark = 20 if $runShark20;
......@@ -122,6 +126,7 @@ sub loadTestsList()
my $testlist = "LIST";
$testlist = "LIST-UBENCH" if ($ubench);
$testlist = "LIST-V8" if ($v8suite);
$testlist = "LIST-PARSE-ONLY" if ($parseonly);
open TESTLIST, "<", "tests/${testlist}" or die "Can't find ./tests/${testlist}";
while (<TESTLIST>) {
......
......@@ -31,6 +31,7 @@ my $showHelp = 0;
my $jsShellPath;
my $ubench = 0;
my $v8suite = 0;
my $parseonly = 0;
my $programName = basename($0);
my $usage = <<EOF;
......@@ -39,16 +40,19 @@ Usage: $programName --shell=[path] [options] FILE FILE
--shell Path to javascript shell
--ubench Compare microbenchmark results
--v8-suite Compare the V8 benchmark results
--parse-only Compare the parse-only benchmark results
EOF
GetOptions('shell=s' => \$jsShellPath,
'ubench' => \$ubench,
'v8-suite' => \$v8suite,
'parse-only' => \$parseonly,
'help' => \$showHelp);
my $resultDirectory = "sunspider-results";
$resultDirectory = "ubench-results" if ($ubench);
$resultDirectory = "v8-results" if ($v8suite);
$resultDirectory = "parse-only-results" if ($parseonly);
if ((scalar @ARGV != 0 && scalar @ARGV != 2) || !$jsShellPath || $showHelp) {
print STDERR $usage;
......
parse-only/jquery-1.3.2
parse-only/mootools-1.2.2-core-nc
parse-only/prototype-1.6.0.3
parse-only/concat-jquery-mootools-prototype
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment