| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |