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

Side by Side Diff: src/js/macros.py

Issue 2630373002: [collections] Shuffle OrderedHashTable fields around for future optimization (Closed)
Patch Set: do the proper english thing Created 3 years, 11 months 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
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2006-2009 the V8 project authors. All rights reserved. 1 # Copyright 2006-2009 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 # Use for keys, values and entries iterators. 133 # Use for keys, values and entries iterators.
134 define ITERATOR_KIND_KEYS = 1; 134 define ITERATOR_KIND_KEYS = 1;
135 define ITERATOR_KIND_VALUES = 2; 135 define ITERATOR_KIND_VALUES = 2;
136 define ITERATOR_KIND_ENTRIES = 3; 136 define ITERATOR_KIND_ENTRIES = 3;
137 137
138 macro FIXED_ARRAY_GET(array, index) = (%_FixedArrayGet(array, (index) | 0)); 138 macro FIXED_ARRAY_GET(array, index) = (%_FixedArrayGet(array, (index) | 0));
139 macro FIXED_ARRAY_SET(array, index, value) = (%_FixedArraySet(array, (index) | 0 , value)); 139 macro FIXED_ARRAY_SET(array, index, value) = (%_FixedArraySet(array, (index) | 0 , value));
140 # TODO(adamk): Find a more robust way to force Smi representation. 140 # TODO(adamk): Find a more robust way to force Smi representation.
141 macro FIXED_ARRAY_SET_SMI(array, index, value) = (FIXED_ARRAY_SET(array, index, (value) | 0)); 141 macro FIXED_ARRAY_SET_SMI(array, index, value) = (FIXED_ARRAY_SET(array, index, (value) | 0));
142 142
143 macro ORDERED_HASH_TABLE_BUCKET_COUNT(table) = (FIXED_ARRAY_GET(table, 0)); 143 macro ORDERED_HASH_TABLE_BUCKET_COUNT(table) = (FIXED_ARRAY_GET(table, 2));
144 macro ORDERED_HASH_TABLE_ELEMENT_COUNT(table) = (FIXED_ARRAY_GET(table, 1)); 144 macro ORDERED_HASH_TABLE_ELEMENT_COUNT(table) = (FIXED_ARRAY_GET(table, 0));
145 macro ORDERED_HASH_TABLE_SET_ELEMENT_COUNT(table, count) = (FIXED_ARRAY_SET_SMI( table, 1, count)); 145 macro ORDERED_HASH_TABLE_SET_ELEMENT_COUNT(table, count) = (FIXED_ARRAY_SET_SMI( table, 0, count));
146 macro ORDERED_HASH_TABLE_DELETED_COUNT(table) = (FIXED_ARRAY_GET(table, 2)); 146 macro ORDERED_HASH_TABLE_DELETED_COUNT(table) = (FIXED_ARRAY_GET(table, 1));
147 macro ORDERED_HASH_TABLE_SET_DELETED_COUNT(table, count) = (FIXED_ARRAY_SET_SMI( table, 2, count)); 147 macro ORDERED_HASH_TABLE_SET_DELETED_COUNT(table, count) = (FIXED_ARRAY_SET_SMI( table, 1, count));
148 macro ORDERED_HASH_TABLE_BUCKET_AT(table, bucket) = (FIXED_ARRAY_GET(table, 3 + (bucket))); 148 macro ORDERED_HASH_TABLE_BUCKET_AT(table, bucket) = (FIXED_ARRAY_GET(table, 3 + (bucket)));
149 macro ORDERED_HASH_TABLE_SET_BUCKET_AT(table, bucket, entry) = (FIXED_ARRAY_SET( table, 3 + (bucket), entry)); 149 macro ORDERED_HASH_TABLE_SET_BUCKET_AT(table, bucket, entry) = (FIXED_ARRAY_SET( table, 3 + (bucket), entry));
150 150
151 macro ORDERED_HASH_TABLE_HASH_TO_BUCKET(hash, numBuckets) = (hash & ((numBuckets ) - 1)); 151 macro ORDERED_HASH_TABLE_HASH_TO_BUCKET(hash, numBuckets) = (hash & ((numBuckets ) - 1));
152 152
153 macro ORDERED_HASH_SET_ENTRY_TO_INDEX(entry, numBuckets) = (3 + (numBuckets) + ( (entry) << 1)); 153 macro ORDERED_HASH_SET_ENTRY_TO_INDEX(entry, numBuckets) = (3 + (numBuckets) + ( (entry) << 1));
154 macro ORDERED_HASH_SET_KEY_AT(table, entry, numBuckets) = (FIXED_ARRAY_GET(table , ORDERED_HASH_SET_ENTRY_TO_INDEX(entry, numBuckets))); 154 macro ORDERED_HASH_SET_KEY_AT(table, entry, numBuckets) = (FIXED_ARRAY_GET(table , ORDERED_HASH_SET_ENTRY_TO_INDEX(entry, numBuckets)));
155 macro ORDERED_HASH_SET_CHAIN_AT(table, entry, numBuckets) = (FIXED_ARRAY_GET(tab le, ORDERED_HASH_SET_ENTRY_TO_INDEX(entry, numBuckets) + 1)); 155 macro ORDERED_HASH_SET_CHAIN_AT(table, entry, numBuckets) = (FIXED_ARRAY_GET(tab le, ORDERED_HASH_SET_ENTRY_TO_INDEX(entry, numBuckets) + 1));
156 156
157 macro ORDERED_HASH_MAP_ENTRY_TO_INDEX(entry, numBuckets) = (3 + (numBuckets) + ( (entry) * 3)); 157 macro ORDERED_HASH_MAP_ENTRY_TO_INDEX(entry, numBuckets) = (3 + (numBuckets) + ( (entry) * 3));
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 define kSloppyModeBlockScopedFunctionRedefinition = 22; 189 define kSloppyModeBlockScopedFunctionRedefinition = 22;
190 define kForInInitializer = 23; 190 define kForInInitializer = 23;
191 define kArrayProtectorDirtied = 24; 191 define kArrayProtectorDirtied = 24;
192 define kArraySpeciesModified = 25; 192 define kArraySpeciesModified = 25;
193 define kArrayPrototypeConstructorModified = 26; 193 define kArrayPrototypeConstructorModified = 26;
194 define kArrayInstanceProtoModified = 27; 194 define kArrayInstanceProtoModified = 27;
195 define kArrayInstanceConstructorModified = 28; 195 define kArrayInstanceConstructorModified = 28;
196 define kLegacyFunctionDeclaration = 29; 196 define kLegacyFunctionDeclaration = 29;
197 define kRegExpPrototypeSourceGetter = 30; 197 define kRegExpPrototypeSourceGetter = 30;
198 define kRegExpPrototypeOldFlagGetter = 31; 198 define kRegExpPrototypeOldFlagGetter = 31;
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698