Chromium Code Reviews| Index: src/runtime/runtime-debug.cc |
| diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc |
| index 660734fa52daf90017cb7c1b002aded3a1a94a99..08fca548f1913b497b13432c548ddcc53dc3888f 100644 |
| --- a/src/runtime/runtime-debug.cc |
| +++ b/src/runtime/runtime-debug.cc |
| @@ -1390,19 +1390,13 @@ class ScopeIterator { |
| return; |
| } |
| - // Get the debug info (create it if it does not exist). |
| - if (!isolate->debug()->EnsureDebugInfo(shared_info, function_)) { |
| - // Return if ensuring debug info failed. |
| - return; |
| - } |
| - |
| // Currently it takes too much time to find nested scopes due to script |
| // parsing. Sometimes we want to run the ScopeIterator as fast as possible |
| // (for example, while collecting async call stacks on every |
| // addEventListener call), even if we drop some nested scopes. |
| // Later we may optimize getting the nested scopes (cache the result?) |
| // and include nested scopes into the "fast" iteration case as well. |
| - if (!ignore_nested_scopes) { |
| + if (!ignore_nested_scopes && !shared_info->debug_info()->IsUndefined()) { |
|
ulan
2015/07/14 09:12:45
What happens if there is no debug info?
Yang
2015/07/14 12:00:57
We can only ever end up here from a return stateme
|
| Handle<DebugInfo> debug_info = Debug::GetDebugInfo(shared_info); |
| // PC points to the instruction after the current one, possibly a break |
| @@ -1413,11 +1407,11 @@ class ScopeIterator { |
| BreakLocation location = |
| BreakLocation::FromAddress(debug_info, ALL_BREAK_LOCATIONS, call_pc); |
| - // Within the return sequence at the moment it is not possible to |
| - // get a source position which is consistent with the current scope chain. |
| - // Thus all nested with, catch and block contexts are skipped and we only |
| - // provide the function scope. |
| - ignore_nested_scopes = location.IsExit(); |
| + // With break points we can end up breaking at a return sequence, where |
| + // at the moment it is not possible to get a source position which is |
| + // consistent with the current scope chain. Thus all nested with, catch |
| + // and block contexts are skipped and we only provide the function scope. |
| + ignore_nested_scopes = location.IsReturn(); |
| } |
| if (ignore_nested_scopes) { |