From a6097f42da3ca39a295826a80a5ec65f578ac5ad Mon Sep 17 00:00:00 2001 From: "sgjesse@google.com" Date: Mon, 10 Jan 2011 08:50:51 +0000 Subject: Add options to enable stressing of the V8 crankshaft optimizations when running reliability tests To do stress testing V8 crankshaft optimizations the same JavaScript code needs to be run a number of times first without optimizations and then with different levels of optimizations. V8 has a stress test API which can provide information on how many times to run the same code and set the optimization level for each run. This change adds an automation message to tell the V8 instance in the renderer: * which type of stress test to conduct * the number of times the page is loaded. The two options --stress-opt and --stress-deopt have been added the reliability test runner. When one of these options is used the reliability test runner will load each page several times and notify the render using the new automation messages. BUG=none TEST=none Review URL: http://codereview.chromium.org/5594008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70877 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/renderer_host/render_view_host.cc | 4 ++++ chrome/browser/renderer_host/render_view_host.h | 6 ++++++ 2 files changed, 10 insertions(+) (limited to 'chrome/browser/renderer_host') diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index ccbd57a..447745f 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -1983,6 +1983,10 @@ void RenderViewHost::FilterURL(ChildProcessSecurityPolicy* policy, } } +void RenderViewHost::JavaScriptStressTestControl(int cmd, int param) { + Send(new ViewMsg_JavaScriptStressTestControl(routing_id(), cmd, param)); +} + void RenderViewHost::OnExtensionPostMessage( int port_id, const std::string& message) { if (process()->profile()->GetExtensionMessageService()) { diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 2174f2f..e341daf 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -525,6 +525,12 @@ class RenderViewHost : public RenderWidgetHost { void DetermineIfPageSupportsInstant(const string16& value, bool verbatim); + // Send a notification to the V8 JavaScript engine to change its parameters + // while performing stress testing. |cmd| is one of the values defined by + // |ViewHostMsg_JavaScriptStressTestControl_Commands|, which is defined + // in render_messages.h. + void JavaScriptStressTestControl(int cmd, int param); + #if defined(UNIT_TEST) // These functions shouldn't be necessary outside of testing. -- cgit v1.1