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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 macro IS_BOOLEAN_WRAPPER(arg) = (%_ClassOf(arg) === 'Boolean'); | 109 macro IS_BOOLEAN_WRAPPER(arg) = (%_ClassOf(arg) === 'Boolean'); |
110 macro IS_ERROR(arg) = (%_ClassOf(arg) === 'Error'); | 110 macro IS_ERROR(arg) = (%_ClassOf(arg) === 'Error'); |
111 macro IS_SCRIPT(arg) = (%_ClassOf(arg) === 'Script'); | 111 macro IS_SCRIPT(arg) = (%_ClassOf(arg) === 'Script'); |
112 macro IS_ARGUMENTS(arg) = (%_ClassOf(arg) === 'Arguments'); | 112 macro IS_ARGUMENTS(arg) = (%_ClassOf(arg) === 'Arguments'); |
113 macro IS_GLOBAL(arg) = (%_ClassOf(arg) === 'global'); | 113 macro IS_GLOBAL(arg) = (%_ClassOf(arg) === 'global'); |
114 macro IS_UNDETECTABLE(arg) = (%_IsUndetectableObject(arg)); | 114 macro IS_UNDETECTABLE(arg) = (%_IsUndetectableObject(arg)); |
115 macro FLOOR(arg) = $floor(arg); | 115 macro FLOOR(arg) = $floor(arg); |
116 | 116 |
117 # Macro for ECMAScript 5 queries of the type: | 117 # Macro for ECMAScript 5 queries of the type: |
118 # "Type(O) is object." | 118 # "Type(O) is object." |
119 # This is the same as being either a function or an object in V8 terminology. | 119 # This is the same as being either a function or an object in V8 terminology |
| 120 # (including proxies). |
120 # In addition, an undetectable object is also included by this. | 121 # In addition, an undetectable object is also included by this. |
121 macro IS_SPEC_OBJECT(arg) = (%_IsSpecObject(arg)); | 122 macro IS_SPEC_OBJECT(arg) = (%_IsSpecObject(arg)); |
| 123 |
| 124 # Macro for ECMAScript 5 queries of the type: |
| 125 # "IsCallable(O)" |
| 126 # We assume here that this is the same as being either a function or a function |
| 127 # proxy. That ignores host objects with [[Call]] methods, but in most situations |
| 128 # we cannot handle those anyway. |
| 129 macro IS_SPEC_FUNCTION(arg) = (%_ClassOf(arg) === 'Function'); |
122 | 130 |
123 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. | 131 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. |
124 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); | 132 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); |
125 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || arg - arg == 0); | 133 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || arg - arg == 0); |
126 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber
(arg))); | 134 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber
(arg))); |
127 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI
ntegerMapMinusZero(ToNumber(arg))); | 135 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI
ntegerMapMinusZero(ToNumber(arg))); |
128 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); | 136 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); |
129 macro TO_UINT32(arg) = (arg >>> 0); | 137 macro TO_UINT32(arg) = (arg >>> 0); |
130 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString
(arg)); | 138 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString
(arg)); |
131 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber
(arg)); | 139 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber
(arg)); |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 180 |
173 # PropertyDescriptor return value indices - must match | 181 # PropertyDescriptor return value indices - must match |
174 # PropertyDescriptorIndices in runtime.cc. | 182 # PropertyDescriptorIndices in runtime.cc. |
175 const IS_ACCESSOR_INDEX = 0; | 183 const IS_ACCESSOR_INDEX = 0; |
176 const VALUE_INDEX = 1; | 184 const VALUE_INDEX = 1; |
177 const GETTER_INDEX = 2; | 185 const GETTER_INDEX = 2; |
178 const SETTER_INDEX = 3; | 186 const SETTER_INDEX = 3; |
179 const WRITABLE_INDEX = 4; | 187 const WRITABLE_INDEX = 4; |
180 const ENUMERABLE_INDEX = 5; | 188 const ENUMERABLE_INDEX = 5; |
181 const CONFIGURABLE_INDEX = 6; | 189 const CONFIGURABLE_INDEX = 6; |
OLD | NEW |