| OLD | NEW |
| 1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 def AcceptNewTrusted(self, data): | 214 def AcceptNewTrusted(self, data): |
| 215 # The format of |data| matches the return value of |SignTrusted()|. | 215 # The format of |data| matches the return value of |SignTrusted()|. |
| 216 if not data: return | 216 if not data: return |
| 217 fingerprint = data[0] | 217 fingerprint = data[0] |
| 218 pubkey = data[1] | 218 pubkey = data[1] |
| 219 signature = data[2] | 219 signature = data[2] |
| 220 signer = data[3] | 220 signer = data[3] |
| 221 if not self.IsTrusted(signer): | 221 if not self.IsTrusted(signer): |
| 222 return | 222 return |
| 223 if self.IsTrusted(fingerprint): | 223 if self.IsTrusted(fingerprint): |
| 224 return # Already trust this guy. | 224 return # Already trusted. |
| 225 filename = self._PubkeyFilename(fingerprint) | 225 filename = self._PubkeyFilename(fingerprint) |
| 226 signer_pubkeyfile = self._PubkeyFilename(signer) | 226 signer_pubkeyfile = self._PubkeyFilename(signer) |
| 227 if not signatures.VerifySignature(filename, pubkey, signature, | 227 if not signatures.VerifySignature(filename, pubkey, signature, |
| 228 signer_pubkeyfile): | 228 signer_pubkeyfile): |
| 229 return | 229 return |
| 230 return # Nothing more to do. | 230 return # Nothing more to do. |
| 231 | 231 |
| 232 def AddPerfData(self, test_key, duration, arch, mode): | 232 def AddPerfData(self, test_key, duration, arch, mode): |
| 233 data_store = self.perf_data_manager.GetStore(arch, mode) | 233 data_store = self.perf_data_manager.GetStore(arch, mode) |
| 234 data_store.RawUpdatePerfData(str(test_key), duration) | 234 data_store.RawUpdatePerfData(str(test_key), duration) |
| 235 | 235 |
| 236 def CompareOwnPerf(self, test, arch, mode): | 236 def CompareOwnPerf(self, test, arch, mode): |
| 237 data_store = self.perf_data_manager.GetStore(arch, mode) | 237 data_store = self.perf_data_manager.GetStore(arch, mode) |
| 238 observed = data_store.FetchPerfData(test) | 238 observed = data_store.FetchPerfData(test) |
| 239 if not observed: return | 239 if not observed: return |
| 240 own_perf_estimate = observed / test.duration | 240 own_perf_estimate = observed / test.duration |
| 241 with self.perf_data_lock: | 241 with self.perf_data_lock: |
| 242 kLearnRateLimiter = 9999 | 242 kLearnRateLimiter = 9999 |
| 243 self.relative_perf *= kLearnRateLimiter | 243 self.relative_perf *= kLearnRateLimiter |
| 244 self.relative_perf += own_perf_estimate | 244 self.relative_perf += own_perf_estimate |
| 245 self.relative_perf /= (kLearnRateLimiter + 1) | 245 self.relative_perf /= (kLearnRateLimiter + 1) |
| OLD | NEW |