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

Side by Side Diff: src/date.js

Issue 10837165: Lattice-based representation inference, powered by left/right specific type feedback for BinaryOps … (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback; fixed tests Created 8 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 | « src/code-stubs.cc ('k') | src/heap.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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 year = TO_INTEGER_MAP_MINUS_ZERO(year); 100 year = TO_INTEGER_MAP_MINUS_ZERO(year);
101 month = TO_INTEGER_MAP_MINUS_ZERO(month); 101 month = TO_INTEGER_MAP_MINUS_ZERO(month);
102 date = TO_INTEGER_MAP_MINUS_ZERO(date); 102 date = TO_INTEGER_MAP_MINUS_ZERO(date);
103 103
104 if (year < kMinYear || year > kMaxYear || 104 if (year < kMinYear || year > kMaxYear ||
105 month < kMinMonth || month > kMaxMonth) { 105 month < kMinMonth || month > kMaxMonth) {
106 return $NaN; 106 return $NaN;
107 } 107 }
108 108
109 // Now we rely on year and month being SMIs. 109 // Now we rely on year and month being SMIs.
110 return %DateMakeDay(year, month) + date - 1; 110 return %DateMakeDay(year | 0, month | 0) + date - 1;
111 } 111 }
112 112
113 113
114 // ECMA 262 - 15.9.1.13 114 // ECMA 262 - 15.9.1.13
115 function MakeDate(day, time) { 115 function MakeDate(day, time) {
116 var time = day * msPerDay + time; 116 var time = day * msPerDay + time;
117 // Some of our runtime funtions for computing UTC(time) rely on 117 // Some of our runtime funtions for computing UTC(time) rely on
118 // times not being significantly larger than MAX_TIME_MS. If there 118 // times not being significantly larger than MAX_TIME_MS. If there
119 // is no way that the time can be within range even after UTC 119 // is no way that the time can be within range even after UTC
120 // conversion we return NaN immediately instead of relying on 120 // conversion we return NaN immediately instead of relying on
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 "toGMTString", DateToGMTString, 823 "toGMTString", DateToGMTString,
824 "toUTCString", DateToUTCString, 824 "toUTCString", DateToUTCString,
825 "getYear", DateGetYear, 825 "getYear", DateGetYear,
826 "setYear", DateSetYear, 826 "setYear", DateSetYear,
827 "toISOString", DateToISOString, 827 "toISOString", DateToISOString,
828 "toJSON", DateToJSON 828 "toJSON", DateToJSON
829 )); 829 ));
830 } 830 }
831 831
832 SetUpDate(); 832 SetUpDate();
OLDNEW
« no previous file with comments | « src/code-stubs.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698