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

Side by Side Diff: src/macros.py

Issue 2841041: Remove some extra calls in date.js. (Closed)
Patch Set: No more CallFunction. Helpers are macros. Created 10 years, 5 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/date.js ('k') | 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 # Limit according to ECMA 262 15.9.1.1 140 # Limit according to ECMA 262 15.9.1.1
141 const MAX_TIME_MS = 8640000000000000; 141 const MAX_TIME_MS = 8640000000000000;
142 142
143 # Gets the value of a Date object. If arg is not a Date object 143 # Gets the value of a Date object. If arg is not a Date object
144 # a type error is thrown. 144 # a type error is thrown.
145 macro DATE_VALUE(arg) = (%_ClassOf(arg) === 'Date' ? %_ValueOf(arg) : ThrowDateT ypeError()); 145 macro DATE_VALUE(arg) = (%_ClassOf(arg) === 'Date' ? %_ValueOf(arg) : ThrowDateT ypeError());
146 macro DAY(time) = ($floor(time / 86400000)); 146 macro DAY(time) = ($floor(time / 86400000));
147 macro MONTH_FROM_TIME(time) = (MonthFromTime(time)); 147 macro MONTH_FROM_TIME(time) = (MonthFromTime(time));
148 macro DATE_FROM_TIME(time) = (DateFromTime(time)); 148 macro DATE_FROM_TIME(time) = (DateFromTime(time));
149 macro NAN_OR_DATE_FROM_TIME(time) = (NUMBER_IS_NAN(time) ? time : DATE_FROM_TIME (time));
149 macro YEAR_FROM_TIME(time) = (YearFromTime(time)); 150 macro YEAR_FROM_TIME(time) = (YearFromTime(time));
150 macro HOUR_FROM_TIME(time) = (Modulo($floor(time / 3600000), 24)); 151 macro HOUR_FROM_TIME(time) = (Modulo($floor(time / 3600000), 24));
151 macro MIN_FROM_TIME(time) = (Modulo($floor(time / 60000), 60)); 152 macro MIN_FROM_TIME(time) = (Modulo($floor(time / 60000), 60));
153 macro NAN_OR_MIN_FROM_TIME(time) = (NUMBER_IS_NAN(time) ? time : MIN_FROM_TIME(t ime));
152 macro SEC_FROM_TIME(time) = (Modulo($floor(time / 1000), 60)); 154 macro SEC_FROM_TIME(time) = (Modulo($floor(time / 1000), 60));
155 macro NAN_OR_SEC_FROM_TIME(time) = (NUMBER_IS_NAN(time) ? time : SEC_FROM_TIME(t ime));
153 macro MS_FROM_TIME(time) = (Modulo(time, 1000)); 156 macro MS_FROM_TIME(time) = (Modulo(time, 1000));
157 macro NAN_OR_MS_FROM_TIME(time) = (NUMBER_IS_NAN(time) ? time: (Modulo(time, 100 0)));
Vyacheslav Egorov (Chromium) 2010/07/05 14:52:18 define in terms of MS_FROM_TIME? whitespace befor
154 158
155 # Last input and last subject of regexp matches. 159 # Last input and last subject of regexp matches.
156 macro LAST_SUBJECT(array) = ((array)[1]); 160 macro LAST_SUBJECT(array) = ((array)[1]);
157 macro LAST_INPUT(array) = ((array)[2]); 161 macro LAST_INPUT(array) = ((array)[2]);
158 162
159 # REGEXP_FIRST_CAPTURE 163 # REGEXP_FIRST_CAPTURE
160 macro CAPTURE(index) = (3 + (index)); 164 macro CAPTURE(index) = (3 + (index));
161 const CAPTURE0 = 3; 165 const CAPTURE0 = 3;
162 const CAPTURE1 = 4; 166 const CAPTURE1 = 4;
163 167
164 # PropertyDescriptor return value indices - must match 168 # PropertyDescriptor return value indices - must match
165 # PropertyDescriptorIndices in runtime.cc. 169 # PropertyDescriptorIndices in runtime.cc.
166 const IS_ACCESSOR_INDEX = 0; 170 const IS_ACCESSOR_INDEX = 0;
167 const VALUE_INDEX = 1; 171 const VALUE_INDEX = 1;
168 const GETTER_INDEX = 2; 172 const GETTER_INDEX = 2;
169 const SETTER_INDEX = 3; 173 const SETTER_INDEX = 3;
170 const WRITABLE_INDEX = 4; 174 const WRITABLE_INDEX = 4;
171 const ENUMERABLE_INDEX = 5; 175 const ENUMERABLE_INDEX = 5;
172 const CONFIGURABLE_INDEX = 6; 176 const CONFIGURABLE_INDEX = 6;
OLDNEW
« no previous file with comments | « src/date.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698