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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 macro IS_WEAKSET(arg) = (%_ClassOf(arg) === 'WeakSet'); | 77 macro IS_WEAKSET(arg) = (%_ClassOf(arg) === 'WeakSet'); |
78 | 78 |
79 # Macro for ES queries of the type: "Type(O) is Object." | 79 # Macro for ES queries of the type: "Type(O) is Object." |
80 macro IS_RECEIVER(arg) = (%_IsJSReceiver(arg)); | 80 macro IS_RECEIVER(arg) = (%_IsJSReceiver(arg)); |
81 | 81 |
82 # Macro for ES queries of the type: "IsCallable(O)" | 82 # Macro for ES queries of the type: "IsCallable(O)" |
83 macro IS_CALLABLE(arg) = (typeof(arg) === 'function'); | 83 macro IS_CALLABLE(arg) = (typeof(arg) === 'function'); |
84 | 84 |
85 # Macro for ES6 CheckObjectCoercible | 85 # Macro for ES6 CheckObjectCoercible |
86 # Will throw a TypeError of the form "[functionName] called on null or undefined
". | 86 # Will throw a TypeError of the form "[functionName] called on null or undefined
". |
87 macro CHECK_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL(%IS_VAR(arg)) || I
S_UNDEFINED(arg)) throw MakeTypeError(kCalledOnNullOrUndefined, functionName); | 87 macro CHECK_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL(%IS_VAR(arg)) || I
S_UNDEFINED(arg)) throw %make_type_error(kCalledOnNullOrUndefined, functionName)
; |
88 | 88 |
89 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. | 89 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. |
90 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); | 90 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); |
91 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg !=
1/0) && (arg != -1/0))); | 91 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg !=
1/0) && (arg != -1/0))); |
92 macro TO_BOOLEAN(arg) = (!!(arg)); | 92 macro TO_BOOLEAN(arg) = (!!(arg)); |
93 macro TO_INTEGER(arg) = (%_ToInteger(arg)); | 93 macro TO_INTEGER(arg) = (%_ToInteger(arg)); |
94 macro TO_INT32(arg) = ((arg) | 0); | 94 macro TO_INT32(arg) = ((arg) | 0); |
95 macro TO_UINT32(arg) = ((arg) >>> 0); | 95 macro TO_UINT32(arg) = ((arg) >>> 0); |
96 macro INVERT_NEG_ZERO(arg) = ((arg) + 0); | 96 macro INVERT_NEG_ZERO(arg) = ((arg) + 0); |
97 macro TO_LENGTH(arg) = (%_ToLength(arg)); | 97 macro TO_LENGTH(arg) = (%_ToLength(arg)); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 define kSloppyModeBlockScopedFunctionRedefinition = 22; | 231 define kSloppyModeBlockScopedFunctionRedefinition = 22; |
232 define kForInInitializer = 23; | 232 define kForInInitializer = 23; |
233 define kArrayProtectorDirtied = 24; | 233 define kArrayProtectorDirtied = 24; |
234 define kArraySpeciesModified = 25; | 234 define kArraySpeciesModified = 25; |
235 define kArrayPrototypeConstructorModified = 26; | 235 define kArrayPrototypeConstructorModified = 26; |
236 define kArrayInstanceProtoModified = 27; | 236 define kArrayInstanceProtoModified = 27; |
237 define kArrayInstanceConstructorModified = 28; | 237 define kArrayInstanceConstructorModified = 28; |
238 define kLegacyFunctionDeclaration = 29; | 238 define kLegacyFunctionDeclaration = 29; |
239 define kRegExpPrototypeSourceGetter = 30; | 239 define kRegExpPrototypeSourceGetter = 30; |
240 define kRegExpPrototypeOldFlagGetter = 31; | 240 define kRegExpPrototypeOldFlagGetter = 31; |
OLD | NEW |