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

Side by Side Diff: pkg/kernel/lib/type_propagation/canonicalizer.dart

Issue 2561723003: Merge kernel closure conversion into the Dart SDK (Closed)
Patch Set: Remove path constraint Created 4 years 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library kernel.type_propagation.canonicalizer; 4 library kernel.type_propagation.canonicalizer;
5 5
6 import 'dart:collection'; 6 import 'dart:collection';
7 7
8 /// Generates unique consecutive integer IDs for tuples of variable length. 8 /// Generates unique consecutive integer IDs for tuples of variable length.
9 class TupleCanonicalizer { 9 class TupleCanonicalizer {
10 final HashMap<List<Object>, int> _table = new HashMap<List<Object>, int>( 10 final HashMap<List<Object>, int> _table = new HashMap<List<Object>, int>(
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } 92 }
93 93
94 /// Associates [value] with the pair previously queried using [lookup]. 94 /// Associates [value] with the pair previously queried using [lookup].
95 void put(T value) { 95 void put(T value) {
96 _table[_key] = value; 96 _table[_key] = value;
97 } 97 }
98 98
99 Iterable<T> get values => _table.values; 99 Iterable<T> get values => _table.values;
100 100
101 static int _bigintHash(int bigint) { 101 static int _bigintHash(int bigint) {
102 » int x = 0x3fffffff & (bigint >> 31); 102 int x = 0x3fffffff & (bigint >> 31);
103 » int y = 0x3fffffff & bigint; 103 int y = 0x3fffffff & bigint;
104 int hash = 0x3fffffff & (x * 1367); 104 int hash = 0x3fffffff & (x * 1367);
105 hash = 0x3fffffff & (y * 31 + hash ^ y); 105 hash = 0x3fffffff & (y * 31 + hash ^ y);
106 hash = 0x3fffffff & ((x ^ y) * 31 + hash ^ y); 106 hash = 0x3fffffff & ((x ^ y) * 31 + hash ^ y);
107 return hash; 107 return hash;
108 } 108 }
109 } 109 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/transformations/closure_conversion.dart ('k') | pkg/kernel/lib/type_propagation/type_propagation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698