OLD | NEW |
1 // Copyright (c) 2012, 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" |
11 #include "vm/handles_impl.h" | 11 #include "vm/handles_impl.h" |
(...skipping 1595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1607 LocationSummary* locs_; | 1607 LocationSummary* locs_; |
1608 }; | 1608 }; |
1609 | 1609 |
1610 | 1610 |
1611 class RangeBoundary : public ValueObject { | 1611 class RangeBoundary : public ValueObject { |
1612 public: | 1612 public: |
1613 enum Kind { kUnknown, kSymbol, kConstant }; | 1613 enum Kind { kUnknown, kSymbol, kConstant }; |
1614 | 1614 |
1615 RangeBoundary() : kind_(kUnknown), value_(0), offset_(0) { } | 1615 RangeBoundary() : kind_(kUnknown), value_(0), offset_(0) { } |
1616 | 1616 |
| 1617 RangeBoundary(const RangeBoundary& other) |
| 1618 : ValueObject(), |
| 1619 kind_(other.kind_), |
| 1620 value_(other.value_), |
| 1621 offset_(other.offset_) { } |
| 1622 |
| 1623 RangeBoundary& operator=(const RangeBoundary& other) { |
| 1624 kind_ = other.kind_; |
| 1625 value_ = other.value_; |
| 1626 offset_ = other.offset_; |
| 1627 return *this; |
| 1628 } |
| 1629 |
1617 static RangeBoundary FromConstant(intptr_t val) { | 1630 static RangeBoundary FromConstant(intptr_t val) { |
1618 return RangeBoundary(kConstant, val, 0); | 1631 return RangeBoundary(kConstant, val, 0); |
1619 } | 1632 } |
1620 | 1633 |
1621 static RangeBoundary FromDefinition(Definition* defn, intptr_t offs = 0); | 1634 static RangeBoundary FromDefinition(Definition* defn, intptr_t offs = 0); |
1622 | 1635 |
1623 static RangeBoundary MinSmi() { | 1636 static RangeBoundary MinSmi() { |
1624 return FromConstant(Smi::kMinValue); | 1637 return FromConstant(Smi::kMinValue); |
1625 } | 1638 } |
1626 | 1639 |
(...skipping 2565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4192 #undef DECLARE_INSTRUCTION | 4205 #undef DECLARE_INSTRUCTION |
4193 | 4206 |
4194 class Environment : public ZoneAllocated { | 4207 class Environment : public ZoneAllocated { |
4195 public: | 4208 public: |
4196 // Iterate the non-NULL values in the innermost level of an environment. | 4209 // Iterate the non-NULL values in the innermost level of an environment. |
4197 class ShallowIterator : public ValueObject { | 4210 class ShallowIterator : public ValueObject { |
4198 public: | 4211 public: |
4199 explicit ShallowIterator(Environment* environment) | 4212 explicit ShallowIterator(Environment* environment) |
4200 : environment_(environment), index_(0) { } | 4213 : environment_(environment), index_(0) { } |
4201 | 4214 |
| 4215 ShallowIterator(const ShallowIterator& other) |
| 4216 : ValueObject(), |
| 4217 environment_(other.environment_), |
| 4218 index_(other.index_) { } |
| 4219 |
| 4220 ShallowIterator& operator=(const ShallowIterator& other) { |
| 4221 environment_ = other.environment_; |
| 4222 index_ = other.index_; |
| 4223 return *this; |
| 4224 } |
| 4225 |
4202 Environment* environment() const { return environment_; } | 4226 Environment* environment() const { return environment_; } |
4203 | 4227 |
4204 void Advance() { | 4228 void Advance() { |
4205 ASSERT(!Done()); | 4229 ASSERT(!Done()); |
4206 ++index_; | 4230 ++index_; |
4207 } | 4231 } |
4208 | 4232 |
4209 bool Done() const { | 4233 bool Done() const { |
4210 return (environment_ == NULL) || (index_ >= environment_->Length()); | 4234 return (environment_ == NULL) || (index_ >= environment_->Length()); |
4211 } | 4235 } |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4396 ForwardInstructionIterator* current_iterator_; | 4420 ForwardInstructionIterator* current_iterator_; |
4397 | 4421 |
4398 private: | 4422 private: |
4399 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 4423 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
4400 }; | 4424 }; |
4401 | 4425 |
4402 | 4426 |
4403 } // namespace dart | 4427 } // namespace dart |
4404 | 4428 |
4405 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 4429 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
OLD | NEW |