OLD | NEW |
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 21 matching lines...) Expand all Loading... |
32 define READ_ONLY = 1; | 32 define READ_ONLY = 1; |
33 define DONT_ENUM = 2; | 33 define DONT_ENUM = 2; |
34 define DONT_DELETE = 4; | 34 define DONT_DELETE = 4; |
35 define NEW_ONE_BYTE_STRING = true; | 35 define NEW_ONE_BYTE_STRING = true; |
36 define 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 define GETTER = 0; | 39 define GETTER = 0; |
40 define SETTER = 1; | 40 define SETTER = 1; |
41 | 41 |
42 # Safe maximum number of arguments to push to stack, when multiplied by | |
43 # pointer size. Used by Function.prototype.apply(), Reflect.apply() and | |
44 # Reflect.construct(). | |
45 define kSafeArgumentsLength = 0x800000; | |
46 | |
47 # 2^53 - 1 | 42 # 2^53 - 1 |
48 define kMaxSafeInteger = 9007199254740991; | 43 define kMaxSafeInteger = 9007199254740991; |
49 | 44 |
50 # 2^32 - 1 | 45 # 2^32 - 1 |
51 define kMaxUint32 = 4294967295; | 46 define kMaxUint32 = 4294967295; |
52 | 47 |
53 # Strict mode flags for passing to %SetProperty | 48 # Strict mode flags for passing to %SetProperty |
54 define kSloppyMode = 0; | 49 define kSloppyMode = 0; |
55 define kStrictMode = 1; | 50 define kStrictMode = 1; |
56 | 51 |
57 # Native cache ids. | 52 # Native cache ids. |
58 define STRING_TO_REGEXP_CACHE_ID = 0; | 53 define STRING_TO_REGEXP_CACHE_ID = 0; |
59 | 54 |
60 # Type query macros. | 55 # Type query macros. |
61 # | 56 # |
62 # Note: We have special support for typeof(foo) === 'bar' in the compiler. | 57 # Note: We have special support for typeof(foo) === 'bar' in the compiler. |
63 # It will *not* generate a runtime typeof call for the most important | 58 # It will *not* generate a runtime typeof call for the most important |
64 # values of 'bar'. | 59 # values of 'bar'. |
65 macro IS_ARRAY(arg) = (%_IsArray(arg)); | 60 macro IS_ARRAY(arg) = (%_IsArray(arg)); |
66 macro IS_ARRAYBUFFER(arg) = (%_ClassOf(arg) === 'ArrayBuffer'); | 61 macro IS_ARRAYBUFFER(arg) = (%_ClassOf(arg) === 'ArrayBuffer'); |
67 macro IS_BOOLEAN(arg) = (typeof(arg) === 'boolean'); | 62 macro IS_BOOLEAN(arg) = (typeof(arg) === 'boolean'); |
68 macro IS_BOOLEAN_WRAPPER(arg) = (%_ClassOf(arg) === 'Boolean'); | |
69 macro IS_DATAVIEW(arg) = (%_ClassOf(arg) === 'DataView'); | 63 macro IS_DATAVIEW(arg) = (%_ClassOf(arg) === 'DataView'); |
70 macro IS_DATE(arg) = (%IsDate(arg)); | 64 macro IS_DATE(arg) = (%IsDate(arg)); |
71 macro IS_ERROR(arg) = (%_ClassOf(arg) === 'Error'); | 65 macro IS_ERROR(arg) = (%_ClassOf(arg) === 'Error'); |
72 macro IS_FUNCTION(arg) = (%IsFunction(arg)); | 66 macro IS_FUNCTION(arg) = (%IsFunction(arg)); |
73 macro IS_GENERATOR(arg) = (%_ClassOf(arg) === 'Generator'); | 67 macro IS_GENERATOR(arg) = (%_ClassOf(arg) === 'Generator'); |
74 macro IS_GLOBAL(arg) = (%_ClassOf(arg) === 'global'); | 68 macro IS_GLOBAL(arg) = (%_ClassOf(arg) === 'global'); |
75 macro IS_MAP(arg) = (%_ClassOf(arg) === 'Map'); | 69 macro IS_MAP(arg) = (%_ClassOf(arg) === 'Map'); |
76 macro IS_MAP_ITERATOR(arg) = (%_ClassOf(arg) === 'Map Iterator'); | 70 macro IS_MAP_ITERATOR(arg) = (%_ClassOf(arg) === 'Map Iterator'); |
77 macro IS_NULL(arg) = (arg === null); | 71 macro IS_NULL(arg) = (arg === null); |
78 macro IS_NULL_OR_UNDEFINED(arg) = (arg == null); | 72 macro IS_NULL_OR_UNDEFINED(arg) = (arg == null); |
79 macro IS_NUMBER(arg) = (typeof(arg) === 'number'); | 73 macro IS_NUMBER(arg) = (typeof(arg) === 'number'); |
80 macro IS_NUMBER_WRAPPER(arg) = (%_ClassOf(arg) === 'Number'); | |
81 macro IS_OBJECT(arg) = (typeof(arg) === 'object'); | 74 macro IS_OBJECT(arg) = (typeof(arg) === 'object'); |
82 macro IS_PROXY(arg) = (%_IsJSProxy(arg)); | 75 macro IS_PROXY(arg) = (%_IsJSProxy(arg)); |
83 macro IS_REGEXP(arg) = (%_IsRegExp(arg)); | 76 macro IS_REGEXP(arg) = (%_IsRegExp(arg)); |
84 macro IS_SCRIPT(arg) = (%_ClassOf(arg) === 'Script'); | 77 macro IS_SCRIPT(arg) = (%_ClassOf(arg) === 'Script'); |
85 macro IS_SET(arg) = (%_ClassOf(arg) === 'Set'); | 78 macro IS_SET(arg) = (%_ClassOf(arg) === 'Set'); |
86 macro IS_SET_ITERATOR(arg) = (%_ClassOf(arg) === 'Set Iterator'); | 79 macro IS_SET_ITERATOR(arg) = (%_ClassOf(arg) === 'Set Iterator'); |
87 macro IS_SHAREDARRAYBUFFER(arg) = (%_ClassOf(arg) === 'SharedArrayBuffer'); | 80 macro IS_SHAREDARRAYBUFFER(arg) = (%_ClassOf(arg) === 'SharedArrayBuffer'); |
88 macro IS_SIMD_VALUE(arg) = (%IsSimdValue(arg)); | 81 macro IS_SIMD_VALUE(arg) = (%IsSimdValue(arg)); |
89 macro IS_STRING(arg) = (typeof(arg) === 'string'); | 82 macro IS_STRING(arg) = (typeof(arg) === 'string'); |
90 macro IS_STRING_WRAPPER(arg) = (%_ClassOf(arg) === 'String'); | |
91 macro IS_SYMBOL(arg) = (typeof(arg) === 'symbol'); | 83 macro IS_SYMBOL(arg) = (typeof(arg) === 'symbol'); |
92 macro IS_SYMBOL_WRAPPER(arg) = (%_ClassOf(arg) === 'Symbol'); | |
93 macro IS_TYPEDARRAY(arg) = (%_IsTypedArray(arg)); | 84 macro IS_TYPEDARRAY(arg) = (%_IsTypedArray(arg)); |
94 macro IS_UNDEFINED(arg) = (arg === (void 0)); | 85 macro IS_UNDEFINED(arg) = (arg === (void 0)); |
95 macro IS_WEAKMAP(arg) = (%_ClassOf(arg) === 'WeakMap'); | 86 macro IS_WEAKMAP(arg) = (%_ClassOf(arg) === 'WeakMap'); |
96 macro IS_WEAKSET(arg) = (%_ClassOf(arg) === 'WeakSet'); | 87 macro IS_WEAKSET(arg) = (%_ClassOf(arg) === 'WeakSet'); |
97 | 88 |
98 # Macro for ES queries of the type: "Type(O) is Object." | 89 # Macro for ES queries of the type: "Type(O) is Object." |
99 macro IS_RECEIVER(arg) = (%_IsJSReceiver(arg)); | 90 macro IS_RECEIVER(arg) = (%_IsJSReceiver(arg)); |
100 | 91 |
101 # Macro for ES queries of the type: "IsCallable(O)" | 92 # Macro for ES queries of the type: "IsCallable(O)" |
102 macro IS_CALLABLE(arg) = (typeof(arg) === 'function'); | 93 macro IS_CALLABLE(arg) = (typeof(arg) === 'function'); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 define kSloppyModeBlockScopedFunctionRedefinition = 22; | 250 define kSloppyModeBlockScopedFunctionRedefinition = 22; |
260 define kForInInitializer = 23; | 251 define kForInInitializer = 23; |
261 define kArrayProtectorDirtied = 24; | 252 define kArrayProtectorDirtied = 24; |
262 define kArraySpeciesModified = 25; | 253 define kArraySpeciesModified = 25; |
263 define kArrayPrototypeConstructorModified = 26; | 254 define kArrayPrototypeConstructorModified = 26; |
264 define kArrayInstanceProtoModified = 27; | 255 define kArrayInstanceProtoModified = 27; |
265 define kArrayInstanceConstructorModified = 28; | 256 define kArrayInstanceConstructorModified = 28; |
266 define kLegacyFunctionDeclaration = 29; | 257 define kLegacyFunctionDeclaration = 29; |
267 define kRegExpPrototypeSourceGetter = 30; | 258 define kRegExpPrototypeSourceGetter = 30; |
268 define kRegExpPrototypeOldFlagGetter = 31; | 259 define kRegExpPrototypeOldFlagGetter = 31; |
OLD | NEW |