| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 if (v->IsHeapObject()) { | 371 if (v->IsHeapObject()) { |
| 372 VerifyHeapPointer(v); | 372 VerifyHeapPointer(v); |
| 373 } | 373 } |
| 374 } | 374 } |
| 375 | 375 |
| 376 | 376 |
| 377 void JSDate::JSDateVerify() { | 377 void JSDate::JSDateVerify() { |
| 378 if (value()->IsHeapObject()) { | 378 if (value()->IsHeapObject()) { |
| 379 VerifyHeapPointer(value()); | 379 VerifyHeapPointer(value()); |
| 380 } | 380 } |
| 381 if (local()->IsHeapObject()) { | |
| 382 VerifyHeapPointer(local()); | |
| 383 } | |
| 384 CHECK(value()->IsUndefined() || value()->IsSmi() || value()->IsHeapNumber()); | 381 CHECK(value()->IsUndefined() || value()->IsSmi() || value()->IsHeapNumber()); |
| 385 CHECK(local()->IsUndefined() || local()->IsSmi() || local()->IsHeapNumber()); | |
| 386 CHECK(year()->IsUndefined() || year()->IsSmi() || year()->IsNaN()); | 382 CHECK(year()->IsUndefined() || year()->IsSmi() || year()->IsNaN()); |
| 387 CHECK(month()->IsUndefined() || month()->IsSmi() || month()->IsNaN()); | 383 CHECK(month()->IsUndefined() || month()->IsSmi() || month()->IsNaN()); |
| 388 CHECK(day()->IsUndefined() || day()->IsSmi() || day()->IsNaN()); | 384 CHECK(day()->IsUndefined() || day()->IsSmi() || day()->IsNaN()); |
| 385 CHECK(weekday()->IsUndefined() || weekday()->IsSmi() || weekday()->IsNaN()); |
| 389 CHECK(hour()->IsUndefined() || hour()->IsSmi() || hour()->IsNaN()); | 386 CHECK(hour()->IsUndefined() || hour()->IsSmi() || hour()->IsNaN()); |
| 390 CHECK(min()->IsUndefined() || min()->IsSmi() || min()->IsNaN()); | 387 CHECK(min()->IsUndefined() || min()->IsSmi() || min()->IsNaN()); |
| 391 CHECK(sec()->IsUndefined() || sec()->IsSmi() || sec()->IsNaN()); | 388 CHECK(sec()->IsUndefined() || sec()->IsSmi() || sec()->IsNaN()); |
| 392 CHECK(weekday()->IsUndefined() || weekday()->IsSmi() || weekday()->IsNaN()); | 389 CHECK(cache_stamp()->IsUndefined() || |
| 390 cache_stamp()->IsSmi() || |
| 391 cache_stamp()->IsNaN()); |
| 392 |
| 393 if (month()->IsSmi()) { | 393 if (month()->IsSmi()) { |
| 394 int month = Smi::cast(this->month())->value(); | 394 int month = Smi::cast(this->month())->value(); |
| 395 CHECK(0 <= month && month <= 11); | 395 CHECK(0 <= month && month <= 11); |
| 396 } | 396 } |
| 397 if (day()->IsSmi()) { | 397 if (day()->IsSmi()) { |
| 398 int day = Smi::cast(this->day())->value(); | 398 int day = Smi::cast(this->day())->value(); |
| 399 CHECK(1 <= day && day <= 31); | 399 CHECK(1 <= day && day <= 31); |
| 400 } | 400 } |
| 401 if (hour()->IsSmi()) { | 401 if (hour()->IsSmi()) { |
| 402 int hour = Smi::cast(this->hour())->value(); | 402 int hour = Smi::cast(this->hour())->value(); |
| 403 CHECK(0 <= hour && hour <= 23); | 403 CHECK(0 <= hour && hour <= 23); |
| 404 } | 404 } |
| 405 if (min()->IsSmi()) { | 405 if (min()->IsSmi()) { |
| 406 int min = Smi::cast(this->min())->value(); | 406 int min = Smi::cast(this->min())->value(); |
| 407 CHECK(0 <= min && min <= 59); | 407 CHECK(0 <= min && min <= 59); |
| 408 } | 408 } |
| 409 if (sec()->IsSmi()) { | 409 if (sec()->IsSmi()) { |
| 410 int sec = Smi::cast(this->sec())->value(); | 410 int sec = Smi::cast(this->sec())->value(); |
| 411 CHECK(0 <= sec && sec <= 59); | 411 CHECK(0 <= sec && sec <= 59); |
| 412 } | 412 } |
| 413 if (weekday()->IsSmi()) { | 413 if (weekday()->IsSmi()) { |
| 414 int weekday = Smi::cast(this->weekday())->value(); | 414 int weekday = Smi::cast(this->weekday())->value(); |
| 415 CHECK(0 <= weekday && weekday <= 6); | 415 CHECK(0 <= weekday && weekday <= 6); |
| 416 } | 416 } |
| 417 if (cache_stamp()->IsSmi()) { |
| 418 CHECK(Smi::cast(cache_stamp())->value() <= |
| 419 Smi::cast(Isolate::Current()->date_cache()->stamp())->value()); |
| 420 } |
| 417 } | 421 } |
| 418 | 422 |
| 419 | 423 |
| 420 void JSMessageObject::JSMessageObjectVerify() { | 424 void JSMessageObject::JSMessageObjectVerify() { |
| 421 CHECK(IsJSMessageObject()); | 425 CHECK(IsJSMessageObject()); |
| 422 CHECK(type()->IsString()); | 426 CHECK(type()->IsString()); |
| 423 CHECK(arguments()->IsJSArray()); | 427 CHECK(arguments()->IsJSArray()); |
| 424 VerifyObjectField(kStartPositionOffset); | 428 VerifyObjectField(kStartPositionOffset); |
| 425 VerifyObjectField(kEndPositionOffset); | 429 VerifyObjectField(kEndPositionOffset); |
| 426 VerifyObjectField(kArgumentsOffset); | 430 VerifyObjectField(kArgumentsOffset); |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 ASSERT(e->IsUndefined()); | 918 ASSERT(e->IsUndefined()); |
| 915 } | 919 } |
| 916 } | 920 } |
| 917 } | 921 } |
| 918 } | 922 } |
| 919 | 923 |
| 920 | 924 |
| 921 #endif // DEBUG | 925 #endif // DEBUG |
| 922 | 926 |
| 923 } } // namespace v8::internal | 927 } } // namespace v8::internal |
| OLD | NEW |