Revision: 12536
Author:   [email protected]
Date:     Tue Sep 18 03:09:02 2012
Log:      Show hint to Octane.

[email protected]

Review URL: https://codereview.appspot.com/6497145
http://code.google.com/p/v8/source/detail?r=12536

Modified:
 /data/benchmarks/v7/run.html

=======================================
--- /data/benchmarks/v7/run.html        Thu Mar 15 10:13:50 2012
+++ /data/benchmarks/v7/run.html        Tue Sep 18 03:09:02 2012
@@ -56,35 +56,21 @@
                              NotifyScore: AddScore });
 }

-function ShowWarningIfObsolete() {
-  // If anything goes wrong we will just catch the exception and no
-  // warning is shown, i.e., no harm is done.
-  try {
-    var xmlhttp;
-    var next_version = parseInt(BenchmarkSuite.version) + 1;
-    var next_version_url = "../v" + next_version + "/run.html";
-    if (window.XMLHttpRequest) {
-      xmlhttp = new window.XMLHttpRequest();
-    } else if (window.ActiveXObject) {
-      xmlhttp = new window.ActiveXObject("Microsoft.XMLHTTP");
-    }
-    xmlhttp.open('GET', next_version_url, true);
-    xmlhttp.onreadystatechange = function() {
-      if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
-        document.getElementById('obsolete').style.display="block";
-      }
-    };
-    xmlhttp.send(null);
-  } catch(e) {
-    // Ignore exception if check for next version fails.
-    // Hence no warning is displayed.
+function ShowHintToOctane() {
+  // if the browser supports typed arrays, suggest to try Octane
+  var hasTypedArrays = typeof Uint8Array != "undefined"
+      && typeof Float64Array != "undefined"
+      && typeof (new Uint8Array(0)).subarray != "undefined";
+
+  if (!hasTypedArrays) {
+    document.getElementById('obsolete').style.display="block";
   }
 }

 function Load() {
   var version = BenchmarkSuite.version;
   document.getElementById("version").innerHTML = version;
-  ShowWarningIfObsolete();
+  ShowHintToOctane();
   setTimeout(Run, 200);
 }
 </script>
@@ -93,10 +79,10 @@
 <div>
<div class="title"><h1>V8 Benchmark Suite - version <span id="version">?</span></h1></div>
   <div class="warning" id="obsolete">
-Warning! This is not the latest version of the V8 benchmark
-suite. Consider running the
-<a href="http://v8.googlecode.com/svn/data/benchmarks/current/run.html";>
-latest version</a>.
+Warning! The V8 benchmark has been updated!
+Consider
+<a href="http://octane-benchmark.googlecode.com/svn/latest/index.html";>
+running the Octane benchmark</a> instead.
   </div>
   <table>
     <tr>

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to