Index: src/deoptimizer.cc |
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc |
index 108e547f2b95e6197a6d282bb432f7d06dde5ca2..b6df432322dfdb7c9ed11ba97cecd775cac7e9b4 100644 |
--- a/src/deoptimizer.cc |
+++ b/src/deoptimizer.cc |
@@ -264,11 +264,14 @@ void Deoptimizer::VisitAllOptimizedFunctions( |
AssertNoAllocation no_allocation; |
// Run through the list of all global contexts and deoptimize. |
- Object* global = Isolate::Current()->heap()->global_contexts_list(); |
- while (!global->IsUndefined()) { |
- VisitAllOptimizedFunctionsForGlobalObject(Context::cast(global)->global(), |
- visitor); |
- global = Context::cast(global)->get(Context::NEXT_CONTEXT_LINK); |
+ Object* context = Isolate::Current()->heap()->global_contexts_list(); |
+ while (!context->IsUndefined()) { |
+ Object* global = Context::cast(context)->get(Context::GLOBAL_INDEX); |
ulan
2011/12/12 19:11:16
Do we need check here? Is global object always def
Vyacheslav Egorov (Chromium)
2011/12/13 12:26:20
I think we need it. Judging from the control flow
ulan
2011/12/13 13:02:58
Done.
|
+ if (!global->IsUndefined()) { |
+ VisitAllOptimizedFunctionsForGlobalObject(JSObject::cast(global), |
+ visitor); |
+ } |
+ context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK); |
} |
} |