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

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

Issue 695483003: Remove saving/restoring of the context at function entry. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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/raw_object.h ('k') | runtime/vm/symbols.h » ('j') | 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/object.h" 7 #include "vm/object.h"
8 #include "vm/stack_frame.h" 8 #include "vm/stack_frame.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 10
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 ASSERT(var->owner()->context_level() >= 0); 318 ASSERT(var->owner()->context_level() >= 0);
319 desc.info.scope_id = var->owner()->context_level(); 319 desc.info.scope_id = var->owner()->context_level();
320 } else { 320 } else {
321 desc.info.set_kind(RawLocalVarDescriptors::kStackVar); 321 desc.info.set_kind(RawLocalVarDescriptors::kStackVar);
322 desc.info.scope_id = *scope_id; 322 desc.info.scope_id = *scope_id;
323 } 323 }
324 desc.info.begin_pos = var->token_pos(); 324 desc.info.begin_pos = var->token_pos();
325 desc.info.end_pos = var->owner()->end_token_pos(); 325 desc.info.end_pos = var->owner()->end_token_pos();
326 desc.info.set_index(var->index()); 326 desc.info.set_index(var->index());
327 vars->Add(desc); 327 vars->Add(desc);
328 } else if (var->name().raw() == Symbols::SavedEntryContextVar().raw()) {
329 // This is the local variable in which the function saves the
330 // caller's chain of closure contexts (caller's CTX register).
331 VarDesc desc;
332 desc.name = &var->name();
333 desc.info.set_kind(RawLocalVarDescriptors::kSavedEntryContext);
334 desc.info.scope_id = 0;
335 desc.info.begin_pos = 0;
336 desc.info.end_pos = 0;
337 desc.info.set_index(var->index());
338 vars->Add(desc);
339 } else if (var->name().raw() == Symbols::CurrentContextVar().raw()) { 328 } else if (var->name().raw() == Symbols::CurrentContextVar().raw()) {
340 // This is the local variable in which the function saves its 329 // This is the local variable in which the function saves its
341 // own context before calling a closure function. 330 // own context before calling a closure function.
342 VarDesc desc; 331 VarDesc desc;
343 desc.name = &var->name(); 332 desc.name = &var->name();
344 desc.info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext); 333 desc.info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext);
345 desc.info.scope_id = 0; 334 desc.info.scope_id = 0;
346 desc.info.begin_pos = 0; 335 desc.info.begin_pos = 0;
347 desc.info.end_pos = 0; 336 desc.info.end_pos = 0;
348 desc.info.set_index(var->index()); 337 desc.info.set_index(var->index());
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 return fixed_parameter_count - (index() - kParamEndSlotFromFp); 661 return fixed_parameter_count - (index() - kParamEndSlotFromFp);
673 } else { 662 } else {
674 // Shift negative indexes so that the lowest one is 0 (they are still 663 // Shift negative indexes so that the lowest one is 0 (they are still
675 // non-positive). 664 // non-positive).
676 return fixed_parameter_count - (index() - kFirstLocalSlotFromFp); 665 return fixed_parameter_count - (index() - kFirstLocalSlotFromFp);
677 } 666 }
678 } 667 }
679 668
680 669
681 } // namespace dart 670 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698