| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 4427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4438 | 4438 |
| 4439 intptr_t Length() const { | 4439 intptr_t Length() const { |
| 4440 return values_.length(); | 4440 return values_.length(); |
| 4441 } | 4441 } |
| 4442 | 4442 |
| 4443 Location LocationAt(intptr_t index) const { | 4443 Location LocationAt(intptr_t index) const { |
| 4444 ASSERT((index >= 0) && (index < values_.length())); | 4444 ASSERT((index >= 0) && (index < values_.length())); |
| 4445 return locations_[index]; | 4445 return locations_[index]; |
| 4446 } | 4446 } |
| 4447 | 4447 |
| 4448 Location* LocationSlotAt(intptr_t index) const { | |
| 4449 ASSERT((index >= 0) && (index < values_.length())); | |
| 4450 return &locations_[index]; | |
| 4451 } | |
| 4452 | |
| 4453 // The use index is the index in the flattened environment. | 4448 // The use index is the index in the flattened environment. |
| 4454 Value* ValueAtUseIndex(intptr_t index) const { | 4449 Value* ValueAtUseIndex(intptr_t index) const { |
| 4455 const Environment* env = this; | 4450 const Environment* env = this; |
| 4456 while (index >= env->Length()) { | 4451 while (index >= env->Length()) { |
| 4457 ASSERT(env->outer_ != NULL); | 4452 ASSERT(env->outer_ != NULL); |
| 4458 index -= env->Length(); | 4453 index -= env->Length(); |
| 4459 env = env->outer_; | 4454 env = env->outer_; |
| 4460 } | 4455 } |
| 4461 return env->ValueAt(index); | 4456 return env->ValueAt(index); |
| 4462 } | 4457 } |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4534 ForwardInstructionIterator* current_iterator_; | 4529 ForwardInstructionIterator* current_iterator_; |
| 4535 | 4530 |
| 4536 private: | 4531 private: |
| 4537 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 4532 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 4538 }; | 4533 }; |
| 4539 | 4534 |
| 4540 | 4535 |
| 4541 } // namespace dart | 4536 } // namespace dart |
| 4542 | 4537 |
| 4543 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 4538 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |