Chromium Code Reviews| 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) { |