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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber
(arg))); | 150 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber
(arg))); |
151 macro TO_INTEGER_FOR_SIDE_EFFECT(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToNumber(
arg)); | 151 macro TO_INTEGER_FOR_SIDE_EFFECT(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToNumber(
arg)); |
152 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI
ntegerMapMinusZero(ToNumber(arg))); | 152 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI
ntegerMapMinusZero(ToNumber(arg))); |
153 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); | 153 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); |
154 macro TO_UINT32(arg) = (arg >>> 0); | 154 macro TO_UINT32(arg) = (arg >>> 0); |
155 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString
(arg)); | 155 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString
(arg)); |
156 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber
(arg)); | 156 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber
(arg)); |
157 macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : ToObject(arg
)); | 157 macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : ToObject(arg
)); |
158 macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ?
%_NumberToString(arg) : "null"); | 158 macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ?
%_NumberToString(arg) : "null"); |
159 | 159 |
| 160 # Private names. |
| 161 macro NEW_PRIVATE(name) = (%CreatePrivateSymbol(name)); |
| 162 macro HAS_PRIVATE(obj, sym) = (sym in obj); |
| 163 macro GET_PRIVATE(obj, sym) = (obj[sym]); |
| 164 macro SET_PRIVATE(obj, sym, val) = (obj[sym] = val); |
| 165 macro DELETE_PRIVATE(obj, sym) = (delete obj[sym]); |
| 166 |
160 # Constants. The compiler constant folds them. | 167 # Constants. The compiler constant folds them. |
161 const NAN = $NaN; | 168 const NAN = $NaN; |
162 const INFINITY = (1/0); | 169 const INFINITY = (1/0); |
163 const UNDEFINED = (void 0); | 170 const UNDEFINED = (void 0); |
164 | 171 |
165 # Macros implemented in Python. | 172 # Macros implemented in Python. |
166 python macro CHAR_CODE(str) = ord(str[1]); | 173 python macro CHAR_CODE(str) = ord(str[1]); |
167 | 174 |
168 # Constants used on an array to implement the properties of the RegExp object. | 175 # Constants used on an array to implement the properties of the RegExp object. |
169 const REGEXP_NUMBER_OF_CAPTURES = 0; | 176 const REGEXP_NUMBER_OF_CAPTURES = 0; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 const TYPE_EXTENSION = 1; | 253 const TYPE_EXTENSION = 1; |
247 const TYPE_NORMAL = 2; | 254 const TYPE_NORMAL = 2; |
248 | 255 |
249 # Matches Script::CompilationType from objects.h | 256 # Matches Script::CompilationType from objects.h |
250 const COMPILATION_TYPE_HOST = 0; | 257 const COMPILATION_TYPE_HOST = 0; |
251 const COMPILATION_TYPE_EVAL = 1; | 258 const COMPILATION_TYPE_EVAL = 1; |
252 const COMPILATION_TYPE_JSON = 2; | 259 const COMPILATION_TYPE_JSON = 2; |
253 | 260 |
254 # Matches Messages::kNoLineNumberInfo from v8.h | 261 # Matches Messages::kNoLineNumberInfo from v8.h |
255 const kNoLineNumberInfo = 0; | 262 const kNoLineNumberInfo = 0; |
OLD | NEW |