| OLD | NEW |
| 1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 | 68 |
| 69 // Keep track of all declared benchmark suites. | 69 // Keep track of all declared benchmark suites. |
| 70 BenchmarkSuite.suites = []; | 70 BenchmarkSuite.suites = []; |
| 71 | 71 |
| 72 | 72 |
| 73 // Scores are not comparable across versions. Bump the version if | 73 // Scores are not comparable across versions. Bump the version if |
| 74 // you're making changes that will affect that scores, e.g. if you add | 74 // you're making changes that will affect that scores, e.g. if you add |
| 75 // a new benchmark or change an existing one. | 75 // a new benchmark or change an existing one. |
| 76 BenchmarkSuite.version = '2'; | 76 BenchmarkSuite.version = '3'; |
| 77 | 77 |
| 78 | 78 |
| 79 // To make the benchmark results predictable, we replace Math.random | 79 // To make the benchmark results predictable, we replace Math.random |
| 80 // with a 100% deterministic alternative. | 80 // with a 100% deterministic alternative. |
| 81 Math.random = (function() { | 81 Math.random = (function() { |
| 82 var seed = 49734321; | 82 var seed = 49734321; |
| 83 return function() { | 83 return function() { |
| 84 // Robert Jenkins' 32 bit integer hash function. | 84 // Robert Jenkins' 32 bit integer hash function. |
| 85 seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff; | 85 seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff; |
| 86 seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff; | 86 seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 suite.NotifyError(e); | 224 suite.NotifyError(e); |
| 225 return null; | 225 return null; |
| 226 } | 226 } |
| 227 return RunNext; | 227 return RunNext; |
| 228 } | 228 } |
| 229 suite.NotifyResult(); | 229 suite.NotifyResult(); |
| 230 return null; | 230 return null; |
| 231 } | 231 } |
| 232 return RunNext(); | 232 return RunNext(); |
| 233 } | 233 } |
| OLD | NEW |