OLD | NEW |
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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 // This is the local variable in which the function saves the | 329 // This is the local variable in which the function saves the |
330 // caller's chain of closure contexts (caller's CTX register). | 330 // caller's chain of closure contexts (caller's CTX register). |
331 VarDesc desc; | 331 VarDesc desc; |
332 desc.name = &var->name(); | 332 desc.name = &var->name(); |
333 desc.info.set_kind(RawLocalVarDescriptors::kSavedEntryContext); | 333 desc.info.set_kind(RawLocalVarDescriptors::kSavedEntryContext); |
334 desc.info.scope_id = 0; | 334 desc.info.scope_id = 0; |
335 desc.info.begin_pos = 0; | 335 desc.info.begin_pos = 0; |
336 desc.info.end_pos = 0; | 336 desc.info.end_pos = 0; |
337 desc.info.set_index(var->index()); | 337 desc.info.set_index(var->index()); |
338 vars->Add(desc); | 338 vars->Add(desc); |
339 } else if (var->name().raw() == Symbols::SavedCurrentContextVar().raw()) { | 339 } else if (var->name().raw() == Symbols::CurrentContextVar().raw()) { |
340 // This is the local variable in which the function saves its | 340 // This is the local variable in which the function saves its |
341 // own context before calling a closure function. | 341 // own context before calling a closure function. |
342 VarDesc desc; | 342 VarDesc desc; |
343 desc.name = &var->name(); | 343 desc.name = &var->name(); |
344 desc.info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext); | 344 desc.info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext); |
345 desc.info.scope_id = 0; | 345 desc.info.scope_id = 0; |
346 desc.info.begin_pos = 0; | 346 desc.info.begin_pos = 0; |
347 desc.info.end_pos = 0; | 347 desc.info.end_pos = 0; |
348 desc.info.set_index(var->index()); | 348 desc.info.set_index(var->index()); |
349 vars->Add(desc); | 349 vars->Add(desc); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 return fixed_parameter_count - (index() - kParamEndSlotFromFp); | 672 return fixed_parameter_count - (index() - kParamEndSlotFromFp); |
673 } else { | 673 } else { |
674 // Shift negative indexes so that the lowest one is 0 (they are still | 674 // Shift negative indexes so that the lowest one is 0 (they are still |
675 // non-positive). | 675 // non-positive). |
676 return fixed_parameter_count - (index() - kFirstLocalSlotFromFp); | 676 return fixed_parameter_count - (index() - kFirstLocalSlotFromFp); |
677 } | 677 } |
678 } | 678 } |
679 | 679 |
680 | 680 |
681 } // namespace dart | 681 } // namespace dart |
OLD | NEW |