Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: src/objects-debug.cc

Issue 2537093002: Check some more invariants on SFIs. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/scopeinfo.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index db50cfba75b5e5f64550075a8c0afa407ea8d8d0..57ac691b6aa24e6b6e68966fdc30b97c9e0840d4 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -604,21 +604,29 @@ void JSFunction::JSFunctionVerify() {
void SharedFunctionInfo::SharedFunctionInfoVerify() {
CHECK(IsSharedFunctionInfo());
- VerifyObjectField(kNameOffset);
+
VerifyObjectField(kCodeOffset);
- VerifyObjectField(kOptimizedCodeMapOffset);
+ VerifyObjectField(kDebugInfoOffset);
VerifyObjectField(kFeedbackMetadataOffset);
- VerifyObjectField(kScopeInfoOffset);
- VerifyObjectField(kOuterScopeInfoOffset);
+ VerifyObjectField(kFunctionDataOffset);
+ VerifyObjectField(kFunctionIdentifierOffset);
VerifyObjectField(kInstanceClassNameOffset);
+ VerifyObjectField(kNameOffset);
+ VerifyObjectField(kOptimizedCodeMapOffset);
+ VerifyObjectField(kOuterScopeInfoOffset);
+ VerifyObjectField(kScopeInfoOffset);
+ VerifyObjectField(kScriptOffset);
+
CHECK(function_data()->IsUndefined(GetIsolate()) || IsApiFunction() ||
HasBytecodeArray() || HasAsmWasmData());
- VerifyObjectField(kFunctionDataOffset);
- VerifyObjectField(kScriptOffset);
- VerifyObjectField(kDebugInfoOffset);
+
CHECK(function_identifier()->IsUndefined(GetIsolate()) ||
HasBuiltinFunctionId() || HasInferredName());
- VerifyObjectField(kFunctionIdentifierOffset);
+
+ if (scope_info()->length() > 0) {
+ CHECK(kind() == scope_info()->function_kind());
+ CHECK_EQ(kind() == kModule, scope_info()->scope_type() == MODULE_SCOPE);
+ }
}
« no previous file with comments | « src/ast/scopeinfo.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698