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

Unified 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: Use a TO_LENGTH macro instead of the ToLengthFlagged function 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 side-by-side diff with in-line comments
Download patch
Index: src/macros.py
diff --git a/src/macros.py b/src/macros.py
index 6ea6d1683b1bd0f552d416daff240c8efddf1ddd..219ba17efff1391c3c9533594c1ef0e215d28067 100644
--- a/src/macros.py
+++ b/src/macros.py
@@ -147,6 +147,7 @@ macro TO_INTEGER_FOR_SIDE_EFFECT(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : ToNumber(
macro TO_INTEGER_MAP_MINUS_ZERO(arg) = (%_IsSmi(%IS_VAR(arg)) ? arg : %NumberToIntegerMapMinusZero(ToNumber(arg)));
macro TO_INT32(arg) = (arg | 0);
macro TO_UINT32(arg) = (arg >>> 0);
+macro TO_LENGTH(arg) = (harmony_tolength ? $toLength(arg) : TO_UINT32(arg));
Camillo Bruni 2015/09/09 13:51:16 With the possibility of being annoying... maybe we
aperez 2015/09/09 18:20:45 Ack. I don't mind changing the name. Reviews with
macro TO_STRING_INLINE(arg) = (IS_STRING(%IS_VAR(arg)) ? arg : $nonStringToString(arg));
macro TO_NUMBER_INLINE(arg) = (IS_NUMBER(%IS_VAR(arg)) ? arg : $nonNumberToNumber(arg));
macro TO_OBJECT(arg) = (%_ToObject(arg));

Powered by Google App Engine
This is Rietveld 408576698