Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(618)

Side by Side Diff: runtime/vm/scopes.cc

Issue 14503003: Fix context-allocated variables in stack traces (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/scopes.h" 5 #include "vm/scopes.h"
6 6
7 #include "vm/ast.h" 7 #include "vm/ast.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/parser.h" 10 #include "vm/parser.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 desc.info.scope_id = var->owner()->context_level(); 252 desc.info.scope_id = var->owner()->context_level();
253 } else { 253 } else {
254 desc.info.kind = RawLocalVarDescriptors::kStackVar; 254 desc.info.kind = RawLocalVarDescriptors::kStackVar;
255 desc.info.scope_id = *scope_id; 255 desc.info.scope_id = *scope_id;
256 } 256 }
257 desc.info.begin_pos = var->token_pos(); 257 desc.info.begin_pos = var->token_pos();
258 desc.info.end_pos = var->owner()->end_token_pos(); 258 desc.info.end_pos = var->owner()->end_token_pos();
259 desc.info.index = var->index(); 259 desc.info.index = var->index();
260 vars->Add(desc); 260 vars->Add(desc);
261 } else if (var->name().Equals( 261 } else if (var->name().Equals(
262 Symbols::Name(Symbols::kSavedCurrentContextVarId))) { 262 Symbols::Name(Symbols::kSavedEntryContextVarId))) {
263 // This is the local variable in which the function saves the 263 // This is the local variable in which the function saves the
264 // caller's chain of closure contexts (caller's CTX register). 264 // caller's chain of closure contexts (caller's CTX register).
265 VarDesc desc; 265 VarDesc desc;
266 desc.name = &var->name(); 266 desc.name = &var->name();
267 desc.info.kind = RawLocalVarDescriptors::kContextChain; 267 desc.info.kind = RawLocalVarDescriptors::kContextChain;
268 desc.info.scope_id = 0; 268 desc.info.scope_id = 0;
269 desc.info.begin_pos = 0; 269 desc.info.begin_pos = 0;
270 desc.info.end_pos = 0; 270 desc.info.end_pos = 0;
271 desc.info.index = var->index(); 271 desc.info.index = var->index();
272 vars->Add(desc); 272 vars->Add(desc);
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 return (fixed_parameter_count - 1) - (index() - kLastParamSlotIndex); 565 return (fixed_parameter_count - 1) - (index() - kLastParamSlotIndex);
566 } else { 566 } else {
567 // Shift negative indexes so that the lowest one is 0 (they are still 567 // Shift negative indexes so that the lowest one is 0 (they are still
568 // non-positive). 568 // non-positive).
569 return fixed_parameter_count - (index() - kFirstLocalSlotIndex); 569 return fixed_parameter_count - (index() - kFirstLocalSlotIndex);
570 } 570 }
571 } 571 }
572 572
573 573
574 } // namespace dart 574 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698