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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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'); |
93 macro IS_FLOAT32X4(arg) = (typeof(arg) === 'float32x4'); | 93 macro IS_FLOAT32X4(arg) = (typeof(arg) === 'float32x4'); |
94 macro IS_INT32X4(arg) = (typeof(arg) === 'int32x4'); | |
95 macro IS_BOOL32X4(arg) = (typeof(arg) === 'bool32x4'); | |
96 macro IS_INT16X8(arg) = (typeof(arg) === 'int16x8'); | |
97 macro IS_BOOL16X8(arg) = (typeof(arg) === 'bool16x8'); | |
98 macro IS_INT8X16(arg) = (typeof(arg) === 'int8x16'); | |
99 macro IS_BOOL8X16(arg) = (typeof(arg) === 'bool8x16'); | |
94 macro IS_STRING(arg) = (typeof(arg) === 'string'); | 100 macro IS_STRING(arg) = (typeof(arg) === 'string'); |
95 macro IS_BOOLEAN(arg) = (typeof(arg) === 'boolean'); | 101 macro IS_BOOLEAN(arg) = (typeof(arg) === 'boolean'); |
96 macro IS_SYMBOL(arg) = (typeof(arg) === 'symbol'); | 102 macro IS_SYMBOL(arg) = (typeof(arg) === 'symbol'); |
97 macro IS_OBJECT(arg) = (%_IsObject(arg)); | 103 macro IS_OBJECT(arg) = (%_IsObject(arg)); |
98 macro IS_ARRAY(arg) = (%_IsArray(arg)); | 104 macro IS_ARRAY(arg) = (%_IsArray(arg)); |
99 macro IS_DATE(arg) = (%_IsDate(arg)); | 105 macro IS_DATE(arg) = (%_IsDate(arg)); |
100 macro IS_FUNCTION(arg) = (%_IsFunction(arg)); | 106 macro IS_FUNCTION(arg) = (%_IsFunction(arg)); |
101 macro IS_REGEXP(arg) = (%_IsRegExp(arg)); | 107 macro IS_REGEXP(arg) = (%_IsRegExp(arg)); |
102 macro IS_SET(arg) = (%_ClassOf(arg) === 'Set'); | 108 macro IS_SET(arg) = (%_ClassOf(arg) === 'Set'); |
103 macro IS_MAP(arg) = (%_ClassOf(arg) === 'Map'); | 109 macro IS_MAP(arg) = (%_ClassOf(arg) === 'Map'); |
104 macro IS_WEAKMAP(arg) = (%_ClassOf(arg) === 'WeakMap'); | 110 macro IS_WEAKMAP(arg) = (%_ClassOf(arg) === 'WeakMap'); |
105 macro IS_WEAKSET(arg) = (%_ClassOf(arg) === 'WeakSet'); | 111 macro IS_WEAKSET(arg) = (%_ClassOf(arg) === 'WeakSet'); |
106 macro IS_NUMBER_WRAPPER(arg) = (%_ClassOf(arg) === 'Number'); | 112 macro IS_NUMBER_WRAPPER(arg) = (%_ClassOf(arg) === 'Number'); |
107 macro IS_FLOAT32X4_WRAPPER(arg) = (%_ClassOf(arg) === 'Float32x4'); | 113 macro IS_FLOAT32X4_WRAPPER(arg) = (%_ClassOf(arg) === 'Float32x4'); |
114 macro IS_INT32X4_WRAPPER(arg) = (%_ClassOf(arg) === 'Int32x4'); | |
115 macro IS_BOOL32X4_WRAPPER(arg) = (%_ClassOf(arg) === 'Bool32x4'); | |
116 macro IS_INT16X8_WRAPPER(arg) = (%_ClassOf(arg) === 'Int16x8'); | |
117 macro IS_BOOL16X8_WRAPPER(arg) = (%_ClassOf(arg) === 'Bool16x8'); | |
118 macro IS_INT8X16_WRAPPER(arg) = (%_ClassOf(arg) === 'Int8x16'); | |
119 macro IS_BOOL8X16_WRAPPER(arg) = (%_ClassOf(arg) === 'Bool8x16'); | |
108 macro IS_STRING_WRAPPER(arg) = (%_ClassOf(arg) === 'String'); | 120 macro IS_STRING_WRAPPER(arg) = (%_ClassOf(arg) === 'String'); |
109 macro IS_SYMBOL_WRAPPER(arg) = (%_ClassOf(arg) === 'Symbol'); | 121 macro IS_SYMBOL_WRAPPER(arg) = (%_ClassOf(arg) === 'Symbol'); |
110 macro IS_BOOLEAN_WRAPPER(arg) = (%_ClassOf(arg) === 'Boolean'); | 122 macro IS_BOOLEAN_WRAPPER(arg) = (%_ClassOf(arg) === 'Boolean'); |
111 macro IS_ERROR(arg) = (%_ClassOf(arg) === 'Error'); | 123 macro IS_ERROR(arg) = (%_ClassOf(arg) === 'Error'); |
112 macro IS_SCRIPT(arg) = (%_ClassOf(arg) === 'Script'); | 124 macro IS_SCRIPT(arg) = (%_ClassOf(arg) === 'Script'); |
113 macro IS_ARGUMENTS(arg) = (%_ClassOf(arg) === 'Arguments'); | 125 macro IS_ARGUMENTS(arg) = (%_ClassOf(arg) === 'Arguments'); |
114 macro IS_GLOBAL(arg) = (%_ClassOf(arg) === 'global'); | 126 macro IS_GLOBAL(arg) = (%_ClassOf(arg) === 'global'); |
115 macro IS_ARRAYBUFFER(arg) = (%_ClassOf(arg) === 'ArrayBuffer'); | 127 macro IS_ARRAYBUFFER(arg) = (%_ClassOf(arg) === 'ArrayBuffer'); |
116 macro IS_DATAVIEW(arg) = (%_ClassOf(arg) === 'DataView'); | 128 macro IS_DATAVIEW(arg) = (%_ClassOf(arg) === 'DataView'); |
117 macro IS_SHAREDARRAYBUFFER(arg) = (%_ClassOf(arg) === 'SharedArrayBuffer'); | 129 macro IS_SHAREDARRAYBUFFER(arg) = (%_ClassOf(arg) === 'SharedArrayBuffer'); |
118 macro IS_GENERATOR(arg) = (%_ClassOf(arg) === 'Generator'); | 130 macro IS_GENERATOR(arg) = (%_ClassOf(arg) === 'Generator'); |
119 macro IS_SET_ITERATOR(arg) = (%_ClassOf(arg) === 'Set Iterator'); | 131 macro IS_SET_ITERATOR(arg) = (%_ClassOf(arg) === 'Set Iterator'); |
120 macro IS_MAP_ITERATOR(arg) = (%_ClassOf(arg) === 'Map Iterator'); | 132 macro IS_MAP_ITERATOR(arg) = (%_ClassOf(arg) === 'Map Iterator'); |
121 macro IS_UNDETECTABLE(arg) = (%_IsUndetectableObject(arg)); | 133 macro IS_UNDETECTABLE(arg) = (%_IsUndetectableObject(arg)); |
122 macro IS_STRONG(arg) = (%IsStrong(arg)); | 134 macro IS_STRONG(arg) = (%IsStrong(arg)); |
123 | 135 |
136 macro IS_SIMD_VALUE(arg) = (IS_FLOAT32X4(arg) || IS_INT32X4(arg) || IS_B OOL32X4(arg) || IS_INT16X8(arg) || IS_BOOL16X8(arg) || IS_INT8X16(arg) || IS_BOO L8X16(arg)); | |
rossberg
2015/07/29 14:37:55
Hm, this seems rather expensive. It is used on som
bbudge
2015/07/30 13:46:58
I don't like those perf bugs, so I'll use your sug
rossberg
2015/07/30 15:12:24
Ah, note the difference between assembly intrinsic
| |
137 macro IS_SIMD_VALUE_WRAPPER(arg) = (IS_FLOAT32X4_WRAPPER(arg) || IS_INT32X4_WRAP PER(arg) || IS_BOOL32X4_WRAPPER(arg) || IS_INT16X8_WRAPPER(arg) || IS_BOOL16X8_W RAPPER(arg) || IS_INT8X16_WRAPPER(arg) || IS_BOOL8X16_WRAPPER(arg)); | |
rossberg
2015/07/29 14:37:55
Is this actually used?
bbudge
2015/07/30 13:46:58
Nope. Deleted.
| |
138 | |
124 # Macro for ECMAScript 5 queries of the type: | 139 # Macro for ECMAScript 5 queries of the type: |
125 # "Type(O) is object." | 140 # "Type(O) is object." |
126 # This is the same as being either a function or an object in V8 terminology | 141 # This is the same as being either a function or an object in V8 terminology |
127 # (including proxies). | 142 # (including proxies). |
128 # In addition, an undetectable object is also included by this. | 143 # In addition, an undetectable object is also included by this. |
129 macro IS_SPEC_OBJECT(arg) = (%_IsSpecObject(arg)); | 144 macro IS_SPEC_OBJECT(arg) = (%_IsSpecObject(arg)); |
130 | 145 |
131 # Macro for ECMAScript 5 queries of the type: | 146 # Macro for ECMAScript 5 queries of the type: |
132 # "IsCallable(O)" | 147 # "IsCallable(O)" |
133 # We assume here that this is the same as being either a function or a function | 148 # We assume here that this is the same as being either a function or a function |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 define NOT_FOUND = -1; | 321 define NOT_FOUND = -1; |
307 | 322 |
308 # Check whether debug is active. | 323 # Check whether debug is active. |
309 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); | 324 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); |
310 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function)); | 325 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function)); |
311 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi on)) %DebugPrepareStepInIfStepping(function); | 326 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi on)) %DebugPrepareStepInIfStepping(function); |
312 | 327 |
313 # SharedFlag equivalents | 328 # SharedFlag equivalents |
314 define kNotShared = false; | 329 define kNotShared = false; |
315 define kShared = true; | 330 define kShared = true; |
OLD | NEW |