It should be easy to run ES6SampleBench from the jsc shell
authorsbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Aug 2016 03:39:33 +0000 (03:39 +0000)
committersbarati@apple.com <sbarati@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Aug 2016 03:39:33 +0000 (03:39 +0000)
commita54b3fb85d852547123f52bdb1d297fcb55bc0cb
tree74231f9f521b0f5a430604fcf7563dce6a576a1b
parent770c27fba326f38b7c7013680bbfc8690a03fa3e
It should be easy to run ES6SampleBench from the jsc shell
https://bugs.webkit.org/show_bug.cgi?id=161085

Reviewed by Yusuke Suzuki.

PerformanceTests:

This patch makes ES6 sample bench runnable through the `jsc` shell.
To do that, you need to be in the PerformanceTests/ES6SampleBench
directory and run `jsc cli.js`. To make this work, the benchmark
is now aware of being run in two modes: via the browser, and via
the shell. Each entry point will set a variable `isInBrowser`,
and the benchmark will do different things based on if that
variable is true or false.

* ES6SampleBench/Air/benchmark.js:
* ES6SampleBench/Air/stress-test.js:
* ES6SampleBench/Basic/benchmark.js:
(runBenchmark):
* ES6SampleBench/Basic/stress-test.js:
* ES6SampleBench/air_benchmark.js:
* ES6SampleBench/basic_benchmark.js:
* ES6SampleBench/cli.js: Added.
(return.doRun):
(makeBenchmarkRunner):
* ES6SampleBench/driver.js:
(Driver):
(Driver.prototype._recomputeSummary):
(Driver.prototype._iterate.window.setTimeout):
(Driver.prototype._iterate):
(Driver.prototype._updateIterations):
* ES6SampleBench/glue.js:
(reportResult):
* ES6SampleBench/index.html:
* ES6SampleBench/results.js:
(Results):
(Results.prototype.reportRunning):
(Results.prototype.reportDone):
(Results.prototype.reportError):
* ES6SampleBench/stats.js:
(Stats):
(Stats.prototype.toString):
(Stats.prototype._update):

Source/JavaScriptCore:

This patch adds a new function called `runString` to the shell.
It takes in a string, and executes it in a new global object.
Then, it returns the global object it executed the code in.
This allows the code to stash some kind of a result on the global,
and then have the caller of `runString` extract the result.

* jsc.cpp:
(GlobalObject::finishCreation):
(functionRunString):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@204882 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
PerformanceTests/ChangeLog
PerformanceTests/ES6SampleBench/Air/benchmark.js
PerformanceTests/ES6SampleBench/Air/stress-test.js
PerformanceTests/ES6SampleBench/Basic/benchmark.js
PerformanceTests/ES6SampleBench/Basic/stress-test.js
PerformanceTests/ES6SampleBench/air_benchmark.js
PerformanceTests/ES6SampleBench/basic_benchmark.js
PerformanceTests/ES6SampleBench/cli.js [new file with mode: 0644]
PerformanceTests/ES6SampleBench/driver.js
PerformanceTests/ES6SampleBench/glue.js
PerformanceTests/ES6SampleBench/index.html
PerformanceTests/ES6SampleBench/results.js
PerformanceTests/ES6SampleBench/stats.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/jsc.cpp