Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/disasm.h" | 7 #include "src/disasm.h" |
| 8 #include "src/disassembler.h" | 8 #include "src/disassembler.h" |
| 9 #include "src/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
| 10 #include "src/jsregexp.h" | 10 #include "src/jsregexp.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 break; | 63 break; |
| 64 case FIXED_ARRAY_TYPE: | 64 case FIXED_ARRAY_TYPE: |
| 65 FixedArray::cast(this)->FixedArrayVerify(); | 65 FixedArray::cast(this)->FixedArrayVerify(); |
| 66 break; | 66 break; |
| 67 case FIXED_DOUBLE_ARRAY_TYPE: | 67 case FIXED_DOUBLE_ARRAY_TYPE: |
| 68 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); | 68 FixedDoubleArray::cast(this)->FixedDoubleArrayVerify(); |
| 69 break; | 69 break; |
| 70 case BYTE_ARRAY_TYPE: | 70 case BYTE_ARRAY_TYPE: |
| 71 ByteArray::cast(this)->ByteArrayVerify(); | 71 ByteArray::cast(this)->ByteArrayVerify(); |
| 72 break; | 72 break; |
| 73 case BYTECODE_ARRAY_TYPE: | |
| 74 BytecodeArray::cast(this)->BytecodeArrayVerify(); | |
| 75 break; | |
| 73 case FREE_SPACE_TYPE: | 76 case FREE_SPACE_TYPE: |
| 74 FreeSpace::cast(this)->FreeSpaceVerify(); | 77 FreeSpace::cast(this)->FreeSpaceVerify(); |
| 75 break; | 78 break; |
| 76 | 79 |
| 77 #define VERIFY_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ | 80 #define VERIFY_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ |
| 78 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ | 81 case EXTERNAL_##TYPE##_ARRAY_TYPE: \ |
| 79 External##Type##Array::cast(this)->External##Type##ArrayVerify(); \ | 82 External##Type##Array::cast(this)->External##Type##ArrayVerify(); \ |
| 80 break; \ | 83 break; \ |
| 81 case FIXED_##TYPE##_ARRAY_TYPE: \ | 84 case FIXED_##TYPE##_ARRAY_TYPE: \ |
| 82 Fixed##Type##Array::cast(this)->FixedTypedArrayVerify(); \ | 85 Fixed##Type##Array::cast(this)->FixedTypedArrayVerify(); \ |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 | 218 |
| 216 | 219 |
| 217 void Float32x4::Float32x4Verify() { CHECK(IsFloat32x4()); } | 220 void Float32x4::Float32x4Verify() { CHECK(IsFloat32x4()); } |
| 218 | 221 |
| 219 | 222 |
| 220 void ByteArray::ByteArrayVerify() { | 223 void ByteArray::ByteArrayVerify() { |
| 221 CHECK(IsByteArray()); | 224 CHECK(IsByteArray()); |
| 222 } | 225 } |
| 223 | 226 |
| 224 | 227 |
| 228 void BytecodeArray::BytecodeArrayVerify() { | |
| 229 // TODO(oth): Walk bytecodes and immediate values to validate sanity. | |
| 230 CHECK(IsBytecodeArray()); | |
| 231 } | |
| 232 | |
| 233 | |
| 225 void FreeSpace::FreeSpaceVerify() { | 234 void FreeSpace::FreeSpaceVerify() { |
| 226 CHECK(IsFreeSpace()); | 235 CHECK(IsFreeSpace()); |
| 227 } | 236 } |
| 228 | 237 |
| 229 | 238 |
| 230 #define EXTERNAL_ARRAY_VERIFY(Type, type, TYPE, ctype, size) \ | 239 #define EXTERNAL_ARRAY_VERIFY(Type, type, TYPE, ctype, size) \ |
| 231 void External##Type##Array::External##Type##ArrayVerify() { \ | 240 void External##Type##Array::External##Type##ArrayVerify() { \ |
| 232 CHECK(IsExternal##Type##Array()); \ | 241 CHECK(IsExternal##Type##Array()); \ |
| 233 } | 242 } |
| 234 | 243 |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 533 | 542 |
| 534 | 543 |
| 535 void SharedFunctionInfo::SharedFunctionInfoVerify() { | 544 void SharedFunctionInfo::SharedFunctionInfoVerify() { |
| 536 CHECK(IsSharedFunctionInfo()); | 545 CHECK(IsSharedFunctionInfo()); |
| 537 VerifyObjectField(kNameOffset); | 546 VerifyObjectField(kNameOffset); |
| 538 VerifyObjectField(kCodeOffset); | 547 VerifyObjectField(kCodeOffset); |
| 539 VerifyObjectField(kOptimizedCodeMapOffset); | 548 VerifyObjectField(kOptimizedCodeMapOffset); |
| 540 VerifyObjectField(kFeedbackVectorOffset); | 549 VerifyObjectField(kFeedbackVectorOffset); |
| 541 VerifyObjectField(kScopeInfoOffset); | 550 VerifyObjectField(kScopeInfoOffset); |
| 542 VerifyObjectField(kInstanceClassNameOffset); | 551 VerifyObjectField(kInstanceClassNameOffset); |
| 543 VerifyObjectField(kFunctionDataOffset); | 552 VerifyObjectField(kFunctionDataOffset); |
|
rmcilroy
2015/07/22 07:44:00
Could you add a CHECK here that kFunctionDataOffse
oth
2015/07/22 08:50:00
Done. And added call to verify Smi/BytecodeArray.
| |
| 544 VerifyObjectField(kScriptOffset); | 553 VerifyObjectField(kScriptOffset); |
| 545 VerifyObjectField(kDebugInfoOffset); | 554 VerifyObjectField(kDebugInfoOffset); |
| 546 } | 555 } |
| 547 | 556 |
| 548 | 557 |
| 549 void JSGlobalProxy::JSGlobalProxyVerify() { | 558 void JSGlobalProxy::JSGlobalProxyVerify() { |
| 550 CHECK(IsJSGlobalProxy()); | 559 CHECK(IsJSGlobalProxy()); |
| 551 JSObjectVerify(); | 560 JSObjectVerify(); |
| 552 VerifyObjectField(JSGlobalProxy::kNativeContextOffset); | 561 VerifyObjectField(JSGlobalProxy::kNativeContextOffset); |
| 553 // Make sure that this object has no properties, elements. | 562 // Make sure that this object has no properties, elements. |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1272 : it.rinfo()->target_object(); | 1281 : it.rinfo()->target_object(); |
| 1273 CHECK(!CanLeak(target, heap, skip_weak_cell)); | 1282 CHECK(!CanLeak(target, heap, skip_weak_cell)); |
| 1274 } | 1283 } |
| 1275 } | 1284 } |
| 1276 | 1285 |
| 1277 | 1286 |
| 1278 #endif // DEBUG | 1287 #endif // DEBUG |
| 1279 | 1288 |
| 1280 } // namespace internal | 1289 } // namespace internal |
| 1281 } // namespace v8 | 1290 } // namespace v8 |
| OLD | NEW |