Revision: 25029
Author: [email protected]
Date: Fri Oct 31 09:30:59 2014 UTC
Log: Assert that unoptimized code does not embed context-specific
objects.
[email protected]
Review URL: https://codereview.chromium.org/690713003
https://code.google.com/p/v8/source/detail?r=25029
Modified:
/branches/bleeding_edge/src/full-codegen.cc
/branches/bleeding_edge/src/objects-debug.cc
/branches/bleeding_edge/src/objects.h
=======================================
--- /branches/bleeding_edge/src/full-codegen.cc Tue Oct 28 13:23:54 2014 UTC
+++ /branches/bleeding_edge/src/full-codegen.cc Fri Oct 31 09:30:59 2014 UTC
@@ -346,6 +346,11 @@
info->SetCode(code);
void* line_info = masm.positions_recorder()->DetachJITHandlerData();
LOG_CODE_EVENT(isolate, CodeEndLinePosInfoRecordEvent(*code, line_info));
+
+#ifdef DEBUG
+ // Check that no context-specific object has been embedded.
+ code->VerifyEmbeddedObjectsInFullCode();
+#endif // DEBUG
return true;
}
=======================================
--- /branches/bleeding_edge/src/objects-debug.cc Tue Oct 14 14:43:45 2014
UTC
+++ /branches/bleeding_edge/src/objects-debug.cc Fri Oct 31 09:30:59 2014
UTC
@@ -1216,6 +1216,24 @@
}
return true;
}
+
+
+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
=======================================
--- /branches/bleeding_edge/src/objects.h Wed Oct 29 10:36:36 2014 UTC
+++ /branches/bleeding_edge/src/objects.h Fri Oct 31 09:30:59 2014 UTC
@@ -5362,6 +5362,10 @@
void VerifyEmbeddedObjectsDependency();
#endif
+#ifdef DEBUG
+ void VerifyEmbeddedObjectsInFullCode();
+#endif // DEBUG
+
inline bool CanContainWeakObjects() {
return is_optimized_code() || is_weak_stub();
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.