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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/objects.h" 5 #include "src/objects.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/disasm.h" 8 #include "src/disasm.h"
9 #include "src/disassembler.h" 9 #include "src/disassembler.h"
10 #include "src/field-type.h" 10 #include "src/field-type.h"
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 CHECK(deferred()->IsJSObject() || deferred()->IsUndefined(isolate)); 936 CHECK(deferred()->IsJSObject() || deferred()->IsUndefined(isolate));
937 CHECK(before_debug_event()->IsJSObject() || 937 CHECK(before_debug_event()->IsJSObject() ||
938 before_debug_event()->IsUndefined(isolate)); 938 before_debug_event()->IsUndefined(isolate));
939 CHECK(after_debug_event()->IsJSObject() || 939 CHECK(after_debug_event()->IsJSObject() ||
940 after_debug_event()->IsUndefined(isolate)); 940 after_debug_event()->IsUndefined(isolate));
941 CHECK(context()->IsContext()); 941 CHECK(context()->IsContext());
942 } 942 }
943 943
944 void JSModuleNamespace::JSModuleNamespaceVerify() { 944 void JSModuleNamespace::JSModuleNamespaceVerify() {
945 CHECK(IsJSModuleNamespace()); 945 CHECK(IsJSModuleNamespace());
946 module()->ObjectVerify(); 946 VerifyPointer(module());
947 } 947 }
948 948
949 void JSFixedArrayIterator::JSFixedArrayIteratorVerify() { 949 void JSFixedArrayIterator::JSFixedArrayIteratorVerify() {
950 CHECK(IsJSFixedArrayIterator()); 950 CHECK(IsJSFixedArrayIterator());
951 951
952 CHECK(array()->IsFixedArray()); 952 VerifyPointer(array());
953 VerifyPointer(initial_next());
953 VerifySmiField(kIndexOffset); 954 VerifySmiField(kIndexOffset);
954 CHECK(initial_next()->IsJSFunction());
955 955
956 CHECK_LE(index(), array()->length()); 956 CHECK_LE(index(), array()->length());
957 } 957 }
958 958
959 void Module::ModuleVerify() { 959 void Module::ModuleVerify() {
960 Isolate* isolate = GetIsolate();
961 CHECK(IsModule()); 960 CHECK(IsModule());
962 CHECK(code()->IsSharedFunctionInfo() || code()->IsJSFunction()); 961
963 code()->ObjectVerify(); 962 VerifyPointer(code());
964 exports()->ObjectVerify(); 963 VerifyPointer(exports());
965 requested_modules()->ObjectVerify(); 964 VerifyPointer(module_namespace());
966 VerifySmiField(kFlagsOffset); 965 VerifyPointer(requested_modules());
967 VerifySmiField(kHashOffset); 966 VerifySmiField(kHashOffset);
968 CHECK(module_namespace()->IsUndefined(isolate) || 967
968 CHECK((!instantiated() && code()->IsSharedFunctionInfo()) ||
969 (instantiated() && !evaluated() && code()->IsJSFunction()) ||
970 (instantiated() && evaluated() && code()->IsModuleInfo()));
971
972 CHECK(module_namespace()->IsUndefined(GetIsolate()) ||
969 module_namespace()->IsJSModuleNamespace()); 973 module_namespace()->IsJSModuleNamespace());
974
970 // TODO(neis): Check more. 975 // TODO(neis): Check more.
971 } 976 }
972 977
973 void PrototypeInfo::PrototypeInfoVerify() { 978 void PrototypeInfo::PrototypeInfoVerify() {
974 CHECK(IsPrototypeInfo()); 979 CHECK(IsPrototypeInfo());
975 if (prototype_users()->IsWeakFixedArray()) { 980 if (prototype_users()->IsWeakFixedArray()) {
976 WeakFixedArray::cast(prototype_users())->FixedArrayVerify(); 981 WeakFixedArray::cast(prototype_users())->FixedArrayVerify();
977 } else { 982 } else {
978 CHECK(prototype_users()->IsSmi()); 983 CHECK(prototype_users()->IsSmi());
979 } 984 }
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 1413
1409 // Both are done at the same time. 1414 // Both are done at the same time.
1410 CHECK_EQ(new_it.done(), old_it.done()); 1415 CHECK_EQ(new_it.done(), old_it.done());
1411 } 1416 }
1412 1417
1413 1418
1414 #endif // DEBUG 1419 #endif // DEBUG
1415 1420
1416 } // namespace internal 1421 } // namespace internal
1417 } // namespace v8 1422 } // namespace v8
OLDNEW
« 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