| Index: src/deoptimizer.cc | 
| diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc | 
| index a730b48d2e8c41c26c8346637f21cf2d7d21d4ff..d8dff9de818b1d7b2b7e69dbe154b050cd420122 100644 | 
| --- a/src/deoptimizer.cc | 
| +++ b/src/deoptimizer.cc | 
| @@ -459,9 +459,11 @@ void Deoptimizer::DeoptimizeGlobalObject(JSObject* object) { | 
| reinterpret_cast<intptr_t>(object)); | 
| } | 
| if (object->IsJSGlobalProxy()) { | 
| -    Object* proto = object->GetPrototype(); | 
| -    CHECK(proto->IsJSGlobalObject()); | 
| -    Context* native_context = GlobalObject::cast(proto)->native_context(); | 
| +    PrototypeIterator iter(object->GetIsolate(), object); | 
| +    // TODO(verwaest): This CHECK will be hit if the global proxy is detached. | 
| +    CHECK(iter.GetCurrent()->IsJSGlobalObject()); | 
| +    Context* native_context = | 
| +        GlobalObject::cast(iter.GetCurrent())->native_context(); | 
| MarkAllCodeForContext(native_context); | 
| DeoptimizeMarkedCodeForContext(native_context); | 
| } else if (object->IsGlobalObject()) { | 
|  |