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

Unified Diff: src/objects-debug.cc

Issue 9307083: Implement caching scheme for Date fields. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased to HEAD. Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index f332d442ea27d506e97b9f43a70dd792993f40fc..61ee9a12246e1959c075231d6ceb312d7f298602 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -378,38 +378,42 @@ void JSDate::JSDateVerify() {
if (value()->IsHeapObject()) {
VerifyHeapPointer(value());
}
+ if (local()->IsHeapObject()) {
+ VerifyHeapPointer(local());
+ }
CHECK(value()->IsUndefined() || value()->IsSmi() || value()->IsHeapNumber());
-/* Don't check yet, will still be undefined...
- if (value()->IsHeapNumber() && isnan(HeapNumber::cast(value())->value())) {
- CHECK(year()->IsHeapNumber() && isnan(HeapNumber::cast(year())->value()));
- CHECK(month()->IsHeapNumber() && isnan(HeapNumber::cast(month())->value()));
- CHECK(day()->IsHeapNumber() && isnan(HeapNumber::cast(day())->value()));
- CHECK(hour()->IsHeapNumber() && isnan(HeapNumber::cast(hour())->value()));
- CHECK(min()->IsHeapNumber() && isnan(HeapNumber::cast(min())->value()));
- CHECK(sec()->IsHeapNumber() && isnan(HeapNumber::cast(sec())->value()));
- CHECK(ms()->IsHeapNumber() && isnan(HeapNumber::cast(ms())->value()));
- return;
+ CHECK(local()->IsUndefined() || local()->IsSmi() || local()->IsHeapNumber());
+ CHECK(year()->IsUndefined() || year()->IsSmi() || year()->IsNaN());
+ CHECK(month()->IsUndefined() || month()->IsSmi() || month()->IsNaN());
+ CHECK(day()->IsUndefined() || day()->IsSmi() || day()->IsNaN());
+ CHECK(hour()->IsUndefined() || hour()->IsSmi() || hour()->IsNaN());
+ CHECK(min()->IsUndefined() || min()->IsSmi() || min()->IsNaN());
+ CHECK(sec()->IsUndefined() || sec()->IsSmi() || sec()->IsNaN());
+ CHECK(weekday()->IsUndefined() || weekday()->IsSmi() || weekday()->IsNaN());
+ if (month()->IsSmi()) {
+ int month = Smi::cast(this->month())->value();
+ CHECK(0 <= month && month <= 11);
+ }
+ if (day()->IsSmi()) {
+ int day = Smi::cast(this->day())->value();
+ CHECK(1 <= day && day <= 31);
+ }
+ if (hour()->IsSmi()) {
+ int hour = Smi::cast(this->hour())->value();
+ CHECK(0 <= hour && hour <= 23);
+ }
+ if (min()->IsSmi()) {
+ int min = Smi::cast(this->min())->value();
+ CHECK(0 <= min && min <= 59);
+ }
+ if (sec()->IsSmi()) {
+ int sec = Smi::cast(this->sec())->value();
+ CHECK(0 <= sec && sec <= 59);
+ }
+ if (weekday()->IsSmi()) {
+ int weekday = Smi::cast(this->weekday())->value();
+ CHECK(0 <= weekday && weekday <= 6);
}
- CHECK(year()->IsSmi());
- CHECK(month()->IsSmi());
- CHECK(day()->IsSmi());
- CHECK(hour()->IsSmi());
- CHECK(min()->IsSmi());
- CHECK(sec()->IsSmi());
- CHECK(ms()->IsSmi());
- int month = Smi::cast(this->month())->value();
- int day = Smi::cast(this->day())->value();
- int hour = Smi::cast(this->hour())->value();
- int min = Smi::cast(this->min())->value();
- int sec = Smi::cast(this->sec())->value();
- int ms = Smi::cast(this->ms())->value();
- CHECK(1 <= month && month <= 12);
- CHECK(1 <= day && day <= 31);
- CHECK(0 <= hour && hour <= 23);
- CHECK(0 <= min && min <= 59);
- CHECK(0 <= sec && sec <= 59);
- CHECK(0 <= ms && ms <= 999);
-*/
}
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698