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

Side by Side Diff: src/date.js

Issue 8409010: Optimize JS date implementation for smi-only arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: remove superfluous double-elements case Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/runtime.cc » ('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-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 + TO_INTEGER(ms); 287 + TO_INTEGER(ms);
288 } 288 }
289 289
290 290
291 // ECMA 262 - 15.9.1.12 291 // ECMA 262 - 15.9.1.12
292 function TimeInYear(year) { 292 function TimeInYear(year) {
293 return DaysInYear(year) * msPerDay; 293 return DaysInYear(year) * msPerDay;
294 } 294 }
295 295
296 296
297 var ymd_from_time_cache = [$NaN, $NaN, $NaN]; 297 var ymd_from_time_cache = [1970, 0, 1];
298 var ymd_from_time_cached_time = $NaN; 298 var ymd_from_time_cached_time = 0;
299 299
300 function YearFromTime(t) { 300 function YearFromTime(t) {
301 if (t !== ymd_from_time_cached_time) { 301 if (t !== ymd_from_time_cached_time) {
302 if (!$isFinite(t)) { 302 if (!$isFinite(t)) {
303 return $NaN; 303 return $NaN;
304 } 304 }
305 305
306 %DateYMDFromTime(t, ymd_from_time_cache); 306 %DateYMDFromTime(t, ymd_from_time_cache);
307 ymd_from_time_cached_time = t 307 ymd_from_time_cached_time = t
308 } 308 }
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 "toGMTString", DateToGMTString, 1106 "toGMTString", DateToGMTString,
1107 "toUTCString", DateToUTCString, 1107 "toUTCString", DateToUTCString,
1108 "getYear", DateGetYear, 1108 "getYear", DateGetYear,
1109 "setYear", DateSetYear, 1109 "setYear", DateSetYear,
1110 "toISOString", DateToISOString, 1110 "toISOString", DateToISOString,
1111 "toJSON", DateToJSON 1111 "toJSON", DateToJSON
1112 )); 1112 ));
1113 } 1113 }
1114 1114
1115 SetUpDate(); 1115 SetUpDate();
OLDNEW
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698