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

Side by Side Diff: src/macros.py

Issue 1110963003: Use "define" instead of "const" for natives macros (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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/third_party/fdlibm/fdlibm.js » ('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 10 matching lines...) Expand all
21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 # Dictionary that is passed as defines for js2c.py. 28 # Dictionary that is passed as defines for js2c.py.
29 # Used for defines that must be defined for all native JS files. 29 # Used for defines that must be defined for all native JS files.
30 30
31 const NONE = 0; 31 define NONE = 0;
32 const READ_ONLY = 1; 32 define READ_ONLY = 1;
33 const DONT_ENUM = 2; 33 define DONT_ENUM = 2;
34 const DONT_DELETE = 4; 34 define DONT_DELETE = 4;
35 const NEW_ONE_BYTE_STRING = true; 35 define NEW_ONE_BYTE_STRING = true;
36 const NEW_TWO_BYTE_STRING = false; 36 define NEW_TWO_BYTE_STRING = false;
37 37
38 # Constants used for getter and setter operations. 38 # Constants used for getter and setter operations.
39 const GETTER = 0; 39 define GETTER = 0;
40 const SETTER = 1; 40 define SETTER = 1;
41 41
42 const NO_HINT = 0; 42 define NO_HINT = 0;
43 const NUMBER_HINT = 1; 43 define NUMBER_HINT = 1;
44 const STRING_HINT = 2; 44 define STRING_HINT = 2;
45 45
46 # For date.js. 46 # For date.js.
47 const HoursPerDay = 24; 47 define HoursPerDay = 24;
48 const MinutesPerHour = 60; 48 define MinutesPerHour = 60;
49 const SecondsPerMinute = 60; 49 define SecondsPerMinute = 60;
50 const msPerSecond = 1000; 50 define msPerSecond = 1000;
51 const msPerMinute = 60000; 51 define msPerMinute = 60000;
52 const msPerHour = 3600000; 52 define msPerHour = 3600000;
53 const msPerDay = 86400000; 53 define msPerDay = 86400000;
54 const msPerMonth = 2592000000; 54 define msPerMonth = 2592000000;
55 55
56 # Note: kDayZeroInJulianDay = ToJulianDay(1970, 0, 1). 56 # Note: kDayZeroInJulianDay = ToJulianDay(1970, 0, 1).
57 const kInvalidDate = 'Invalid Date'; 57 define kInvalidDate = 'Invalid Date';
58 const kDayZeroInJulianDay = 2440588; 58 define kDayZeroInJulianDay = 2440588;
59 const kMonthMask = 0x1e0; 59 define kMonthMask = 0x1e0;
60 const kDayMask = 0x01f; 60 define kDayMask = 0x01f;
61 const kYearShift = 9; 61 define kYearShift = 9;
62 const kMonthShift = 5; 62 define kMonthShift = 5;
63 63
64 # Limits for parts of the date, so that we support all the dates that 64 # Limits for parts of the date, so that we support all the dates that
65 # ECMA 262 - 15.9.1.1 requires us to, but at the same time be sure that 65 # ECMA 262 - 15.9.1.1 requires us to, but at the same time be sure that
66 # the date (days since 1970) is in SMI range. 66 # the date (days since 1970) is in SMI range.
67 const kMinYear = -1000000; 67 define kMinYear = -1000000;
68 const kMaxYear = 1000000; 68 define kMaxYear = 1000000;
69 const kMinMonth = -10000000; 69 define kMinMonth = -10000000;
70 const kMaxMonth = 10000000; 70 define kMaxMonth = 10000000;
71 71
72 # Safe maximum number of arguments to push to stack, when multiplied by 72 # Safe maximum number of arguments to push to stack, when multiplied by
73 # pointer size. Used by Function.prototype.apply(), Reflect.apply() and 73 # pointer size. Used by Function.prototype.apply(), Reflect.apply() and
74 # Reflect.construct(). 74 # Reflect.construct().
75 const kSafeArgumentsLength = 0x800000; 75 define kSafeArgumentsLength = 0x800000;
76 76
77 # Strict mode flags for passing to %SetProperty 77 # Strict mode flags for passing to %SetProperty
78 const kSloppyMode = 0; 78 define kSloppyMode = 0;
79 const kStrictMode = 1; 79 define kStrictMode = 1;
80 80
81 # Native cache ids. 81 # Native cache ids.
82 const STRING_TO_REGEXP_CACHE_ID = 0; 82 define STRING_TO_REGEXP_CACHE_ID = 0;
83 83
84 # Type query macros. 84 # Type query macros.
85 # 85 #
86 # Note: We have special support for typeof(foo) === 'bar' in the compiler. 86 # Note: We have special support for typeof(foo) === 'bar' in the compiler.
87 # It will *not* generate a runtime typeof call for the most important 87 # It will *not* generate a runtime typeof call for the most important
88 # values of 'bar'. 88 # values of 'bar'.
89 macro IS_NULL(arg) = (arg === null); 89 macro IS_NULL(arg) = (arg === null);
90 macro IS_NULL_OR_UNDEFINED(arg) = (arg == null); 90 macro IS_NULL_OR_UNDEFINED(arg) = (arg == null);
91 macro IS_UNDEFINED(arg) = (arg === (void 0)); 91 macro IS_UNDEFINED(arg) = (arg === (void 0));
92 macro IS_NUMBER(arg) = (typeof(arg) === 'number'); 92 macro IS_NUMBER(arg) = (typeof(arg) === 'number');
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 # We assume here that this is the same as being either a function or a function 129 # We assume here that this is the same as being either a function or a function
130 # proxy. That ignores host objects with [[Call]] methods, but in most situations 130 # proxy. That ignores host objects with [[Call]] methods, but in most situations
131 # we cannot handle those anyway. 131 # we cannot handle those anyway.
132 macro IS_SPEC_FUNCTION(arg) = (%_ClassOf(arg) === 'Function'); 132 macro IS_SPEC_FUNCTION(arg) = (%_ClassOf(arg) === 'Function');
133 133
134 # Macro for ES6 CheckObjectCoercible 134 # Macro for ES6 CheckObjectCoercible
135 # Will throw a TypeError of the form "[functionName] called on null or undefined ". 135 # Will throw a TypeError of the form "[functionName] called on null or undefined ".
136 macro CHECK_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL_OR_UNDEFINED(arg) && !IS_UNDETECTABLE(arg)) throw MakeTypeError(kCalledOnNullOrUndefined, function Name); 136 macro CHECK_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL_OR_UNDEFINED(arg) && !IS_UNDETECTABLE(arg)) throw MakeTypeError(kCalledOnNullOrUndefined, function Name);
137 137
138 # Indices in bound function info retrieved by %BoundFunctionGetBindings(...). 138 # Indices in bound function info retrieved by %BoundFunctionGetBindings(...).
139 const kBoundFunctionIndex = 0; 139 define kBoundFunctionIndex = 0;
140 const kBoundThisIndex = 1; 140 define kBoundThisIndex = 1;
141 const kBoundArgumentsStartIndex = 2; 141 define kBoundArgumentsStartIndex = 2;
142 142
143 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. 143 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once.
144 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); 144 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg));
145 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg != 1/0) && (arg != -1/0))); 145 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg != 1/0) && (arg != -1/0)));
146 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber (arg))); 146 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber (arg)));
147 macro TO_INTEGER_FOR_SIDE_EFFECT(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToNumber( arg)); 147 macro TO_INTEGER_FOR_SIDE_EFFECT(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToNumber( arg));
148 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI ntegerMapMinusZero(ToNumber(arg))); 148 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI ntegerMapMinusZero(ToNumber(arg)));
149 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); 149 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0));
150 macro TO_UINT32(arg) = (arg >>> 0); 150 macro TO_UINT32(arg) = (arg >>> 0);
151 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString (arg)); 151 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString (arg));
(...skipping 10 matching lines...) Expand all
162 macro GLOBAL_PRIVATE(name) = (%CreateGlobalPrivateOwnSymbol(name)); 162 macro GLOBAL_PRIVATE(name) = (%CreateGlobalPrivateOwnSymbol(name));
163 macro NEW_PRIVATE_OWN(name) = (%CreatePrivateOwnSymbol(name)); 163 macro NEW_PRIVATE_OWN(name) = (%CreatePrivateOwnSymbol(name));
164 macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym)); 164 macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym));
165 macro HAS_PRIVATE(obj, sym) = (%HasOwnProperty(obj, sym)); 165 macro HAS_PRIVATE(obj, sym) = (%HasOwnProperty(obj, sym));
166 macro HAS_DEFINED_PRIVATE(obj, sym) = (!IS_UNDEFINED(obj[sym])); 166 macro HAS_DEFINED_PRIVATE(obj, sym) = (!IS_UNDEFINED(obj[sym]));
167 macro GET_PRIVATE(obj, sym) = (obj[sym]); 167 macro GET_PRIVATE(obj, sym) = (obj[sym]);
168 macro SET_PRIVATE(obj, sym, val) = (obj[sym] = val); 168 macro SET_PRIVATE(obj, sym, val) = (obj[sym] = val);
169 macro DELETE_PRIVATE(obj, sym) = (delete obj[sym]); 169 macro DELETE_PRIVATE(obj, sym) = (delete obj[sym]);
170 170
171 # Constants. The compiler constant folds them. 171 # Constants. The compiler constant folds them.
172 const NAN = $NaN; 172 define NAN = $NaN;
173 const INFINITY = (1/0); 173 define INFINITY = (1/0);
174 const UNDEFINED = (void 0); 174 define UNDEFINED = (void 0);
175 175
176 # Macros implemented in Python. 176 # Macros implemented in Python.
177 python macro CHAR_CODE(str) = ord(str[1]); 177 python macro CHAR_CODE(str) = ord(str[1]);
178 178
179 # Constants used on an array to implement the properties of the RegExp object. 179 # Constants used on an array to implement the properties of the RegExp object.
180 const REGEXP_NUMBER_OF_CAPTURES = 0; 180 define REGEXP_NUMBER_OF_CAPTURES = 0;
181 const REGEXP_FIRST_CAPTURE = 3; 181 define REGEXP_FIRST_CAPTURE = 3;
182 182
183 # We can't put macros in macros so we use constants here. 183 # We can't put macros in macros so we use constants here.
184 # REGEXP_NUMBER_OF_CAPTURES 184 # REGEXP_NUMBER_OF_CAPTURES
185 macro NUMBER_OF_CAPTURES(array) = ((array)[0]); 185 macro NUMBER_OF_CAPTURES(array) = ((array)[0]);
186 186
187 # Limit according to ECMA 262 15.9.1.1 187 # Limit according to ECMA 262 15.9.1.1
188 const MAX_TIME_MS = 8640000000000000; 188 define MAX_TIME_MS = 8640000000000000;
189 # Limit which is MAX_TIME_MS + msPerMonth. 189 # Limit which is MAX_TIME_MS + msPerMonth.
190 const MAX_TIME_BEFORE_UTC = 8640002592000000; 190 define MAX_TIME_BEFORE_UTC = 8640002592000000;
191 191
192 # Gets the value of a Date object. If arg is not a Date object 192 # Gets the value of a Date object. If arg is not a Date object
193 # a type error is thrown. 193 # a type error is thrown.
194 macro CHECK_DATE(arg) = if (%_ClassOf(arg) !== 'Date') throw MakeTypeError(kDate Type); 194 macro CHECK_DATE(arg) = if (%_ClassOf(arg) !== 'Date') throw MakeTypeError(kDate Type);
195 macro LOCAL_DATE_VALUE(arg) = (%_DateField(arg, 0) + %_DateField(arg, 21)); 195 macro LOCAL_DATE_VALUE(arg) = (%_DateField(arg, 0) + %_DateField(arg, 21));
196 macro UTC_DATE_VALUE(arg) = (%_DateField(arg, 0)); 196 macro UTC_DATE_VALUE(arg) = (%_DateField(arg, 0));
197 197
198 macro LOCAL_YEAR(arg) = (%_DateField(arg, 1)); 198 macro LOCAL_YEAR(arg) = (%_DateField(arg, 1));
199 macro LOCAL_MONTH(arg) = (%_DateField(arg, 2)); 199 macro LOCAL_MONTH(arg) = (%_DateField(arg, 2));
200 macro LOCAL_DAY(arg) = (%_DateField(arg, 3)); 200 macro LOCAL_DAY(arg) = (%_DateField(arg, 3));
(...skipping 15 matching lines...) Expand all
216 macro UTC_MS(arg) = (%_DateField(arg, 18)); 216 macro UTC_MS(arg) = (%_DateField(arg, 18));
217 macro UTC_DAYS(arg) = (%_DateField(arg, 19)); 217 macro UTC_DAYS(arg) = (%_DateField(arg, 19));
218 macro UTC_TIME_IN_DAY(arg) = (%_DateField(arg, 20)); 218 macro UTC_TIME_IN_DAY(arg) = (%_DateField(arg, 20));
219 219
220 macro TIMEZONE_OFFSET(arg) = (%_DateField(arg, 21)); 220 macro TIMEZONE_OFFSET(arg) = (%_DateField(arg, 21));
221 221
222 macro SET_UTC_DATE_VALUE(arg, value) = (%DateSetValue(arg, value, 1)); 222 macro SET_UTC_DATE_VALUE(arg, value) = (%DateSetValue(arg, value, 1));
223 macro SET_LOCAL_DATE_VALUE(arg, value) = (%DateSetValue(arg, value, 0)); 223 macro SET_LOCAL_DATE_VALUE(arg, value) = (%DateSetValue(arg, value, 0));
224 224
225 # Last input and last subject of regexp matches. 225 # Last input and last subject of regexp matches.
226 const LAST_SUBJECT_INDEX = 1; 226 define LAST_SUBJECT_INDEX = 1;
227 macro LAST_SUBJECT(array) = ((array)[1]); 227 macro LAST_SUBJECT(array) = ((array)[1]);
228 macro LAST_INPUT(array) = ((array)[2]); 228 macro LAST_INPUT(array) = ((array)[2]);
229 229
230 # REGEXP_FIRST_CAPTURE 230 # REGEXP_FIRST_CAPTURE
231 macro CAPTURE(index) = (3 + (index)); 231 macro CAPTURE(index) = (3 + (index));
232 const CAPTURE0 = 3; 232 define CAPTURE0 = 3;
233 const CAPTURE1 = 4; 233 define CAPTURE1 = 4;
234 234
235 # For the regexp capture override array. This has the same 235 # For the regexp capture override array. This has the same
236 # format as the arguments to a function called from 236 # format as the arguments to a function called from
237 # String.prototype.replace. 237 # String.prototype.replace.
238 macro OVERRIDE_MATCH(override) = ((override)[0]); 238 macro OVERRIDE_MATCH(override) = ((override)[0]);
239 macro OVERRIDE_POS(override) = ((override)[(override).length - 2]); 239 macro OVERRIDE_POS(override) = ((override)[(override).length - 2]);
240 macro OVERRIDE_SUBJECT(override) = ((override)[(override).length - 1]); 240 macro OVERRIDE_SUBJECT(override) = ((override)[(override).length - 1]);
241 # 1-based so index of 1 returns the first capture 241 # 1-based so index of 1 returns the first capture
242 macro OVERRIDE_CAPTURE(override, index) = ((override)[(index)]); 242 macro OVERRIDE_CAPTURE(override, index) = ((override)[(index)]);
243 243
244 # PropertyDescriptor return value indices - must match 244 # PropertyDescriptor return value indices - must match
245 # PropertyDescriptorIndices in runtime-object.cc. 245 # PropertyDescriptorIndices in runtime-object.cc.
246 const IS_ACCESSOR_INDEX = 0; 246 define IS_ACCESSOR_INDEX = 0;
247 const VALUE_INDEX = 1; 247 define VALUE_INDEX = 1;
248 const GETTER_INDEX = 2; 248 define GETTER_INDEX = 2;
249 const SETTER_INDEX = 3; 249 define SETTER_INDEX = 3;
250 const WRITABLE_INDEX = 4; 250 define WRITABLE_INDEX = 4;
251 const ENUMERABLE_INDEX = 5; 251 define ENUMERABLE_INDEX = 5;
252 const CONFIGURABLE_INDEX = 6; 252 define CONFIGURABLE_INDEX = 6;
253 253
254 # For messages.js 254 # For messages.js
255 # Matches Script::Type from objects.h 255 # Matches Script::Type from objects.h
256 const TYPE_NATIVE = 0; 256 define TYPE_NATIVE = 0;
257 const TYPE_EXTENSION = 1; 257 define TYPE_EXTENSION = 1;
258 const TYPE_NORMAL = 2; 258 define TYPE_NORMAL = 2;
259 259
260 # Matches Script::CompilationType from objects.h 260 # Matches Script::CompilationType from objects.h
261 const COMPILATION_TYPE_HOST = 0; 261 define COMPILATION_TYPE_HOST = 0;
262 const COMPILATION_TYPE_EVAL = 1; 262 define COMPILATION_TYPE_EVAL = 1;
263 const COMPILATION_TYPE_JSON = 2; 263 define COMPILATION_TYPE_JSON = 2;
264 264
265 # Matches Messages::kNoLineNumberInfo from v8.h 265 # Matches Messages::kNoLineNumberInfo from v8.h
266 const kNoLineNumberInfo = 0; 266 define kNoLineNumberInfo = 0;
267 267
268 # Matches PropertyAttributes from property-details.h 268 # Matches PropertyAttributes from property-details.h
269 const PROPERTY_ATTRIBUTES_NONE = 0; 269 define PROPERTY_ATTRIBUTES_NONE = 0;
270 const PROPERTY_ATTRIBUTES_STRING = 8; 270 define PROPERTY_ATTRIBUTES_STRING = 8;
271 const PROPERTY_ATTRIBUTES_SYMBOLIC = 16; 271 define PROPERTY_ATTRIBUTES_SYMBOLIC = 16;
272 const PROPERTY_ATTRIBUTES_PRIVATE_SYMBOL = 32; 272 define 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 define ITERATOR_KIND_KEYS = 1;
276 const ITERATOR_KIND_VALUES = 2; 276 define ITERATOR_KIND_VALUES = 2;
277 const ITERATOR_KIND_ENTRIES = 3; 277 define ITERATOR_KIND_ENTRIES = 3;
278 278
279 macro FIXED_ARRAY_GET(array, index) = (%_FixedArrayGet(array, (index) | 0)); 279 macro FIXED_ARRAY_GET(array, index) = (%_FixedArrayGet(array, (index) | 0));
280 macro FIXED_ARRAY_SET(array, index, value) = (%_FixedArraySet(array, (index) | 0 , value)); 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. 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)); 282 macro FIXED_ARRAY_SET_SMI(array, index, value) = (FIXED_ARRAY_SET(array, index, (value) | 0));
283 283
284 macro ORDERED_HASH_TABLE_BUCKET_COUNT(table) = (FIXED_ARRAY_GET(table, 0)); 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)); 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)); 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)); 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)); 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))); 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)); 290 macro ORDERED_HASH_TABLE_SET_BUCKET_AT(table, bucket, entry) = (FIXED_ARRAY_SET( table, 3 + (bucket), entry));
291 291
292 macro ORDERED_HASH_TABLE_HASH_TO_BUCKET(hash, numBuckets) = (hash & ((numBuckets ) - 1)); 292 macro ORDERED_HASH_TABLE_HASH_TO_BUCKET(hash, numBuckets) = (hash & ((numBuckets ) - 1));
293 293
294 macro ORDERED_HASH_SET_ENTRY_TO_INDEX(entry, numBuckets) = (3 + (numBuckets) + ( (entry) << 1)); 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))); 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)); 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 297
298 macro ORDERED_HASH_MAP_ENTRY_TO_INDEX(entry, numBuckets) = (3 + (numBuckets) + ( (entry) * 3)); 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))); 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)); 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)); 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 302
303 # Must match OrderedHashTable::kNotFound. 303 # Must match OrderedHashTable::kNotFound.
304 const NOT_FOUND = -1; 304 define NOT_FOUND = -1;
305 305
306 # Check whether debug is active. 306 # Check whether debug is active.
307 const DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); 307 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0);
308 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function)); 308 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function));
309 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 | « no previous file | src/third_party/fdlibm/fdlibm.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698