| 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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 } | 562 } |
| 563 } | 563 } |
| 564 } | 564 } |
| 565 return false; | 565 return false; |
| 566 } | 566 } |
| 567 | 567 |
| 568 | 568 |
| 569 int LocalVariable::BitIndexIn(intptr_t fixed_parameter_count) const { | 569 int LocalVariable::BitIndexIn(intptr_t fixed_parameter_count) const { |
| 570 ASSERT(!is_captured()); | 570 ASSERT(!is_captured()); |
| 571 // Parameters have positive indexes with the lowest index being | 571 // Parameters have positive indexes with the lowest index being |
| 572 // kLastParamSlotIndex. Locals and copied parameters have negative indexes | 572 // kParamEndSlotFromFp + 1. Locals and copied parameters have negative |
| 573 // with the lowest (closest to zero) index being kFirstLocalSlotIndex. | 573 // indexes with the lowest (closest to 0) index being kFirstLocalSlotFromFp. |
| 574 if (index() > 0) { | 574 if (index() > 0) { |
| 575 // Shift non-negative indexes so that the lowest one is 0. | 575 // Shift non-negative indexes so that the lowest one is 0. |
| 576 return (fixed_parameter_count - 1) - (index() - kLastParamSlotIndex); | 576 return fixed_parameter_count - (index() - kParamEndSlotFromFp); |
| 577 } else { | 577 } else { |
| 578 // Shift negative indexes so that the lowest one is 0 (they are still | 578 // Shift negative indexes so that the lowest one is 0 (they are still |
| 579 // non-positive). | 579 // non-positive). |
| 580 return fixed_parameter_count - (index() - kFirstLocalSlotIndex); | 580 return fixed_parameter_count - (index() - kFirstLocalSlotFromFp); |
| 581 } | 581 } |
| 582 } | 582 } |
| 583 | 583 |
| 584 | 584 |
| 585 } // namespace dart | 585 } // namespace dart |
| OLD | NEW |