Index: src/objects-debug.cc |
diff --git a/src/objects-debug.cc b/src/objects-debug.cc |
index 4587d2e596b680edf08dd25ec7ae770ad82c2919..b68895fbc6d27745e4dd8e1ca6bc71674b772ef9 100644 |
--- a/src/objects-debug.cc |
+++ b/src/objects-debug.cc |
@@ -70,6 +70,9 @@ void HeapObject::HeapObjectVerify() { |
case BYTE_ARRAY_TYPE: |
ByteArray::cast(this)->ByteArrayVerify(); |
break; |
+ case BYTECODE_ARRAY_TYPE: |
+ BytecodeArray::cast(this)->BytecodeArrayVerify(); |
+ break; |
case FREE_SPACE_TYPE: |
FreeSpace::cast(this)->FreeSpaceVerify(); |
break; |
@@ -222,6 +225,12 @@ void ByteArray::ByteArrayVerify() { |
} |
+void BytecodeArray::BytecodeArrayVerify() { |
+ // TODO(oth): Walk bytecodes and immediate values to validate sanity. |
+ CHECK(IsBytecodeArray()); |
+} |
+ |
+ |
void FreeSpace::FreeSpaceVerify() { |
CHECK(IsFreeSpace()); |
} |
@@ -540,6 +549,8 @@ void SharedFunctionInfo::SharedFunctionInfoVerify() { |
VerifyObjectField(kFeedbackVectorOffset); |
VerifyObjectField(kScopeInfoOffset); |
VerifyObjectField(kInstanceClassNameOffset); |
+ CHECK(function_data()->IsUndefined() || IsApiFunction() || |
+ HasBuiltinFunctionId() || HasBytecodeArray()); |
VerifyObjectField(kFunctionDataOffset); |
VerifyObjectField(kScriptOffset); |
VerifyObjectField(kDebugInfoOffset); |