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

Unified Diff: src/objects-debug.cc

Issue 2407183002: [modules] Don't unnecessarily keep function alive after evaluation. (Closed)
Patch Set: Remove stale offset. Created 4 years, 2 months 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/objects.cc ('k') | src/objects-inl.h » ('j') | 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 3b233024e63ffdcf3cf0b23987bf335b9c897e5a..4f37c2b20dc146651f7169ad9007e8cb90bfb3a6 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -943,30 +943,35 @@ void PromiseReactionJobInfo::PromiseReactionJobInfoVerify() {
void JSModuleNamespace::JSModuleNamespaceVerify() {
CHECK(IsJSModuleNamespace());
- module()->ObjectVerify();
+ VerifyPointer(module());
}
void JSFixedArrayIterator::JSFixedArrayIteratorVerify() {
CHECK(IsJSFixedArrayIterator());
- CHECK(array()->IsFixedArray());
+ VerifyPointer(array());
+ VerifyPointer(initial_next());
VerifySmiField(kIndexOffset);
- CHECK(initial_next()->IsJSFunction());
CHECK_LE(index(), array()->length());
}
void Module::ModuleVerify() {
- Isolate* isolate = GetIsolate();
CHECK(IsModule());
- CHECK(code()->IsSharedFunctionInfo() || code()->IsJSFunction());
- code()->ObjectVerify();
- exports()->ObjectVerify();
- requested_modules()->ObjectVerify();
- VerifySmiField(kFlagsOffset);
+
+ VerifyPointer(code());
+ VerifyPointer(exports());
+ VerifyPointer(module_namespace());
+ VerifyPointer(requested_modules());
VerifySmiField(kHashOffset);
- CHECK(module_namespace()->IsUndefined(isolate) ||
+
+ CHECK((!instantiated() && code()->IsSharedFunctionInfo()) ||
+ (instantiated() && !evaluated() && code()->IsJSFunction()) ||
+ (instantiated() && evaluated() && code()->IsModuleInfo()));
+
+ CHECK(module_namespace()->IsUndefined(GetIsolate()) ||
module_namespace()->IsJSModuleNamespace());
+
// TODO(neis): Check more.
}
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698