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

Side by Side Diff: src/macros.py

Issue 947683002: Reimplement Maps and Sets in JS (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Merged to master Created 5 years, 8 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 | « src/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.cc » ('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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 const PROPERTY_ATTRIBUTES_NONE = 0; 269 const PROPERTY_ATTRIBUTES_NONE = 0;
270 const PROPERTY_ATTRIBUTES_STRING = 8; 270 const PROPERTY_ATTRIBUTES_STRING = 8;
271 const PROPERTY_ATTRIBUTES_SYMBOLIC = 16; 271 const PROPERTY_ATTRIBUTES_SYMBOLIC = 16;
272 const PROPERTY_ATTRIBUTES_PRIVATE_SYMBOL = 32; 272 const PROPERTY_ATTRIBUTES_PRIVATE_SYMBOL = 32;
273 273
274 # Use for keys, values and entries iterators. 274 # Use for keys, values and entries iterators.
275 const ITERATOR_KIND_KEYS = 1; 275 const ITERATOR_KIND_KEYS = 1;
276 const ITERATOR_KIND_VALUES = 2; 276 const ITERATOR_KIND_VALUES = 2;
277 const ITERATOR_KIND_ENTRIES = 3; 277 const ITERATOR_KIND_ENTRIES = 3;
278 278
279 macro FIXED_ARRAY_GET(array, index) = (%_FixedArrayGet(array, (index) | 0));
280 macro FIXED_ARRAY_SET(array, index, value) = (%_FixedArraySet(array, (index) | 0 , value));
281 # TODO(adamk): Find a more robust way to force Smi representation.
282 macro FIXED_ARRAY_SET_SMI(array, index, value) = (FIXED_ARRAY_SET(array, index, (value) | 0));
283
284 macro ORDERED_HASH_TABLE_BUCKET_COUNT(table) = (FIXED_ARRAY_GET(table, 0));
285 macro ORDERED_HASH_TABLE_ELEMENT_COUNT(table) = (FIXED_ARRAY_GET(table, 1));
286 macro ORDERED_HASH_TABLE_SET_ELEMENT_COUNT(table, count) = (FIXED_ARRAY_SET_SMI( table, 1, count));
287 macro ORDERED_HASH_TABLE_DELETED_COUNT(table) = (FIXED_ARRAY_GET(table, 2));
288 macro ORDERED_HASH_TABLE_SET_DELETED_COUNT(table, count) = (FIXED_ARRAY_SET_SMI( table, 2, count));
289 macro ORDERED_HASH_TABLE_BUCKET_AT(table, bucket) = (FIXED_ARRAY_GET(table, 3 + (bucket)));
290 macro ORDERED_HASH_TABLE_SET_BUCKET_AT(table, bucket, entry) = (FIXED_ARRAY_SET( table, 3 + (bucket), entry));
291
292 macro ORDERED_HASH_TABLE_HASH_TO_BUCKET(hash, numBuckets) = (hash & ((numBuckets ) - 1));
293
294 macro ORDERED_HASH_SET_ENTRY_TO_INDEX(entry, numBuckets) = (3 + (numBuckets) + ( (entry) << 1));
295 macro ORDERED_HASH_SET_KEY_AT(table, entry, numBuckets) = (FIXED_ARRAY_GET(table , ORDERED_HASH_SET_ENTRY_TO_INDEX(entry, numBuckets)));
296 macro ORDERED_HASH_SET_CHAIN_AT(table, entry, numBuckets) = (FIXED_ARRAY_GET(tab le, ORDERED_HASH_SET_ENTRY_TO_INDEX(entry, numBuckets) + 1));
297
298 macro ORDERED_HASH_MAP_ENTRY_TO_INDEX(entry, numBuckets) = (3 + (numBuckets) + ( (entry) * 3));
299 macro ORDERED_HASH_MAP_KEY_AT(table, entry, numBuckets) = (FIXED_ARRAY_GET(table , ORDERED_HASH_MAP_ENTRY_TO_INDEX(entry, numBuckets)));
300 macro ORDERED_HASH_MAP_VALUE_AT(table, entry, numBuckets) = (FIXED_ARRAY_GET(tab le, ORDERED_HASH_MAP_ENTRY_TO_INDEX(entry, numBuckets) + 1));
301 macro ORDERED_HASH_MAP_CHAIN_AT(table, entry, numBuckets) = (FIXED_ARRAY_GET(tab le, ORDERED_HASH_MAP_ENTRY_TO_INDEX(entry, numBuckets) + 2));
302
303 # Must match OrderedHashTable::kNotFound.
304 const NOT_FOUND = -1;
305
279 # Check whether debug is active. 306 # Check whether debug is active.
280 const DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); 307 const DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0);
281 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function)); 308 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function));
282 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi on)) %DebugPrepareStepInIfStepping(function); 309 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi on)) %DebugPrepareStepInIfStepping(function);
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698