| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 macro IS_ERROR(arg) = (%_ClassOf(arg) === 'Error'); | 105 macro IS_ERROR(arg) = (%_ClassOf(arg) === 'Error'); |
| 106 macro IS_SCRIPT(arg) = (%_ClassOf(arg) === 'Script'); | 106 macro IS_SCRIPT(arg) = (%_ClassOf(arg) === 'Script'); |
| 107 macro IS_ARGUMENTS(arg) = (%_ClassOf(arg) === 'Arguments'); | 107 macro IS_ARGUMENTS(arg) = (%_ClassOf(arg) === 'Arguments'); |
| 108 macro IS_GLOBAL(arg) = (%_ClassOf(arg) === 'global'); | 108 macro IS_GLOBAL(arg) = (%_ClassOf(arg) === 'global'); |
| 109 macro IS_UNDETECTABLE(arg) = (%_IsUndetectableObject(arg)); | 109 macro IS_UNDETECTABLE(arg) = (%_IsUndetectableObject(arg)); |
| 110 macro FLOOR(arg) = $floor(arg); | 110 macro FLOOR(arg) = $floor(arg); |
| 111 | 111 |
| 112 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. | 112 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. |
| 113 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); | 113 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); |
| 114 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToInteger(arg)); | 114 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToInteger(arg)); |
| 115 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI
ntegerMapMinusZero(ToNumber(arg))); |
| 115 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); | 116 macro TO_INT32(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : (arg >> 0)); |
| 116 macro TO_UINT32(arg) = (arg >>> 0); | 117 macro TO_UINT32(arg) = (arg >>> 0); |
| 117 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString
(arg)); | 118 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : NonStringToString
(arg)); |
| 118 | 119 |
| 119 | 120 |
| 120 # Macros implemented in Python. | 121 # Macros implemented in Python. |
| 121 python macro CHAR_CODE(str) = ord(str[1]); | 122 python macro CHAR_CODE(str) = ord(str[1]); |
| 122 | 123 |
| 123 # Constants used on an array to implement the properties of the RegExp object. | 124 # Constants used on an array to implement the properties of the RegExp object. |
| 124 const REGEXP_NUMBER_OF_CAPTURES = 0; | 125 const REGEXP_NUMBER_OF_CAPTURES = 0; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 144 macro MS_FROM_TIME(time) = (Modulo(time, 1000)); | 145 macro MS_FROM_TIME(time) = (Modulo(time, 1000)); |
| 145 | 146 |
| 146 # Last input and last subject of regexp matches. | 147 # Last input and last subject of regexp matches. |
| 147 macro LAST_SUBJECT(array) = ((array)[1]); | 148 macro LAST_SUBJECT(array) = ((array)[1]); |
| 148 macro LAST_INPUT(array) = ((array)[2]); | 149 macro LAST_INPUT(array) = ((array)[2]); |
| 149 | 150 |
| 150 # REGEXP_FIRST_CAPTURE | 151 # REGEXP_FIRST_CAPTURE |
| 151 macro CAPTURE(index) = (3 + (index)); | 152 macro CAPTURE(index) = (3 + (index)); |
| 152 const CAPTURE0 = 3; | 153 const CAPTURE0 = 3; |
| 153 const CAPTURE1 = 4; | 154 const CAPTURE1 = 4; |
| OLD | NEW |