Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: benchmarks/spinning-balls/v.js

Issue 8430006: Convert array index to integer when computing pause distribution for spinning-balls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 346
347 this.angle += Math.PI / 90.0; 347 this.angle += Math.PI / 90.0;
348 }; 348 };
349 349
350 350
351 function updateStats(pause) { 351 function updateStats(pause) {
352 numberOfFrames++; 352 numberOfFrames++;
353 if (pause > 20) { 353 if (pause > 20) {
354 sumOfSquaredPauses += (pause - 20) * (pause - 20); 354 sumOfSquaredPauses += (pause - 20) * (pause - 20);
355 } 355 }
356 pauseDistribution[pause / 10] |= 0; 356 pauseDistribution[Math.floor(pause / 10)] |= 0;
357 pauseDistribution[pause / 10]++; 357 pauseDistribution[Math.floor(pause / 10)]++;
358 } 358 }
359 359
360 360
361 function renderStats() { 361 function renderStats() {
362 var msg = document.createElement("p"); 362 var msg = document.createElement("p");
363 msg.innerHTML = "Score " + 363 msg.innerHTML = "Score " +
364 Math.round(numberOfFrames * 1000 / sumOfSquaredPauses); 364 Math.round(numberOfFrames * 1000 / sumOfSquaredPauses);
365 var table = document.createElement("table"); 365 var table = document.createElement("table");
366 table.align = "center"; 366 table.align = "center";
367 for (var i = 0; i < pauseDistribution.length; i++) { 367 for (var i = 0; i < pauseDistribution.length; i++) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 } 446 }
447 447
448 function start() { 448 function start() {
449 benchmarkTimeLimit = document.getElementById("timelimit").value * 1000; 449 benchmarkTimeLimit = document.getElementById("timelimit").value * 1000;
450 document.body.removeChild(form); 450 document.body.removeChild(form);
451 init(); 451 init();
452 render(); 452 render();
453 } 453 }
454 454
455 renderForm(); 455 renderForm();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698