| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 # Macro for ECMAScript 5 queries of the type: | 127 # Macro for ECMAScript 5 queries of the type: |
| 128 # "IsCallable(O)" | 128 # "IsCallable(O)" |
| 129 # We assume here that this is the same as being either a function or a function | 129 # We assume here that this is the same as being either a function or a function |
| 130 # proxy. That ignores host objects with [[Call]] methods, but in most situations | 130 # proxy. That ignores host objects with [[Call]] methods, but in most situations |
| 131 # we cannot handle those anyway. | 131 # we cannot handle those anyway. |
| 132 macro IS_SPEC_FUNCTION(arg) = (%_ClassOf(arg) === 'Function'); | 132 macro IS_SPEC_FUNCTION(arg) = (%_ClassOf(arg) === 'Function'); |
| 133 | 133 |
| 134 # Macro for ES6 CheckObjectCoercible | 134 # Macro for ES6 CheckObjectCoercible |
| 135 # Will throw a TypeError of the form "[functionName] called on null or undefined
". | 135 # Will throw a TypeError of the form "[functionName] called on null or undefined
". |
| 136 macro CHECK_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL_OR_UNDEFINED(arg)
&& !IS_UNDETECTABLE(arg)) throw MakeTypeError('called_on_null_or_undefined', [fu
nctionName]); | 136 macro CHECK_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL_OR_UNDEFINED(arg)
&& !IS_UNDETECTABLE(arg)) throw MakeTypeError(kCalledOnNullOrUndefined, function
Name); |
| 137 | 137 |
| 138 # Indices in bound function info retrieved by %BoundFunctionGetBindings(...). | 138 # Indices in bound function info retrieved by %BoundFunctionGetBindings(...). |
| 139 const kBoundFunctionIndex = 0; | 139 const kBoundFunctionIndex = 0; |
| 140 const kBoundThisIndex = 1; | 140 const kBoundThisIndex = 1; |
| 141 const kBoundArgumentsStartIndex = 2; | 141 const kBoundArgumentsStartIndex = 2; |
| 142 | 142 |
| 143 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. | 143 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. |
| 144 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); | 144 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); |
| 145 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg !=
1/0) && (arg != -1/0))); | 145 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg !=
1/0) && (arg != -1/0))); |
| 146 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber
(arg))); | 146 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber
(arg))); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 # REGEXP_NUMBER_OF_CAPTURES | 184 # REGEXP_NUMBER_OF_CAPTURES |
| 185 macro NUMBER_OF_CAPTURES(array) = ((array)[0]); | 185 macro NUMBER_OF_CAPTURES(array) = ((array)[0]); |
| 186 | 186 |
| 187 # Limit according to ECMA 262 15.9.1.1 | 187 # Limit according to ECMA 262 15.9.1.1 |
| 188 const MAX_TIME_MS = 8640000000000000; | 188 const MAX_TIME_MS = 8640000000000000; |
| 189 # Limit which is MAX_TIME_MS + msPerMonth. | 189 # Limit which is MAX_TIME_MS + msPerMonth. |
| 190 const MAX_TIME_BEFORE_UTC = 8640002592000000; | 190 const MAX_TIME_BEFORE_UTC = 8640002592000000; |
| 191 | 191 |
| 192 # Gets the value of a Date object. If arg is not a Date object | 192 # Gets the value of a Date object. If arg is not a Date object |
| 193 # a type error is thrown. | 193 # a type error is thrown. |
| 194 macro CHECK_DATE(arg) = if (%_ClassOf(arg) !== 'Date') ThrowDateTypeError(); | 194 macro CHECK_DATE(arg) = if (%_ClassOf(arg) !== 'Date') throw MakeTypeError(kDate
Type); |
| 195 macro LOCAL_DATE_VALUE(arg) = (%_DateField(arg, 0) + %_DateField(arg, 21)); | 195 macro LOCAL_DATE_VALUE(arg) = (%_DateField(arg, 0) + %_DateField(arg, 21)); |
| 196 macro UTC_DATE_VALUE(arg) = (%_DateField(arg, 0)); | 196 macro UTC_DATE_VALUE(arg) = (%_DateField(arg, 0)); |
| 197 | 197 |
| 198 macro LOCAL_YEAR(arg) = (%_DateField(arg, 1)); | 198 macro LOCAL_YEAR(arg) = (%_DateField(arg, 1)); |
| 199 macro LOCAL_MONTH(arg) = (%_DateField(arg, 2)); | 199 macro LOCAL_MONTH(arg) = (%_DateField(arg, 2)); |
| 200 macro LOCAL_DAY(arg) = (%_DateField(arg, 3)); | 200 macro LOCAL_DAY(arg) = (%_DateField(arg, 3)); |
| 201 macro LOCAL_WEEKDAY(arg) = (%_DateField(arg, 4)); | 201 macro LOCAL_WEEKDAY(arg) = (%_DateField(arg, 4)); |
| 202 macro LOCAL_HOUR(arg) = (%_DateField(arg, 5)); | 202 macro LOCAL_HOUR(arg) = (%_DateField(arg, 5)); |
| 203 macro LOCAL_MIN(arg) = (%_DateField(arg, 6)); | 203 macro LOCAL_MIN(arg) = (%_DateField(arg, 6)); |
| 204 macro LOCAL_SEC(arg) = (%_DateField(arg, 7)); | 204 macro LOCAL_SEC(arg) = (%_DateField(arg, 7)); |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 macro ORDERED_HASH_MAP_VALUE_AT(table, entry, numBuckets) = (FIXED_ARRAY_GET(tab
le, ORDERED_HASH_MAP_ENTRY_TO_INDEX(entry, numBuckets) + 1)); | 300 macro ORDERED_HASH_MAP_VALUE_AT(table, entry, numBuckets) = (FIXED_ARRAY_GET(tab
le, ORDERED_HASH_MAP_ENTRY_TO_INDEX(entry, numBuckets) + 1)); |
| 301 macro ORDERED_HASH_MAP_CHAIN_AT(table, entry, numBuckets) = (FIXED_ARRAY_GET(tab
le, ORDERED_HASH_MAP_ENTRY_TO_INDEX(entry, numBuckets) + 2)); | 301 macro ORDERED_HASH_MAP_CHAIN_AT(table, entry, numBuckets) = (FIXED_ARRAY_GET(tab
le, ORDERED_HASH_MAP_ENTRY_TO_INDEX(entry, numBuckets) + 2)); |
| 302 | 302 |
| 303 # Must match OrderedHashTable::kNotFound. | 303 # Must match OrderedHashTable::kNotFound. |
| 304 const NOT_FOUND = -1; | 304 const NOT_FOUND = -1; |
| 305 | 305 |
| 306 # Check whether debug is active. | 306 # Check whether debug is active. |
| 307 const DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); | 307 const DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); |
| 308 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup
portsStepping(function)); | 308 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup
portsStepping(function)); |
| 309 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi
on)) %DebugPrepareStepInIfStepping(function); | 309 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi
on)) %DebugPrepareStepInIfStepping(function); |
| OLD | NEW |