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); |
| 552 CHECK(function_data()->IsUndefined() || IsApiFunction() || |
| 553 HasBuiltinFunctionId() || HasBytecodeArray()); |
543 VerifyObjectField(kFunctionDataOffset); | 554 VerifyObjectField(kFunctionDataOffset); |
544 VerifyObjectField(kScriptOffset); | 555 VerifyObjectField(kScriptOffset); |
545 VerifyObjectField(kDebugInfoOffset); | 556 VerifyObjectField(kDebugInfoOffset); |
546 } | 557 } |
547 | 558 |
548 | 559 |
549 void JSGlobalProxy::JSGlobalProxyVerify() { | 560 void JSGlobalProxy::JSGlobalProxyVerify() { |
550 CHECK(IsJSGlobalProxy()); | 561 CHECK(IsJSGlobalProxy()); |
551 JSObjectVerify(); | 562 JSObjectVerify(); |
552 VerifyObjectField(JSGlobalProxy::kNativeContextOffset); | 563 VerifyObjectField(JSGlobalProxy::kNativeContextOffset); |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 : it.rinfo()->target_object(); | 1282 : it.rinfo()->target_object(); |
1272 CHECK(!CanLeak(target, heap, skip_weak_cell)); | 1283 CHECK(!CanLeak(target, heap, skip_weak_cell)); |
1273 } | 1284 } |
1274 } | 1285 } |
1275 | 1286 |
1276 | 1287 |
1277 #endif // DEBUG | 1288 #endif // DEBUG |
1278 | 1289 |
1279 } // namespace internal | 1290 } // namespace internal |
1280 } // namespace v8 | 1291 } // namespace v8 |
OLD | NEW |