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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 # In addition, an undetectable object is also included by this. | 121 # In addition, an undetectable object is also included by this. |
122 macro IS_SPEC_OBJECT(arg) = (%_IsSpecObject(arg)); | 122 macro IS_SPEC_OBJECT(arg) = (%_IsSpecObject(arg)); |
123 | 123 |
124 # Macro for ECMAScript 5 queries of the type: | 124 # Macro for ECMAScript 5 queries of the type: |
125 # "IsCallable(O)" | 125 # "IsCallable(O)" |
126 # We assume here that this is the same as being either a function or a function | 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 | 127 # proxy. That ignores host objects with [[Call]] methods, but in most situations |
128 # we cannot handle those anyway. | 128 # we cannot handle those anyway. |
129 macro IS_SPEC_FUNCTION(arg) = (%_ClassOf(arg) === 'Function'); | 129 macro IS_SPEC_FUNCTION(arg) = (%_ClassOf(arg) === 'Function'); |
130 | 130 |
| 131 # Indices in bound function info retrieved by %BoundFunctionGetBindings(...). |
| 132 const kBoundFunctionIndex = 0; |
| 133 const kBoundThisIndex = 1; |
| 134 const kBoundArgumentsStartIndex = 2; |
| 135 |
131 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. | 136 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. |
132 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); | 137 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); |
133 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg !=
1/0) && (arg != -1/0))); | 138 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg !=
1/0) && (arg != -1/0))); |
134 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber
(arg))); | 139 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber
(arg))); |
135 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI
ntegerMapMinusZero(ToNumber(arg))); | 140 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI
ntegerMapMinusZero(ToNumber(arg))); |
136 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); | 141 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); |
137 macro TO_UINT32(arg) = (arg >>> 0); | 142 macro TO_UINT32(arg) = (arg >>> 0); |
138 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString
(arg)); | 143 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString
(arg)); |
139 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber
(arg)); | 144 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber
(arg)); |
140 macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : ToObject(arg
)); | 145 macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : ToObject(arg
)); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 const TYPE_EXTENSION = 1; | 199 const TYPE_EXTENSION = 1; |
195 const TYPE_NORMAL = 2; | 200 const TYPE_NORMAL = 2; |
196 | 201 |
197 # Matches Script::CompilationType from objects.h | 202 # Matches Script::CompilationType from objects.h |
198 const COMPILATION_TYPE_HOST = 0; | 203 const COMPILATION_TYPE_HOST = 0; |
199 const COMPILATION_TYPE_EVAL = 1; | 204 const COMPILATION_TYPE_EVAL = 1; |
200 const COMPILATION_TYPE_JSON = 2; | 205 const COMPILATION_TYPE_JSON = 2; |
201 | 206 |
202 # Matches Messages::kNoLineNumberInfo from v8.h | 207 # Matches Messages::kNoLineNumberInfo from v8.h |
203 const kNoLineNumberInfo = 0; | 208 const kNoLineNumberInfo = 0; |
OLD | NEW |