Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.utilities.general; | 8 library engine.utilities.general; |
| 9 | 9 |
| 10 import 'dart:profiler'; | 10 import 'dart:profiler'; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 } | 21 } |
| 22 | 22 |
| 23 static int finish(int hash) { | 23 static int finish(int hash) { |
| 24 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); | 24 hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3)); |
| 25 hash = hash ^ (hash >> 11); | 25 hash = hash ^ (hash >> 11); |
| 26 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); | 26 return 0x1fffffff & (hash + ((0x00003fff & hash) << 15)); |
| 27 } | 27 } |
| 28 | 28 |
| 29 static int hash2(a, b) => finish(combine(combine(0, a), b)); | 29 static int hash2(a, b) => finish(combine(combine(0, a), b)); |
| 30 | 30 |
| 31 static int hash3(a, b, c) => finish(combine(combine(combine(0, a), b), c)); | |
|
Brian Wilkerson
2015/05/23 15:58:50
Perhaps something more general would be better (al
| |
| 32 | |
| 31 static int hash4(a, b, c, d) => | 33 static int hash4(a, b, c, d) => |
| 32 finish(combine(combine(combine(combine(0, a), b), c), d)); | 34 finish(combine(combine(combine(combine(0, a), b), c), d)); |
| 33 } | 35 } |
| 34 | 36 |
| 35 /** | 37 /** |
| 36 * Helper class for gathering performance statistics. This class is modeled on | 38 * Helper class for gathering performance statistics. This class is modeled on |
| 37 * the UserTag class in dart:profiler so that it can interoperate easily with | 39 * the UserTag class in dart:profiler so that it can interoperate easily with |
| 38 * it. | 40 * it. |
| 39 */ | 41 */ |
| 40 abstract class PerformanceTag { | 42 abstract class PerformanceTag { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 | 148 |
| 147 makeCurrentWhile(f()) { | 149 makeCurrentWhile(f()) { |
| 148 PerformanceTag prevTag = makeCurrent(); | 150 PerformanceTag prevTag = makeCurrent(); |
| 149 try { | 151 try { |
| 150 return f(); | 152 return f(); |
| 151 } finally { | 153 } finally { |
| 152 prevTag.makeCurrent(); | 154 prevTag.makeCurrent(); |
| 153 } | 155 } |
| 154 } | 156 } |
| 155 } | 157 } |
| OLD | NEW |