Chromium Code Reviews| Index: runtime/vm/debugger.cc |
| diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc |
| index f29fbf7a9bd78c5948f1d67d86a48cf13e60c261..b02d3f9531cebcd00974e7cb3cb1fee01ce447b4 100644 |
| --- a/runtime/vm/debugger.cc |
| +++ b/runtime/vm/debugger.cc |
| @@ -1393,19 +1393,17 @@ void Debugger::DeoptimizeWorld() { |
| } |
| } |
| } |
| + } |
| + } |
| - // Disable other optimized closure functions. |
| - closures = cls.closures(); |
| - if (!closures.IsNull()) { |
| - intptr_t num_closures = closures.Length(); |
| - for (intptr_t pos = 0; pos < num_closures; pos++) { |
| - function ^= closures.At(pos); |
| - ASSERT(!function.IsNull()); |
| - if (function.HasOptimizedCode()) { |
| - function.SwitchToUnoptimizedCode(); |
| - } |
| - } |
| - } |
| + // Disable optimized closure functions. |
| + closures = isolate_->object_store()->closure_functions(); |
| + const intptr_t num_closures = closures.Length(); |
| + for (intptr_t pos = 0; pos < num_closures; pos++) { |
| + function ^= closures.At(pos); |
| + ASSERT(!function.IsNull()); |
| + if (function.HasOptimizedCode()) { |
| + function.SwitchToUnoptimizedCode(); |
| } |
| } |
| } |
| @@ -1881,6 +1879,26 @@ void Debugger::FindCompiledFunctions(const Script& script, |
| GrowableObjectArray& closures = GrowableObjectArray::Handle(zone); |
| Function& function = Function::Handle(zone); |
| + closures = isolate_->object_store()->closure_functions(); |
|
Ivan Posva
2015/11/13 17:47:51
Why did this code move from after the class table
hausner
2015/11/13 20:13:29
It wasn't after the class table, it was inside the
|
| + const intptr_t num_closures = closures.Length(); |
| + for (intptr_t pos = 0; pos < num_closures; pos++) { |
| + function ^= closures.At(pos); |
| + ASSERT(!function.IsNull()); |
| + if ((function.token_pos() == start_pos) |
| + && (function.end_token_pos() == end_pos) |
| + && (function.script() == script.raw())) { |
| + if (function.HasCode() && function.is_debuggable()) { |
| + function_list->Add(function); |
| + } |
| + if (function.HasImplicitClosureFunction()) { |
| + function = function.ImplicitClosureFunction(); |
| + if (function.HasCode() && function.is_debuggable()) { |
| + function_list->Add(function); |
| + } |
| + } |
| + } |
| + } |
| + |
| const ClassTable& class_table = *isolate_->class_table(); |
| const intptr_t num_classes = class_table.NumCids(); |
| for (intptr_t i = 1; i < num_classes; i++) { |
| @@ -1919,27 +1937,6 @@ void Debugger::FindCompiledFunctions(const Script& script, |
| } |
| } |
| } |
| - closures = cls.closures(); |
| - if (!closures.IsNull()) { |
| - const intptr_t num_closures = closures.Length(); |
| - for (intptr_t pos = 0; pos < num_closures; pos++) { |
| - function ^= closures.At(pos); |
| - ASSERT(!function.IsNull()); |
| - if ((function.token_pos() == start_pos) |
| - && (function.end_token_pos() == end_pos) |
| - && (function.script() == script.raw())) { |
| - if (function.HasCode() && function.is_debuggable()) { |
| - function_list->Add(function); |
| - } |
| - if (function.HasImplicitClosureFunction()) { |
| - function = function.ImplicitClosureFunction(); |
| - if (function.HasCode() && function.is_debuggable()) { |
| - function_list->Add(function); |
| - } |
| - } |
| - } |
| - } |
| - } |
| } |
| } |
| } |
| @@ -1967,6 +1964,16 @@ RawFunction* Debugger::FindBestFit(const Script& script, |
| Function& best_fit = Function::Handle(zone); |
| Error& error = Error::Handle(zone); |
| + closures = isolate_->object_store()->closure_functions(); |
|
Ivan Posva
2015/11/13 17:47:51
ditto
hausner
2015/11/13 20:13:29
ditto
|
| + const intptr_t num_closures = closures.Length(); |
| + for (intptr_t i = 0; i < num_closures; i++) { |
| + function ^= closures.At(i); |
| + ASSERT(!function.IsNull()); |
| + if (FunctionContains(function, script, token_pos)) { |
| + SelectBestFit(&best_fit, &function); |
| + } |
| + } |
| + |
| const ClassTable& class_table = *isolate_->class_table(); |
| const intptr_t num_classes = class_table.NumCids(); |
| for (intptr_t i = 1; i < num_classes; i++) { |
| @@ -2001,18 +2008,6 @@ RawFunction* Debugger::FindBestFit(const Script& script, |
| } |
| } |
| } |
| - |
| - closures = cls.closures(); |
| - if (!closures.IsNull()) { |
| - const intptr_t num_closures = closures.Length(); |
| - for (intptr_t pos = 0; pos < num_closures; pos++) { |
| - function ^= closures.At(pos); |
| - ASSERT(!function.IsNull()); |
| - if (FunctionContains(function, script, token_pos)) { |
| - SelectBestFit(&best_fit, &function); |
| - } |
| - } |
| - } |
| } |
| } |
| return best_fit.raw(); |
| @@ -2829,10 +2824,6 @@ void Debugger::NotifyIsolateCreated() { |
| // the given token position. |
| RawFunction* Debugger::FindInnermostClosure(const Function& function, |
| intptr_t token_pos) { |
| - const Class& owner = Class::Handle(function.Owner()); |
| - if (owner.closures() == GrowableObjectArray::null()) { |
| - return Function::null(); |
| - } |
| // Note that we need to check that the closure is in the same |
| // script as the outer function. We could have closures originating |
| // in mixin classes whose source code is contained in a different |
|
Ivan Posva
2015/11/13 17:47:51
I don't think this comment is entirely right anymo
hausner
2015/11/13 20:13:29
True. The script needs to be checked now because o
|
| @@ -2840,7 +2831,8 @@ RawFunction* Debugger::FindInnermostClosure(const Function& function, |
| Zone* zone = Thread::Current()->zone(); |
| const Script& outer_origin = Script::Handle(zone, function.script()); |
| const GrowableObjectArray& closures = |
| - GrowableObjectArray::Handle(zone, owner.closures()); |
| + GrowableObjectArray::Handle(zone, |
| + Isolate::Current()->object_store()->closure_functions()); |
| const intptr_t num_closures = closures.Length(); |
| Function& closure = Function::Handle(zone); |
| Function& best_fit = Function::Handle(zone); |