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

Unified Diff: src/objects-debug.cc

Issue 690713003: Assert that unoptimized code does not embed context-specific objects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: do not allow objects from builtins context Created 6 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.h ('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 92bd97a87fcdde55ecb64f79f1469d6c99731f77..353cfdaa44bb686aa658df166bd5ea9841c467a2 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -1218,6 +1218,24 @@ bool TransitionArray::IsConsistentWithBackPointers(Map* current_map) {
}
+void Code::VerifyEmbeddedObjectsInFullCode() {
+ // Check that no context-specific object has been embedded.
+ Heap* heap = GetIsolate()->heap();
+ int mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
+ for (RelocIterator it(this, mask); !it.done(); it.next()) {
+ Object* obj = it.rinfo()->target_object();
+ if (obj->IsCell()) obj = Cell::cast(obj)->value();
+ if (obj->IsPropertyCell()) obj = PropertyCell::cast(obj)->value();
+ if (!obj->IsHeapObject()) continue;
+ Map* map = obj->IsMap() ? Map::cast(obj) : HeapObject::cast(obj)->map();
+ int i = 0;
+ while (map != heap->roots_array_start()[i++]) {
+ CHECK_LT(i, Heap::kStrongRootListLength);
+ }
+ }
+}
+
+
#endif // DEBUG
} } // namespace v8::internal
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698