Chromium Code Reviews

Unified Diff: src/serialize.cc

Issue 659513003: Use WeakCell to handle the script wrapper cache (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.cc
diff --git a/src/serialize.cc b/src/serialize.cc
index 70b69c23c0dc01beeda05d4bcb2532584df4b5a6..8657ea38502ac185d66741f7816ecf12299ab90e 100644
--- a/src/serialize.cc
+++ b/src/serialize.cc
@@ -2018,10 +2018,11 @@ void CodeSerializer::SerializeHeapObject(HeapObject* heap_object,
HowToCode how_to_code,
WhereToPoint where_to_point) {
if (heap_object->IsScript()) {
- // The wrapper cache uses a Foreign object to point to a global handle.
- // However, the object visitor expects foreign objects to point to external
- // references. Clear the cache to avoid this issue.
- Script::cast(heap_object)->ClearWrapperCache();
+ // The wrapper cache uses a WeakCell. However it's not clear what
+ // the semantics of WeakCell are when serializing. For now we just
+ // clear the cache.
+ HeapObject* clear = heap_object->GetHeap()->undefined_value();
ulan 2014/10/14 15:45:56 Since we rebuild the WeakCell list on every GC, se
+ Script::cast(heap_object)->set_wrapper(clear);
ulan 2014/10/14 15:45:56 Should we also isolate->counters()->script_wrapper
}
if (FLAG_trace_code_serializer) {
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine