Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Side by Side Diff: src/js/macros.py

Issue 2740433003: [macros] Implement NUMBER_IS_NAN in terms of strict equality. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 macro IS_RECEIVER(arg) = (%_IsJSReceiver(arg)); 75 macro IS_RECEIVER(arg) = (%_IsJSReceiver(arg));
76 76
77 # Macro for ES queries of the type: "IsCallable(O)" 77 # Macro for ES queries of the type: "IsCallable(O)"
78 macro IS_CALLABLE(arg) = (typeof(arg) === 'function'); 78 macro IS_CALLABLE(arg) = (typeof(arg) === 'function');
79 79
80 # Macro for ES6 CheckObjectCoercible 80 # Macro for ES6 CheckObjectCoercible
81 # Will throw a TypeError of the form "[functionName] called on null or undefined ". 81 # Will throw a TypeError of the form "[functionName] called on null or undefined ".
82 macro CHECK_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL(%IS_VAR(arg)) || I S_UNDEFINED(arg)) throw %make_type_error(kCalledOnNullOrUndefined, functionName) ; 82 macro CHECK_OBJECT_COERCIBLE(arg, functionName) = if (IS_NULL(%IS_VAR(arg)) || I S_UNDEFINED(arg)) throw %make_type_error(kCalledOnNullOrUndefined, functionName) ;
83 83
84 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. 84 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once.
85 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); 85 macro NUMBER_IS_NAN(arg) = (%IS_VAR(arg) !== arg);
86 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg != 1/0) && (arg != -1/0))); 86 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg != 1/0) && (arg != -1/0)));
87 macro TO_BOOLEAN(arg) = (!!(arg)); 87 macro TO_BOOLEAN(arg) = (!!(arg));
88 macro TO_INTEGER(arg) = (%_ToInteger(arg)); 88 macro TO_INTEGER(arg) = (%_ToInteger(arg));
89 macro TO_INT32(arg) = ((arg) | 0); 89 macro TO_INT32(arg) = ((arg) | 0);
90 macro TO_UINT32(arg) = ((arg) >>> 0); 90 macro TO_UINT32(arg) = ((arg) >>> 0);
91 macro INVERT_NEG_ZERO(arg) = ((arg) + 0); 91 macro INVERT_NEG_ZERO(arg) = ((arg) + 0);
92 macro TO_LENGTH(arg) = (%_ToLength(arg)); 92 macro TO_LENGTH(arg) = (%_ToLength(arg));
93 macro TO_STRING(arg) = (%_ToString(arg)); 93 macro TO_STRING(arg) = (%_ToString(arg));
94 macro TO_NUMBER(arg) = (%_ToNumber(arg)); 94 macro TO_NUMBER(arg) = (%_ToNumber(arg));
95 macro TO_OBJECT(arg) = (%_ToObject(arg)); 95 macro TO_OBJECT(arg) = (%_ToObject(arg));
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 define kSloppyModeBlockScopedFunctionRedefinition = 22; 188 define kSloppyModeBlockScopedFunctionRedefinition = 22;
189 define kForInInitializer = 23; 189 define kForInInitializer = 23;
190 define kArrayProtectorDirtied = 24; 190 define kArrayProtectorDirtied = 24;
191 define kArraySpeciesModified = 25; 191 define kArraySpeciesModified = 25;
192 define kArrayPrototypeConstructorModified = 26; 192 define kArrayPrototypeConstructorModified = 26;
193 define kArrayInstanceProtoModified = 27; 193 define kArrayInstanceProtoModified = 27;
194 define kArrayInstanceConstructorModified = 28; 194 define kArrayInstanceConstructorModified = 28;
195 define kLegacyFunctionDeclaration = 29; 195 define kLegacyFunctionDeclaration = 29;
196 define kRegExpPrototypeSourceGetter = 30; 196 define kRegExpPrototypeSourceGetter = 30;
197 define kRegExpPrototypeOldFlagGetter = 31; 197 define kRegExpPrototypeOldFlagGetter = 31;
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698