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

Side by Side Diff: src/date.js

Issue 112003005: Initialize Date parse cache with SMI instead of double to workaround sharing mutable heap numbers i… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years 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 | test/mjsunit/regress/regress-280531.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-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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 if (!$isFinite(time)) return NAN; 125 if (!$isFinite(time)) return NAN;
126 if ($abs(time) > MAX_TIME_MS) return NAN; 126 if ($abs(time) > MAX_TIME_MS) return NAN;
127 return TO_INTEGER(time); 127 return TO_INTEGER(time);
128 } 128 }
129 129
130 130
131 // The Date cache is used to limit the cost of parsing the same Date 131 // The Date cache is used to limit the cost of parsing the same Date
132 // strings over and over again. 132 // strings over and over again.
133 var Date_cache = { 133 var Date_cache = {
134 // Cached time value. 134 // Cached time value.
135 time: NAN, 135 time: 0,
136 // String input for which the cached time is valid. 136 // String input for which the cached time is valid.
137 string: null 137 string: null
138 }; 138 };
139 139
140 140
141 function DateConstructor(year, month, date, hours, minutes, seconds, ms) { 141 function DateConstructor(year, month, date, hours, minutes, seconds, ms) {
142 if (!%_IsConstructCall()) { 142 if (!%_IsConstructCall()) {
143 // ECMA 262 - 15.9.2 143 // ECMA 262 - 15.9.2
144 return (new $Date()).toString(); 144 return (new $Date()).toString();
145 } 145 }
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 "toGMTString", DateToGMTString, 819 "toGMTString", DateToGMTString,
820 "toUTCString", DateToUTCString, 820 "toUTCString", DateToUTCString,
821 "getYear", DateGetYear, 821 "getYear", DateGetYear,
822 "setYear", DateSetYear, 822 "setYear", DateSetYear,
823 "toISOString", DateToISOString, 823 "toISOString", DateToISOString,
824 "toJSON", DateToJSON 824 "toJSON", DateToJSON
825 )); 825 ));
826 } 826 }
827 827
828 SetUpDate(); 828 SetUpDate();
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-280531.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698