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