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

Side by Side Diff: src/runtime.cc

Issue 1132002: Add parens to DateYMDFromTimeSlow to clearify. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 9 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 | 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 5713 matching lines...) Expand 10 before | Expand all | Expand 10 after
5724 year += 4 * yd2; 5724 year += 4 * yd2;
5725 5725
5726 date--; 5726 date--;
5727 int yd3 = date / 365; 5727 int yd3 = date / 365;
5728 date %= 365; 5728 date %= 365;
5729 year += yd3; 5729 year += yd3;
5730 5730
5731 bool is_leap = (!yd1 || yd2) && !yd3; 5731 bool is_leap = (!yd1 || yd2) && !yd3;
5732 5732
5733 ASSERT(date >= -1); 5733 ASSERT(date >= -1);
5734 ASSERT(is_leap || date >= 0); 5734 ASSERT(is_leap || (date >= 0));
5735 ASSERT(date < 365 || is_leap && date < 366); 5735 ASSERT((date < 365) || (is_leap && (date < 366)));
5736 ASSERT(is_leap == (year % 4 == 0 && (year % 100 || (year % 400 == 0)))); 5736 ASSERT(is_leap == ((year % 4 == 0) && (year % 100 || (year % 400 == 0))));
5737 ASSERT(is_leap || MakeDay(year, 0, 1) + date == save_date); 5737 ASSERT(is_leap || ((MakeDay(year, 0, 1) + date) == save_date));
5738 ASSERT(!is_leap || MakeDay(year, 0, 1) + date + 1 == save_date); 5738 ASSERT(!is_leap || ((MakeDay(year, 0, 1) + date + 1) == save_date));
5739 5739
5740 if (is_leap) { 5740 if (is_leap) {
5741 day = kDayInYear[2*365 + 1 + date]; 5741 day = kDayInYear[2*365 + 1 + date];
5742 month = kMonthInYear[2*365 + 1 + date]; 5742 month = kMonthInYear[2*365 + 1 + date];
5743 } else { 5743 } else {
5744 day = kDayInYear[date]; 5744 day = kDayInYear[date];
5745 month = kMonthInYear[date]; 5745 month = kMonthInYear[date];
5746 } 5746 }
5747 5747
5748 ASSERT(MakeDay(year, month, day) == save_date); 5748 ASSERT(MakeDay(year, month, day) == save_date);
(...skipping 3675 matching lines...) Expand 10 before | Expand all | Expand 10 after
9424 } else { 9424 } else {
9425 // Handle last resort GC and make sure to allow future allocations 9425 // Handle last resort GC and make sure to allow future allocations
9426 // to grow the heap without causing GCs (if possible). 9426 // to grow the heap without causing GCs (if possible).
9427 Counters::gc_last_resort_from_js.Increment(); 9427 Counters::gc_last_resort_from_js.Increment();
9428 Heap::CollectAllGarbage(false); 9428 Heap::CollectAllGarbage(false);
9429 } 9429 }
9430 } 9430 }
9431 9431
9432 9432
9433 } } // namespace v8::internal 9433 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698