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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 macro TO_INTEGER_FOR_SIDE_EFFECT(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToNumber(
arg)); | 161 macro TO_INTEGER_FOR_SIDE_EFFECT(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToNumber(
arg)); |
162 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI
ntegerMapMinusZero(ToNumber(arg))); | 162 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI
ntegerMapMinusZero(ToNumber(arg))); |
163 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); | 163 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); |
164 macro TO_UINT32(arg) = (arg >>> 0); | 164 macro TO_UINT32(arg) = (arg >>> 0); |
165 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString
(arg)); | 165 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString
(arg)); |
166 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber
(arg)); | 166 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber
(arg)); |
167 macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : ToObject(arg
)); | 167 macro TO_OBJECT_INLINE(arg) = (IS_SPEC_OBJECT(%IS_VAR(arg)) ? arg : ToObject(arg
)); |
168 macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ?
%_NumberToString(arg) : "null"); | 168 macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ?
%_NumberToString(arg) : "null"); |
169 macro HAS_OWN_PROPERTY(obj, index) = (%_CallFunction(obj, index, ObjectHasOwnPro
perty)); | 169 macro HAS_OWN_PROPERTY(obj, index) = (%_CallFunction(obj, index, ObjectHasOwnPro
perty)); |
170 macro SHOULD_CREATE_WRAPPER(functionName, receiver) = (!IS_SPEC_OBJECT(receiver)
&& %IsSloppyModeFunction(functionName)); | 170 macro SHOULD_CREATE_WRAPPER(functionName, receiver) = (!IS_SPEC_OBJECT(receiver)
&& %IsSloppyModeFunction(functionName)); |
| 171 macro HAS_INDEX(array, index, is_array) = ((is_array && %_HasFastPackedElements(
%IS_VAR(array))) ? (index < array.length) : (index in array)); |
171 | 172 |
172 # Private names. | 173 # Private names. |
173 # GET_PRIVATE should only be used if the property is known to exists on obj | 174 # GET_PRIVATE should only be used if the property is known to exists on obj |
174 # itself (it should really use %GetOwnProperty, but that would be way slower). | 175 # itself (it should really use %GetOwnProperty, but that would be way slower). |
175 macro GLOBAL_PRIVATE(name) = (%CreateGlobalPrivateOwnSymbol(name)); | 176 macro GLOBAL_PRIVATE(name) = (%CreateGlobalPrivateOwnSymbol(name)); |
176 macro NEW_PRIVATE_OWN(name) = (%CreatePrivateOwnSymbol(name)); | 177 macro NEW_PRIVATE_OWN(name) = (%CreatePrivateOwnSymbol(name)); |
177 macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym)); | 178 macro IS_PRIVATE(sym) = (%SymbolIsPrivate(sym)); |
178 macro HAS_PRIVATE(obj, sym) = (%HasOwnProperty(obj, sym)); | 179 macro HAS_PRIVATE(obj, sym) = (%HasOwnProperty(obj, sym)); |
179 macro HAS_DEFINED_PRIVATE(obj, sym) = (!IS_UNDEFINED(obj[sym])); | 180 macro HAS_DEFINED_PRIVATE(obj, sym) = (!IS_UNDEFINED(obj[sym])); |
180 macro GET_PRIVATE(obj, sym) = (obj[sym]); | 181 macro GET_PRIVATE(obj, sym) = (obj[sym]); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 287 |
287 # Use for keys, values and entries iterators. | 288 # Use for keys, values and entries iterators. |
288 const ITERATOR_KIND_KEYS = 1; | 289 const ITERATOR_KIND_KEYS = 1; |
289 const ITERATOR_KIND_VALUES = 2; | 290 const ITERATOR_KIND_VALUES = 2; |
290 const ITERATOR_KIND_ENTRIES = 3; | 291 const ITERATOR_KIND_ENTRIES = 3; |
291 | 292 |
292 # Check whether debug is active. | 293 # Check whether debug is active. |
293 const DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); | 294 const DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); |
294 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup
portsStepping(function)); | 295 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup
portsStepping(function)); |
295 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi
on)) %DebugPrepareStepInIfStepping(function); | 296 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi
on)) %DebugPrepareStepInIfStepping(function); |
OLD | NEW |