Chromium Code Reviews| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 | 120 |
| 121 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. | 121 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. |
| 122 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); | 122 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); |
| 123 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || arg - arg == 0); | 123 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || arg - arg == 0); |
| 124 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber (arg))); | 124 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber (arg))); |
| 125 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI ntegerMapMinusZero(ToNumber(arg))); | 125 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI ntegerMapMinusZero(ToNumber(arg))); |
| 126 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); | 126 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); |
| 127 macro TO_UINT32(arg) = (arg >>> 0); | 127 macro TO_UINT32(arg) = (arg >>> 0); |
| 128 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString (arg)); | 128 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString (arg)); |
| 129 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber (arg)); | 129 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : NonNumberToNumber (arg)); |
| 130 | 130 macro TO_OBJECT_INLINE(arg) = ((IS_OBJECT(%IS_VAR(arg)) && !IS_NULL_OR_UNDEFINED (arg)) ? arg : ToObject(arg)); |
|
Mads Ager (chromium)
2011/05/12 16:11:05
I wonder if what we should be using here is %_IsSp
Vitaly Repeshko
2011/05/12 16:19:24
You're right. It's simpler.
| |
| 131 | 131 |
| 132 # Macros implemented in Python. | 132 # Macros implemented in Python. |
| 133 python macro CHAR_CODE(str) = ord(str[1]); | 133 python macro CHAR_CODE(str) = ord(str[1]); |
| 134 | 134 |
| 135 # Constants used on an array to implement the properties of the RegExp object. | 135 # Constants used on an array to implement the properties of the RegExp object. |
| 136 const REGEXP_NUMBER_OF_CAPTURES = 0; | 136 const REGEXP_NUMBER_OF_CAPTURES = 0; |
| 137 const REGEXP_FIRST_CAPTURE = 3; | 137 const REGEXP_FIRST_CAPTURE = 3; |
| 138 | 138 |
| 139 # We can't put macros in macros so we use constants here. | 139 # We can't put macros in macros so we use constants here. |
| 140 # REGEXP_NUMBER_OF_CAPTURES | 140 # REGEXP_NUMBER_OF_CAPTURES |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 169 | 169 |
| 170 # PropertyDescriptor return value indices - must match | 170 # PropertyDescriptor return value indices - must match |
| 171 # PropertyDescriptorIndices in runtime.cc. | 171 # PropertyDescriptorIndices in runtime.cc. |
| 172 const IS_ACCESSOR_INDEX = 0; | 172 const IS_ACCESSOR_INDEX = 0; |
| 173 const VALUE_INDEX = 1; | 173 const VALUE_INDEX = 1; |
| 174 const GETTER_INDEX = 2; | 174 const GETTER_INDEX = 2; |
| 175 const SETTER_INDEX = 3; | 175 const SETTER_INDEX = 3; |
| 176 const WRITABLE_INDEX = 4; | 176 const WRITABLE_INDEX = 4; |
| 177 const ENUMERABLE_INDEX = 5; | 177 const ENUMERABLE_INDEX = 5; |
| 178 const CONFIGURABLE_INDEX = 6; | 178 const CONFIGURABLE_INDEX = 6; |
| OLD | NEW |