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

Side by Side Diff: runtime/lib/date.cc

Issue 9114054: Port a couple more stubs to x64. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/integers.cc » ('j') | runtime/lib/integers.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/bootstrap_natives.h" 5 #include "vm/bootstrap_natives.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/native_entry.h" 8 #include "vm/native_entry.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/os.h" 10 #include "vm/os.h"
11 11
(...skipping 21 matching lines...) Expand all
33 UNIMPLEMENTED(); 33 UNIMPLEMENTED();
34 } 34 }
35 Smi& smi_years = Smi::Handle(); 35 Smi& smi_years = Smi::Handle();
36 smi_years ^= dart_years.raw(); 36 smi_years ^= dart_years.raw();
37 OS::BrokenDownDate broken_down; 37 OS::BrokenDownDate broken_down;
38 // mktime takes the years since 1900. 38 // mktime takes the years since 1900.
39 // TODO(floitsch): Removing 1900 could underflow the intptr_t. 39 // TODO(floitsch): Removing 1900 could underflow the intptr_t.
40 intptr_t year = smi_years.Value() - 1900; 40 intptr_t year = smi_years.Value() - 1900;
41 // TODO(floitsch): We don't handle the case yet where intptr_t and int have 41 // TODO(floitsch): We don't handle the case yet where intptr_t and int have
42 // different sizes. 42 // different sizes.
43 ASSERT(sizeof(year) <= sizeof(broken_down.year)); 43 // See issue 1143.
Ivan Posva 2012/01/12 22:27:31 How about changing the TODO above to TODO(1143) in
regis 2012/01/12 22:53:37 Done. Also added a static cast to make the convers
44 // ASSERT(sizeof(year) <= sizeof(broken_down.year));
44 broken_down.year = year; 45 broken_down.year = year;
45 // libc months are 0-based (contrary to Dart' 1-based months). 46 // libc months are 0-based (contrary to Dart' 1-based months).
46 broken_down.month = dart_month.Value() - 1; 47 broken_down.month = dart_month.Value() - 1;
47 broken_down.day = dart_day.Value(); 48 broken_down.day = dart_day.Value();
48 broken_down.hours = dart_hours.Value(); 49 broken_down.hours = dart_hours.Value();
49 broken_down.minutes = dart_minutes.Value(); 50 broken_down.minutes = dart_minutes.Value();
50 broken_down.seconds = dart_seconds.Value(); 51 broken_down.seconds = dart_seconds.Value();
51 time_t value; 52 time_t value;
52 bool succeeded = OS::BrokenDownToSecondsSinceEpoch(broken_down, 53 bool succeeded = OS::BrokenDownToSecondsSinceEpoch(broken_down,
53 dart_is_utc.value(), 54 dart_is_utc.value(),
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 bool succeeded = 147 bool succeeded =
147 BreakDownSecondsSinceEpoch(dart_seconds, dart_is_utc, &broken_down); 148 BreakDownSecondsSinceEpoch(dart_seconds, dart_is_utc, &broken_down);
148 if (!succeeded) { 149 if (!succeeded) {
149 UNIMPLEMENTED(); 150 UNIMPLEMENTED();
150 } 151 }
151 const Smi& result = Smi::Handle(Smi::New(broken_down.seconds)); 152 const Smi& result = Smi::Handle(Smi::New(broken_down.seconds));
152 arguments->SetReturn(result); 153 arguments->SetReturn(result);
153 } 154 }
154 155
155 } // namespace dart 156 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/integers.cc » ('j') | runtime/lib/integers.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698