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

Side by Side Diff: src/macros.py

Issue 1309243003: ES6: Array.prototype.slice and friends should use ToLength instead of ToUint32 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed nit: use factory()->ToBoolean() Created 5 years, 3 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 | « src/heap/heap.h ('k') | src/runtime.js » ('j') | 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 define kBoundArgumentsStartIndex = 2; 140 define kBoundArgumentsStartIndex = 2;
141 141
142 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once. 142 # Inline macros. Use %IS_VAR to make sure arg is evaluated only once.
143 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg)); 143 macro NUMBER_IS_NAN(arg) = (!%_IsSmi(%IS_VAR(arg)) && !(arg == arg));
144 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg != 1/0) && (arg != -1/0))); 144 macro NUMBER_IS_FINITE(arg) = (%_IsSmi(%IS_VAR(arg)) || ((arg == arg) && (arg != 1/0) && (arg != -1/0)));
145 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber (arg))); 145 macro TO_INTEGER(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToInteger(ToNumber (arg)));
146 macro TO_INTEGER_FOR_SIDE_EFFECT(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToNumber( arg)); 146 macro TO_INTEGER_FOR_SIDE_EFFECT(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToNumber( arg));
147 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI ntegerMapMinusZero(ToNumber(arg))); 147 macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToI ntegerMapMinusZero(ToNumber(arg)));
148 macro TO_INT32(arg) = (arg | 0); 148 macro TO_INT32(arg) = (arg | 0);
149 macro TO_UINT32(arg) = (arg >>> 0); 149 macro TO_UINT32(arg) = (arg >>> 0);
150 macro TO_LENGTH_OR_UINT32(arg) = (harmony_tolength ? $toLength(arg) : TO_UINT32( arg));
150 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : $nonStringToStrin g(arg)); 151 macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : $nonStringToStrin g(arg));
151 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : $nonNumberToNumbe r(arg)); 152 macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : $nonNumberToNumbe r(arg));
152 macro TO_OBJECT(arg) = (%_ToObject(arg)); 153 macro TO_OBJECT(arg) = (%_ToObject(arg));
153 macro TO_PRIMITIVE(arg) = (%_ToPrimitive(arg)); 154 macro TO_PRIMITIVE(arg) = (%_ToPrimitive(arg));
154 macro TO_PRIMITIVE_NUMBER(arg) = (%_ToPrimitive_Number(arg)); 155 macro TO_PRIMITIVE_NUMBER(arg) = (%_ToPrimitive_Number(arg));
155 macro TO_PRIMITIVE_STRING(arg) = (%_ToPrimitive_String(arg)); 156 macro TO_PRIMITIVE_STRING(arg) = (%_ToPrimitive_String(arg));
156 macro TO_NAME(arg) = (%_ToName(arg)); 157 macro TO_NAME(arg) = (%_ToName(arg));
157 macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ? %_NumberToString(arg) : "null"); 158 macro JSON_NUMBER_TO_STRING(arg) = ((%_IsSmi(%IS_VAR(arg)) || arg - arg == 0) ? %_NumberToString(arg) : "null");
158 macro HAS_OWN_PROPERTY(arg, index) = (%_CallFunction(arg, index, ObjectHasOwnPro perty)); 159 macro HAS_OWN_PROPERTY(arg, index) = (%_CallFunction(arg, index, ObjectHasOwnPro perty));
159 macro HAS_INDEX(array, index, is_array) = ((is_array && %_HasFastPackedElements( %IS_VAR(array))) ? (index < array.length) : (index in array)); 160 macro HAS_INDEX(array, index, is_array) = ((is_array && %_HasFastPackedElements( %IS_VAR(array))) ? (index < array.length) : (index in array));
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 define NOT_FOUND = -1; 302 define NOT_FOUND = -1;
302 303
303 # Check whether debug is active. 304 # Check whether debug is active.
304 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0); 305 define DEBUG_IS_ACTIVE = (%_DebugIsActive() != 0);
305 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function)); 306 macro DEBUG_IS_STEPPING(function) = (%_DebugIsActive() != 0 && %DebugCallbackSup portsStepping(function));
306 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi on)) %DebugPrepareStepInIfStepping(function); 307 macro DEBUG_PREPARE_STEP_IN_IF_STEPPING(function) = if (DEBUG_IS_STEPPING(functi on)) %DebugPrepareStepInIfStepping(function);
307 308
308 # SharedFlag equivalents 309 # SharedFlag equivalents
309 define kNotShared = false; 310 define kNotShared = false;
310 define kShared = true; 311 define kShared = true;
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698