| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 break; | 87 break; |
| 88 case FIXED_ARRAY_TYPE: | 88 case FIXED_ARRAY_TYPE: |
| 89 FixedArray::cast(this)->FixedArrayVerify(); | 89 FixedArray::cast(this)->FixedArrayVerify(); |
| 90 break; | 90 break; |
| 91 case FIXED_DOUBLE_ARRAY_TYPE: | 91 case FIXED_DOUBLE_ARRAY_TYPE: |
| 92 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); | 92 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); |
| 93 break; | 93 break; |
| 94 case BYTE_ARRAY_TYPE: | 94 case BYTE_ARRAY_TYPE: |
| 95 ByteArray::cast(this)->ByteArrayVerify(); | 95 ByteArray::cast(this)->ByteArrayVerify(); |
| 96 break; | 96 break; |
| 97 case FREE_SPACE_TYPE: |
| 98 FreeSpace::cast(this)->FreeSpaceVerify(); |
| 99 break; |
| 97 case EXTERNAL_PIXEL_ARRAY_TYPE: | 100 case EXTERNAL_PIXEL_ARRAY_TYPE: |
| 98 ExternalPixelArray::cast(this)->ExternalPixelArrayVerify(); | 101 ExternalPixelArray::cast(this)->ExternalPixelArrayVerify(); |
| 99 break; | 102 break; |
| 100 case EXTERNAL_BYTE_ARRAY_TYPE: | 103 case EXTERNAL_BYTE_ARRAY_TYPE: |
| 101 ExternalByteArray::cast(this)->ExternalByteArrayVerify(); | 104 ExternalByteArray::cast(this)->ExternalByteArrayVerify(); |
| 102 break; | 105 break; |
| 103 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: | 106 case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: |
| 104 ExternalUnsignedByteArray::cast(this)->ExternalUnsignedByteArrayVerify(); | 107 ExternalUnsignedByteArray::cast(this)->ExternalUnsignedByteArrayVerify(); |
| 105 break; | 108 break; |
| 106 case EXTERNAL_SHORT_ARRAY_TYPE: | 109 case EXTERNAL_SHORT_ARRAY_TYPE: |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 void HeapNumber::HeapNumberVerify() { | 203 void HeapNumber::HeapNumberVerify() { |
| 201 ASSERT(IsHeapNumber()); | 204 ASSERT(IsHeapNumber()); |
| 202 } | 205 } |
| 203 | 206 |
| 204 | 207 |
| 205 void ByteArray::ByteArrayVerify() { | 208 void ByteArray::ByteArrayVerify() { |
| 206 ASSERT(IsByteArray()); | 209 ASSERT(IsByteArray()); |
| 207 } | 210 } |
| 208 | 211 |
| 209 | 212 |
| 213 void FreeSpace::FreeSpaceVerify() { |
| 214 ASSERT(IsFreeSpace()); |
| 215 } |
| 216 |
| 217 |
| 210 void ExternalPixelArray::ExternalPixelArrayVerify() { | 218 void ExternalPixelArray::ExternalPixelArrayVerify() { |
| 211 ASSERT(IsExternalPixelArray()); | 219 ASSERT(IsExternalPixelArray()); |
| 212 } | 220 } |
| 213 | 221 |
| 214 | 222 |
| 215 void ExternalByteArray::ExternalByteArrayVerify() { | 223 void ExternalByteArray::ExternalByteArrayVerify() { |
| 216 ASSERT(IsExternalByteArray()); | 224 ASSERT(IsExternalByteArray()); |
| 217 } | 225 } |
| 218 | 226 |
| 219 | 227 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 CHECK(!this->parent()->IsConsString()); | 388 CHECK(!this->parent()->IsConsString()); |
| 381 CHECK(!this->parent()->IsSlicedString()); | 389 CHECK(!this->parent()->IsSlicedString()); |
| 382 CHECK(this->length() >= SlicedString::kMinLength); | 390 CHECK(this->length() >= SlicedString::kMinLength); |
| 383 } | 391 } |
| 384 | 392 |
| 385 | 393 |
| 386 void JSFunction::JSFunctionVerify() { | 394 void JSFunction::JSFunctionVerify() { |
| 387 CHECK(IsJSFunction()); | 395 CHECK(IsJSFunction()); |
| 388 VerifyObjectField(kPrototypeOrInitialMapOffset); | 396 VerifyObjectField(kPrototypeOrInitialMapOffset); |
| 389 VerifyObjectField(kNextFunctionLinkOffset); | 397 VerifyObjectField(kNextFunctionLinkOffset); |
| 398 CHECK(code()->IsCode()); |
| 390 CHECK(next_function_link()->IsUndefined() || | 399 CHECK(next_function_link()->IsUndefined() || |
| 391 next_function_link()->IsJSFunction()); | 400 next_function_link()->IsJSFunction()); |
| 392 } | 401 } |
| 393 | 402 |
| 394 | 403 |
| 395 void SharedFunctionInfo::SharedFunctionInfoVerify() { | 404 void SharedFunctionInfo::SharedFunctionInfoVerify() { |
| 396 CHECK(IsSharedFunctionInfo()); | 405 CHECK(IsSharedFunctionInfo()); |
| 397 VerifyObjectField(kNameOffset); | 406 VerifyObjectField(kNameOffset); |
| 398 VerifyObjectField(kCodeOffset); | 407 VerifyObjectField(kCodeOffset); |
| 399 VerifyObjectField(kScopeInfoOffset); | 408 VerifyObjectField(kScopeInfoOffset); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 | 465 |
| 457 void JSGlobalPropertyCell::JSGlobalPropertyCellVerify() { | 466 void JSGlobalPropertyCell::JSGlobalPropertyCellVerify() { |
| 458 CHECK(IsJSGlobalPropertyCell()); | 467 CHECK(IsJSGlobalPropertyCell()); |
| 459 VerifyObjectField(kValueOffset); | 468 VerifyObjectField(kValueOffset); |
| 460 } | 469 } |
| 461 | 470 |
| 462 | 471 |
| 463 void Code::CodeVerify() { | 472 void Code::CodeVerify() { |
| 464 CHECK(IsAligned(reinterpret_cast<intptr_t>(instruction_start()), | 473 CHECK(IsAligned(reinterpret_cast<intptr_t>(instruction_start()), |
| 465 kCodeAlignment)); | 474 kCodeAlignment)); |
| 475 relocation_info()->Verify(); |
| 466 Address last_gc_pc = NULL; | 476 Address last_gc_pc = NULL; |
| 467 for (RelocIterator it(this); !it.done(); it.next()) { | 477 for (RelocIterator it(this); !it.done(); it.next()) { |
| 468 it.rinfo()->Verify(); | 478 it.rinfo()->Verify(); |
| 469 // Ensure that GC will not iterate twice over the same pointer. | 479 // Ensure that GC will not iterate twice over the same pointer. |
| 470 if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) { | 480 if (RelocInfo::IsGCRelocMode(it.rinfo()->rmode())) { |
| 471 CHECK(it.rinfo()->pc() != last_gc_pc); | 481 CHECK(it.rinfo()->pc() != last_gc_pc); |
| 472 last_gc_pc = it.rinfo()->pc(); | 482 last_gc_pc = it.rinfo()->pc(); |
| 473 } | 483 } |
| 474 } | 484 } |
| 475 } | 485 } |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 ASSERT(e->IsUndefined()); | 818 ASSERT(e->IsUndefined()); |
| 809 } | 819 } |
| 810 } | 820 } |
| 811 } | 821 } |
| 812 } | 822 } |
| 813 | 823 |
| 814 | 824 |
| 815 #endif // DEBUG | 825 #endif // DEBUG |
| 816 | 826 |
| 817 } } // namespace v8::internal | 827 } } // namespace v8::internal |
| OLD | NEW |